Commit graph

1266 commits

Author SHA1 Message Date
toaster
0aa85bf291 Unused variable in Got_AddBot 2022-11-30 17:17:40 +00:00
toaster
6d0637d39d Unlockable skins (in a way friendly to #define MAXSKINS 255)
Mammoth commit, sorry. I only realised halfway through writing it that SECRET_SKIN was only partially merged.

Ports from 2.2:
- Merge SECRET_SKIN (STJr/SRB2!1474)
    - Default skin is now handled by checking all skins for unlock status, and I_Erroring if none are available
    - Don't show skin names on game startup, to keep our secrets hidden
    - Unlockables now have string variables zallocated.
         - For skin names rather than numbers.
    - Correctly clean up memory when freeing unlockables and emblems.

Bespoke code:
- For temporary testing. `unlocks.pk3`
    - Using this for rapid testing gameboot SOC instead of patch.pk3 because of the intent to turn that into scripts.pk3
- Don't not save gamedata in DEVELOP builds, even if you've used cheats!
- `player->availabilities` is now an array of UINT8
    - (MAXSKINS + 7)/8 entries, or 32 bytes.
    - Included with XD_ADDPLAYER instead of XD_NAMEANDCOLOR.
         - Simplifies a lot of logic with respect to demos, skin changes mid-game, etc.
             - Seriously, there's a lot of random places in the code that just iterate over MAXSPLITSCREENPLAYERS and g_localplayers to update availabilities in real time in a way that's not particularly netsafe...
         - Lines up with the plan for handling unlocks when returning to menus.
         - Was included with XD_ADDBOT, but that actually overruns the netxcmd buffer at first mapload with 7 bots. We might need to consider expanding the size of the netxcmd buffer...
    - In demos, can be interpreted as both relative to the original replay and the current skin list depending on boolean context provided to R_SkinUsable.
    - Used for SF_IRONMAN (and will crash if all other skins are inaccessible).
- Grand Prix bot randomisation uses the host's unlocks.
- Don't show locked characters on the fancy new character select.
-  DXD_JOINDATA for demos
    - Replaces the dual-purpose behaviour of DXD_PLAYSTATE
    - Contains availabilities
    - Handles bot material in a different way
- Forceskin restrictions
    - Won't run in demos, because it's assumed recorded DXD_SKIN will handle all the conversions the original match had
    - Won't run if K_CanChangeRules says no
- Correctly set `mapvisited` on level visit, even in [fake gasp] MULTIPLAYER/NETGAMES!! 🥹
- Added updating unlockables and extra emblems on `mapvisited` update.
    - Currently fails to produce the cecho, but that'll be stripped out entirely in a future commit so I'm not bothered.
2022-11-27 22:53:29 +00:00
toaster
c2183a626c Actually track lastfakeskin!
Tremendous whoopsie: turns out there's no code that actually saves it outside of netsync. This is now fixed.
Also now allows you to roll Eggman as your first skin, and doesn't cause immediate characterswaps for midgame joiners.
2022-11-23 18:03:27 +00:00
toaster
33203bb53f Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into ironman 2022-11-23 17:21:51 +00:00
toaster
b8f59fd227 Skin and playerstate code in demos has been partly rewritten to support more than was previously possible.
Notable new features:
- Guaranteed native compatibility with SF_IRONMAN even with differing # of skins
- Bots (todo: can still desync midway through round)

Implementation details:
- Demo code (skins):
    - Instead of writing a skin name string, and the player's kartspeed, kartweight, and charflags for each player in the initial player-interpreting loop...
    - Write a skinlist of EVERY skin's name string, kartspeed, kartweight, and flags next to the file list, to be read into `demo.skinlist`.
        - If the skin name isn't loaded, find the skin with (in order)
            - SF_IRONMAN if your skin had SF_IRONMAN, since that's more important to signal
            - the closest stats otherwise (as per previous implementation)
        - Just as tolerant to stats AND the number of base skins changing between versions (the bonuschars aegis situation)
        - Not tolerant to restat, but we can add a DXD or EZT later if we want to natively support that kind of mod
    - In the initial loop and DXD_SKIN, just write an index that can be used for `demo.skinlist`, and store it in `demo.currentskinid[p]`
    - The player's skin is now encoded as EZT_IRONMAN for ghosts (and just in case RNG sync fails for unrelated reasons)
- In the SF_IRONMAN code when demo.playback is true
    - everywhere where `skins[player->skin]` is referenced instead uses an index into `demo.skinlist`
    - SetRandomFakePlayerSkin uses the `demo.skinlist` to build a table to ensure exact random call parity
        - Also means it no longer double rejection-samples.
    - `player->fakeskin` and `lastfakeskin` are always == their original recording values, a skin id which can be used into `demo.skinlist`
- Demo code (playstate, initial player setup loop):
    - Add bot flag (`DXD_PST_ISBOT`, `DEMO_BOT`)
    - Add in-between-level botvars (difficulty, diffincrease, rival)
    - Don't rely on `PF_WANTSTOJOIN` to activate

Additional bugfixes:
- Followerskin set to -1 in CL_ClearPlayer so a bad follower isn't recorded on player join without name and color change arriving immediately
- Accomodate new joiners in demo code even if they're not on DXD_PST_SPECTATING for one reason or another
- Demo extra file list saving is now its own function for code cleanliness
- Actually only modify players relevant to the demo at the end of G_DoPlayDemo, not all 16 by supplying and overwriting garbage values (POSSIBLE MEMORY CORRUPTION FIX, mobj_t pointer was previously dereferenced)
2022-11-22 14:28:48 +00:00
toaster
62bf8458c5 Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into servers-16
# Conflicts:
#	src/d_main.c
2022-11-21 15:29:35 +00:00
Sal
e8a6aa7540 Merge branch 'follower-fixes' into 'master'
Followers and Character Select improvements

See merge request KartKrew/Kart!764
2022-11-14 21:30:03 +00:00
toaster
f5f94b977e Deprecated constants flagged in review 2022-11-12 17:42:16 +00:00
toaster
35a3a9db4a Remove follower on player departure 2022-11-07 17:09:51 +00:00
toaster
ebdb5db502 Unused variable cropped up during porting 2022-11-05 23:23:08 +00:00
toaster
34540b9caa More consistently time out people nearing the end of the BACKUPTICS, not just if they cross the line, to match desired v1 behaviour 2022-11-05 23:23:07 +00:00
toaster
0da626807c EXPERIMENTAL: Dedicated server idling system
- If no clients at server start or after 10 seconds of GS_LEVEL, and no Netxcmd waiting to be digested, halt all SV_MakeTic.
- It's absolutely netsafe to only have enabled on the host's end, the only risk is that a dedicated server might not re-awaken when presented with certain stimuli
2022-11-05 23:23:07 +00:00
toaster
c77147fd1c Rewrite ping timeout
- Reduce the joiner grace period for normal ping limit to 10 seconds (from 30)
- Properly account for ignoring all local players when the host is splitscreen

# Conflicts:
#	src/d_clisrv.c
2022-11-05 23:23:07 +00:00
toaster
6cbbb0b286 All download meters ported from v1 now use the 2.2 palette 2022-11-05 14:04:39 +00:00
toaster
c445b0b26a Direct file downloader changes ported from 1.6
Flattened due to changes between the code base including renamed functions.
Also renames CL_LEGACYREQUESTFAILED to the more specific CL_DOWNLOADFAILED.
2022-11-05 13:53:04 +00:00
toaster
c4fd7d74dd P_AddWadFile partial stages port from SRB2Kart 1.6
Originally written by x.organic, flattened rewrite due to massive changes between RR and SRB2Kart codebase
Notable changes:
- p_adding_file has been reworked into partadd_earliestfile to allow for final setup to use
- much like the public version required removing TEXTURE SOCs, this one required removing Flats support from ANIMDEFS
2022-11-04 16:15:53 +00:00
toaster
e486926943 Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into miniladder-16
# Conflicts:
#	src/d_main.c
2022-11-04 12:03:48 +00:00
toaster
b4227bde05 Fix M_ConfirmConnect properly ending the menu popup
Turns out M_ClearMenus returns early, we should do M_StopMessage directly
2022-11-03 23:48:58 +00:00
toaster
13003cb66a NONET was killed prior, get rid of its body 2022-11-03 22:42:06 +00:00
toaster
21be387d0f Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into connection-doinglus
# Conflicts:
#	src/d_clisrv.c
#	src/d_main.c
#	src/k_menudraw.c
#	src/m_misc.c
2022-11-03 22:36:34 +00:00
toaster
0230b57aa8 Remove advancedemo
Just a weird, meaningless footgun waiting in the wings for someone to catch themselves on
2022-11-03 14:45:36 +00:00
toaster
c5a3d362a1 Shadowed declaration fix for d_clisrv anti-bodysnatch fix 2022-11-03 14:28:19 +00:00
Ashnal
ce7fe894b8 Should fix the dedicated server player node takeover
that completely destroys servers

# Conflicts:
#	src/d_clisrv.c
2022-11-03 12:42:39 +00:00
toaster
243f38227c Rework time limit a bit
- Make timelimitintics handled a bit more like gamespeed, encore, frantic, etc - update on mapload/starttime, not during gameplay
    - Use default setting if can't change rules - this is a surprise tool that will help us later
- Have it properly update when adjusting gametype from the menu
    - Cleaned up SV_StartSinglePlayerServer to do this
- Remove CV_SAVE to prevent time limit bruh moments
2022-10-11 23:00:44 +01:00
Sal
1300ec5d56 Merge branch 'commit-version' into 'master'
Compare git commit before joining netgames

See merge request KartKrew/Kart!721
2022-10-01 02:54:58 +00:00
James R
bc0fc9b05a Readd version and subversion to serverinfo
Add commit field after those two so packet is identical up
to that point and DEVELOP builds mismatch version online.

blame d176aefd8
2022-09-30 05:51:43 -07:00
James R
d176aefd88 Compare git commit when joining netgames in DEVELOP builds 2022-09-29 12:55:07 -07:00
Sally Coolatta
80d9637dda devmode cheat online 2022-09-29 12:19:45 -04:00
toaster
52f0217bac Completely rewrite how joined IPs are saved and written... again
- Use strlcpy instead of strcpy to prevent footguns
- Use fprintf instead of raw fputs
- Enforce consistent MAX_LOGIP (255) length for each component instead of a combination of magic number 255 and MAXSTRINGLENGTH (32!?) depending on where you look
- Fix fun memory leak in waiting
- Avoid pointless strlens
2022-09-26 21:28:33 +01:00
toaster
dfce863449 Dummy out connectedservername usage for now, as it's only ever written to when YOU host 2022-09-26 20:52:08 +01:00
toaster
e58a109a2b Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into joinedip-fixes 2022-09-26 20:16:34 +01:00
toaster
ff629a4c78 Merge branch 'kill-nonet' into 'master'
Kill last of NONET, DJGPP (DOS), WATTCP (also DOS?), _WINDOWS (DirectDraw)

See merge request KartKrew/Kart!704
2022-09-26 17:02:55 +00:00
Sally Coolatta
139d6f4a49 Merge branch 'master' into rng-states-2 2022-09-25 14:04:19 -04:00
James R
f6a5ed9c6c Remove NONET 2022-09-24 19:22:04 -07:00
SteelT
b5e9de2e69 Grab server name from connectedservername, instead of netbuffer->u.serverinfo.servername (fixes garbage server name)
Yeah it will be blank, but preparation for whenever the server's name is stored in that variable
2022-09-24 18:20:58 -04:00
Sally Coolatta
d582cf0a3f Merge branch 'master' into rng-states-2 2022-09-23 11:23:49 -04:00
toaster
e1c8f8095b Clean up recent IP handling a bunch. 2022-09-23 04:06:37 -04:00
toaster
abb567ab81 Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into big-large-map-markers 2022-09-21 23:06:24 +01:00
toaster
5a813cd94d Remove mapname buffer from serverinfo_pak 2022-09-21 22:19:51 +01:00
AJ Martinez
aaf18fb1cf Offline Input Delay -> Minimum Input Delay, default 0 -> 2 2022-09-20 21:29:17 -07:00
AJ Martinez
8525dfb502 Allow netgame clients to display and be affected by mindelay 2022-09-20 21:21:51 -07:00
AJ Martinez
bd83a9f3b1 Mindelay: Probably don't calculate ping outside of games period 2022-09-20 20:33:30 -07:00
AJ Martinez
e1f72898f5 Mindelay: Update ping display even in local play 2022-09-20 20:15:02 -07:00
AJ Martinez
e242207d10 Mindelay: Oni suggestions rollup 2022-09-20 19:01:54 -07:00
AJ Martinez
db25599647 Offline input delay cvar 2022-09-20 02:34:53 -07:00
Sally Coolatta
a60d4a13a1 RNG classes, take 2
Redone version of my old branch
2022-09-19 00:04:57 -04:00
toaster
1a284ec7c6 Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into big-large-map-markers
# Conflicts:
#	src/d_netcmd.c
2022-09-17 13:57:26 +01:00
James R
6a6a0accee Merge remote-tracking branch 'origin/cvar-default-ports' 2022-09-17 00:18:10 -07:00
James R
1cf1643233 Merge branch 'stability-fix-ports' into 'master'
Stability fix ports

See merge request KartKrew/Kart!670
2022-09-17 07:08:26 +00:00
Sally Coolatta
81a4cb17c0 Only do it in netgames 2022-09-14 05:14:54 -04:00