(svn r229) -Fix: Some more const stuff fixed .(Tron)

-Fix: ParseConnectionString() function to parse network connection string: <IP>[:<PORT>][#<PLAY_AS] .
This commit is contained in:
darkvater
2004-09-12 23:35:01 +00:00
parent ec21a64c03
commit 01dd0219d3
6 changed files with 33 additions and 43 deletions

View File

@@ -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() {};