diff options
author | darkvater <darkvater@openttd.org> | 2004-09-12 23:35:01 +0000 |
---|---|---|
committer | darkvater <darkvater@openttd.org> | 2004-09-12 23:35:01 +0000 |
commit | 01dd0219d312060d64d714c566a5307f6b187057 (patch) | |
tree | 1cb3f0310e6977a2f58d828b00a1a70c173bce95 /network.c | |
parent | ec21a64c03c01dcf9fa842721766562262a49d66 (diff) | |
download | openttd-01dd0219d312060d64d714c566a5307f6b187057.tar.xz |
(svn r229) -Fix: Some more const stuff fixed .(Tron)
-Fix: ParseConnectionString() function to parse network connection string: <IP>[:<PORT>][#<PLAY_AS] .
Diffstat (limited to 'network.c')
-rw-r--r-- | network.c | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -1653,6 +1653,22 @@ void NetworkCoreShutdown() /* *************************************************** */ +void ParseConnectionString(const byte **player, const byte **port, byte *connection_string) +{ + byte c = 0; + while (connection_string[c] != '\0') { + if (connection_string[c] == '#') { + *player = &connection_string[c+1]; + connection_string[c] = '\0'; + } + if (connection_string[c] == ':') { + *port = &connection_string[c+1]; + connection_string[c] = '\0'; + } + c++; + } +} + bool NetworkCoreConnectGame(const byte* b, unsigned short port) { if (!_network_available) return false; @@ -1901,6 +1917,7 @@ void NetworkCoreInit() { _network_available=false; }; void NetworkCoreShutdown() {}; void NetworkCoreDisconnect() {}; void NetworkCoreLoop(bool incomming) {}; +void ParseConnectionString(const byte **player, const byte **port, byte *connection_string) {}; bool NetworkCoreConnectGame(const byte* b, unsigned short port) {return false;}; bool NetworkCoreStartGame() {return false;}; void NetworkLobbyShutdown() {}; |