From 501b13786b024388b3cd7a21c8be8501dbfffb02 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sun, 28 Oct 2012 10:41:45 +0000 Subject: Add functions for network signature requests. These request the signed messages from the master server, to be used at the start and end of recording a secure demo. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 2535 --- src/net_sdl.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/net_sdl.c') diff --git a/src/net_sdl.c b/src/net_sdl.c index 2589540d..2f7eaa6f 100644 --- a/src/net_sdl.c +++ b/src/net_sdl.c @@ -44,6 +44,7 @@ #define DEFAULT_PORT 2342 +static boolean initted = false; static int port = DEFAULT_PORT; static UDPsocket udpsocket; static UDPpacket *recvpacket; @@ -162,6 +163,9 @@ static boolean NET_SDL_InitClient(void) { int p; + if (initted) + return true; + //! // @category net // @arg @@ -189,13 +193,18 @@ static boolean NET_SDL_InitClient(void) srand(time(NULL)); #endif + initted = true; + return true; } static boolean NET_SDL_InitServer(void) { int p; - + + if (initted) + return true; + p = M_CheckParmWithArgs("-port", 1); if (p > 0) port = atoi(myargv[p+1]); @@ -214,6 +223,8 @@ static boolean NET_SDL_InitServer(void) srand(time(NULL)); #endif + initted = true; + return true; } -- cgit v1.2.3