예제 #1
0
파일: Client.cpp 프로젝트: argarak/vcmi
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!";
}
예제 #2
0
파일: Client.cpp 프로젝트: lightsgoout/vcmi
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!";
}
예제 #3
0
파일: Client.cpp 프로젝트: vcmi/vcmi
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();
	}
}