Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5966


Ignore:
Timestamp:
Oct 19, 2009, 8:25:30 PM (15 years ago)
Author:
scheusso
Message:

(kind of) fixed HumanPlayer bodys beeing around from clients that have not yet disconnected when unloading level

Location:
code/trunk/src/orxonox
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/PlayerManager.cc

    r5929 r5966  
    9191        }
    9292    }
     93   
     94    void PlayerManager::disconnectAllClients()
     95    {
     96        for( std::map<unsigned int, PlayerInfo*>::iterator it = this->clients_.begin(); it != this->clients_.end(); )
     97            this->clientDisconnected( (it++)->first );
     98    }
    9399
    94100
  • code/trunk/src/orxonox/PlayerManager.h

    r5929 r5966  
    5252            void clientConnected(unsigned int clientID);
    5353            void clientDisconnected(unsigned int clientID);
     54            void disconnectAllClients();
    5455
    5556        private:
  • code/trunk/src/orxonox/gamestates/GSLevel.cc

    r5929 r5966  
    117117        if (GameMode::showsGraphics())
    118118        {
    119             // disconnect the HumanPlayer
    120             PlayerManager::getInstance().clientDisconnected(0);
    121            
    122119            // unload all compositors (this is only necessary because we don't yet destroy all resources!)
    123120            Ogre::CompositorManager::getSingleton().removeAll();
     
    125122            InputManager::getInstance().leaveState("game");
    126123        }
     124       
     125        // disconnect all HumanPlayers
     126        PlayerManager::getInstance().disconnectAllClients();
    127127
    128128        if (GameMode::isMaster())
Note: See TracChangeset for help on using the changeset viewer.