bug fixes: browse connection

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5798 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Rafael Barreto
2010-11-01 20:06:00 +00:00
parent 6295f8b599
commit c5bf72393d
2 changed files with 7 additions and 5 deletions
+4 -2
View File
@@ -61,18 +61,20 @@ void abortconnect()
void connectserv_(const char *servername, const char *serverport = NULL, const char *password = NULL, int role = CR_DEFAULT)
{
const char *defaultport = "28763";
if (!serverport) serverport = defaultport;
extern void enddemoplayback();
if(watchingdemo) enddemoplayback();
if(connpeer)
{
conoutf(_("aborting connection attempt"));
abortconnect();
}
connectrole = role;
copystring(clientpassword, password ? password : "");
ENetAddress address;
int p = 0;
if(serverport && serverport[0]) p = atoi(serverport);
address.port = p > 0 ? p : CUBE_DEFAULT_SERVER_PORT;