void Client::Init() { conoutf("[DEBUG] Client::Init"); setvar("mainmenu", false); setvar("hidehud", 1); if(!connected) localconnect(); }
void ClientSystem::gotoLoginScreen() { assert(0); #if 0 Logging::log(Logging::DEBUG, "Going to login screen\r\n"); INDENT_LOG(Logging::DEBUG); LogicSystem::init(); // This is also done later, but as the mainloop assumes there is always a ScriptEngine, we do it here as well ClientSystem::onDisconnect(); // disconnect has several meanings... localconnect(); game::gameconnect(false); // FPSServerInterface::vote("login", 0); game::changemap("login"); Logging::log(Logging::DEBUG, "Going to login screen complete\r\n"); #endif }
void disconnect(int onlyclean, int async) { bool cleanup = onlyclean!=0; if(curpeer || connectedlocally) { if(curpeer) { if(!discmillis) { enet_peer_disconnect(curpeer, DISC_NONE); if(clienthost) enet_host_flush(clienthost); discmillis = totalmillis; } if(curpeer->state!=ENET_PEER_STATE_DISCONNECTED) { if(async) return; enet_peer_reset(curpeer); } curpeer = NULL; } discmillis = 0; conoutft(CON_MESG, "\frdisconnected"); cleanup = true; } if(!connpeer && clienthost) { enet_host_destroy(clienthost); clienthost = NULL; } if(cleanup) { client::gamedisconnect(onlyclean); localdisconnect(); } if(!onlyclean) localconnect(false); }
void changemap(const char *name) { if(!connected) localconnect(); if(editmode) toggleedit(); if(!load_world(name)) emptymap(0, true, name); }
void connectfail() { abortconnect(false); localconnect(false); }