Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/lib/network/proxy/proxy_control.h @ 9656

Last change on this file since 9656 was 9656, checked in by bensch, 18 years ago

orxonox/trunk: merged the proxy bache back with no conflicts

File size: 2.0 KB
RevLine 
[9537]1/*!
2 * @file player_stats.h
3 * @brief Definition of ProxyControl
[9573]4 *
5 * manages the clients on the proxies (connect/disconnect)
[9537]6 */
7
8#ifndef _PROXY_SETTINGS_H
9#define _PROXY_SETTINGS_H
10
11#include "synchronizeable.h"
12#include "message_manager.h"
13
14#include <string>
15#include <list>
16
17
[9599]18typedef enum proxyCommand {
19  PXY_RECONNECT              = 0,              //!< forces a reconnection of the node
[9537]20
[9625]21  PXY_WEAKUP,                                  //!< signal to weakup a sleeping proxy server (not impl. yet)
22  PXY_SLEEP,                                   //!< signal to sleep and disconnect clients
23
[9599]24  PXY_NUMBER
25};
[9537]26
[9538]27
[9599]28
[9537]29//! A class for storing player information
30class ProxyControl : public Synchronizeable
31{
32
33  public:
34    inline static ProxyControl* getInstance() { if (!ProxyControl::singletonRef) ProxyControl::singletonRef = new ProxyControl();
35      return ProxyControl::singletonRef; }
36    virtual ~ProxyControl();
37
38    virtual void varChangeHandler( std::list<int> & id );
39
[9599]40    /* connection signal handling */
[9538]41    void signalNewClient(int userId);
42    static bool messageHandlerNewClient( MessageType messageType, byte * data, int dataLength, void * someData, int senderId, int destinationId  );
[9537]43
[9570]44    void signalLeaveClient(int userId);
45    static bool messageHandlerLeaveClient( MessageType messageType, byte * data, int dataLength, void * someData, int senderId, int destinationId  );
[9538]46
[9599]47    /* proxy server network control */
[9603]48    void forceReconnectionShellThumb();
[9600]49    void forceReconnectionShell(int userId, int serverId);
[9599]50    void forceReconnection(int userId, int serverId);
[9654]51    void forceReconnection(int userId, int serverId, IP newAddress);
[9599]52    void forceReconnection(int userId, const std::string& newAddress);
53    static bool messageHandlerCommand( MessageType messageType, byte * data, int dataLength, void * someData, int senderId, int destinationId  );
[9570]54
[9537]55  private:
56    ProxyControl();
57
58
59  private:
60    static ProxyControl*      singletonRef;            //!< Pointer to the only instance of this Class
61
62
63};
64
65#endif /* _PROXY_SETTINGS_H */
Note: See TracBrowser for help on using the repository browser.