void CClient::waitForMoveAndSend(PlayerColor color) { try { setThreadName("CClient::waitForMoveAndSend"); assert(vstd::contains(battleints, color)); BattleAction ba = battleints[color]->activeStack(gs->curB->battleGetStackByID(gs->curB->activeStack, false)); if(ba.actionType != Battle::CANCEL) { logNetwork->traceStream() << "Send battle action to server: " << ba; MakeAction temp_action(ba); sendRequest(&temp_action, color); } return; } catch(boost::thread_interrupted&) { logNetwork->debugStream() << "Wait for move thread was interrupted and no action will be send. Was a battle ended by spell?"; return; } catch(...) { handleException(); return; } logNetwork->errorStream() << "We should not be here!"; }
void CClient::waitForMoveAndSend(PlayerColor color) { try { setThreadName("CClient::waitForMoveAndSend"); assert(vstd::contains(battleints, color)); BattleAction ba = battleints[color]->activeStack(gs->curB->battleGetStackByID(gs->curB->activeStack, false)); MakeAction temp_action(ba); sendRequest(&temp_action, color); return; } catch(boost::thread_interrupted&) { logNetwork->debugStream() << "Wait for move thread was interrupted and no action will be send. Was a battle ended by spell?"; return; } HANDLE_EXCEPTION logNetwork->errorStream() << "We should not be here!"; }
void CClient::waitForMoveAndSend(PlayerColor color) { try { setThreadName("CClient::waitForMoveAndSend"); assert(vstd::contains(battleints, color)); BattleAction ba = battleints[color]->activeStack(gs->curB->battleGetStackByID(gs->curB->activeStack, false)); if(ba.actionType != EActionType::CANCEL) { logNetwork->trace("Send battle action to server: %s", ba.toString()); MakeAction temp_action(ba); sendRequest(&temp_action, color); } } catch(boost::thread_interrupted &) { logNetwork->debug("Wait for move thread was interrupted and no action will be send. Was a battle ended by spell?"); } catch(...) { handleException(); } }