Skip to content

Commit

Permalink
class
Browse files Browse the repository at this point in the history
  • Loading branch information
ST-Chara committed Feb 19, 2024
1 parent a5c47e5 commit 95be575
Show file tree
Hide file tree
Showing 131 changed files with 536 additions and 49,895 deletions.
4 changes: 2 additions & 2 deletions autoexec_server.cfg.example
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ sv_rcon_helper_password "HELPER_PASSWORD"
sv_exp_bonus 5
sv_emoticon_delay 0
sv_test_cmds 1
sv_warmup 15
sv_warmup 1
sv_inactivekick 4
sv_spectator_votes 0
sv_timelimit 5
sv_timelimit 1
sv_new_hearth 0
logfile "autoexec_server.log"
sv_motd "Register with /register - PASSWORDS ARE STORED IN PLAINTEXT. DO NOT USE ANY PASSWORD YOU HAVE USED FOR OTHER SERVICES."
Expand Down
96 changes: 2 additions & 94 deletions bam.lua
Original file line number Diff line number Diff line change
Expand Up @@ -121,41 +121,21 @@ end
-- Content Compile
network_source = ContentCompile("network_source", "src/game/generated/protocol.cpp")
network_header = ContentCompile("network_header", "src/game/generated/protocol.h")
client_content_source = ContentCompile("client_content_source", "src/game/generated/client_data.cpp")
client_content_header = ContentCompile("client_content_header", "src/game/generated/client_data.h")
server_content_source = ContentCompile("server_content_source", "src/game/generated/server_data.cpp")
server_content_header = ContentCompile("server_content_header", "src/game/generated/server_data.h")

AddDependency(network_source, network_header)
AddDependency(client_content_source, client_content_header)
AddDependency(server_content_source, server_content_header)

nethash = CHash("src/game/generated/nethash.cpp", "src/engine/shared/protocol.h", "src/game/generated/protocol.h",
"src/game/tuning.h", "src/game/gamecore.cpp", network_header)

icu_depends = {}
client_link_other = {}
client_depends = {}
server_link_other = {}
server_sql_depends = {}

if family == "windows" then
if platform == "win32" then
table.insert(client_depends, CopyToDirectory(".", "other/freetype/lib32/freetype.dll"))
table.insert(client_depends, CopyToDirectory(".", "other/sdl/lib32/SDL.dll"))

table.insert(client_depends, CopyToDirectory(".", "other/curl/windows/lib32/libcurl.dll"))
table.insert(client_depends, CopyToDirectory(".", "other/curl/windows/lib32/libeay32.dll"))
table.insert(client_depends, CopyToDirectory(".", "other/curl/windows/lib32/libidn-11.dll"))
table.insert(client_depends, CopyToDirectory(".", "other/curl/windows/lib32/ssleay32.dll"))
table.insert(client_depends, CopyToDirectory(".", "other/curl/windows/lib32/zlib1.dll"))

table.insert(client_depends, CopyToDirectory(".", "other/opus/windows/lib32/libwinpthread-1.dll"))
table.insert(client_depends, CopyToDirectory(".", "other/opus/windows/lib32/libgcc_s_sjlj-1.dll"))
table.insert(client_depends, CopyToDirectory(".", "other/opus/windows/lib32/libogg-0.dll"))
table.insert(client_depends, CopyToDirectory(".", "other/opus/windows/lib32/libopus-0.dll"))
table.insert(client_depends, CopyToDirectory(".", "other/opus/windows/lib32/libopusfile-0.dll"))

if config.compiler.driver == "cl" then
table.insert(icu_depends, CopyToDirectory(".", "other/icu/vc/lib32/icudt53.dll"))
table.insert(icu_depends, CopyToDirectory(".", "other/icu/vc/lib32/icuin53.dll"))
Expand All @@ -166,20 +146,6 @@ if family == "windows" then
table.insert(icu_depends, CopyToDirectory(".", "other/icu/gcc/lib32/icuuc53.dll"))
end
else
table.insert(client_depends, CopyToDirectory(".", "other/freetype/lib64/freetype.dll"))
table.insert(client_depends, CopyToDirectory(".", "other/sdl/lib64/SDL.dll"))

table.insert(client_depends, CopyToDirectory(".", "other/curl/windows/lib64/libcurl.dll"))
table.insert(client_depends, CopyToDirectory(".", "other/curl/windows/lib64/libeay32.dll"))
table.insert(client_depends, CopyToDirectory(".", "other/curl/windows/lib64/ssleay32.dll"))
table.insert(client_depends, CopyToDirectory(".", "other/curl/windows/lib64/zlib1.dll"))

