-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Validate client version on connect handshake
- Loading branch information
Showing
6 changed files
with
86 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* MafiaHub OSS license | ||
* Copyright (c) 2022, MafiaHub. All rights reserved. | ||
* | ||
* This file comes from MafiaHub, hosted at https://github.com/MafiaHub/Framework. | ||
* See LICENSE file in the source repository for information regarding licensing. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "messages.h" | ||
|
||
#include <BitStream.h> | ||
|
||
#include <flecs/flecs.h> | ||
|
||
namespace Framework::Networking::Messages { | ||
class ClientKick final: public IMessage { | ||
private: | ||
DisconnectionReason _reason; | ||
|
||
public: | ||
uint8_t GetMessageID() const override { | ||
return GAME_CONNECTION_KICKED; | ||
} | ||
|
||
void FromParameters(DisconnectionReason reason) { | ||
_reason = reason; | ||
} | ||
|
||
void Serialize(SLNet::BitStream *bs, bool write) override { | ||
bs->Serialize(write, _reason); | ||
} | ||
|
||
bool Valid() override { | ||
return true; | ||
} | ||
|
||
DisconnectionReason GetDisconnectionReason() const { | ||
return _reason; | ||
} | ||
}; | ||
} // namespace Framework::Networking::Messages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters