sources/network/rconsession.h

branch
protocol5
changeset 167
0150f86e68f0
parent 160
cf514fa0f1cc
child 169
febc3ed5435c
equal deleted inserted replaced
166:af5fa8c43ca8 167:0150f86e68f0
30 30
31 #pragma once 31 #pragma once
32 #include "ipaddress.h" 32 #include "ipaddress.h"
33 #include "udpsocket.h" 33 #include "udpsocket.h"
34 #include "bytestream.h" 34 #include "bytestream.h"
35 #include "packetqueue.h"
35 BEGIN_ZFC_NAMESPACE 36 BEGIN_ZFC_NAMESPACE
36 37
37 // ------------------------------------------------------------------------------------------------- 38 // -------------------------------------------------------------------------------------------------
38 // 39 //
39 enum 40 enum
70 CLRC_COMMAND, 71 CLRC_COMMAND,
71 CLRC_PONG, 72 CLRC_PONG,
72 CLRC_DISCONNECT, 73 CLRC_DISCONNECT,
73 CLRC_TABCOMPLETE, 74 CLRC_TABCOMPLETE,
74 CLRC_WATCHCVAR, 75 CLRC_WATCHCVAR,
76 CLRC_MISSINGPACKET,
75 }; 77 };
76 78
77 // ------------------------------------------------------------------------------------------------- 79 // -------------------------------------------------------------------------------------------------
78 // 80 //
79 enum RCONUpdateType 81 enum RCONUpdateType
107 void disconnect(); 109 void disconnect();
108 int getAdminCount() const; 110 int getAdminCount() const;
109 const String& getLevel() const; 111 const String& getLevel() const;
110 UDPSocket* getSocket(); 112 UDPSocket* getSocket();
111 RCONSessionState getState() const; 113 RCONSessionState getState() const;
112 void handlePacket(Datagram& datagram); 114 void handlePacket(ByteArray& message);
113 bool isActive() const; 115 bool isActive() const;
114 void processServerUpdates(Bytestream& packet); 116 void processServerUpdates(Bytestream& packet);
115 void requestTabCompletion(const String& part); 117 void requestTabCompletion(const String& part);
116 void requestWatch (const String& cvar); 118 void requestWatch (const String& cvar);
117 void requestWatch (const StringList& cvars); 119 void requestWatch (const StringList& cvars);
125 127
126 private: 128 private:
127 RCONSessionState m_state; 129 RCONSessionState m_state;
128 IPAddress m_address; 130 IPAddress m_address;
129 UDPSocket m_socket; 131 UDPSocket m_socket;
132 PacketQueue m_packetQueue;
130 time_t m_lastPing; 133 time_t m_lastPing;
131 String m_password; 134 String m_password;
132 String m_salt; 135 String m_salt;
133 int m_serverProtocol; 136 int m_serverProtocol;
134 String m_hostname; 137 String m_hostname;
135 int m_adminCount; 138 int m_adminCount;
136 String m_level; 139 String m_level;
137 String m_lastTabComplete; 140 String m_lastTabComplete;
141 time_t m_lastMissingPacketRequest;
138 class Interface* m_interface; 142 class Interface* m_interface;
139 }; 143 };
140 144
141 END_ZFC_NAMESPACE 145 END_ZFC_NAMESPACE

mercurial