From c9de2a3ce6e759eaf6888cc2c4bbb378e8efeec3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Gr=C3=BCttemeier?= Date: Fri, 1 May 2020 18:18:30 +0200 Subject: [PATCH 1/2] Small bugfix - Fixed error when inserting the server into the database --- addon.json | 3 ++- lua/msync/server/sv_mysql.lua | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/addon.json b/addon.json index b1ebc0d..3002f9a 100644 --- a/addon.json +++ b/addon.json @@ -12,6 +12,7 @@ "README.md", "*.sql", ".git/*", - ".git" + ".git*", + ".vscode*" ] } \ No newline at end of file diff --git a/lua/msync/server/sv_mysql.lua b/lua/msync/server/sv_mysql.lua index d1a0bb4..5b24f78 100644 --- a/lua/msync/server/sv_mysql.lua +++ b/lua/msync/server/sv_mysql.lua @@ -153,14 +153,14 @@ function MSync.mysql.saveServer() ]] ) local hostname = GetHostName() - local ip, port = string.Split(game.GetIPAddress(), ":") + local gameAddress = string.Split(game.GetIPAddress(), ":") if string.len(hostname) > 75 then hostname = string.sub( hostname, 1, 75 ) end addServer:setString(1, hostname) - addServer:setString(2, ip) - addServer:setString(3, port) + addServer:setString(2, gameAddress[1]) + addServer:setString(3, gameAddress[2]) addServer:setString(4, MSync.settings.data.serverGroup) function addServer.onSuccess() From fbd7988273925c59b0a800979228a630a077adf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Gr=C3=BCttemeier?= Date: Fri, 1 May 2020 18:30:16 +0200 Subject: [PATCH 2/2] Ups, Bugfix addition - Forgot to update the database structure to the new IP format --- lua/msync/server/sv_mysql.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/msync/server/sv_mysql.lua b/lua/msync/server/sv_mysql.lua index 5b24f78..9f3c959 100644 --- a/lua/msync/server/sv_mysql.lua +++ b/lua/msync/server/sv_mysql.lua @@ -40,7 +40,7 @@ function MSync.mysql.initialize() `p_id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, `server_name` VARCHAR(75) NOT NULL, `options` VARCHAR(100) NOT NULL DEFAULT '[]', - `ip` INT NOT NULL, + `ip` VARCHAR(15) NOT NULL, `port` VARCHAR(5) NOT NULL, `server_group` INT UNSIGNED NOT NULL, FOREIGN KEY (server_group) REFERENCES tbl_server_grp(p_group_id),