diff --git a/Makefile b/Makefile index 55cdbfb537..928766f564 100644 --- a/Makefile +++ b/Makefile @@ -109,17 +109,27 @@ rnull_LIBS = $(COMMON_LIBS) $(rnull_DEPS) PROGRAMS += rsdl2 rnull renderers: $(rsdl2_TARGET) $(rnull_TARGET) +# Mods Common +mod_common_SRCS := $(shell find OpenRA.Mods.Common/ -iname '*.cs') +mod_common_TARGET = mods/common/OpenRA.Mods.Common.dll +mod_common_KIND = library +mod_common_DEPS = $(game_TARGET) +mod_common_LIBS = $(COMMON_LIBS) $(STD_MOD_LIBS) +PROGRAMS += mod_common +mod_common: $(mod_common_TARGET) + ##### Official Mods ##### STD_MOD_LIBS = $(game_TARGET) thirdparty/KopiLua.dll thirdparty/NLua.dll STD_MOD_DEPS = $(STD_MOD_LIBS) $(ralint_TARGET) + # Red Alert mod_ra_SRCS := $(shell find OpenRA.Mods.RA/ -iname '*.cs') mod_ra_TARGET = mods/ra/OpenRA.Mods.RA.dll mod_ra_KIND = library -mod_ra_DEPS = $(STD_MOD_DEPS) $(irc_TARGET) -mod_ra_LIBS = $(COMMON_LIBS) $(STD_MOD_LIBS) $(irc_TARGET) +mod_ra_DEPS = $(STD_MOD_DEPS) $(mod_common_TARGET) $(irc_TARGET) +mod_ra_LIBS = $(COMMON_LIBS) $(STD_MOD_LIBS) $(mod_common_TARGET) $(irc_TARGET) PROGRAMS += mod_ra mod_ra: $(mod_ra_TARGET) @@ -260,7 +270,7 @@ tools: editor tsbuild crashdialog package: dependencies core editor crashdialog docs version -mods: mod_ra mod_cnc mod_d2k mod_ts +mods: mod_common mod_ra mod_cnc mod_d2k mod_ts all: cli-dependencies core tools @@ -307,6 +317,7 @@ install-core: default @$(INSTALL_PROGRAM) $(foreach prog,$(CORE),$($(prog)_TARGET)) "$(DATA_INSTALL_DIR)" @$(INSTALL_DIR) "$(DATA_INSTALL_DIR)/mods" @$(CP_R) mods/common "$(DATA_INSTALL_DIR)/mods/" + @$(INSTALL_PROGRAM) $(mod_common_TARGET) "$(DATA_INSTALL_DIR)/mods/common" @$(CP_R) mods/cnc "$(DATA_INSTALL_DIR)/mods/" @$(INSTALL_PROGRAM) $(mod_cnc_TARGET) "$(DATA_INSTALL_DIR)/mods/cnc" @$(CP_R) mods/ra "$(DATA_INSTALL_DIR)/mods/" diff --git a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj new file mode 100644 index 0000000000..84e3b2a0d3 --- /dev/null +++ b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj @@ -0,0 +1,57 @@ + + + + + Debug + AnyCPU + {FE6C8CC0-2F07-442A-B29F-17617B3B7FC6} + Library + Properties + OpenRA.Mods.Common + OpenRA.Mods.Common + v4.0 + 512 + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + x86 + true + + + + + + + + {0dfb103f-2962-400f-8c6d-e2c28ccba633} + OpenRA.Game + + + + + + + + + + mkdir "$(SolutionDir)mods/common/" +copy "$(TargetPath)" "$(SolutionDir)mods/common/" +cd "$(SolutionDir)thirdparty/" +copy "FuzzyLogicLibrary.dll" "$(SolutionDir)" +cd "$(SolutionDir)" + + + \ No newline at end of file diff --git a/OpenRA.Mods.RA/ServerTraits/ColorValidator.cs b/OpenRA.Mods.Common/ServerTraits/ColorValidator.cs similarity index 99% rename from OpenRA.Mods.RA/ServerTraits/ColorValidator.cs rename to OpenRA.Mods.Common/ServerTraits/ColorValidator.cs index 5c22218578..5c956a06ad 100644 --- a/OpenRA.Mods.RA/ServerTraits/ColorValidator.cs +++ b/OpenRA.Mods.Common/ServerTraits/ColorValidator.cs @@ -17,7 +17,7 @@ using OpenRA.Network; using OpenRA.Server; using S = OpenRA.Server.Server; -namespace OpenRA.Mods.RA.Server +namespace OpenRA.Mods.Common.Server { public class ColorValidator : ServerTrait, IClientJoined { diff --git a/OpenRA.Mods.RA/ServerTraits/MasterServerPinger.cs b/OpenRA.Mods.Common/ServerTraits/MasterServerPinger.cs similarity index 98% rename from OpenRA.Mods.RA/ServerTraits/MasterServerPinger.cs rename to OpenRA.Mods.Common/ServerTraits/MasterServerPinger.cs index 44e54afbe0..73f0edab28 100644 --- a/OpenRA.Mods.RA/ServerTraits/MasterServerPinger.cs +++ b/OpenRA.Mods.Common/ServerTraits/MasterServerPinger.cs @@ -16,7 +16,7 @@ using System.Text; using OpenRA.Server; using S = OpenRA.Server.Server; -namespace OpenRA.Mods.RA.Server +namespace OpenRA.Mods.Common.Server { public class MasterServerPinger : ServerTrait, ITick, INotifySyncLobbyInfo, IStartGame, IEndGame { diff --git a/OpenRA.Mods.RA/ServerTraits/PlayerPinger.cs b/OpenRA.Mods.Common/ServerTraits/PlayerPinger.cs similarity index 96% rename from OpenRA.Mods.RA/ServerTraits/PlayerPinger.cs rename to OpenRA.Mods.Common/ServerTraits/PlayerPinger.cs index 37b4e7f861..5dce33a719 100644 --- a/OpenRA.Mods.RA/ServerTraits/PlayerPinger.cs +++ b/OpenRA.Mods.Common/ServerTraits/PlayerPinger.cs @@ -12,7 +12,7 @@ using System; using OpenRA.Server; using S = OpenRA.Server.Server; -namespace OpenRA.Mods.RA.Server +namespace OpenRA.Mods.Common.Server { public class PlayerPinger : ServerTrait, ITick { diff --git a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj index 1ba4218013..6bf2ecb211 100644 --- a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj +++ b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj @@ -294,7 +294,6 @@ - @@ -350,7 +349,6 @@ - @@ -434,7 +432,6 @@ - @@ -586,6 +583,10 @@ {85B48234-8B31-4BE6-AF9C-665CC6866841} OpenRA.Irc + + {fe6c8cc0-2f07-442a-b29f-17617b3b7fc6} + OpenRA.Mods.Common + @@ -620,4 +621,4 @@ copy "FuzzyLogicLibrary.dll" "$(SolutionDir)" cd "$(SolutionDir)" - + \ No newline at end of file diff --git a/OpenRA.Mods.RA/ServerTraits/LobbyCommands.cs b/OpenRA.Mods.RA/ServerTraits/LobbyCommands.cs index cb4ded76d1..50027f9cc6 100644 --- a/OpenRA.Mods.RA/ServerTraits/LobbyCommands.cs +++ b/OpenRA.Mods.RA/ServerTraits/LobbyCommands.cs @@ -16,6 +16,7 @@ using OpenRA.Graphics; using OpenRA.Network; using OpenRA.Server; using S = OpenRA.Server.Server; +using OpenRA.Mods.Common.Server; namespace OpenRA.Mods.RA.Server { diff --git a/OpenRA.sln b/OpenRA.sln index 37302ef3c8..38aba1ae18 100644 --- a/OpenRA.sln +++ b/OpenRA.sln @@ -25,6 +25,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Irc", "OpenRA.Irc\Op EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Renderer.Sdl2", "OpenRA.Renderer.Sdl2\OpenRA.Renderer.Sdl2.csproj", "{33D03738-C154-4028-8EA8-63A3C488A651}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Mods.Common", "OpenRA.Mods.Common\OpenRA.Mods.Common.csproj", "{FE6C8CC0-2F07-442A-B29F-17617B3B7FC6}" +EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Common Lua scripts", "Common Lua scripts", "{FCA943AB-E622-415E-8A61-639D97F62EEC}" ProjectSection(SolutionItems) = preProject mods\common\lua\actor.lua = mods\common\lua\actor.lua @@ -79,6 +81,8 @@ Global GlobalSection(ProjectConfigurationPlatforms) = postSolution {0DFB103F-2962-400F-8C6D-E2C28CCBA633}.Debug|x86.ActiveCfg = Debug|x86 {0DFB103F-2962-400F-8C6D-E2C28CCBA633}.Debug|x86.Build.0 = Debug|x86 + {FE6C8CC0-2F07-442A-B29F-17617B3B7FC6}.Debug|x86.ActiveCfg = Debug|x86 + {FE6C8CC0-2F07-442A-B29F-17617B3B7FC6}.Debug|x86.Build.0 = Debug|x86 {4A8A43B5-A9EF-4ED0-99DD-4BAB10A0DB6E}.Debug|x86.ActiveCfg = Debug|x86 {4A8A43B5-A9EF-4ED0-99DD-4BAB10A0DB6E}.Debug|x86.Build.0 = Debug|x86 {2881135D-4D62-493E-8F83-5EEE92CCC6BE}.Debug|x86.ActiveCfg = Debug|x86 diff --git a/mods/cnc/mod.yaml b/mods/cnc/mod.yaml index bba5b0f568..77e8b37e1b 100644 --- a/mods/cnc/mod.yaml +++ b/mods/cnc/mod.yaml @@ -69,6 +69,7 @@ Chrome: Assemblies: mods/ra/OpenRA.Mods.RA.dll + mods/common/OpenRA.Mods.Common.dll mods/cnc/OpenRA.Mods.Cnc.dll mods/d2k/OpenRA.Mods.D2k.dll diff --git a/mods/d2k/mod.yaml b/mods/d2k/mod.yaml index d216aabc58..9cd71c63be 100644 --- a/mods/d2k/mod.yaml +++ b/mods/d2k/mod.yaml @@ -52,6 +52,7 @@ Chrome: Assemblies: mods/ra/OpenRA.Mods.RA.dll + mods/common/OpenRA.Mods.Common.dll mods/cnc/OpenRA.Mods.Cnc.dll mods/d2k/OpenRA.Mods.D2k.dll diff --git a/mods/ra/mod.yaml b/mods/ra/mod.yaml index 2852236732..0324d4659e 100644 --- a/mods/ra/mod.yaml +++ b/mods/ra/mod.yaml @@ -65,6 +65,7 @@ Chrome: Assemblies: mods/ra/OpenRA.Mods.RA.dll + mods/common/OpenRA.Mods.Common.dll mods/cnc/OpenRA.Mods.Cnc.dll mods/d2k/OpenRA.Mods.D2k.dll diff --git a/mods/ts/mod.yaml b/mods/ts/mod.yaml index d31a64bd23..032550810c 100644 --- a/mods/ts/mod.yaml +++ b/mods/ts/mod.yaml @@ -93,6 +93,7 @@ Chrome: Assemblies: mods/ra/OpenRA.Mods.RA.dll + mods/common/OpenRA.Mods.Common.dll mods/d2k/OpenRA.Mods.D2k.dll mods/cnc/OpenRA.Mods.Cnc.dll mods/ts/OpenRA.Mods.TS.dll