Commit graph

125 commits

Author SHA1 Message Date
Lach
54920c817b Correct local millisecond measurement in ping command output 2024-06-08 00:27:44 +10:00
Sally Coolatta
7dfa597c7d SRB2 -> DRRR copyright in src, acs, android folder
Be consistent with toaster's recent changes to copyright
2024-04-05 02:08:23 -04:00
James R
7abe285f84 Refactor: replace references to cv_timescale with I_GetTimeScale 2024-03-18 02:42:21 -07:00
AJ Martinez
15338c4e32 Packet loss indicator 2023-10-20 20:33:37 -07:00
AJ Martinez
f9f5c74244 New bans 2023-10-16 23:50:50 +00:00
James R
8d699864b1 DebugPrintpacket: fix underflow for PT_TEXTCMD reporting 2023-08-11 18:14:28 -07:00
James R
039a73ce64 Expand textcmd size byte to 16-bit word
Raises hard limit from 255 to 65535
2023-06-01 20:03:23 -07:00
James R
3ad30c0c7a debugfile: replace mixed string/control character notation with hexdump
Example of old notation:

    [10]O[0,0]jartha[0,254,142,131]c[133]hL^{[170][[251,199]+E[181]U+t[247,183,129,165,152]#$[164,22,10,169]r[150,212,3,232,3,0,0,2,0,0,0,8,0]0[8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,9,2,0,0,1,0,217,161,192] D[0,0,0,0,0,0,0]

Example of new notation:

         0:  01 0e 6a 61  72 74 68 61  00 57 00 09  5a 00 42 00  ..jartha.W..Z.B.
        16:  02 01 00 b7  6a d4 20 6f  2b 45 b5                  ....j. o+E.
2023-05-24 18:33:22 -07:00
AJ Martinez
cb8e48d8a7 WIP: PT_SAY 2023-04-29 16:12:23 -07:00
AJ Martinez
e09b21ddae IsExternalAddress type fixup, move into i_tcp.c / SOCK_ abstraction 2023-03-28 01:25:56 -07:00
AJ Martinez
78b30802bb Let's try fixing potential UB on GetNodeAddressInt 2023-03-28 01:25:55 -07:00
AJ Martinez
30ca69e51d Don't sign game traffic, we shouldn't need it anymore 2023-03-28 01:25:54 -07:00
AJ Martinez
a1f82b2a37 Use server IP and timestamp in PT_SERVERCHALLENGE to avoid signature reuse 2023-03-28 01:25:54 -07:00
AJ Martinez
137f166043 Cvars to do bad network things in DEVELOP, fixes to bad network things 2023-03-28 01:25:54 -07:00
AJ Martinez
33760dec51 I don't even know, unfuck everything 2023-03-28 01:20:44 -07:00
AJ Martinez
2925843ea2 Sigfail command for testing, fix guest join sigcheck, scaffolding for sigfail kick reason 2023-03-28 01:20:43 -07:00
AJ Martinez
936da9870c Move guest profile checks into dedicated method 2023-03-28 01:20:43 -07:00
AJ Martinez
b758001661 We don't need payloadsize, we don't trust it anyway 2023-03-28 01:20:43 -07:00
AJ Martinez
3747ba6cbd Sign game traffic that could be used to cause problems 2023-03-28 01:20:43 -07:00
AJ Martinez
cacb4f453f Scramble keys and challenges when init/closing node 2023-03-28 01:19:43 -07:00
James R
0d0310a140 typedef.h: typedef node_t
d_net.c: rename node_t to netnode_t
2022-11-27 17:21:40 -08: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
James R
f6a5ed9c6c Remove NONET 2022-09-24 19:22:04 -07:00
toaster
5a813cd94d Remove mapname buffer from serverinfo_pak 2022-09-21 22:19:51 +01:00
VelocitOni
8a5707ad83 Merge branch 'master' into hostcode 2022-09-13 17:08:15 -04:00
X.organic
902fcfa569 Miscellaneous memory bug fixes to make AddressSanitizer happy
# Conflicts:
#	src/d_clisrv.c
#	src/dehacked.c
#	src/hardware/hw_cache.c
#	src/hardware/hw_md2.c
#	src/http-mserv.c
#	src/lua_hudlib_drawlist.c
2022-09-12 16:49:18 +01:00
toaster
f728f164f5 Create a single struct for bannednode and bannednodetimelft, and use the matching ban ID inside that struct.
While this commit does not increase the visibility of ban reasons, it makes this possible later.
2022-08-24 21:53:49 +01:00
Sally Coolatta
d6e2410cbb Ban improvements
- Save a note of the username, not just the reason.
- Allow setting a mask with the `banip` command.
- Make ban.txt's formatting a lot more sane. Username and reason are stored in quotes. The mask uses the same formatting as actual CDIR.
- Keep track of if we tried to load ban.txt. If it wasn't, then don't save over it with a blank file.
- Disallow quotes in player names, as it makes player name detection in console more annoying, and saving username in files scary.
2022-08-24 21:07:42 +01:00
Sally Coolatta
3096806f04 Kicks are now temp bans
Length is determined by the "kicktime" cvar, in minutes. By default, this is set to 10, but I'm willing to adjust this. Only applies to manual kicks (in the future, maybe also name filter kicks).

The timestamp for the unban time is even saved in ban.txt, so long-term temporary bans are completely possible. (I checked, you can attempt to ban someone for up to 1902 years if you really want to.)
2022-08-24 21:02:38 +01:00
Sally Coolatta
5ea0f69a83 - Attach ban reasons to banned_t
- Properly call D_SaveBan after remote bans. Bans are no longer saved in the ban command and instead wait for the actual kick to process, since before they were split between the two, which is what caused the discrepancy.
2022-08-24 21:02:38 +01:00
Sally Coolatta
70c48fc0e9 Ping measured in frame delay instead of milliseconds
The part of HOSTMOD ministats that I wanted. Can go back to ms using the pingmeasurement cvar.

If Tyron wants to bring ministats fully in I think it'd be better to bring its ideas to replace the current HUD instead, ideally using the existing ping gfx, so they should bring it up with Oni
2022-08-24 21:02:37 +01:00
Eidolon
f7ec2f182f Uncapped (squashed v2)
Squashed SRB2 2.2 Public uncapped without UDMF merge

Implement interpolation at the renderer level

Instead of interpolating thinkers, we interpolate mobjs inside the
renderer. Further interpolation is TBI.

Place Frame Interpolation in "Experimental" video options header

This seems like an appropriate way to describe the feature for now.

Add smooth level platter under interpolation, `renderdeltatics`

`renderdeltatics` can be used as a standard delta time in any place,
allowing for smooth menus. It will always be equal to `realtics`
when frame interpolation is turned off, producing consistent
framerate behavior everywhere it is used.

Add smooth rendering to save select screen

Add smooth rendering to Record/NiGHTS Attack, F_SkyScroll

Ensure viewsector is accurate to viewx/viewy

This fixes a potential crash in OpenGL when changing between levels.

Ensure + commands get executed before map start

Always have precise_t defined

Fix misc dropshadow issues

Reset view interpolation on level load

Remove unnecessary precipmobj thinker hack

Add reset interpolation state functions

Reset precip interpolation on snap to ceil

Reset mobj interp state on TeleportMove

Only swap view interp state if a tick is run

Run anti-lag chasecam at tic frequency

Fixes jittery and unstable chasecam in high latency netgames

Homogenize mobj interpolations

Add sector plane level interpolations

Add SectorScroll interpolator

Add SideScroll interpolator

Add Polyobj interpolator

Intialize interpolator list at a better time

Delete interpolators associated with thinkers

Interpolate mobj angles and player drawangle

Interpolate HWR_DrawModel

Add functions to handle interpolation

Much less code duplication

P_InitAngle, to fix angle interpolation on spawning objects

Fully fix drop shadows

It used the thing's floorz / ceilingz directly -- that wouldn't account for interpolated coordinates.

Do not speed up underwater/heatwave effect in OpenGL

Closer OpenGL underwater/heatwave effect to Software

Interpolate from time of previous tic

Previously interpolated from last 35th of a second, which
may be offset from game time due to connection lag.

Consider this the proper fix to 6ecac4159a too.

Calculate FPS stuff even if frame is skipped

I decided ultimately to actually keep the frame skip optimization disabled, because I think it is actually a little bit helpful that you can still get accurate rendering perfstats while paused, however if we decide otherwise then we can have this optimization back without making the game act like it's lagging.

Keep rect in memory

Feel better about this than creating one all da time

Lots of FPS stuff

- Disabled VSync, due to the numerous problems it has.
- Instead, added an FPS cap.
- Frame interpolation is now tied to fpscap != 35.
- By default, the FPS cap is set to the monitor's refresh rate.
- Rewrote the FPS counter.

(This also consolidates several more commits ahead of this
fixing various issues. -eid)

Misc changes after Kart cherry-picks

Fix renderdeltatics with new timing data

Update mobj oldstates before all thinkers

Allow FPS cap values

Adjust how FPS cap is checked to improve FPS stability

Fix precip crash from missing vars

Improve the framerate limiter's timing for extreme stable FPS

Handle the sleep at the end of D_SRB2Loop instead of the start

Simplifies logic in the other parts of the loop, and fixes problems with it frequently waiting too long.

Reset mobj interp state on add

Add mobj interpolator on load netgame

Move mobj interpolators to r_fps

Dynamic slope interpolators

I_GetFrameTime to try and improve frame pace

(It doesn't feel that much better though.)

Move I_FinishUpdate to D_SRB2Loop to sync screen updates with FPS cap, use timestamps in I_FrameCapSleep to simplify the code

Fix plane interpolation light level flickering

Fix flickering plane interpolation for OpenGL in the exact same way

Funny OpenGL renderer being at least 50% copy-pasted Software code :)

P_SetOrigin & P_MoveOrigin to replace P_TeleportMove

Convert P_TeleportMove use to origin funcs

Revert "P_InitAngle, to fix angle interpolation on spawning objects"

This reverts commit a80c98bd164a2748cbbfad9027b34601185d93f5.

Waypoint polyobjects interpolate z & children

Add interpolation to more moving plane types

Adds interpolation to the following:
- Crumbling platforms
- Mario blocks
- Floatbob platforms (this one works really strangely due to two thinkers, maybe double-check this one?)

Reset overlays interp states each TryRunTics

Interpolate model interpolation (lol)

Use interp tracer pos for GL linkdraw

Papersprite angle interpolation

Makes the ending signpost smooth

Move intermission emerald bounce to ticker

Bring back shadows on polyobjects

Also optimizes the method used so rings can show their shadows too. Using just the subsector is a tad bit imprecise admittedly but any more precise methods get really laggy.

Fix a bunch of ticking in hu_ drawing functions

Revert "Reset overlays interp states each TryRunTics"

This reverts commit a71a216faa20e8751b3bd0157354e8d748940c92.

Move intro ticking out of the drawer

Adjust 1up monitor icon z offsets

Fixes interpolation issues with 1up monitors.

Delta time choose player menu animations

Add drawerlib deltaTime function

Interpolate afterimages further back

Use old sleep in dedicated mode

Clamp cechotimer to 0

Fixes issues with cechos staying on-screen and glitching out
(NiGHTS items for example).

Revert "Remove unnecessary precipmobj thinker hack"

This reverts commit 0e38208620d19ec2ab690740438ac2fc7862a49e.

Fix frame pacing when game lags behind

The frame timestamp should've been made at the start of the frame, not the end.

Fix I_FrameCapSleep not respecting cpusleep

Jonathan Joestar bruh

Allow dedicated to use precise sleep timing again

Instead of only using one old sleep, just enforce framerate cap to match TICRATE.

Make Lua TeleportMove call MoveOrigin

Reset Metal fume interp state on appear

Add interpdebug

Put interpdebug stuff in perfstats instead

Add timescale cvar

Slow the game down to debug animations / interpolation problems! Speed it up if you need to get somewhere quickly while mapping!

Enable timescale outside of DEVELOP builds

It has NETVAR, so it should be fine -- put an end to useful debugging features excluded in multiplayer!

Force interpolation when timescale != 1.0

Reset old_z in MT_LOCKON think

Fixes interpolation artifacting due to spawn pos.

Fix cutscenes in interp

Fix boss1 laser in interp

Interpolate mobj scale

Precalculate refresh rate

Slower PCs can have issue querying mode over and over. This might kinda suck for windowed mode if you have different refresh rate displays but oh well

Fix interp scaling crashing software

Reset interp scale when Lua sets .scale

Disable angle interp on fresh mobjs

Fix interp scale crash for hires sprites

Interp shadow scales

Copy interp state in P_SpawnMobjFromMobj

Fix multiplayer character select

Don't interpolate mobj state if frac = 1.0

Fix Mario block item placement

Interpolate spritescale/offset x/y

Fix offset copies for SpawnMobjFromMobj

THANKS SAL

Add Lua HUD drawlists

Buffers draw calls between tics to ensure hooks
run at the originally intended rate.

Rename drawerlib deltaTime to getDeltaTime

Make renderisnewtic is false between tics

I know what I'm doing! I swear

Completely refactor timing system

Time is now tracked internally in the game using I_GetPreciseTime
and I_UpdateTime. I_Time now pulls from this internal timer. The
system code no longer needs to keep track of time itself.

This significantly improves frame and tic timing in interp mode,
resulting in a much smoother image with essentially no judder at
any framerate.

Ensure mobj interpolators reset on level load

Ensure view is not interpolated on first frame

Disable sprite offset interpolation (for now)

Refactor timing code even more

System layer is greatly simplified and framecap
logic has been moved internally. I_Sleep now
takes a sleep duration and I_SleepDuration
generically implements a precise sleep with spin
loop.

Adjust spawned mobj z by gravity inversion

Only check VERTICALFLIP for old_z calc

Fix Marathon Mode menu for uncapped

Move screenshot code before timing

Only play emerald hunt sounds on new tics

Restore deleted zofs (fixes signpost sparkles etc)

Revert to before screenUpdate boolean was added

Was done this way for the sake of an older version of uncapped's timing; now that the new timing is much better, I decided it should remain as close to pre-uncapped as it can be.

Run UpdateLevelInterpolators in preticker

Fixes KartKrew/Kart-Public#10

Run UpdateMobjInterpolators in preticker

Reset view interp in preticker

Add per-split player view resets
2022-05-06 22:47:39 -05:00
LJ Sonic
4b1ba2974d Do not attempt to disconnect when a packet checksum is invalid 2022-03-18 20:35:07 +00:00
James R
59c04ae041 pedantic: resolve flexible array member in nested struct
ISO C forbids a structure that has a flexible array member
to be a member of another structure or element of an
array.

filetx_pak and fileack_pak are two such structures. These
have been removed from doomdata_t's union.
2022-02-20 03:10:27 -08:00
Sally Coolatta
9d7ec0ab8f Merge SRB2 next
Probably doesn't compile yet, but I got rid of all of the conflicts for anyone who wants to take a stab at it.
2021-02-27 05:18:36 -05:00
James R
c8d4ef64f9 Hole punching 2020-11-12 17:08:34 -08:00
Louis-Antoine
8471f9e71f Merge branch 'next' of https://git.magicalgirl.moe/STJr/SRB2.git into resend-gamestate
# Conflicts:
#	src/d_clisrv.c
#	src/d_clisrv.h
#	src/d_net.c
#	src/p_saveg.c
#	src/p_saveg.h
2020-08-13 13:53:10 +02:00
Sally Coolatta
e296e1309a YAY, round 2 2020-08-09 21:02:56 -04:00
Sally Coolatta
6ddae4728f Merge d_net.c 2020-08-02 14:15:29 -04:00
LJ Sonic
05e8d12427 Merge branch 'next' into 'better-download'
# Conflicts:
#   src/sdl/i_system.c
#   src/win32/win_sys.c
2020-06-01 08:16:53 -04:00
Sally Coolatta
63917ffccc The start of the scary 2.2 merge
All conflicts are left in-tact. We should be collaborating on solving these files one at a time.
2020-05-29 13:43:38 -04:00
Louis-Antoine
dc527a8afb Use per-node reference tics in ExpandTics 2020-05-17 20:23:07 +02:00
Louis-Antoine
24bd03cd22 Store starttic as a raw value in PT_SERVERTICS packets
This avoids some desynch issues and is simpler to handle.
Those packets are always big anyway, so the difference is irrelevant.
2020-05-17 20:09:11 +02:00
Louis-Antoine
ebeac311af Add missing packet name 2020-05-16 23:22:33 +02:00
Louis-Antoine
c221b76716 Rewrite file transfer code
This code uses a custom packet acknowledgement system,
which is more suited for file transfer and does not suffer from
the small sender window used by the default acknowledgement system
2020-05-16 22:09:00 +02:00
Wolfy
f35bdf3bb7 Revert basically every attempted join passwords fix 2020-04-26 01:20:46 -07:00
James R
6613b19220 Merge remote-tracking branch 'lat/remove-passwords' into awful-mix-fucked 2020-04-26 01:16:27 -07:00
Wolfy
7444dd34ab Add PT_CLIENTCMD back to allowed packet types
Fixes unexpected CLIENTCMD prints
2020-04-07 07:09:51 -05:00
Wolfy
6ea0492008 Potentially fix join passwords 2020-04-05 18:57:47 -05:00
Wolfy
e6d7af623a Revert "PT_CLIENTCMD test"
This reverts commit e2feca3dc7.
2020-04-05 17:18:22 -05:00