Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7765


Ignore:
Timestamp:
Dec 15, 2010, 3:27:22 PM (14 years ago)
Author:
smerkli
Message:

prepared MSC for singleton usage.

Location:
code/branches/presentation/src/libraries/network
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation/src/libraries/network/MasterServer.cc

    r7763 r7765  
    194194
    195195        /* remove the server from the list it belongs to */
    196         this->mainlist.delServerByName( name );
     196        this->mainlist.delServerByAddress( name );
    197197
    198198        /* tell the user */
  • code/branches/presentation/src/libraries/network/MasterServerComm.cc

    r7763 r7765  
    3131namespace orxonox
    3232{
     33  ManageScopedSingleton(MasterServerComm, ScopeID::Root, true);
    3334 
    3435  MasterServerComm::MasterServerComm()
  • code/branches/presentation/src/libraries/network/MasterServerComm.h

    r7763 r7765  
    3636#include <enet/enet.h>
    3737
     38// tolua_begin
    3839namespace orxonox
    3940{
    40   class MasterServerComm
    41   {
     41  class _NetworkExport MasterServerComm
     42    : public Singleton<MasterServerComm>, public OrxonoxClass
     43  { // tolua_export
     44    friend class Singleton<MasterServerComm>;
    4245    public:
    4346      /** constructor */
     
    8992      int pollForReply( int (*callback)( char*, ENetEvent* ), int delayms );
    9093
     94      /** \return an instance of WANDiscovery
     95       *
     96       * Create and return an instance of WANDiscovery.
     97       */
     98      static MasterServerComm& getInstance() { return Singleton<MasterServerComm>::getInstance(); } // tolua_export
     99
    91100    private:
    92101      /** client handle */
     
    101110      /** peer data holder */
    102111      ENetPeer *peer;
    103   };
    104112
    105 }
     113      /** Singleton pointer */
     114      static MasterServerComm* singletonPtr_s;
     115  }; // tolua_export
     116
     117} // tolua_export
    106118
    107119#endif /* MASTERSERVERCOMM_H */
Note: See TracChangeset for help on using the changeset viewer.