Commit a0047e1a authored by Chen Bill's avatar Chen Bill

class DuelMode: default initialize

parent 8830ce97
...@@ -12,16 +12,16 @@ ...@@ -12,16 +12,16 @@
namespace ygo { namespace ygo {
struct HostInfo { struct HostInfo {
unsigned int lflist; unsigned int lflist{ 0 };
unsigned char rule; unsigned char rule{ 0 };
unsigned char mode; unsigned char mode{ 0 };
unsigned char duel_rule; unsigned char duel_rule{ 0 };
bool no_check_deck; bool no_check_deck{ false };
bool no_shuffle_deck; bool no_shuffle_deck{ false };
unsigned int start_lp; unsigned int start_lp{ 0 };
unsigned char start_hand; unsigned char start_hand{ 0 };
unsigned char draw_count; unsigned char draw_count{ 0 };
unsigned short time_limit; unsigned short time_limit{ 0 };
}; };
struct HostPacket { struct HostPacket {
unsigned short identifier; unsigned short identifier;
...@@ -99,22 +99,16 @@ struct STOC_HS_WatchChange { ...@@ -99,22 +99,16 @@ struct STOC_HS_WatchChange {
class DuelMode; class DuelMode;
struct DuelPlayer { struct DuelPlayer {
unsigned short name[20]; unsigned short name[20]{};
DuelMode* game; DuelMode* game{ nullptr };
unsigned char type; unsigned char type{ 0 };
unsigned char state; unsigned char state{ 0 };
bufferevent* bev; bufferevent* bev{ 0 };
DuelPlayer() {
game = 0;
type = 0;
state = 0;
bev = 0;
}
}; };
class DuelMode { class DuelMode {
public: public:
DuelMode(): host_player(0), pduel(0), duel_stage(0) {} DuelMode(): host_player(nullptr), pduel(0), duel_stage(0) {}
virtual ~DuelMode() {} virtual ~DuelMode() {}
virtual void Chat(DuelPlayer* dp, void* pdata, int len) {} virtual void Chat(DuelPlayer* dp, void* pdata, int len) {}
virtual void JoinGame(DuelPlayer* dp, void* pdata, bool is_creater) {} virtual void JoinGame(DuelPlayer* dp, void* pdata, bool is_creater) {}
......
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