summaryrefslogtreecommitdiff
path: root/src/net_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/net_common.c')
-rw-r--r--src/net_common.c46
1 files changed, 5 insertions, 41 deletions
diff --git a/src/net_common.c b/src/net_common.c
index da3d7fd5..f25cc73d 100644
--- a/src/net_common.c
+++ b/src/net_common.c
@@ -21,15 +21,17 @@
// Common code shared between the client and server
//
-#include <ctype.h>
+#include <stdio.h>
#include <stdlib.h>
-#include "doomdef.h"
+#include "doomtype.h"
+#include "d_mode.h"
#include "i_timer.h"
#include "net_common.h"
#include "net_io.h"
#include "net_packet.h"
+#include "net_structrw.h"
// connections time out after 10 seconds
@@ -511,44 +513,6 @@ unsigned int NET_ExpandTicNum(unsigned int relative, unsigned int b)
return result;
}
-// "Safe" version of puts, for displaying messages received from the
-// network.
-
-void NET_SafePuts(char *s)
-{
- char *p;
-
- // Do not do a straight "puts" of the string, as this could be
- // dangerous (sending control codes to terminals can do all
- // kinds of things)
-
- for (p=s; *p; ++p)
- {
- if (isprint(*p))
- putchar(*p);
- }
-
- putchar('\n');
-}
-
-// Check that a gamemode+gamemission received over the network is valid.
-
-boolean NET_ValidGameMode(GameMode_t mode, GameMission_t mission)
-{
- if (mode == shareware || mode == registered || mode == retail)
- {
- return true;
- }
- else if (mode == commercial)
- {
- return mission == doom2 || mission == pack_tnt || mission == pack_plut;
- }
- else
- {
- return false;
- }
-}
-
// Check that game settings are valid
boolean NET_ValidGameSettings(GameMode_t mode, GameMission_t mission,
@@ -566,7 +530,7 @@ boolean NET_ValidGameSettings(GameMode_t mode, GameMission_t mission,
if (settings->skill < sk_noitems || settings->skill > sk_nightmare)
return false;
- if (settings->gameversion < exe_doom_1_9 || settings->gameversion > exe_chex)
+ if (!D_ValidGameVersion(mission, settings->gameversion))
return false;
if (mode == shareware || mode == retail || mode == registered)