CLVM: remove cruft Having more than one var tracking one state can lead to bugs. Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
com: rename BSD strlcpy and strlcat The C standard reserves str* and mem* for the implementation. Checking for BSD or OS X is not a robust way to determine if libc provides these (eg glibc may implement them). Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
cl_netfps: reduce pings by synchronising when possible, related fixes Fixes possibility of input frequency to exceed cl_netfps in certain configurations. Fixes possibility of rate limiting to reduce input frequency more than it should. Fixes timescale affecting input frequency (now consistent with client FPS and server HZ being unaffected by timescale). History of this code (most recent first): 1b6ea396b616e359cfe98d1e85e8e7a9ac571e91 528b92ffab3a9ab09770310e2796adbe5f0f1e20 79e332ad14e7ec9dbd2702a2d28127f7600f0678 663279ba8feeb4c114df0950bbc820f3bb32dcdc 21beb5fe4fa2e1f1b7591a4a1f6013b82186912f Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
input: activate DP_BUTTONCHAT if the window is hidden or loses focus Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
Adding the natural curve mouse acceleration Signed-off-by: Draena <franparpe@disroot.org>
cl_main: Keep old CL_Disconnect for simplicity. Move guts to CL_DisconnectEx
protocol/dp8: Implement parting messages * Extended CL_Disconnect and SV_DropClient for this purpose. * Add a string parameter to svc_disconnect and clc_disconnect, which shall contain the parting message.
protocol: Stub DP8 protocol
client: Add SV_Shutdown hook and remove all direct calls in non-server code. Lock the server mutex within SV_Shutdown itself. Call the hook directly from CL_Disconnect. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@13141 d7cf8633-e32d-0410-b094-e92efae38249
cl_input: Don't floor cl.cmd.frametime to the nearest millisecond in CL_SendMove Removes the requirement of integer millisecond client and server frame times (eg 125fps) to get the smoothest asynchronous movement. Authored by bones_was_here https://gitlab.com/xonotic/darkplaces/-/merge_requests/112 git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@13114 d7cf8633-e32d-0410-b094-e92efae38249
client: Improve input packet timing (netfps) Increase min netfps to 10 (matches min ticrate). Skip packettime calculations for 0ms packets. Cap netfps when ticrate stat is available: soft limit 2x, hard limit < 4x server frame rate. Set packettime to (largest multiple of realframetime) <= packettime. Prevents packet rates lower than cl_netfps or server frame rate, eg: cl_netfps 60 and cl_maxfps 250 would otherwise send only 50 netfps. Allow for float error when deciding if it's time to send yet. Accumulate realframetime instead of storing host.realtime. Fixes low packet rates in some configurations, eg: with cl_maxfps 125 and cl_netfps 125 it would not send every frame, as host.realtime - lastpackettime was often well below (or above) 8ms. Authored by bones_was_here https://gitlab.com/xonotic/darkplaces/-/merge_requests/112 git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@13113 d7cf8633-e32d-0410-b094-e92efae38249
cl_input: Implement CheckJump function. Rename ambiguous variable git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@13070 d7cf8633-e32d-0410-b094-e92efae38249
cl_input: Simplify wishspeed calculation to use VectorNormalizeLength instead of duplicating its functionality git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@13067 d7cf8633-e32d-0410-b094-e92efae38249
Unify the command and cvar flags, under the CF_ prefix. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12923 d7cf8633-e32d-0410-b094-e92efae38249
Rename qboolean to qbool git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12920 d7cf8633-e32d-0410-b094-e92efae38249
Add -Wshadow cflag and eliminate its warnings, including with g++ git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12750 d7cf8633-e32d-0410-b094-e92efae38249
Eradicated the CVAR_NQUSERINFOHACK flag, for good This is a massive commit, admittedly. But pretty much every single change goes together and this could not be split up, unfortunately. I implemented a few new functions and turned a lot of the userinfo keys into cvars, just like their QW counterparts. CMD_INITWAIT is also gone and replaced by CMD_USERINFO to denote special server-from-client commands that specifically change a userinfo string of a given client. I'm sure there's a cleaner way to do this, especially the holy callback trinity I implemented to avoid an infinite loop when synchronizing topcolor and bottomcolor with _cl_color and vice versa. But, if this gets rid of decade old legacy cruft, and makes it all easier to maintain down the road, that's a plus for me. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12722 d7cf8633-e32d-0410-b094-e92efae38249
First massive rename and move A lot of these functions belong on their respective side of the engine. host.c and host_cmd.c appear to be a dumping ground for misc functions that Quakeworld engines have a proper place for. This is part of the moving operation. There's still plenty more functions that need to be put in their respective places. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12717 d7cf8633-e32d-0410-b094-e92efae38249
Organize system and host globals into structs. Implement host state tracking git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12691 d7cf8633-e32d-0410-b094-e92efae38249
Initial implementation of command flag system This should reduce code duplication and allows other cool things. This is part of the solution to a bug where "stuffcmds" stopped working because of changes to the initialization order in Host_Init. More work needs to be done but this should be fine for now. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12668 d7cf8633-e32d-0410-b094-e92efae38249