Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 28, 2010, 8:29:32 PM (14 years ago)
Author:
scheusso
Message:

some new features:
-Orxonox servers announce themselves now inside a LAN (and can provide some information (e.g. server name, etc.) to the client )
-Orxonox clients discover the servers inside the LAN and list them in the menu

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation3/src/libraries/network/Client.h

    r5961 r7161  
    4747
    4848#include "util/UtilPrereqs.h"
     49#include "util/Singleton.h"
    4950#include "ClientConnection.h"
    5051#include "GamestateClient.h"
    5152#include "Host.h"
     53#include "LANDiscovery.h"
     54#include "packet/ServerInformation.h"
    5255
     56// tolua_begin
    5357namespace orxonox
    5458{
     59// tolua_end
    5560  /**
    5661  Client *client;
     
    6065  *
    6166  */
    62   class _NetworkExport Client : public Host, public ClientConnection{
     67  class _NetworkExport Client // tolua_export
     68    : public Host, protected ClientConnection, public Singleton<Client>
     69  { // tolua_export
     70  friend class Singleton<Client>;
    6371  public:
    6472    Client();
    65     Client(const std::string& address, int port);
    6673    ~Client();
     74   
     75    static Client* getInstance(){ return singletonPtr_s; } // tolua_export
    6776
    6877    bool establishConnection();
     78    void setDestination( const std::string& serverAddress, unsigned int port ); // tolua_export
    6979    bool closeConnection();
    7080    bool queuePacket(ENetPacket *packet, int clientID);
     
    8191    virtual bool isServer_(){return false;}
    8292
    83     GamestateClient gamestate;
     93    static Client* singletonPtr_s;
     94    GamestateClient* gamestate;
    8495    bool isSynched_;
    8596
    8697    bool gameStateFailure_;
    8798    float timeSinceLastUpdate_;
    88   };
     99  }; // tolua_export
    89100
    90101
    91 }
     102} // tolua_export
    92103
    93104#endif /* _Client_H__ */
Note: See TracChangeset for help on using the changeset viewer.