sources/network/rconsession.h

branch
protocol5
changeset 195
be953e1621d9
parent 171
d0fba0d7ad03
parent 191
2e6cbacafdc7
equal deleted inserted replaced
176:060a13878ca0 195:be953e1621d9
1 /* 1 /*
2 Copyright 2014 - 2016 Teemu Piippo 2 Copyright 2014 - 2021 Teemu Piippo
3 All rights reserved. 3 All rights reserved.
4 4
5 Redistribution and use in source and binary forms, with or without 5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions 6 modification, are permitted provided that the following conditions
7 are met: 7 are met:
99 { 99 {
100 public: 100 public:
101 RCONSession(); 101 RCONSession();
102 ~RCONSession(); 102 ~RCONSession();
103 103
104 const IPAddress& address() const; 104 const net::ip_address& address() const;
105 void bumpLastPing(); 105 void bumpLastPing();
106 void connect(IPAddress address); 106 void connect(net::ip_address address);
107 void disconnect(); 107 void disconnect();
108 int getAdminCount() const; 108 int getAdminCount() const;
109 const String& getLevel() const; 109 const std::string& getLevel() const;
110 UDPSocket* getSocket(); 110 net::UDPSocket* getSocket();
111 RCONSessionState getState() const; 111 RCONSessionState getState() const;
112 void handlePacket(ByteArray& message); 112 void handlePacket(std::vector<unsigned char>& message);
113 bool isActive() const; 113 bool isActive() const;
114 void processServerUpdates(Bytestream& packet); 114 void processServerUpdates(Bytestream& packet);
115 void requestTabCompletion(const String& part); 115 void requestTabCompletion(const std::string& part);
116 void requestWatch (const String& cvar); 116 void requestWatch (const String& cvar);
117 void requestWatch (const StringList& cvars); 117 void requestWatch (const StringList& cvars);
118 void send(const ByteArray& packet); 118 bool send(const std::vector<unsigned char>& packet);
119 bool sendCommand(const String& commandString); 119 bool sendCommand(const std::string& commandString);
120 void sendHello(); 120 void sendHello();
121 void sendPassword(); 121 void sendPassword();
122 void setInterface(class Interface* interface); 122 void setInterface(class Interface* interface);
123 void setPassword(const String& password); 123 void setPassword(const std::string& password);
124 void tick(); 124 void tick();
125 125
126 private: 126 private:
127 RCONSessionState m_state; 127 RCONSessionState m_state;
128 IPAddress m_address; 128 net::ip_address m_address;
129 UDPSocket m_socket; 129 net::UDPSocket m_socket;
130 time_t m_lastPing; 130 time_t m_lastPing;
131 String m_password; 131 std::string m_password;
132 String m_salt; 132 std::string m_salt;
133 int m_serverProtocol; 133 int m_serverProtocol;
134 String m_hostname; 134 std::string m_hostname;
135 int m_adminCount; 135 int m_adminCount;
136 String m_level; 136 std::string m_level;
137 String m_lastTabComplete; 137 std::string m_lastTabComplete;
138 class Interface* m_interface; 138 class Interface* m_interface;
139 }; 139 };
140 140
141 END_ZFC_NAMESPACE 141 END_ZFC_NAMESPACE

mercurial