Commit 3c6de956 authored by Chen Bill's avatar Chen Bill

update message handler

parent 86825b0a
...@@ -64,7 +64,7 @@ int ReplayMode::ReplayThread() { ...@@ -64,7 +64,7 @@ int ReplayMode::ReplayThread() {
mainGame->dInfo.tag_player[1] = false; mainGame->dInfo.tag_player[1] = false;
set_script_reader(DataManager::ScriptReaderEx); set_script_reader(DataManager::ScriptReaderEx);
set_card_reader(DataManager::CardReader); set_card_reader(DataManager::CardReader);
set_message_handler((message_handler)MessageHandler); set_message_handler(ReplayMode::MessageHandler);
if(!StartDuel()) { if(!StartDuel()) {
EndDuel(); EndDuel();
return 0; return 0;
...@@ -929,7 +929,7 @@ void ReplayMode::ReplayReload() { ...@@ -929,7 +929,7 @@ void ReplayMode::ReplayReload() {
ReloadLocation(0, LOCATION_REMOVED, flag, queryBuffer); ReloadLocation(0, LOCATION_REMOVED, flag, queryBuffer);
ReloadLocation(1, LOCATION_REMOVED, flag, queryBuffer); ReloadLocation(1, LOCATION_REMOVED, flag, queryBuffer);
} }
int ReplayMode::MessageHandler(intptr_t fduel, int type) { uint32 ReplayMode::MessageHandler(intptr_t fduel, uint32 type) {
if(!enable_log) if(!enable_log)
return 0; return 0;
char msgbuf[1024]; char msgbuf[1024];
......
...@@ -47,7 +47,7 @@ public: ...@@ -47,7 +47,7 @@ public:
static void ReplayRefreshSingle(int player, int location, int sequence, int flag = 0xf81fff); static void ReplayRefreshSingle(int player, int location, int sequence, int flag = 0xf81fff);
static void ReplayReload(); static void ReplayReload();
static int MessageHandler(intptr_t fduel, int type); static uint32 MessageHandler(intptr_t fduel, uint32 type);
}; };
} }
......
...@@ -430,7 +430,7 @@ void SingleDuel::TPResult(DuelPlayer* dp, unsigned char tp) { ...@@ -430,7 +430,7 @@ void SingleDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
time_limit[1] = host_info.time_limit; time_limit[1] = host_info.time_limit;
set_script_reader(DataManager::ScriptReaderEx); set_script_reader(DataManager::ScriptReaderEx);
set_card_reader(DataManager::CardReader); set_card_reader(DataManager::CardReader);
set_message_handler((message_handler)SingleDuel::MessageHandler); set_message_handler(SingleDuel::MessageHandler);
pduel = create_duel(duel_seed); pduel = create_duel(duel_seed);
set_player_info(pduel, 0, host_info.start_lp, host_info.start_hand, host_info.draw_count); set_player_info(pduel, 0, host_info.start_lp, host_info.start_hand, host_info.draw_count);
set_player_info(pduel, 1, host_info.start_lp, host_info.start_hand, host_info.draw_count); set_player_info(pduel, 1, host_info.start_lp, host_info.start_hand, host_info.draw_count);
...@@ -1577,7 +1577,7 @@ void SingleDuel::RefreshSingle(int player, int location, int sequence, int flag) ...@@ -1577,7 +1577,7 @@ void SingleDuel::RefreshSingle(int player, int location, int sequence, int flag)
NetServer::ReSendToPlayer(*pit); NetServer::ReSendToPlayer(*pit);
} }
} }
int SingleDuel::MessageHandler(intptr_t fduel, int type) { uint32 SingleDuel::MessageHandler(intptr_t fduel, uint32 type) {
if(!enable_log) if(!enable_log)
return 0; return 0;
char msgbuf[1024]; char msgbuf[1024];
......
...@@ -38,7 +38,7 @@ public: ...@@ -38,7 +38,7 @@ public:
void RefreshExtra(int player, int flag = 0xe81fff, int use_cache = 1); void RefreshExtra(int player, int flag = 0xe81fff, int use_cache = 1);
void RefreshSingle(int player, int location, int sequence, int flag = 0xf81fff); void RefreshSingle(int player, int location, int sequence, int flag = 0xf81fff);
static int MessageHandler(intptr_t fduel, int type); static uint32 MessageHandler(intptr_t fduel, uint32 type);
static void SingleTimer(evutil_socket_t fd, short events, void* arg); static void SingleTimer(evutil_socket_t fd, short events, void* arg);
private: private:
......
...@@ -38,7 +38,7 @@ int SingleMode::SinglePlayThread() { ...@@ -38,7 +38,7 @@ int SingleMode::SinglePlayThread() {
mt19937 rnd((uint_fast32_t)seed); mt19937 rnd((uint_fast32_t)seed);
set_script_reader(DataManager::ScriptReaderEx); set_script_reader(DataManager::ScriptReaderEx);
set_card_reader(DataManager::CardReader); set_card_reader(DataManager::CardReader);
set_message_handler((message_handler)MessageHandler); set_message_handler(SingleMode::MessageHandler);
pduel = create_duel(rnd.rand()); pduel = create_duel(rnd.rand());
set_player_info(pduel, 0, start_lp, start_hand, draw_count); set_player_info(pduel, 0, start_lp, start_hand, draw_count);
set_player_info(pduel, 1, start_lp, start_hand, draw_count); set_player_info(pduel, 1, start_lp, start_hand, draw_count);
...@@ -830,7 +830,7 @@ void SingleMode::SinglePlayReload() { ...@@ -830,7 +830,7 @@ void SingleMode::SinglePlayReload() {
ReloadLocation(0, LOCATION_REMOVED, flag, queryBuffer); ReloadLocation(0, LOCATION_REMOVED, flag, queryBuffer);
ReloadLocation(1, LOCATION_REMOVED, flag, queryBuffer); ReloadLocation(1, LOCATION_REMOVED, flag, queryBuffer);
} }
int SingleMode::MessageHandler(intptr_t fduel, int type) { uint32 SingleMode::MessageHandler(intptr_t fduel, uint32 type) {
if(!enable_log) if(!enable_log)
return 0; return 0;
char msgbuf[1024]; char msgbuf[1024];
......
...@@ -30,7 +30,7 @@ public: ...@@ -30,7 +30,7 @@ public:
static void SinglePlayRefreshSingle(int player, int location, int sequence, int flag = 0xf81fff); static void SinglePlayRefreshSingle(int player, int location, int sequence, int flag = 0xf81fff);
static void SinglePlayReload(); static void SinglePlayReload();
static int MessageHandler(intptr_t fduel, int type); static uint32 MessageHandler(intptr_t fduel, uint32 type);
protected: protected:
static Replay last_replay; static Replay last_replay;
......
...@@ -399,7 +399,7 @@ void TagDuel::TPResult(DuelPlayer* dp, unsigned char tp) { ...@@ -399,7 +399,7 @@ void TagDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
time_limit[1] = host_info.time_limit; time_limit[1] = host_info.time_limit;
set_script_reader(DataManager::ScriptReaderEx); set_script_reader(DataManager::ScriptReaderEx);
set_card_reader(DataManager::CardReader); set_card_reader(DataManager::CardReader);
set_message_handler((message_handler)TagDuel::MessageHandler); set_message_handler(TagDuel::MessageHandler);
pduel = create_duel(duel_seed); pduel = create_duel(duel_seed);
set_player_info(pduel, 0, host_info.start_lp, host_info.start_hand, host_info.draw_count); set_player_info(pduel, 0, host_info.start_lp, host_info.start_hand, host_info.draw_count);
set_player_info(pduel, 1, host_info.start_lp, host_info.start_hand, host_info.draw_count); set_player_info(pduel, 1, host_info.start_lp, host_info.start_hand, host_info.draw_count);
...@@ -1690,7 +1690,7 @@ void TagDuel::RefreshSingle(int player, int location, int sequence, int flag) { ...@@ -1690,7 +1690,7 @@ void TagDuel::RefreshSingle(int player, int location, int sequence, int flag) {
} }
} }
} }
int TagDuel::MessageHandler(intptr_t fduel, int type) { uint32 TagDuel::MessageHandler(intptr_t fduel, uint32 type) {
if(!enable_log) if(!enable_log)
return 0; return 0;
char msgbuf[1024]; char msgbuf[1024];
......
...@@ -38,7 +38,7 @@ public: ...@@ -38,7 +38,7 @@ public:
void RefreshExtra(int player, int flag = 0xe81fff, int use_cache = 1); void RefreshExtra(int player, int flag = 0xe81fff, int use_cache = 1);
void RefreshSingle(int player, int location, int sequence, int flag = 0xf81fff); void RefreshSingle(int player, int location, int sequence, int flag = 0xf81fff);
static int MessageHandler(intptr_t fduel, int type); static uint32 MessageHandler(intptr_t fduel, uint32 type);
static void TagTimer(evutil_socket_t fd, short events, void* arg); static void TagTimer(evutil_socket_t fd, short events, void* arg);
private: private:
......
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