Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions gframe/single_duel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ namespace ygo {
SingleDuel::SingleDuel(bool is_match) {
match_mode = is_match;
}
SingleDuel::~SingleDuel() {
}
SingleDuel::~SingleDuel() = default;
void SingleDuel::Chat(DuelPlayer* dp, unsigned char* pdata, int len) {
unsigned char scc[SIZE_STOC_CHAT];
const auto scc_size = NetServer::CreateChatPacket(pdata, len, scc, dp->type);
Expand Down Expand Up @@ -1492,7 +1491,7 @@ void SingleDuel::TimeConfirm(DuelPlayer* dp) {
if(time_elapsed < 10)
time_elapsed = 0;
}
inline int SingleDuel::WriteUpdateData(int player, int location, unsigned int flag, unsigned char*& qbuf, int use_cache) {
int SingleDuel::WriteUpdateData(int player, int location, unsigned int flag, unsigned char*& qbuf, int use_cache) {
flag |= (QUERY_CODE | QUERY_POSITION);
BufferIO::Write<uint8_t>(qbuf, MSG_UPDATE_DATA);
BufferIO::Write<uint8_t>(qbuf, player);
Expand Down
1 change: 0 additions & 1 deletion gframe/single_duel.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,3 @@ class SingleDuel: public DuelMode {
}

#endif //SINGLE_DUEL_H

13 changes: 3 additions & 10 deletions gframe/tag_duel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,8 @@

namespace ygo {

TagDuel::TagDuel() {
for(int i = 0; i < 4; ++i) {
players[i] = 0;
ready[i] = false;
surrender[i] = false;
}
}
TagDuel::~TagDuel() {
}
TagDuel::TagDuel() = default;
TagDuel::~TagDuel() = default;
void TagDuel::Chat(DuelPlayer* dp, unsigned char* pdata, int len) {
unsigned char scc[SIZE_STOC_CHAT];
const auto scc_size = NetServer::CreateChatPacket(pdata, len, scc, dp->type);
Expand Down Expand Up @@ -1609,7 +1602,7 @@ void TagDuel::TimeConfirm(DuelPlayer* dp) {
if(time_elapsed < 10)
time_elapsed = 0;
}
inline int TagDuel::WriteUpdateData(int player, int location, unsigned int flag, unsigned char*& qbuf, int use_cache) {
int TagDuel::WriteUpdateData(int player, int location, unsigned int flag, unsigned char*& qbuf, int use_cache) {
flag |= (QUERY_CODE | QUERY_POSITION);
BufferIO::Write<uint8_t>(qbuf, MSG_UPDATE_DATA);
BufferIO::Write<uint8_t>(qbuf, player);
Expand Down
23 changes: 11 additions & 12 deletions gframe/tag_duel.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,24 +47,23 @@ class TagDuel: public DuelMode {
int WriteUpdateData(int player, int location, unsigned int flag, unsigned char*& qbuf, int use_cache);

protected:
DuelPlayer* players[4];
DuelPlayer* pplayer[4];
DuelPlayer* cur_player[2];
DuelPlayer* players[4]{};
DuelPlayer* pplayer[4]{};
DuelPlayer* cur_player[2]{};
std::set<DuelPlayer*> observers;
bool ready[4];
bool surrender[4];
bool ready[4]{};
bool surrender[4]{};
Deck pdeck[4];
int deck_error[4];
unsigned char hand_result[2];
unsigned char last_response;
int deck_error[4]{};
unsigned char hand_result[2]{};
unsigned char last_response{ 0 };
Replay last_replay;
size_t last_replay_response_size{ 0 };
unsigned char turn_count;
short time_limit[2];
short time_elapsed;
unsigned char turn_count{ 0 };
short time_limit[2]{};
short time_elapsed{ 0 };
};

}

#endif //TAG_DUEL_H

Loading