Commit 18a801c0 authored by Chen Bill's avatar Chen Bill Committed by GitHub

update DuelClient::ClientAnalyze (#2645)

* update ClientAnalyze

* move STOC_GAME_MSG header to network.h
parent bb6ef1e1
......@@ -26,7 +26,7 @@ bool DuelClient::is_swapping = false;
int DuelClient::select_hint = 0;
int DuelClient::select_unselect_hint = 0;
int DuelClient::last_select_hint = 0;
unsigned char DuelClient::last_successful_msg[0x2000];
unsigned char DuelClient::last_successful_msg[SIZE_NETWORK_BUFFER];
size_t DuelClient::last_successful_msg_length = 0;
wchar_t DuelClient::event_string[256];
mt19937 DuelClient::rnd;
......@@ -936,7 +936,7 @@ void DuelClient::HandleSTOCPacketLan(unsigned char* data, int len) {
}
}
// Analyze STOC_GAME_MSG packet
int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
bool DuelClient::ClientAnalyze(unsigned char* msg, int len) {
unsigned char* pbuf = msg;
wchar_t textBuffer[256];
mainGame->dInfo.curMsg = BufferIO::ReadUInt8(pbuf);
......
......@@ -23,7 +23,7 @@ private:
static int select_hint;
static int select_unselect_hint;
static int last_select_hint;
static unsigned char last_successful_msg[0x2000];
static unsigned char last_successful_msg[SIZE_NETWORK_BUFFER];
static size_t last_successful_msg_length;
static wchar_t event_string[256];
static mt19937 rnd;
......@@ -41,7 +41,7 @@ public:
static void ClientEvent(bufferevent* bev, short events, void* ctx);
static int ClientThread();
static void HandleSTOCPacketLan(unsigned char* data, int len);
static int ClientAnalyze(unsigned char* msg, unsigned int len);
static bool ClientAnalyze(unsigned char* msg, int len);
static void SwapField();
static void SetResponseI(int32_t respI);
static void SetResponseB(void* respB, size_t len);
......
......@@ -831,19 +831,6 @@ extern Game* mainGame;
#define BUTTON_BIG_CARD_ZOOM_OUT 382
#define BUTTON_BIG_CARD_ORIG_SIZE 383
//STOC_GAME_MSG messages
#define MSG_WAITING 3
#define MSG_START 4
#define MSG_UPDATE_DATA 6 // flag=0: clear
#define MSG_UPDATE_CARD 7 // flag=QUERY_CODE, code=0: clear
#define MSG_REQUEST_DECK 8
#define MSG_REFRESH_DECK 34
#define MSG_CARD_SELECTED 80
#define MSG_UNEQUIP 95
#define MSG_BE_CHAIN_TARGET 121
#define MSG_CREATE_RELATION 122
#define MSG_RELEASE_RELATION 123
#define AVAIL_OCG 0x1
#define AVAIL_TCG 0x2
#define AVAIL_CUSTOM 0x4
......
......@@ -301,6 +301,19 @@ public:
#define STOC_TEAMMATE_SURRENDER 0x23 // no data
#define STOC_FIELD_FINISH 0x30
// STOC_GAME_MSG header
#define MSG_WAITING 3
#define MSG_START 4
#define MSG_UPDATE_DATA 6 // flag=0: clear
#define MSG_UPDATE_CARD 7 // flag=QUERY_CODE, code=0: clear
#define MSG_REQUEST_DECK 8
#define MSG_REFRESH_DECK 34
#define MSG_CARD_SELECTED 80
#define MSG_UNEQUIP 95
#define MSG_BE_CHAIN_TARGET 121
#define MSG_CREATE_RELATION 122
#define MSG_RELEASE_RELATION 123
#define PLAYERCHANGE_OBSERVE 0x8
#define PLAYERCHANGE_READY 0x9
#define PLAYERCHANGE_NOTREADY 0xa
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment