Skip to content

Commit 94be307

Browse files
Boondorlmadame-rachelle
authored andcommitted
Netcode Overhaul
Rewrote netcode to be more stable and functional. Packet-server mode has been restrategized and will now be the default netmode when playing with 3+ non-LAN players. TryRunTics has been cleaned up with older tick control behavior removed to account for the rewritten renderer. The main thread is now more consistent when playing online to prevent potential slow downs and lock ups. Load barriers are better accounted for to prevent spikes on level transition. Improvements to chat and lobby systems including a force start game button. Added a suite of new host options such as kicking and controlling who can pause the game. Max players increased from 8 to 16 since the new code can now handle it. Note: Demo functionality is untested. This will be rewritten at a later time alongside improvements to GZDoom's playback features (e.g. freecam mode).
1 parent abfd91e commit 94be307

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+3119
-2669
lines changed

src/common/console/c_dispatch.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,22 @@ static const char *KeyConfCommands[] =
190190

191191
// CODE --------------------------------------------------------------------
192192

193+
bool C_IsValidInt(const char* arg, int& value, int base)
194+
{
195+
char* end_read;
196+
value = std::strtol(arg, &end_read, base);
197+
ptrdiff_t chars_read = end_read - arg;
198+
return chars_read == strlen(arg);
199+
}
200+
201+
bool C_IsValidFloat(const char* arg, double& value)
202+
{
203+
char* end_read;
204+
value = std::strtod(arg, &end_read);
205+
ptrdiff_t chars_read = end_read - arg;
206+
return chars_read == strlen(arg);
207+
}
208+
193209
void C_DoCommand (const char *cmd, int keynum)
194210
{
195211
FConsoleCommand *com;

src/common/console/c_dispatch.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ void C_ClearDelayedCommands();
7474

7575
// Process a single console command. Does not handle wait.
7676
void C_DoCommand (const char *cmd, int keynum=0);
77+
bool C_IsValidInt(const char* arg, int& value, int base = 10);
78+
bool C_IsValidFloat(const char* arg, double& value);
7779

7880
FExecList *C_ParseExecFile(const char *file, FExecList *source);
7981
void C_SearchForPullins(FExecList *exec, const char *file, class FCommandLine &args);

0 commit comments

Comments
 (0)