Commit 7f54f3c8 authored by mercury233's avatar mercury233

exclude reading replay in server mode

parent bd68750c
......@@ -145,6 +145,7 @@ void Replay::SaveReplay(const wchar_t* name) {
std::fwrite(comp_data, comp_size, 1, rfp);
std::fclose(rfp);
}
#ifndef YGOPRO_SERVER_MODE
bool Replay::OpenReplay(const wchar_t* name) {
FILE* rfp = mywfopen(name, "rb");
if(!rfp) {
......@@ -260,6 +261,7 @@ void Replay::Rewind() {
data_position = 0;
can_read = true;
}
#endif // YGOPRO_SERVER_MODE
void Replay::Reset() {
is_recording = false;
is_replaying = false;
......@@ -273,6 +275,7 @@ void Replay::Reset() {
decks.clear();
script_name.clear();
}
#ifndef YGOPRO_SERVER_MODE
void Replay::SkipInfo(){
if (data_position == 0)
data_position += info_offset;
......@@ -330,5 +333,6 @@ bool Replay::ReadInfo() {
}
return true;
}
#endif // YGOPRO_SERVER_MODE
}
......@@ -83,6 +83,9 @@ public:
return deck_index;
}
}
#ifdef YGOPRO_SERVER_MODE
void Reset();
#else
bool OpenReplay(const wchar_t* name);
bool ReadNextResponse(unsigned char resp[]);
bool ReadName(wchar_t* data);
......@@ -99,6 +102,7 @@ public:
void Reset();
void SkipInfo();
bool IsReplaying() const;
#endif // YGOPRO_SERVER_MODE
FILE* fp{ nullptr };
#ifdef _WIN32
......@@ -116,7 +120,9 @@ public:
std::string script_name; // 2 bytes, script name (max: 256 bytes)
private:
#ifndef YGOPRO_SERVER_MODE
bool ReadInfo();
#endif
unsigned char* replay_data;
size_t replay_size{};
......
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