table.insert(client_depends, CopyToDirectory(".", "other/opus/windows/lib64/libwinpthread-1.dll"))
table.insert(client_depends, CopyToDirectory(".", "other/opus/windows/lib64/libgcc_s_seh-1.dll"))
table.insert(client_depends, CopyToDirectory(".", "other/opus/windows/lib64/libogg-0.dll"))
table.insert(client_depends, CopyToDirectory(".", "other/opus/windows/lib64/libopus-0.dll"))
table.insert(client_depends, CopyToDirectory(".", "other/opus/windows/lib64/libopusfile-0.dll"))

-- Add ICU because its a HAVE to
if config.compiler.driver == "cl" then
table.insert(icu_depends, CopyToDirectory(".", "other/icu/vc/lib64/icudt53.dll"))
Expand All @@ -195,10 +161,8 @@ if family == "windows" then
table.insert(server_sql_depends, CopyToDirectory(".", "other/mysql/vc2005libs/libmysql.dll"))

if config.compiler.driver == "cl" then
client_link_other = {ResCompile("other/icons/teeworlds_cl.rc")}
server_link_other = {ResCompile("other/icons/teeworlds_srv_cl.rc")}
elseif config.compiler.driver == "gcc" then
client_link_other = {ResCompile("other/icons/teeworlds_gcc.rc")}
server_link_other = {ResCompile("other/icons/teeworlds_srv_gcc.rc")}
end
end
Expand Down Expand Up @@ -328,34 +292,9 @@ function build(settings)
-- build game components
engine_settings = settings:Copy()
server_settings = engine_settings:Copy()
client_settings = engine_settings:Copy()
launcher_settings = engine_settings:Copy()

if family == "unix" then
if platform == "macosx" then
client_settings.link.frameworks:Add("OpenGL")
client_settings.link.frameworks:Add("AGL")
client_settings.link.frameworks:Add("Carbon")
client_settings.link.frameworks:Add("Cocoa")
launcher_settings.link.frameworks:Add("Cocoa")
client_settings.cc.flags:Add("-I/opt/X11/include")
else
client_settings.link.libs:Add("X11")
client_settings.link.libs:Add("GL")
client_settings.link.libs:Add("GLU")
end

elseif family == "windows" then
if arch == "amd64" then
client_settings.link.libpath:Add("other/curl/windows/lib64")
else
client_settings.link.libpath:Add("other/curl/windows/lib32")
end
client_settings.link.libs:Add("opengl32")
client_settings.link.libs:Add("glu32")
client_settings.link.libs:Add("winmm")
client_settings.link.libs:Add("libopusfile-0")
client_settings.link.libs:Add("curl")
if family == "windows" then
if string.find(settings.config_name, "sql") then
server_settings.link.libpath:Add("other/mysql/vc2005libs")
server_settings.link.libs:Add("mysqlcppconn")
Expand Down Expand Up @@ -383,22 +322,13 @@ function build(settings)
end
end

config.sdl:Apply(client_settings)
config.freetype:Apply(client_settings)
config.curl:Apply(client_settings)
config.opusfile:Apply(client_settings)
config.opus:Apply(client_settings)
config.ogg:Apply(client_settings)

if family == "unix" and (platform == "macosx" or platform == "linux") then
engine_settings.link.libs:Add("dl")
server_settings.link.libs:Add("dl")
client_settings.link.libs:Add("dl")
launcher_settings.link.libs:Add("dl")
end

engine = Compile(engine_settings, Collect("src/engine/shared/*.cpp", "src/base/*.c"))
client = Compile(client_settings, Collect("src/engine/client/*.cpp"))
server = Compile(server_settings, Collect("src/engine/server/*.cpp"))
teeothers = Compile(server_settings,
Collect("src/teeothers/*.cpp", "src/teeothers/components/*.cpp", "src/teeothers/system/*.cpp"))
Expand All @@ -407,21 +337,14 @@ function build(settings)
masterserver = Compile(settings, Collect("src/mastersrv/*.cpp"))
twping = Compile(settings, Collect("src/twping/*.cpp"))
game_shared = Compile(settings, Collect("src/game/*.cpp"), nethash, network_source)
game_client = Compile(client_settings, CollectRecursive("src/game/client/*.cpp"), client_content_source)
game_server = Compile(settings, CollectRecursive("src/game/server/*.cpp"), server_content_source)
game_editor = Compile(settings, Collect("src/game/editor/*.cpp"))

