/*********************************************************** close connection ***********************************************************/ void GameClient::CloseConnection() { if(!m_connected) return; m_disconnecting = true; ZCom_Disconnect( m_zoi_id, NULL ); // process until everything has been sent while(m_connected) { ZCom_processInput( eZCom_NoBlock ); ZCom_processOutput(); ZoidCom::Sleep(10); } //clean up everything m_maps_objects.clear(); m_actors.clear(); m_disconnecting = false; }
Client::~Client() { ZCom_disconnectAll(NULL); printf("Disconnecting Client\n"); double start_time = al_current_time(); while(al_current_time()-start_time < 1) { ZCom_processInput(); ZCom_processOutput(); } }
/*********************************************************** close connection ***********************************************************/ void MainServerClient::CloseConnection() { if(!m_connected) return; ZCom_Disconnect( m_zoi_id, NULL ); // process until everything has been sent while(m_connected) { ZCom_processInput( eZCom_NoBlock ); ZCom_processOutput(); ZoidCom::Sleep(10); } }