void PhotonLib::sendData(void)
{
	ExitGames::Common::Hashtable event;
	event.put(static_cast<nByte>(0), ++mSendCount);
	mLitePeer->opRaiseEvent(true, event, 101, 0, &mActorNumber, 1);
	if(mSendCount >= MAX_SENDCOUNT)
		mState = State::SENT_DATA;
}
Esempio n. 2
0
void NetworkLogic::sendEvent(unsigned char eventCode)
{
	if(eventCode == EV_PLAYERINFO){
		ExitGames::Common::Hashtable ev;

		ev.put(USER_NAME_KEY, this->mGameScene->myInfo->user_name);
		//CCLOG("My Player Name: %s",this->mGameScene->myInfo->user_name);
		//mOutputListener->write(L"send data");
		mLoadBalancingClient.opRaiseEvent(true, ev, eventCode, 1);
		
	}else if(eventCode == EV_DISCONNECT){
		ExitGames::Common::Hashtable ev;
		mLoadBalancingClient.opRaiseEvent(true, ev, eventCode, 1);
	}else if(eventCode == EV_HPCHANGE){
		ExitGames::Common::Hashtable ev;
		ev.put(HP_CHANGE_KEY,mGameScene->myInfo->hp);
		mLoadBalancingClient.opRaiseEvent(true, ev, eventCode, 1);
	}else if(eventCode == EV_LOST){
		ExitGames::Common::Hashtable ev;
		mLoadBalancingClient.opRaiseEvent(true, ev, eventCode, 1);
	}
	
	//mOutputListener->write(L"s");
}