Removed unused functions.

This commit is contained in:
hiker 2016-12-07 09:34:33 +11:00
parent 95e627c004
commit 32daf4ce29
4 changed files with 3 additions and 50 deletions

View File

@ -63,8 +63,6 @@ bool GameEventsProtocol::notifyEvent(Event* event)
int8_t type = data.getUInt8();
switch (type)
{
case GE_START_READY_SET_GO:
receivedReadySetGo(); break;
case GE_CLIENT_STARTED_RSG:
receivedClientHasStarted(event); break;
case GE_ITEM_COLLECTED:
@ -165,31 +163,6 @@ void GameEventsProtocol::kartFinishedRace(const NetworkString &ns)
/*from_server*/true);
} // kartFinishedRace
// ----------------------------------------------------------------------------
/** This function is called on a server when the world starts the ready-set-go
* phase. It signals to all clients to do the same.
*/
void GameEventsProtocol::startReadySetGo()
{
assert(NetworkConfig::get()->isServer());
NetworkString *ns = getNetworkString(1);
ns->setSynchronous(true);
ns->addUInt8(GE_START_READY_SET_GO);
sendMessageToPeersChangingToken(ns, /*reliable*/true);
delete ns;
} // startReadySetGo
// ----------------------------------------------------------------------------
/** Called on the client when it receives the message that the server has
* started its ready-set-go. Signal to world that it can go to the next
* phase (ready phase) now.
*/
void GameEventsProtocol::receivedReadySetGo()
{
assert(NetworkConfig::get()->isClient());
World::getWorld()->startReadySetGo();
} // receivedReadySetGo
// ----------------------------------------------------------------------------
/** Called on a client when it has started its ready-set-go. The client will
* inform the server anout this. The server will wait for all clients to

View File

@ -11,10 +11,9 @@ class GameEventsProtocol : public Protocol
{
private:
enum GameEventType {
GE_START_READY_SET_GO = 0x01,
GE_CLIENT_STARTED_RSG = 0x02,
GE_ITEM_COLLECTED = 0x03,
GE_KART_FINISHED_RACE = 0x04
GE_CLIENT_STARTED_RSG = 0x01,
GE_ITEM_COLLECTED = 0x02,
GE_KART_FINISHED_RACE = 0x03
}; // GameEventType
/** Count how many clients have started 'ready'. The server
@ -35,8 +34,6 @@ public:
void clientHasStarted();
void receivedClientHasStarted(Event *event);
void kartFinishedRace(const NetworkString &ns);
void startReadySetGo();
void receivedReadySetGo();
virtual void setup() OVERRIDE;
virtual void update(float dt) OVERRIDE {};
virtual void asynchronousUpdate() OVERRIDE{}

View File

@ -85,22 +85,6 @@ void RaceEventManager::collectedItem(Item *item, AbstractKart *kart)
protocol->collectedItem(item,kart);
} // collectedItem
// ----------------------------------------------------------------------------
/** A message from the server to all clients that it is now starting the
* 'ready' phase. Clients will wait for this event before they display
* RSG. This will make sure that the server time is always ahead of
* the client time.
*/
void RaceEventManager::startReadySetGo()
{
// this is only called in the server
assert(NetworkConfig::get()->isServer());
GameEventsProtocol* protocol = static_cast<GameEventsProtocol*>(
ProtocolManager::getInstance()->getProtocol(PROTOCOL_GAME_EVENTS));
protocol->startReadySetGo();
} // startReadySetGo
// ----------------------------------------------------------------------------
void RaceEventManager::controllerAction(Controller* controller,
PlayerAction action, int value)

View File

@ -56,7 +56,6 @@ public:
void controllerAction(Controller* controller, PlayerAction action,
int value);
void kartFinishedRace(AbstractKart *kart, float time);
void startReadySetGo();
// ------------------------------------------------------------------------
/** Returns if this instance is in running state or not. */
bool isRunning() { return m_running; }