Ignore askinfoviams
Turns out PT_ASKINFOVIAMS is an obsolete packet type anyway, the MS doesn't send it at all. So let's just ignore it in the netcode then. (the online page just acts like a client and sends PT_ASKINFO, and is not part of the MS itself)
See merge request !191
Netcode hotfix
Various netcode fixes are included in this branch. Most important of all of course is a fix for the Net_CloseConnection invalid node -32769 detected message thing, or rather what actually caused that to occur.
It's a merge to master since everything here should be compatible with 2.1.18: the only main changes are related to recieving packets (whether you're the host of a netgame or a client), which AFAIK shouldn't cause desyncs if you played with these fixes on a 2.1.18-hosted netgame (or hosted a netgame with the fixes and 2.1.18-using players join you).
See merge request !185
A bunch of bugfixes about too many wads in netgames
Fixes:
* Having bunch of music WADs added and then breaching the file limit(s) through joining a server with important files added. http://mb.srb2.org/showthread.php?t=42662
* Having a bunch of music WADs added, joining a server, and then breaching the file limit(s) when the server adds a file. https://mb.srb2.org/showthread.php?t=34664
* Informing the adminplayer whenever they try to send a request addfile net command but the file limit(s) are reached.
Done into next because I might as well be 100% safe, even though this could probably work on master as well.
See merge request !187
Missiles 'n slopes
Fixed that thing where missiles like sliding up slopes for some reason.
This isn't a 1:1 fix compared to non-slopes - missiles still like stepping up over the borders of sloped sectors and will continue going as long as they never touch that ground again, whereas they can never step up on flat ones - but this fixes the most egregrious issue.
See merge request !181
* if you sent it to a client rather than the server, game over, your connection is closed
* if files that don't exist or are too large are requested are listed, game over, your connection is closed (they should have been checked on YOUR side beforehand, silly)
* if the server has downloading disabled anyway, ...yeah, you get the idea
Don't worry, I made sure Got_RequestFilePak cleaned up the full file request list for the node in case of failure
--------
Fireballs narrower
Fake Item is no longer restricted while held
Held items that are restricted remain in the item wheel until used
Magnet now correctly hits nearby players and objects
This is just in case someone actually tries to dump in C_START/C_END and "add" colormaps using them, not that they would ever be used currently anyway.
Admin ban fix
Okay, THIS time admin bans should work properly. Turns out the relevant code for banning did not properly consider the case of admins doing the banning, at least until now.
Unlike my last attempt at fixing admin bans (!165), this one would require both host and admin to have the fix exe assuming everyone else would be using 2.1.17, so I'm merging to next instead of master.
See merge request !167
Allowteamchange fix
Fixes "allowteamchange no" to actually work properly and NOT desync you from the game in most cases. You can now switch TO spectator freely (as intended it turns out), and switching FROM spectator is prohibited. The "Enter Game" menu option in Match/Tag now displays one of those blue window notices just like with "Change Teams" in CTF/Team Match if you cannot change teams right now. Everything else works as you'd expect.
The de-sync issue was originally reported here https://mb.srb2.org/showthread.php?p=789965#85
See merge request !168
Falling rocks fix
This fixes the rock spawners' rocks not being removed if they rolled down to the ground from a slope rather than bouncing (see https://mb.srb2.org/showthread.php?t=41963)
See merge request !162
-------
Braking no longer stops on a dime, and instead reduces your speed input. The effect is different between braking and accelerating at the same time, and braking on its own.
Increased 'driftweight' to player->kartweight*14, up from player->kartweight*12.
Changed the base drift curve formula from a range of 447 - 303, to 415 - 303. This will result in a very slightly wider drift arc at low weights. This does not effect the strength of steering while drifting.
Drifting without holding a direction now has a bonus of 0.5 frames, up from 0.
Added kartweight to the required number of drift frames, at half value. Lighter characters take up to 4 additional frames to earn blue sparks, 8 for orange.
-------
Accelcode now factors in forwardmove value rather than a boolean. This is used to enable clutching (or whatever you call it; accel+brake) to give its own result.
Fixed Thwomps killing players rather than crushing them.
Reverted buggy collision experiment from previous version.
-------
Reverted drift timer to 52 + player->kartspeed;
Reduced weight's effect on neutral drifting by 10%
Reduced weight's effect on collision by 50%
*EXPERIMENTAL*: Inverted collision's x and y. This should shunt players to the side instead of bump them forward?
--------
Driftboost formula changed to:
49 + player->kartspeed*2;
(No longer factors weight from previous version)
Collision code now factors character weight for players.
Collision code now only plays the collision sound once, rather than per player.
Weight now factors into drifting's base value. A heavier character will drift more straight with no input and have less control.
Added a cheat check in SetPlayerSkinByNum(), to force speed and weight within the boundaries of 1 and 9.
Nerfed orange turbo to 50 frames, down from 60.
-------
Changed the drift spark formula from:
51 + player->kartspeed;
To:
43 + player->kartspeed*2 + (10 - player->kartweight);
This allows an extreme heavy/accel to get sparks more often than an extreme light/speed character. Other extremes should be roughly where they were before.
--------
Hardcoded Collide.lua.
Added player boolean array "Collide", used by Collide.lua.
Walls are now bouncy by default again, like they were in 1.09.
Buffed Orange Drift sparks, the boost now lasts 60 frames up from 40.
-------
Diagonal springs now keep your current speed if you are faster than their set speed. This only affects players for now.
Offroad is no longer handled by &256, and is now handled by &2, &3, &4; Damage (Damage (Water), Damage (Fire), and Damage (Electric))
Starpost mobj radius and height have been reduced to 1*FRACUNIT, this should fix the checkpoint infinispawn bug.
doesn't draw off of the sides, and doesn't ignore snapping or widths for reasons that don't make sense
(for instance: the green bar in MI's test script showed *above* the blue one in non-green resolutions in 2.1.17)
Command-line skin selecting fix
Fixed http://mb.srb2.org/showthread.php?t=42312.
Also, fixed being able to change your skin colour during credits/cutscenes in singleplayer.
See merge request !158
Lakitu is completely commented out currently and we will be able to re-add it back later
Final lap sounds do some wacky stuff with the variables of the local player only, and also block out the music just to restart it at the same speed currently, changed it to just be the lap sound, we can use a new sound for it later
No longer does all the angle adjustments inside of the player thinker and instead does it with the controls
Should hopefully avoid any desynch from drifting
Also maybe fixed player 2's controls
I believe editing the player data in G_BuildTiccmd will cause desync, especially for anything that would effect gameplay
driftfix didn't seem to do much, will find a way to re-enable looking backwards properly later (probably change one of the buttons, DRIFTLEFT or DRIFRRIGHT?)
they are basically unused outside of timeattack and checkpointtimes isn't sent for netplay anyway
we can reimplement later with a more sensible solution for lap times in time attack
We can set a standard for friction sectors in maps and people can then do what they want with it.
Also caused problems with Ice and FOFs above friction sectors.
Mushrooms rewritten to not use Instathrust, instead they jack up your accel to 10x. Feels nicer.
Floor mushroom panels no longer activate while above them
Mushrooms force player to accelerate (and cannot brake)
K_PlayTauntSound works now. (YES YES YES HUP HUP YES HUP HERE WE GO)
Star and Mega sfx might stop correctly now in netgames (need to test)
Item box radius and height increased from 32 to 36.
(various large invisible blocks used in the level cause rain to make splashes high above the main level, high enough to make ghostly rain splash sprite artifacts appear sometimes in nearby areas)
Intermission timer is back down to 20 seconds unless something breaks with auto-transmissions again.
Also I remembered to enable Magnets this time. Super low odds on it though.
Consolidated the turning and drifting values to k_kart functions for easier editing
Removed 200cc. 50/100/150ccs are a weird amalgamation of the prior values.
This is used by Command_Addfile in the MD5 calculation code, so that it can search subfolders properly and allow addfile in netgames to treat them the same way as in SP
This fixes the grid floors in TD's Lava Mountain freezing the game if they go off the bottom of the screen far enough (they have ACWRFL1A as the wall texture, which is a single patch texture with holes)
* Fixing an inconsistency with being able to change skin colours when you shouldn't be able to, much like the previous skin change issue that was fixed.
-If the server tries to kick a joiner who is downloading the game state, they will get a timeout instead, because a regular kick would only happen once the game state has been downloaded
-Added a timeout for player ticcmd packets, again to prevent freezes to happen in some cases
-File/game state downloading is now faster, the speed is controlled by the "downloadspeed" cvar, in packets per tic
-The reason is now properly shown when the server refuses connection
-Changed the default values of "nettimeout" to 10 seconds (previously 15) and "maxsend" to 4 MB (previously 1)
-Added a "noticedownload" cvar that displays a message in the server console when someone is downloading a file
CMake: Fix nasm Linux builds
When compiling under Linux with CMake and nasm/yasm enabled, the operation would fail during linking with undefined symbols related to the tmap files.
This commit adds support for passing flags to the assembler and passes ```-DLINUX``` in order to compile.
After this change, binaries are successfully compiled with either nasm or yasm on Linux systems.
Tested on Ubuntu.
See merge request !153
Savegame hotfixes
Yes, this another netgame related fix! Named this "savegame hotfixes" rather than "ERCZ hotfix" or the like in advance of the fact we probably need a general branch for other $$$.sav fixes?
Anyway, fixes included in by this branch:
* ERCZ's lava falls now act as expected rather than being stuck in place for the map's duration, fixing all other known desynchronisation issues known in the map for the time being (yay)
* Changing sector tags in a map no longer causes joiners to netgames to have their SRB2 application stop responding etc
* Player names should no longer turn red in the console in gametypes outside of CTF/Team Match if a resynch occurs (not $$$.sav related, but it's related to netplay so I lumped it in anyway)
See merge request !150
One Eggscalibur fix
Use mobj->watertop instead of mobj->spawnpoint->z. CEZ3 is far from fixed in multiplayer, but this is still one less thing to worry about.
See merge request !148
Software plane rendering fixes/cleanup
This is mostly cleanup, with the exception that polyobject planes should now behave somewhat better than they do in 2.1 currently (translucent polyobj planes should now always be actually translucent regardless of where you view them from, for instance). I can't claim I've fixed their rendering once and for all though, there may still be bugs for all I know...
See merge request !136
Some texture-related fixes
Bugs fixed in this branch:
* upper/lower/middle textures with non-existent texture ids being capable of crashing the game. For instance, RVZ1 has colormap codes on non-colormap linedefs, which causes them to wind up with invalid texture ids because of how the game tries to interpret lower/upper textures with "#" followed by characters on normal linedefs. Fortunately these "textures" are normally not visible anyway (since they're all in control sectors) unless they are swapped with in-level textures by some crazy Lua script of some sort...
* animated single-patch textures with holes displaying garbage on first viewing (see this thread: https://mb.srb2.org/showthread.php?t=42195)
* the heights of the lighting (shadows or colormapping) from water/translucent/shadowcasting/etc FOFs become messed up when displayed on repeated midtextures.
See merge request !144
Flat changing hotfix
This should fix how Lua scripts that change flats in levels, particularly to flats that don't already exist in the level, cause SRB2 to crash for anyone who joins a netgame afterwards. (I'm not sure if it's a consistent thing or not though)
Probably needs a good test to verify the issue is completely fixed before being merged in. Maybe there are other minor things I didn't account for in this fix? I don't know!
See merge request !141
Dunno who thought it was a good idea to lump tag, nexttag and firsttag together in $$$.sav, but that meant changing sector tags caused SRB2 to stop responding since it lead to the tag lists being broken
This fixes ERCZ's lava falls not moving after joining a netgame at that stage. Possibly explains other various floor/ceiling related netgame quirks that haven't been noticed until now, maybe even in multiplayer levels.
Remove secplanes
This is just removing SSNTails's old port of ZDoom's secplane code and math, from back when he attempted slopes himself. The slopes we've had since 2.1.15 however do not need these, so we can pretty much toss the code for them out now (nothing uses them anyway).
See merge request !149
-Updated packet name list so the debug file no longer shows garbage packet names
-Replaced byte values with actual net command names in the debug file. Only the first net command in a packet will be shown though
-Added a MOBJCONSISTANCY define that makes the game takes all revelant mobjs to be counted in the synch seed
-Added a PACKETDROP define that adds two console commands "drop" and "droprate" to simulate bad internet by dropping packets
-Added/changed comments here in there in the netcode
-Fixed a minor error that would ignore one of the urgent ack slots
-Added a space between the map name and "zone" for the messages shown in a joiner's console
This fixes Brak's electric barrier disappearing for joiners to ERZC. There seems to be some issues with the lava falls there too I've found, but the electric barrier actually stays around now at least
Smoother ropes and zoom tubes
Makes rope hangs and zoom tubes suck less. Specifically, they handle corners (and vertical height changes, ala sloped rope hangs) a LOT nicer. Ported from internal.
See merge request !139
As LJSonic has pointed out, there's no need for a for loop in either case; just use sector->floorpic/ceilingpic as a levelflats index directly
(Besides, if that was to stop any out-of-bounds indexes being used, that's hardly the way to do it anyway)
Turns out sdl12's version of this function only did stuff for DC/GP2X ports; support for them have been cut out for SDL2, so for now let's just not use the function at all