// using SDL_WaitThread()
//
// Code used with SDL 1.2:
- // if (network_server) // terminate network server
- // SDL_KillThread(server_thread);
+ // if (network.server_thread) // terminate network server
+ // SDL_KillThread(network.server_thread);
CloseVideoDisplay();
ClosePlatformDependentStuff();
network.server_host = server_host;
network.server_port = server_port;
+
+ network.server_thread = NULL;
+ network.is_server_thread = FALSE;
}
void InitRuntimeInfo()
char *server_host;
int server_port;
+ SDL_Thread *server_thread;
+ boolean is_server_thread;
};
struct RuntimeInfo
boolean game_status_last_screen = -1;
boolean level_editor_test_game = FALSE;
boolean network_playing = FALSE;
-boolean network_server = FALSE;
-SDL_Thread *server_thread;
int key_joystick_mapping = 0;
extern boolean game_status_last_screen;
extern boolean level_editor_test_game;
extern boolean network_playing;
-extern boolean network_server;
-extern SDL_Thread *server_thread;
extern int key_joystick_mapping;
// the pointer points to an integer containing the port-number
int NetworkServerThread(void *ptr)
{
+ network.is_server_thread = TRUE;
+
NetworkServer(*((int *) ptr), 0);
// should never be reached
p = port;
- server_thread = SDL_CreateThread(NetworkServerThread,
- "NetworkServerThread", &p);
- network_server = TRUE;
+ network.server_thread = SDL_CreateThread(NetworkServerThread,
+ "NetworkServerThread", &p);
}
boolean ConnectToServer(char *hostname, int port)