From 75b71ca05b6abba9df048dca8a0bb6ca7fb015ac Mon Sep 17 00:00:00 2001 From: aerkefiende Date: Sat, 20 Nov 2010 15:21:45 +0000 Subject: [PATCH] URL protocol: assaultcube:// Now assaultcube://example.org:28763 works as port definition as well. git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5914 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/main.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/src/main.cpp b/source/src/main.cpp index c452b6e5..80820b74 100644 --- a/source/src/main.cpp +++ b/source/src/main.cpp @@ -1018,10 +1018,16 @@ void connectprotocol(char *protocolstring, string &servername, string &serverpor int len = 0; direct_connect = false; servername[0] = serverport[0] = password[0] = '\0'; - while(*c && *c!='/' && *c!='?') { len++; c++; } + while(*c && *c!='/' && *c!='?' && *c!=':') { len++; c++; } if(!len) { conoutf("\f3bad commandline syntax", protocolstring); return; } copystring(servername, p, min(len+1, MAXSTRLEN)); direct_connect = true; + if(*c && *c==':') + { + c++; p = c; len = 0; + while(*c && *c!='/' && *c!='?') { len++; c++; } + if(len) copystring(serverport, p, min(len+1, MAXSTRLEN)); + } if(*c && *c=='/') c++; if(!*c || *c!='?') return; do