(svn r6753) -Codechange: Move some function declerations from functions.h into network.h
authorDarkvater
Thu, 12 Oct 2006 14:48:36 +0000
changeset 4829 cb6ad7332c52
parent 4828 9e32eafd4657
child 4830 0ff2a14e90be
(svn r6753) -Codechange: Move some function declerations from functions.h into network.h
and let NetworkDisconnect handle all shutdown related operations.
functions.h
network.c
network.h
openttd.c
--- a/functions.h	Thu Oct 12 14:42:00 2006 +0000
+++ b/functions.h	Thu Oct 12 14:48:36 2006 +0000
@@ -132,16 +132,6 @@
 uint32 GetBridgeLength(TileIndex begin, TileIndex end);
 int CalcBridgeLenCostFactor(int x);
 
-/* network.c */
-void NetworkUDPClose(void);
-void NetworkStartUp(void);
-void NetworkShutDown(void);
-void NetworkGameLoop(void);
-void NetworkUDPGameLoop(void);
-bool NetworkServerStart(void);
-bool NetworkClientConnectGame(const char* host, unsigned short port);
-void NetworkReboot(void);
-void NetworkDisconnect(void);
 /* misc_cmd.c */
 void PlaceTreesRandomly(void);
 
--- a/network.c	Thu Oct 12 14:42:00 2006 +0000
+++ b/network.c	Thu Oct 12 14:48:36 2006 +0000
@@ -1465,6 +1465,9 @@
 // This shuts the network down
 void NetworkShutDown(void)
 {
+	NetworkDisconnect();
+	NetworkUDPClose();
+
 	DEBUG(net, 3) ("[NET][Core] Shutting down the network.");
 
 	_network_available = false;
--- a/network.h	Thu Oct 12 14:42:00 2006 +0000
+++ b/network.h	Thu Oct 12 14:48:36 2006 +0000
@@ -224,6 +224,15 @@
 void NetworkPopulateCompanyInfo(void);
 void CheckMinPlayers(void);
 
+void NetworkStartUp(void);
+void NetworkUDPClose(void);
+void NetworkShutDown(void);
+void NetworkGameLoop(void);
+void NetworkUDPGameLoop(void);
+bool NetworkServerStart(void);
+bool NetworkClientConnectGame(const char* host, unsigned short port);
+void NetworkReboot(void);
+void NetworkDisconnect(void);
 #endif /* ENABLE_NETWORK */
 
 // Those variables must always be registered!
--- a/openttd.c	Thu Oct 12 14:42:00 2006 +0000
+++ b/openttd.c	Thu Oct 12 14:48:36 2006 +0000
@@ -509,8 +509,6 @@
 	if (_network_available) {
 		// Shut down the network and close any open connections
 		NetworkDisconnect();
-		NetworkUDPClose();
-		NetworkShutDown();
 	}
 #endif /* ENABLE_NETWORK */