Tried to implement some Utility::Bitconverter methods but it didnt worked
InternalTags cant be higher than 255 because they will be converted to byte added new ToString method in Utility::StringConverter Server now closes the connection better
This commit is contained in:
@ -187,8 +187,8 @@ enum ConnectionCode
|
||||
|
||||
enum InternalTags
|
||||
{
|
||||
CONNECT = 65534,
|
||||
DISCONNECT = 65535,
|
||||
CONNECT = 254,
|
||||
DISCONNECT = 255,
|
||||
};
|
||||
|
||||
#endif // DEFS_HPP
|
||||
@ -15,7 +15,7 @@ struct NetworkBuffer
|
||||
NetworkBuffer();
|
||||
~NetworkBuffer();
|
||||
|
||||
std::vector<byte> header = Utility::BitConverter::FromUint32(8); // contains the size of the body
|
||||
std::vector<byte> header; // size must always be 8
|
||||
std::vector<byte> body;
|
||||
};
|
||||
|
||||
|
||||
@ -54,13 +54,14 @@ struct Utility
|
||||
static const std::string &ToString(int16 value);
|
||||
static const std::string &ToString(int32 value);
|
||||
static const std::string &ToString(int64 value);
|
||||
static const std::string &ToString(const std::vector<byte> &bytes);
|
||||
|
||||
static const std::string &ToString(const std::vector<byte> &bytes, uint16 start_index = 0, uint16 lenght = 0);
|
||||
};
|
||||
|
||||
struct ConfigReader
|
||||
{
|
||||
const void ReadConfig(const std::string &file_name);
|
||||
void ReadConfig(const std::string &file_name);
|
||||
const std::map<std::string, std::string> &ReadNodes();
|
||||
|
||||
const std::string &operator[](uint16 index);
|
||||
|
||||
Reference in New Issue
Block a user