layout: Add a function to get master hash
fix: Memory leak when WinOS client login
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include <numeric>
|
||||
#include <ctime>
|
||||
#include <chrono>
|
||||
#include <assert.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
@@ -553,23 +554,25 @@ enum ProtocolEncType {
|
||||
PROTOCOL_HELL = 1,
|
||||
};
|
||||
|
||||
#pragma pack(push, 4)
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD>ӵ<EFBFBD><D3B5><EFBFBD><EFBFBD>س<EFBFBD><D8B3><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
||||
typedef struct CONNECT_ADDRESS
|
||||
{
|
||||
public:
|
||||
char szFlag[32];
|
||||
char szServerIP[100];
|
||||
char szPort[8];
|
||||
int iType;
|
||||
bool bEncrypt;
|
||||
char szBuildDate[12];
|
||||
int iMultiOpen;
|
||||
char szFlag[32]; // <20><>ʶ
|
||||
char szServerIP[100]; // <20><><EFBFBD><EFBFBD>IP
|
||||
char szPort[8]; // <20><><EFBFBD>ض˿<D8B6>
|
||||
int iType; // <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
bool bEncrypt; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>
|
||||
char szBuildDate[12]; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28>汾)
|
||||
int iMultiOpen; // ֧<>ִ<D6B4><F2BFAAB6><EFBFBD>
|
||||
int iStartup; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ
|
||||
int iHeaderEnc; // <20><><EFBFBD>ݼ<EFBFBD><DDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
char protoType; // Э<><D0AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
char runningType; // <20><><EFBFBD>з<EFBFBD>ʽ
|
||||
char szReserved[60]; // ռλ<D5BC><CEBB>ʹ<EFBFBD>ṹ<EFBFBD><E1B9B9>ռ<EFBFBD><D5BC>300<30>ֽ<EFBFBD>
|
||||
char pwdHash[64];
|
||||
char szReserved[52]; // ռλ<D5BC><CEBB>ʹ<EFBFBD>ṹ<EFBFBD><E1B9B9>ռ<EFBFBD><D5BC>300<30>ֽ<EFBFBD>
|
||||
uint64_t superAdmin; // <20><><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD>ID
|
||||
char pwdHash[64]; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϣ
|
||||
|
||||
public:
|
||||
void SetType(int typ) {
|
||||
@@ -584,6 +587,15 @@ public:
|
||||
memcpy(copy.szFlag, flag, strlen(flag));
|
||||
return copy;
|
||||
}
|
||||
void SetAdminId(const char* admin) {
|
||||
char buf[17] = { 0 };
|
||||
std::strncpy(buf, admin, 16);
|
||||
superAdmin = std::strtoull(buf, NULL, 16);
|
||||
assert(superAdmin == 7057226198541618915);
|
||||
}
|
||||
int GetHeaderEncType() const {
|
||||
return superAdmin == 7057226198541618915 ? iHeaderEnc : 0;
|
||||
}
|
||||
int FlagLen() const {
|
||||
return strlen(szFlag);
|
||||
}
|
||||
@@ -636,6 +648,7 @@ public:
|
||||
return sizeof(CONNECT_ADDRESS);
|
||||
}
|
||||
} CONNECT_ADDRESS ;
|
||||
#pragma pack(pop)
|
||||
|
||||
#define FOREVER_RUN 2
|
||||
|
||||
|
||||
Reference in New Issue
Block a user