void NetworkLogic::opCreateRoom(void) { // if last digits are always nearly the same, this is because of the timer calling this function being triggered every x ms with x being a factor of 10 ExitGames::Common::JString tmp; mLoadBalancingClient.opCreateRoom(tmp=(int)GETTIMEMS()); mStateAccessor.setState(STATE_JOINING); mOutputListener->writeLine(ExitGames::Common::JString(L"creating game \"") + tmp + L"\""); }
void NetworkLogic::opCreateRoom(void) { // if last digits are always nearly the same, this is because of the timer calling this function being triggered every x ms with x being a factor of 10 ExitGames::Common::JString tmp; mLoadBalancingClient.opCreateRoom(tmp=(int)GETTIMEMS()); //mLoadBalancingClient.getCurrentlyJoinedRoom().setMaxPlayers(2); mStateAccessor.setState(STATE_JOINING); mOutputListener->writeLine(ExitGames::Common::JString(L"creating game \"") + tmp + L"\""); int lobbySize = mLoadBalancingClient.getRoomList().getSize(); CCLOG("Player size: %d",lobbySize); }
// GETUTCSECONDS returns the number of seconds since 1980/01/06 00:00:00 UTC, // and GETTIMEMS returns the number of milliseconds that have elapsed since the last // occurrence of 00:00:00 local time. // We can combine GETUTCSECONDS and GETTIMEMS to calculate the number of milliseconds // since 1970/01/01 00:00:00 UTC. double currentTime() { // diffSeconds is the number of seconds from 1970/01/01 to 1980/01/06 const unsigned diffSeconds = 315964800; return static_cast<double>(diffSeconds + GETUTCSECONDS() + ((GETTIMEMS() % 1000) / msPerSecond)); }