Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6715 in orxonox.OLD for branches


Ignore:
Timestamp:
Jan 25, 2006, 4:28:37 PM (19 years ago)
Author:
patrick
Message:

network: removing entity

Location:
branches/network/src/lib/network
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/lib/network/network_game_manager.cc

    r6706 r6715  
    3232#include "network_manager.h"
    3333
     34#include "class_list.h"
    3435
    3536/* include your own header */
     
    462463
    463464
     465
     466bool NetworkGameManager::signalLeftPlayer(int userID)
     467{
     468  const std::list<BaseObject*>* playableList = ClassList::getList(CL_PLAYABLE);
     469  std::list<BaseObject*>::const_iterator it = playableList->begin();
     470
     471  for(; it != playableList->end(); it++)
     472  {
     473    if( dynamic_cast<Synchronizeable*>(*it)->getOwner() == userID )
     474    {
     475      PRINTF(0)("remove playable from %i\n", userID);
     476      this->removeEntity(dynamic_cast<Synchronizeable*>(*it)->getUniqueID());
     477      return true;
     478    }
     479  }
     480  return false;
     481}
     482
     483
    464484/**
    465485 * Creates a buffer for user n
  • branches/network/src/lib/network/network_game_manager.h

    r6695 r6715  
    9595    void sendEntityList(int userID);
    9696
     97    bool signalNewPlayer(int userId);
     98    bool signalLeftPlayer(int userID);
     99
    97100
    98101  private:
     
    133136    bool canCreateEntity(ClassID classID);
    134137
    135     bool signalNewPlayer(int userId);
    136 
    137138    void resizeBufferVector(int n);
    138139
  • branches/network/src/lib/network/network_stream.cc

    r6695 r6715  
    390390      handshakes[i] = NULL;
    391391
     392
     393      NetworkGameManager::getInstance()->signalLeftPlayer(i);
     394
    392395      if ( i == networkSockets.size()-1 )
    393396      {
Note: See TracChangeset for help on using the changeset viewer.