first changes

This commit is contained in:
ErikasKontenis
2019-09-29 21:56:37 +03:00
parent 9299222bd1
commit ad4cf36193
28 changed files with 1042 additions and 310 deletions

View File

@@ -50,8 +50,9 @@ class ProtocolGame final : public Protocol
{
public:
// static protocol information
enum {server_sends_first = false};
enum {protocol_identifier = 0x0A}; // Not required as we send first
enum { server_sends_first = true };
enum { protocol_identifier = 0 }; // Not required as we send first
enum { use_checksum = true };
static const char* protocol_name() {
return "gameworld protocol";
@@ -71,7 +72,6 @@ class ProtocolGame final : public Protocol
return std::static_pointer_cast<ProtocolGame>(shared_from_this());
}
void connect(uint32_t playerId, OperatingSystem_t operatingSystem);
void sendUpdateRequest();
void disconnectClient(const std::string& message) const;
void writeToOutputBuffer(const NetworkMessage& msg);
@@ -86,6 +86,7 @@ class ProtocolGame final : public Protocol
// we have all the parse methods
void parsePacket(NetworkMessage& msg) final;
void onRecvFirstMessage(NetworkMessage& msg) final;
void onConnect() override;
//Parse methods
void parseAutoWalk(NetworkMessage& msg);
@@ -262,8 +263,11 @@ class ProtocolGame final : public Protocol
Player* player = nullptr;
uint32_t eventConnect = 0;
uint32_t challengeTimestamp = 0;
uint16_t version = CLIENT_VERSION_MIN;
uint8_t challengeRandom = 0;
bool debugAssertSent = false;
bool acceptPackets = false;
};