Commit 9ef1f807 authored by nanahira's avatar nanahira

Merge branch 'server-develop' of ../versions/ygopro-mc into dev-salixthing-server

parents 6a48ac2f af3ada8e
...@@ -159,7 +159,7 @@ public: ...@@ -159,7 +159,7 @@ public:
#endif #endif
virtual void EndDuel() {} virtual void EndDuel() {}
#ifdef YGOPRO_SERVER_MODE #ifdef YGOPRO_SERVER_MODE
virtual void TestCard(int code) {}; virtual void TestCard(int code) {}
#endif #endif
public: public:
......
...@@ -29,6 +29,9 @@ if SERVER_MODE then ...@@ -29,6 +29,9 @@ if SERVER_MODE then
if SERVER_PRO2_SUPPORT then if SERVER_PRO2_SUPPORT then
defines { "SERVER_PRO2_SUPPORT" } defines { "SERVER_PRO2_SUPPORT" }
end end
if SERVER_TAG_SURRENDER_CONFIRM then
defines { "SERVER_TAG_SURRENDER_CONFIRM" }
end
else else
kind "WindowedApp" kind "WindowedApp"
......
...@@ -568,10 +568,10 @@ void SingleDuel::TPResult(DuelPlayer* dp, unsigned char tp) { ...@@ -568,10 +568,10 @@ void SingleDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
set_card_reader(DataManager::CardReader); set_card_reader(DataManager::CardReader);
set_message_handler(SingleDuel::MessageHandler); set_message_handler(SingleDuel::MessageHandler);
pduel = create_duel(duel_seed); pduel = create_duel(duel_seed);
preload_script(pduel, "./script/special.lua", 0);
preload_script(pduel, "./script/init.lua", 0);
set_player_info(pduel, 0, host_info.start_lp, host_info.start_hand, host_info.draw_count); set_player_info(pduel, 0, host_info.start_lp, host_info.start_hand, host_info.draw_count);
set_player_info(pduel, 1, host_info.start_lp, host_info.start_hand, host_info.draw_count); set_player_info(pduel, 1, host_info.start_lp, host_info.start_hand, host_info.draw_count);
preload_script(pduel, "./script/special.lua", 0);
preload_script(pduel, "./script/init.lua", 0);
int opt = (int)host_info.duel_rule << 16; int opt = (int)host_info.duel_rule << 16;
if(host_info.no_shuffle_deck) if(host_info.no_shuffle_deck)
opt |= DUEL_PSEUDO_SHUFFLE; opt |= DUEL_PSEUDO_SHUFFLE;
......
...@@ -692,7 +692,7 @@ void TagDuel::Surrender(DuelPlayer* dp) { ...@@ -692,7 +692,7 @@ void TagDuel::Surrender(DuelPlayer* dp) {
if(dp->type > 3 || !pduel) if(dp->type > 3 || !pduel)
return; return;
uint32 player = dp->type; uint32 player = dp->type;
#if !defined(YGOPRO_SERVER_MODE) || defined(YGOPRO_TAG_SURRENDER_CONFIRM) #if !defined(YGOPRO_SERVER_MODE) || defined(SERVER_TAG_SURRENDER_CONFIRM)
if(surrender[player]) if(surrender[player])
return; return;
static const uint32 teammatemap[] = { 1, 0, 3, 2 }; static const uint32 teammatemap[] = { 1, 0, 3, 2 };
......
...@@ -12,6 +12,7 @@ LUA_LIB_NAME = "lua" ...@@ -12,6 +12,7 @@ LUA_LIB_NAME = "lua"
SERVER_MODE = true SERVER_MODE = true
SERVER_ZIP_SUPPORT = false SERVER_ZIP_SUPPORT = false
SERVER_PRO2_SUPPORT = false SERVER_PRO2_SUPPORT = false
SERVER_TAG_SURRENDER_CONFIRM = false
USE_IRRKLANG = false USE_IRRKLANG = false
-- read settings from command line or environment variables -- read settings from command line or environment variables
...@@ -60,13 +61,13 @@ newoption { trigger = "mac-arm", category = "YGOPro", description = "M1" } ...@@ -60,13 +61,13 @@ newoption { trigger = "mac-arm", category = "YGOPro", description = "M1" }
newoption { trigger = "server-mode", category = "YGOPro - server", description = "" } newoption { trigger = "server-mode", category = "YGOPro - server", description = "" }
newoption { trigger = "server-zip-support", category = "YGOPro - server", description = "" } newoption { trigger = "server-zip-support", category = "YGOPro - server", description = "" }
newoption { trigger = "server-pro2-support", category = "YGOPro - server", description = "" } newoption { trigger = "server-pro2-support", category = "YGOPro - server", description = "" }
newoption { trigger = "server-tag-surrender-confirm", category = "YGOPro - server", description = "" }
boolOptions = { boolOptions = {
"compat-mycard", "compat-mycard",
"no-lua-safe", "no-lua-safe",
"message-debug", "message-debug",
"no-side-check", "no-side-check",
"tag-surrender-confirm",
} }
for _, boolOption in ipairs(boolOptions) do for _, boolOption in ipairs(boolOptions) do
...@@ -211,7 +212,6 @@ if os.istarget("macosx") then ...@@ -211,7 +212,6 @@ if os.istarget("macosx") then
end end
if GetParam("server-mode") then if GetParam("server-mode") then
SERVER_MODE = true SERVER_MODE = true
SERVER_ZIP_SUPPORT = false
end end
if GetParam("server-zip-support") then if GetParam("server-zip-support") then
SERVER_ZIP_SUPPORT = true SERVER_ZIP_SUPPORT = true
...@@ -220,6 +220,9 @@ if GetParam("server-pro2-support") then ...@@ -220,6 +220,9 @@ if GetParam("server-pro2-support") then
SERVER_PRO2_SUPPORT = true SERVER_PRO2_SUPPORT = true
SERVER_ZIP_SUPPORT = true SERVER_ZIP_SUPPORT = true
end end
if GetParam("server-tag-surrender-confirm") then
SERVER_TAG_SURRENDER_CONFIRM = true
end
if SERVER_MODE then if SERVER_MODE then
BUILD_FREETYPE = false BUILD_FREETYPE = false
......
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