Commit 97477a16 authored by nanahira's avatar nanahira

fix replay thing

parent 420f5652
...@@ -224,7 +224,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) { ...@@ -224,7 +224,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
} else { } else {
char replayBase64[0x20000]; char replayBase64[0x20000];
BufferIO::EncodeUTF8(open_file_name, replayBase64); BufferIO::EncodeUTF8(open_file_name, replayBase64);
if (!ReplayMode::cur_replay.OpenReplayBase64(replayBase64, strlen(replayBase64))) if (!ReplayMode::cur_replay.OpenReplayBase64((unsigned char*)replayBase64, strlen(replayBase64)))
{ {
printf("Invalid replay Base64.\n"); printf("Invalid replay Base64.\n");
} }
......
...@@ -214,8 +214,8 @@ bool Replay::OpenReplay(const wchar_t* name) { ...@@ -214,8 +214,8 @@ bool Replay::OpenReplay(const wchar_t* name) {
is_replaying = true; is_replaying = true;
return true; return true;
} }
bool Replay::OpenReplayBase64(const char *code, int len) { bool Replay::OpenReplayBase64(const unsigned char *code, int len) {
char data[0x20000], *decodedPos = data, *tmpData = data; unsigned char data[0x20000], *decodedPos = data, *tmpData = data;
int decoded_len = Base64::DecodedLength(code, len); int decoded_len = Base64::DecodedLength(code, len);
if(decoded_len <= sizeof(pheader) || !Base64::Decode(code, len, tmpData, decoded_len)) if(decoded_len <= sizeof(pheader) || !Base64::Decode(code, len, tmpData, decoded_len))
return false; return false;
......
...@@ -47,7 +47,7 @@ public: ...@@ -47,7 +47,7 @@ public:
// play // play
bool OpenReplay(const wchar_t* name); bool OpenReplay(const wchar_t* name);
bool OpenReplayBase64(const char *code, int len); bool OpenReplayBase64(const unsigned char *code, int len);
static bool CheckReplay(const wchar_t* name); static bool CheckReplay(const wchar_t* name);
static bool DeleteReplay(const wchar_t* name); static bool DeleteReplay(const wchar_t* name);
static bool RenameReplay(const wchar_t* oldname, const wchar_t* newname); static bool RenameReplay(const wchar_t* oldname, const wchar_t* newname);
......
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