moving some code to make the server execute it
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/hilnius@13423 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
67c2cb2395
commit
149875d83c
@ -51,6 +51,7 @@ bool GameEventsProtocol::notifyEvent(Event* event)
|
||||
ItemManager::get()->getItem(item_id),
|
||||
kart,
|
||||
powerup_type);
|
||||
Log::info("GameEventsProtocol", "Item picked by a player.");
|
||||
} break;
|
||||
default:
|
||||
Log::warn("GameEventsProtocol", "Unkown message type.");
|
||||
@ -81,5 +82,6 @@ void GameEventsProtocol::collectedItem(Item* item, AbstractKart* kart)
|
||||
// 0x01 : item picked : send item id, powerup type and kart race id
|
||||
ns.ai8(0x01).ai32(item->getItemId()).ai8((int)(kart->getPowerup()->getType())).ai8(player_profile->race_id); // send item,
|
||||
m_listener->sendMessage(this, peers[i], ns, true); // reliable
|
||||
Log::info("GameEventsProtocol", "Notified a peer that a kart collected an item.");
|
||||
}
|
||||
}
|
||||
|
@ -179,6 +179,8 @@ void StartGameProtocol::update()
|
||||
}
|
||||
else if (m_state == READY)
|
||||
{
|
||||
// set karts into the network game setup
|
||||
NetworkManager::getInstance()->getGameSetup()->bindKartsToProfiles();
|
||||
m_state = EXITING;
|
||||
m_listener->requestTerminate(this);
|
||||
}
|
||||
@ -193,8 +195,6 @@ void StartGameProtocol::ready() // on clients, means the loading is finished
|
||||
ns.ai32(NetworkManager::getInstance()->getPeers()[0]->getClientServerToken()).ai8(1);
|
||||
Log::info("StartGameProtocol", "Player ready, notifying server.");
|
||||
m_listener->sendMessage(this, ns, true);
|
||||
// set karts into the network game setup
|
||||
NetworkManager::getInstance()->getGameSetup()->bindKartsToProfiles();
|
||||
m_state = READY;
|
||||
m_ready = true;
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user