Commit c17c0e02 authored by nanahira's avatar nanahira

Merge branch 'server' of https://github.com/purerosefallen/ygopro

parents bfc24f10 5e2460af
...@@ -73,7 +73,8 @@ ...@@ -73,7 +73,8 @@
# others # others
*.log *.log
/.vscode .vscode
core*
/bak/ /bak/
/bug.txt /bug.txt
/output /output
...@@ -81,8 +82,6 @@ ...@@ -81,8 +82,6 @@
[Tt]humbs.cdb [Tt]humbs.cdb
/PrinterData.txt /PrinterData.txt
/ygopro_*.bat
/ygopro_*.sh
/*.bat /*.bat
/*.sh /*.sh
No preview for this file type
...@@ -367,12 +367,11 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) { ...@@ -367,12 +367,11 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
unsigned short count = BufferIO::ReadUInt16(pdata); unsigned short count = BufferIO::ReadUInt16(pdata);
char temp1[64]; char temp1[64];
char temp2[128]; char temp2[128];
wchar_t roomname[32];
wchar_t player1[64];
wchar_t player2[64];
wchar_t hoststr[1024];
for(unsigned short i = 0; i < count; ++i) { for(unsigned short i = 0; i < count; ++i) {
wchar_t roomname[32];
wchar_t player1[64];
wchar_t player2[64];
wchar_t hoststr[1024];
memcpy(temp1, pdata, 64); memcpy(temp1, pdata, 64);
pdata += 64; pdata += 64;
BufferIO::DecodeUTF8(temp1, roomname); BufferIO::DecodeUTF8(temp1, roomname);
......
...@@ -1456,9 +1456,36 @@ void Game::LoadConfig() { ...@@ -1456,9 +1456,36 @@ void Game::LoadConfig() {
} }
} }
fclose(fp_user); fclose(fp_user);
} else { } else
#else // YGOPRO_COMPAT_MYCARD
if(!gameConf.locale || wcslen(gameConf.locale) <= 0)
#endif
{
unsigned int lcid = 0;
#ifdef _WIN32 #ifdef _WIN32
unsigned int lcid = ((unsigned int)GetSystemDefaultLangID()) & 0xff; lcid = ((unsigned int)GetSystemDefaultLangID()) & 0xff;
#else
char* locale_str = getenv("LANG");
if(locale_str) {
if(strstr(locale_str, "zh"))
lcid = 0x04;
else
if(strstr(locale_str, "en"))
lcid = 0x09;
else
if(strstr(locale_str, "es"))
lcid = 0x0a;
else
if(strstr(locale_str, "ja"))
lcid = 0x11;
else
if(strstr(locale_str, "ko"))
lcid = 0x12;
else
if(strstr(locale_str, "pt"))
lcid = 0x16;
}
#endif
switch(lcid) { switch(lcid) {
case 0x04: { case 0x04: {
myswprintf(mainGame->gameConf.locale, L"%ls", L"zh-CN"); myswprintf(mainGame->gameConf.locale, L"%ls", L"zh-CN");
...@@ -1480,11 +1507,12 @@ void Game::LoadConfig() { ...@@ -1480,11 +1507,12 @@ void Game::LoadConfig() {
myswprintf(mainGame->gameConf.locale, L"%ls", L"ko-KR"); myswprintf(mainGame->gameConf.locale, L"%ls", L"ko-KR");
break; break;
} }
case 0x16: {
myswprintf(mainGame->gameConf.locale, L"%ls", L"pt-BR");
break;
}
} }
#endif
//SaveConfig();
} }
#endif //YGOPRO_COMPAT_MYCARD
} }
void Game::SaveConfig() { void Game::SaveConfig() {
#ifdef YGOPRO_COMPAT_MYCARD #ifdef YGOPRO_COMPAT_MYCARD
......
...@@ -2,8 +2,7 @@ include "lzma/." ...@@ -2,8 +2,7 @@ include "lzma/."
project "ygopro" project "ygopro"
kind "ConsoleApp" kind "ConsoleApp"
defines { "YGOPRO_SERVER_MODE" }
local mr=os.getenv("YGOPRO_DEFAULT_DUEL_RULE") local mr=os.getenv("YGOPRO_DEFAULT_DUEL_RULE")
if mr and tonumber(mr) then defines { "DEFAULT_DUEL_RULE="..tonumber(mr) } end if mr and tonumber(mr) then defines { "DEFAULT_DUEL_RULE="..tonumber(mr) } end
......
...@@ -44,10 +44,8 @@ static const luaL_Reg loadedlibs[] = { ...@@ -44,10 +44,8 @@ static const luaL_Reg loadedlibs[] = {
{LUA_LOADLIBNAME, luaopen_package}, {LUA_LOADLIBNAME, luaopen_package},
{LUA_COLIBNAME, luaopen_coroutine}, {LUA_COLIBNAME, luaopen_coroutine},
{LUA_TABLIBNAME, luaopen_table}, {LUA_TABLIBNAME, luaopen_table},
#if !defined(LUA_SAFE_MODE)
{LUA_IOLIBNAME, luaopen_io}, {LUA_IOLIBNAME, luaopen_io},
{LUA_OSLIBNAME, luaopen_os}, {LUA_OSLIBNAME, luaopen_os},
#endif
{LUA_STRLIBNAME, luaopen_string}, {LUA_STRLIBNAME, luaopen_string},
{LUA_MATHLIBNAME, luaopen_math}, {LUA_MATHLIBNAME, luaopen_math},
{LUA_UTF8LIBNAME, luaopen_utf8}, {LUA_UTF8LIBNAME, luaopen_utf8},
......
...@@ -5,7 +5,7 @@ solution "ygo" ...@@ -5,7 +5,7 @@ solution "ygo"
--startproject "ygopro" --startproject "ygopro"
configurations { "Release", "Debug" } configurations { "Release", "Debug" }
defines { "LUA_COMPAT_5_2" } defines { "LUA_COMPAT_5_2", "YGOPRO_SERVER_MODE", "YGOPRO_LUA_SAVE" }
configuration "windows" configuration "windows"
defines { "WIN32", "_WIN32" } defines { "WIN32", "_WIN32" }
......
...@@ -4,7 +4,7 @@ solution "ygo" ...@@ -4,7 +4,7 @@ solution "ygo"
objdir "obj" objdir "obj"
configurations { "Release", "Debug" } configurations { "Release", "Debug" }
defines { "LUA_COMPAT_5_2" } defines { "LUA_COMPAT_5_2", "YGOPRO_SERVER_MODE" } --, "YGOPRO_LUA_SAVE" }
configuration "windows" configuration "windows"
defines { "WIN32", "_WIN32" } defines { "WIN32", "_WIN32" }
startproject "ygopro" startproject "ygopro"
......
...@@ -571,6 +571,9 @@ ...@@ -571,6 +571,9 @@
!counter 0x4a 运动员指示物 !counter 0x4a 运动员指示物
!counter 0x4b 枪管指示物 !counter 0x4b 枪管指示物
!counter 0x4c 召唤指示物 !counter 0x4c 召唤指示物
!counter 0x104d 信号指示物
!counter 0x4e 指示物(魂之灵摆)
!counter 0x104f 蛊指示物
#setnames, using tab for comment #setnames, using tab for comment
!setname 0x1 正义盟军 AOJ !setname 0x1 正义盟军 AOJ
!setname 0x2 次世代 ジェネクス !setname 0x2 次世代 ジェネクス
...@@ -948,3 +951,4 @@ ...@@ -948,3 +951,4 @@
!setname 0x122 女武神 Valkyrie !setname 0x122 女武神 Valkyrie
!setname 0x123 蔷薇龙 ローズ・ドラゴン !setname 0x123 蔷薇龙 ローズ・ドラゴン
!setname 0x124 机械天使 機械天使 !setname 0x124 机械天使 機械天使
!setname 0x125 笑容 スマイル
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