Commit 25d1722b authored by fallenstardust's avatar fallenstardust

sync ocgcore

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