Commit 25d1722b authored by fallenstardust's avatar fallenstardust

sync ocgcore

parent c94082ab
...@@ -126,7 +126,7 @@ void ClientCard::UpdateInfo(char* buf) { ...@@ -126,7 +126,7 @@ void ClientCard::UpdateInfo(char* buf) {
if(flag & QUERY_REASON) if(flag & QUERY_REASON)
reason = BufferIO::ReadInt32(buf); reason = BufferIO::ReadInt32(buf);
if(flag & QUERY_REASON_CARD) if(flag & QUERY_REASON_CARD)
BufferIO::ReadInt32(buf); buf += 4;
if(flag & QUERY_EQUIP_CARD) { if(flag & QUERY_EQUIP_CARD) {
int c = BufferIO::ReadInt8(buf); int c = BufferIO::ReadInt8(buf);
int l = BufferIO::ReadInt8(buf); int l = BufferIO::ReadInt8(buf);
......
...@@ -680,12 +680,9 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) { ...@@ -680,12 +680,9 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame->btnCancelOrFinish->setVisible(false); mainGame->btnCancelOrFinish->setVisible(false);
mainGame->btnShuffle->setVisible(false); mainGame->btnShuffle->setVisible(false);
time_t nowtime = time(NULL); time_t nowtime = time(NULL);
struct tm *localedtime = localtime(&nowtime); tm* localedtime = localtime(&nowtime);
char timebuf[40]; wchar_t timetext[40];
strftime(timebuf, 40, "%Y-%m-%d %H-%M-%S", localedtime); wcsftime(timetext, 40, L"%Y-%m-%d %H-%M-%S", localedtime);
size_t size = strlen(timebuf) + 1;
wchar_t timetext[80];
mbstowcs(timetext, timebuf, size);
mainGame->ebRSName->setText(timetext); mainGame->ebRSName->setText(timetext);
mainGame->wReplaySave->setText(dataManager.GetSysString(1340)); mainGame->wReplaySave->setText(dataManager.GetSysString(1340));
mainGame->PopupElement(mainGame->wReplaySave); mainGame->PopupElement(mainGame->wReplaySave);
......
...@@ -1516,7 +1516,7 @@ void Game::ClearCardInfo(int player) { ...@@ -1516,7 +1516,7 @@ void Game::ClearCardInfo(int player) {
stText->setText(L""); stText->setText(L"");
scrCardText->setVisible(false); scrCardText->setVisible(false);
} }
void Game::AddChatMsg(wchar_t* msg, int player) { void Game::AddChatMsg(const wchar_t* msg, int player) {
for(int i = 7; i > 0; --i) { for(int i = 7; i > 0; --i) {
chatMsg[i] = chatMsg[i - 1]; chatMsg[i] = chatMsg[i - 1];
chatTiming[i] = chatTiming[i - 1]; chatTiming[i] = chatTiming[i - 1];
...@@ -1563,25 +1563,29 @@ void Game::ClearChatMsg() { ...@@ -1563,25 +1563,29 @@ void Game::ClearChatMsg() {
chatTiming[i] = 0; chatTiming[i] = 0;
} }
} }
void Game::AddDebugMsg(char* msg) void Game::AddDebugMsg(const char* msg) {
{
if (enable_log & 0x1) { if (enable_log & 0x1) {
wchar_t wbuf[1024]; wchar_t wbuf[1024];
BufferIO::DecodeUTF8(msg, wbuf); BufferIO::DecodeUTF8(msg, wbuf);
AddChatMsg(wbuf, 9); AddChatMsg(wbuf, 9);
} }
if (enable_log & 0x2) { if (enable_log & 0x2) {
FILE* fp = fopen("error.log", "at"); char msgbuf[1040];
if (!fp) sprintf(msgbuf, "[Script Error]: %s", msg);
return; ErrorLog(msgbuf);
time_t nowtime = time(NULL);
struct tm *localedtime = localtime(&nowtime);
char timebuf[40];
strftime(timebuf, 40, "%Y-%m-%d %H:%M:%S", localedtime);
fprintf(fp, "[%s][Script Error]: %s\n", timebuf, msg);
fclose(fp);
} }
} }
void Game::ErrorLog(const char* msg) {
FILE* fp = fopen("error.log", "at");
if(!fp)
return;
time_t nowtime = time(NULL);
tm* localedtime = localtime(&nowtime);
char timebuf[40];
strftime(timebuf, 40, "%Y-%m-%d %H:%M:%S", localedtime);
fprintf(fp, "[%s]%s\n", timebuf, msg);
fclose(fp);
}
void Game::ClearTextures() { void Game::ClearTextures() {
matManager.mCard.setTexture(0, 0); matManager.mCard.setTexture(0, 0);
imgCard->setImage(imageManager.tCover[0]); imgCard->setImage(imageManager.tCover[0]);
......
...@@ -140,10 +140,10 @@ public: ...@@ -140,10 +140,10 @@ public:
void SaveConfig(); void SaveConfig();
void ShowCardInfo(int code); void ShowCardInfo(int code);
void ClearCardInfo(int player = 0); void ClearCardInfo(int player = 0);
void AddChatMsg(wchar_t* msg, int player); void AddChatMsg(const wchar_t* msg, int player);
void ClearChatMsg(); void ClearChatMsg();
void AddDebugMsg(char* msgbuf); void AddDebugMsg(const char* msgbuf);
bool MakeDirectory(const std::string folder); void ErrorLog(const char* msgbuf);
void initUtils(); void initUtils();
void ClearTextures(); void ClearTextures();
void CloseDuelWindow(); void CloseDuelWindow();
......
...@@ -461,7 +461,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) { ...@@ -461,7 +461,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
std::wstring repinfo; std::wstring repinfo;
time_t curtime = ReplayMode::cur_replay.pheader.seed; time_t curtime = ReplayMode::cur_replay.pheader.seed;
tm* st = localtime(&curtime); tm* st = localtime(&curtime);
myswprintf(infobuf, L"%d/%d/%d %02d:%02d:%02d\n", st->tm_year + 1900, st->tm_mon + 1, st->tm_mday, st->tm_hour, st->tm_min, st->tm_sec); wcsftime(infobuf, 256, L"%Y/%m/%d %H:%M:%S\n", st);
repinfo.append(infobuf); repinfo.append(infobuf);
wchar_t namebuf[4][20]; wchar_t namebuf[4][20];
ReplayMode::cur_replay.ReadName(namebuf[0]); ReplayMode::cur_replay.ReadName(namebuf[0]);
......
...@@ -116,12 +116,9 @@ int SingleMode::SinglePlayThread(void* param) { ...@@ -116,12 +116,9 @@ int SingleMode::SinglePlayThread(void* param) {
} }
last_replay.EndRecord(); last_replay.EndRecord();
time_t nowtime = time(NULL); time_t nowtime = time(NULL);
struct tm *localedtime = localtime(&nowtime); tm* localedtime = localtime(&nowtime);
char timebuf[40]; wchar_t timetext[40];
strftime(timebuf, 40, "%Y-%m-%d %H-%M-%S", localedtime); wcsftime(timetext, 40, L"%Y-%m-%d %H-%M-%S", localedtime);
size_t size = strlen(timebuf) + 1;
wchar_t timetext[80];
mbstowcs(timetext, timebuf, size);
mainGame->ebRSName->setText(timetext); mainGame->ebRSName->setText(timetext);
mainGame->wReplaySave->setText(dataManager.GetSysString(1340)); mainGame->wReplaySave->setText(dataManager.GetSysString(1340));
mainGame->PopupElement(mainGame->wReplaySave); mainGame->PopupElement(mainGame->wReplaySave);
......
...@@ -1051,7 +1051,7 @@ int32 scriptlib::duel_is_environment(lua_State *L) { ...@@ -1051,7 +1051,7 @@ int32 scriptlib::duel_is_environment(lua_State *L) {
} }
} }
if(playerid == 1 || playerid == PLAYER_ALL) { if(playerid == 1 || playerid == PLAYER_ALL) {
for(auto& pcard : pduel->game_field->player[0].list_szone) { for(auto& pcard : pduel->game_field->player[1].list_szone) {
if(pcard && pcard->is_position(POS_FACEUP) && pcard->get_status(STATUS_EFFECT_ENABLED) && code == pcard->get_code()) if(pcard && pcard->is_position(POS_FACEUP) && pcard->get_status(STATUS_EFFECT_ENABLED) && code == pcard->get_code())
ret = 1; ret = 1;
} }
...@@ -1065,7 +1065,7 @@ int32 scriptlib::duel_is_environment(lua_State *L) { ...@@ -1065,7 +1065,7 @@ int32 scriptlib::duel_is_environment(lua_State *L) {
} }
} }
if(playerid == 1 || playerid == PLAYER_ALL) { if(playerid == 1 || playerid == PLAYER_ALL) {
for(auto& pcard : pduel->game_field->player[0].list_mzone) { for(auto& pcard : pduel->game_field->player[1].list_mzone) {
if(pcard && pcard->is_position(POS_FACEUP) && pcard->get_status(STATUS_EFFECT_ENABLED) && code == pcard->get_code()) if(pcard && pcard->is_position(POS_FACEUP) && pcard->get_status(STATUS_EFFECT_ENABLED) && code == pcard->get_code())
ret = 1; ret = 1;
} }
......
...@@ -17,21 +17,15 @@ ...@@ -17,21 +17,15 @@
特别感谢: 菜菜,尸体,废话多,大毛,龙道香姐,晓L,幻兽L 的支持与努力. 特别感谢: 菜菜,尸体,废话多,大毛,龙道香姐,晓L,幻兽L 的支持与努力.
</pre> </pre>
<ul> <ul>
<li style="color:#ffff00">3.3.7</li> <li style="color:#ffff00">3.3.8</li>
</ul> </ul>
<pre> <pre>
更新: 更新:
1.更新ygo内核; 1.更新ygo内核;
2.新卡1007+YA+VJ+LEHD+T1006; 2.新卡DP21;
3.版本号升级为1034.6
优化: 优化:
1.新版本更新提示对话框; 1.新版本更新提示对话框;
2.连锁数字显示; 2.连锁数字显示;
3.墓地卡显示状态标签;
4.更新安卓系统适配;
修复:
1.检查更新失败跳转错误的问题;
2.若干卡图错误;
</pre> </pre>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -8,8 +8,8 @@ android { ...@@ -8,8 +8,8 @@ android {
applicationId "cn.garymb.ygomobile" applicationId "cn.garymb.ygomobile"
minSdkVersion 16 minSdkVersion 16
targetSdkVersion 21 targetSdkVersion 21
versionCode 330701102 versionCode 330801117
versionName "3.3.7" versionName "3.3.8"
flavorDimensions "versionCode" flavorDimensions "versionCode"
vectorDrawables.useSupportLibrary = true vectorDrawables.useSupportLibrary = true
ndk { ndk {
......
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