-- build tools (TODO: fix this so we don't get double _d_d stuff)
tools_src = Collect("src/tools/*.cpp", "src/tools/*.c")

client_notification = {}
client_osxlaunch = {}
server_osxlaunch = {}
if platform == "macosx" then
notification_settings = client_settings:Copy()
notification_settings.cc.flags:Add("-x objective-c++")
client_notification = Compile(notification_settings, "src/osx/notification.m")
client_osxlaunch = Compile(client_settings, "src/osxlaunch/client.m")
server_osxlaunch = Compile(launcher_settings, "src/osxlaunch/server.m")
end

Expand All @@ -431,10 +354,6 @@ function build(settings)
tools[i] = Link(settings, toolname, Compile(settings, v), engine, zlib, pnglite, md5)
end

-- build client, server, version server and master server
client_exe = Link(client_settings, "xPanic-Editor", game_shared, game_client, engine, client, game_editor, zlib,
pnglite, wavpack, client_link_other, client_osxlaunch, jsonparser, libwebsockets, md5, client_notification)

server_exe = Link(server_settings, "xPanic-Server", engine, server, game_shared, game_server, zlib,
server_link_other, libwebsockets, md5, icu_depends, teeothers, jsonparser)

Expand All @@ -450,13 +369,12 @@ function build(settings)
twping_exe = Link(server_settings, "twping", twping, engine, zlib, md5)

-- make targets
c = PseudoTarget("client" .. "_" .. settings.config_name, client_exe, client_depends)
if string.find(settings.config_name, "sql") then
s = PseudoTarget("server" .. "_" .. settings.config_name, server_exe, serverlaunch, server_sql_depends)
else
s = PseudoTarget("server" .. "_" .. settings.config_name, server_exe, serverlaunch)
end
g = PseudoTarget("game" .. "_" .. settings.config_name, client_exe, server_exe)
g = PseudoTarget("game" .. "_" .. settings.config_name, server_exe)

v = PseudoTarget("versionserver" .. "_" .. settings.config_name, versionserver_exe)
m = PseudoTarget("masterserver" .. "_" .. settings.config_name, masterserver_exe)
Expand Down Expand Up @@ -610,8 +528,6 @@ if platform == "macosx" then
PseudoTarget("debug", ppc_d, x86_d)
PseudoTarget("server_release", "server_release_ppc", "server_release_x86")
PseudoTarget("server_debug", "server_debug_ppc", "server_debug_x86")
PseudoTarget("client_release", "client_release_ppc", "client_release_x86")
PseudoTarget("client_debug", "client_debug_ppc", "client_debug_x86")
PseudoTarget("sql_release", sql_ppc_r, sql_x86_r)
PseudoTarget("sql_debug", sql_ppc_d, sql_x86_d)
PseudoTarget("server_sql_release", "server_sql_release_ppc", "server_sql_release_x86")
Expand All @@ -621,8 +537,6 @@ if platform == "macosx" then
PseudoTarget("debug", ppc_d, x86_d, x86_64_d)
PseudoTarget("server_release", "server_release_ppc", "server_release_x86", "server_release_x86_64")
PseudoTarget("server_debug", "server_debug_ppc", "server_debug_x86", "server_debug_x86_64")
PseudoTarget("client_release", "client_release_ppc", "client_release_x86", "client_release_x86_64")
PseudoTarget("client_debug", "client_debug_ppc", "client_debug_x86", "client_debug_x86_64")
PseudoTarget("sql_release", sql_ppc_r, sql_x86_r, sql_x86_64_r)
PseudoTarget("sql_debug", sql_ppc_d, sql_x86_d, sql_x86_64_d)
PseudoTarget("server_sql_release", "server_sql_release_ppc", "server_sql_release_x86",
Expand All @@ -633,8 +547,6 @@ if platform == "macosx" then
PseudoTarget("debug", ppc_d)
PseudoTarget("server_release", "server_release_ppc")
PseudoTarget("server_debug", "server_debug_ppc")
PseudoTarget("client_release", "client_release_ppc")
PseudoTarget("client_debug", "client_debug_ppc")
PseudoTarget("sql_release", sql_ppc_r)
PseudoTarget("sql_debug", sql_ppc_d)
PseudoTarget("server_sql_release", "server_sql_release_ppc")
Expand All @@ -646,8 +558,6 @@ if platform == "macosx" then
PseudoTarget("debug", x86_d)
PseudoTarget("server_release", "server_release_x86")
PseudoTarget("server_debug", "server_debug_x86")
PseudoTarget("client_release", "client_release_x86")
PseudoTarget("client_debug", "client_debug_x86")
PseudoTarget("sql_release", sql_x86_r)
PseudoTarget("sql_debug", sql_x86_d)
PseudoTarget("server_sql_release", "server_sql_release_x86")
Expand All @@ -657,8 +567,6 @@ if platform == "macosx" then
PseudoTarget("debug", x86_d, x86_64_d)
PseudoTarget("server_release", "server_release_x86", "server_release_x86_64")
PseudoTarget("server_debug", "server_debug_x86", "server_debug_x86_64")
PseudoTarget("client_release", "client_release_x86", "client_release_x86_64")
PseudoTarget("client_debug", "client_debug_x86", "client_debug_x86_64")
PseudoTarget("sql_release", sql_x86_r, sql_x86_64_r)
PseudoTarget("sql_debug", sql_x86_d, sql_x86_64_d)
PseudoTarget("server_sql_release", "server_sql_release_x86", "server_sql_release_x86_64")
Expand Down
Loading

0 comments on commit 95be575

Please sign in to comment.