Commit 1ff39351 authored by Chen Bill's avatar Chen Bill Committed by GitHub

DuelMode change: fix the declaration of Analyze (#2609)

parent cc9497b7
......@@ -208,26 +208,25 @@ inline unsigned int GetPosition(unsigned char* qbuf, int offset) {
class DuelMode {
public:
virtual ~DuelMode() {}
virtual void Chat(DuelPlayer* dp, unsigned char* pdata, int len) {}
virtual void JoinGame(DuelPlayer* dp, unsigned char* pdata, bool is_creater) {}
virtual void LeaveGame(DuelPlayer* dp) {}
virtual void ToDuelist(DuelPlayer* dp) {}
virtual void ToObserver(DuelPlayer* dp) {}
virtual void PlayerReady(DuelPlayer* dp, bool is_ready) {}
virtual void PlayerKick(DuelPlayer* dp, unsigned char pos) {}
virtual void UpdateDeck(DuelPlayer* dp, unsigned char* pdata, int len) {}
virtual void StartDuel(DuelPlayer* dp) {}
virtual void HandResult(DuelPlayer* dp, unsigned char res) {}
virtual void TPResult(DuelPlayer* dp, unsigned char tp) {}
virtual void Process() {}
virtual int Analyze(char* msgbuffer, unsigned int len) {
return 0;
}
virtual void Surrender(DuelPlayer* dp) {}
virtual void GetResponse(DuelPlayer* dp, unsigned char* pdata, unsigned int len) {}
virtual void TimeConfirm(DuelPlayer* dp) {}
virtual void EndDuel() {}
DuelMode() = default;
virtual ~DuelMode() = default;
virtual void Chat(DuelPlayer* dp, unsigned char* pdata, int len) = 0;
virtual void JoinGame(DuelPlayer* dp, unsigned char* pdata, bool is_creater) = 0;
virtual void LeaveGame(DuelPlayer* dp) = 0;
virtual void ToDuelist(DuelPlayer* dp) = 0;
virtual void ToObserver(DuelPlayer* dp) = 0;
virtual void PlayerReady(DuelPlayer* dp, bool is_ready) = 0;
virtual void PlayerKick(DuelPlayer* dp, unsigned char pos) = 0;
virtual void UpdateDeck(DuelPlayer* dp, unsigned char* pdata, int len) = 0;
virtual void StartDuel(DuelPlayer* dp) = 0;
virtual void HandResult(DuelPlayer* dp, unsigned char res) = 0;
virtual void TPResult(DuelPlayer* dp, unsigned char tp) = 0;
virtual void Process() = 0;
virtual int Analyze(unsigned char* msgbuffer, unsigned int len) = 0;
virtual void Surrender(DuelPlayer* dp) = 0;
virtual void GetResponse(DuelPlayer* dp, unsigned char* pdata, unsigned int len) = 0;
virtual void TimeConfirm(DuelPlayer* dp) = 0;
virtual void EndDuel() = 0;
public:
event* etimer { nullptr };
......
......@@ -10,24 +10,24 @@ namespace ygo {
class SingleDuel: public DuelMode {
public:
SingleDuel(bool is_match);
virtual ~SingleDuel();
virtual void Chat(DuelPlayer* dp, unsigned char* pdata, int len);
virtual void JoinGame(DuelPlayer* dp, unsigned char* pdata, bool is_creater);
virtual void LeaveGame(DuelPlayer* dp);
virtual void ToDuelist(DuelPlayer* dp);
virtual void ToObserver(DuelPlayer* dp);
virtual void PlayerReady(DuelPlayer* dp, bool ready);
virtual void PlayerKick(DuelPlayer* dp, unsigned char pos);
virtual void UpdateDeck(DuelPlayer* dp, unsigned char* pdata, int len);
virtual void StartDuel(DuelPlayer* dp);
virtual void HandResult(DuelPlayer* dp, unsigned char res);
virtual void TPResult(DuelPlayer* dp, unsigned char tp);
virtual void Process();
virtual void Surrender(DuelPlayer* dp);
virtual int Analyze(unsigned char* msgbuffer, unsigned int len);
virtual void GetResponse(DuelPlayer* dp, unsigned char* pdata, unsigned int len);
virtual void TimeConfirm(DuelPlayer* dp);
virtual void EndDuel();
~SingleDuel() override;
void Chat(DuelPlayer* dp, unsigned char* pdata, int len) override;
void JoinGame(DuelPlayer* dp, unsigned char* pdata, bool is_creater) override;
void LeaveGame(DuelPlayer* dp) override;
void ToDuelist(DuelPlayer* dp) override;
void ToObserver(DuelPlayer* dp) override;
void PlayerReady(DuelPlayer* dp, bool ready) override;
void PlayerKick(DuelPlayer* dp, unsigned char pos) override;
void UpdateDeck(DuelPlayer* dp, unsigned char* pdata, int len) override;
void StartDuel(DuelPlayer* dp) override;
void HandResult(DuelPlayer* dp, unsigned char res) override;
void TPResult(DuelPlayer* dp, unsigned char tp) override;
void Process() override;
void Surrender(DuelPlayer* dp) override;
int Analyze(unsigned char* msgbuffer, unsigned int len) override;
void GetResponse(DuelPlayer* dp, unsigned char* pdata, unsigned int len) override;
void TimeConfirm(DuelPlayer* dp) override;
void EndDuel() override;
void DuelEndProc();
void WaitforResponse(int playerid);
......
......@@ -10,24 +10,24 @@ namespace ygo {
class TagDuel: public DuelMode {
public:
TagDuel();
virtual ~TagDuel();
virtual void Chat(DuelPlayer* dp, unsigned char* pdata, int len);
virtual void JoinGame(DuelPlayer* dp, unsigned char* pdata, bool is_creater);
virtual void LeaveGame(DuelPlayer* dp);
virtual void ToDuelist(DuelPlayer* dp);
virtual void ToObserver(DuelPlayer* dp);
virtual void PlayerReady(DuelPlayer* dp, bool ready);
virtual void PlayerKick(DuelPlayer* dp, unsigned char pos);
virtual void UpdateDeck(DuelPlayer* dp, unsigned char* pdata, int len);
virtual void StartDuel(DuelPlayer* dp);
virtual void HandResult(DuelPlayer* dp, unsigned char res);
virtual void TPResult(DuelPlayer* dp, unsigned char tp);
virtual void Process();
virtual void Surrender(DuelPlayer* dp);
virtual int Analyze(unsigned char* msgbuffer, unsigned int len);
virtual void GetResponse(DuelPlayer* dp, unsigned char* pdata, unsigned int len);
virtual void TimeConfirm(DuelPlayer* dp);
virtual void EndDuel();
~TagDuel() override;
void Chat(DuelPlayer* dp, unsigned char* pdata, int len) override;
void JoinGame(DuelPlayer* dp, unsigned char* pdata, bool is_creater) override;
void LeaveGame(DuelPlayer* dp) override;
void ToDuelist(DuelPlayer* dp) override;
void ToObserver(DuelPlayer* dp) override;
void PlayerReady(DuelPlayer* dp, bool ready) override;
void PlayerKick(DuelPlayer* dp, unsigned char pos) override;
void UpdateDeck(DuelPlayer* dp, unsigned char* pdata, int len) override;
void StartDuel(DuelPlayer* dp) override;
void HandResult(DuelPlayer* dp, unsigned char res) override;
void TPResult(DuelPlayer* dp, unsigned char tp) override;
void Process() override;
void Surrender(DuelPlayer* dp) override;
int Analyze(unsigned char* msgbuffer, unsigned int len) override;
void GetResponse(DuelPlayer* dp, unsigned char* pdata, unsigned int len) override;
void TimeConfirm(DuelPlayer* dp) override;
void EndDuel() override;
void DuelEndProc();
void WaitforResponse(int playerid);
......
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