From 6d623dec288c3dc7de82ef91ed1fb28c98028c76 Mon Sep 17 00:00:00 2001 From: wan-may Date: Tue, 19 Sep 2023 02:48:14 -0300 Subject: [PATCH] clear submodules --- .gitmodules | 9 --------- src/client.bat | 2 ++ src/metaserver.bat | 2 ++ src/metaserver/getip.lua | 4 +--- src/metaserver/main.lua | 4 ++-- src/server.bat | 2 ++ src/shared/metaserver.lua | 3 +-- 7 files changed, 10 insertions(+), 16 deletions(-) delete mode 100644 .gitmodules create mode 100644 src/client.bat create mode 100644 src/metaserver.bat create mode 100644 src/server.bat diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 072af42..0000000 --- a/.gitmodules +++ /dev/null @@ -1,9 +0,0 @@ -[submodule "lib/love-gltf"] - path = lib/love-gltf - url = https://gitlab.com/Alloyed/love-gltf.git -[submodule "lib/luasocket"] - path = lib/luasocket - url = https://github.com/lunarmodules/luasocket -[submodule "lib/lua54"] - path = lib/lua54 - url = https://github.com/walterschell/Lua.git diff --git a/src/client.bat b/src/client.bat new file mode 100644 index 0000000..9870c06 --- /dev/null +++ b/src/client.bat @@ -0,0 +1,2 @@ +D:/dev/love/love.exe "./client/" +pause \ No newline at end of file diff --git a/src/metaserver.bat b/src/metaserver.bat new file mode 100644 index 0000000..87101ad --- /dev/null +++ b/src/metaserver.bat @@ -0,0 +1,2 @@ +D:/dev/love/love.exe "./metaserver/" +pause \ No newline at end of file diff --git a/src/metaserver/getip.lua b/src/metaserver/getip.lua index c3115d5..805bc68 100644 --- a/src/metaserver/getip.lua +++ b/src/metaserver/getip.lua @@ -1,3 +1 @@ -local http = assert( require 'socket.http' ) -print( "Retrieving IP: " ) -return assert( http.request 'https://api.ipify.org' ) \ No newline at end of file +assert( assert( require 'socket.http' ).request 'https://api.ipify.org' ) == '142.162.167.92' \ No newline at end of file diff --git a/src/metaserver/main.lua b/src/metaserver/main.lua index 0f24f75..0c2e4ef 100644 --- a/src/metaserver/main.lua +++ b/src/metaserver/main.lua @@ -6,7 +6,7 @@ local socket = assert( require 'socket' ) local packet = assert( shared.packet ) local udp = assert( socket.udp() ) udp:settimeout(0) -assert( udp:setsockname( shared.metaserver.ip, shared.metaserver.port ) ) +assert( udp:setsockname( socket.dns.toip(socket.dns.gethostname()), shared.metaserver.port )) --Servers broadcast their information here. --The metaserver builds a list of available servers. ( available meaning, "broadcasted in last ten heartbeats" ) @@ -83,7 +83,7 @@ local function prune( t ) end end -print( "Starting Metaserver", socket.gettime() ) +print( "Starting Metaserver", os.time(), udp:getsockname() ) function love.update() read( udp:receivefrom() ) prune( socket.gettime() ) diff --git a/src/server.bat b/src/server.bat new file mode 100644 index 0000000..3303c48 --- /dev/null +++ b/src/server.bat @@ -0,0 +1,2 @@ +D:/dev/love/love.exe "./server/" +pause \ No newline at end of file diff --git a/src/shared/metaserver.lua b/src/shared/metaserver.lua index 779a2fb..8daecac 100644 --- a/src/shared/metaserver.lua +++ b/src/shared/metaserver.lua @@ -1,2 +1 @@ -local socket = assert( require 'socket' ) -return { ip = socket.dns.toip(socket.dns.gethostname()), port = 42069 } \ No newline at end of file +return { ip = '142.162.167.92', port = 42069 } \ No newline at end of file