1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-23 14:39:08 +00:00

(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

@@ -170,27 +170,13 @@ static void NetworkGameWindowWndProc(Window *w, WindowEvent *e)
case WE_ON_EDIT_TEXT: {
byte *b = e->edittext.str;
if (*b != 0) {
byte * ip = NULL;
byte * port = NULL;
byte * player = NULL;
byte c;
const byte *port = NULL;
const byte *player = NULL;
uint16 rport;
rport = _network_server_port;
c = 0;
ip = b;
while (b[c] != 0) {
if (((char)b[c]) == '#') {
player = &b[c+1];
b[c] = 0;
}
if (((char)b[c]) == ':') {
port = &b[c+1];
b[c] = 0;
}
c++;
}
ParseConnectionString(&player, &port, b);
if (player!=NULL) _network_playas = atoi(player);
if (port!=NULL) rport = atoi(port);