summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2006-10-12 14:48:36 +0000
committerDarkvater <darkvater@openttd.org>2006-10-12 14:48:36 +0000
commit15bf48acfda4ce5e5291e0a68292d7f9d9b6a569 (patch)
treeeba2d3604689aa9e8702463f6611e3aaa06c39ab
parent110fc94cb539fcb742e8c01ee52e130d4ca9989e (diff)
downloadopenttd-15bf48acfda4ce5e5291e0a68292d7f9d9b6a569.tar.xz
(svn r6753) -Codechange: Move some function declerations from functions.h into network.h
and let NetworkDisconnect handle all shutdown related operations.
-rw-r--r--functions.h10
-rw-r--r--network.c3
-rw-r--r--network.h9
-rw-r--r--openttd.c2
4 files changed, 12 insertions, 12 deletions
diff --git a/functions.h b/functions.h
index cd59d8fb2..f1323c77d 100644
--- a/functions.h
+++ b/functions.h
@@ -132,16 +132,6 @@ bool CheckBridge_Stuff(byte bridge_type, uint bridge_len);
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);
diff --git a/network.c b/network.c
index 88e893b09..f961e16e0 100644
--- a/network.c
+++ b/network.c
@@ -1465,6 +1465,9 @@ void NetworkStartUp(void)
// This shuts the network down
void NetworkShutDown(void)
{
+ NetworkDisconnect();
+ NetworkUDPClose();
+
DEBUG(net, 3) ("[NET][Core] Shutting down the network.");
_network_available = false;
diff --git a/network.h b/network.h
index 5e0d0ac11..af7aeb405 100644
--- a/network.h
+++ b/network.h
@@ -224,6 +224,15 @@ bool NetworkChangeCompanyPassword(byte argc, char *argv[]);
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!
diff --git a/openttd.c b/openttd.c
index ee2b0234b..02ea57537 100644
--- a/openttd.c
+++ b/openttd.c
@@ -509,8 +509,6 @@ int ttd_main(int argc, char *argv[])
if (_network_available) {
// Shut down the network and close any open connections
NetworkDisconnect();
- NetworkUDPClose();
- NetworkShutDown();
}
#endif /* ENABLE_NETWORK */