Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/proxy/src/lib/network/proxy/proxy_control.h @ 9600

Last change on this file since 9600 was 9600, checked in by patrick, 18 years ago

reconnection command deep structure

File size: 1.8 KB
Line 
1/*!
2 * @file player_stats.h
3 * @brief Definition of ProxyControl
4 *
5 * manages the clients on the proxies (connect/disconnect)
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
18typedef enum proxyCommand {
19  PXY_RECONNECT              = 0,              //!< forces a reconnection of the node
20
21  PXY_NUMBER
22};
23
24
25
26//! A class for storing player information
27class ProxyControl : public Synchronizeable
28{
29
30  public:
31    inline static ProxyControl* getInstance() { if (!ProxyControl::singletonRef) ProxyControl::singletonRef = new ProxyControl();
32      return ProxyControl::singletonRef; }
33    virtual ~ProxyControl();
34
35    virtual void varChangeHandler( std::list<int> & id );
36
37    /* connection signal handling */
38    void signalNewClient(int userId);
39    static bool messageHandlerNewClient( MessageType messageType, byte * data, int dataLength, void * someData, int senderId, int destinationId  );
40
41    void signalLeaveClient(int userId);
42    static bool messageHandlerLeaveClient( MessageType messageType, byte * data, int dataLength, void * someData, int senderId, int destinationId  );
43
44    /* proxy server network control */
45    void forceReconnectionShell(int userId, int serverId);
46    void forceReconnection(int userId, int serverId);
47    void forceReconnection(int userId, IP newAddress);
48    void forceReconnection(int userId, const std::string& newAddress);
49    static bool messageHandlerCommand( MessageType messageType, byte * data, int dataLength, void * someData, int senderId, int destinationId  );
50
51  private:
52    ProxyControl();
53
54
55  private:
56    static ProxyControl*      singletonRef;            //!< Pointer to the only instance of this Class
57
58
59};
60
61#endif /* _PROXY_SETTINGS_H */
Note: See TracBrowser for help on using the repository browser.