From c049defe9d9bfc2020c3775ae5ab3df8d6ddb2d0 Mon Sep 17 00:00:00 2001 From: Pao Date: Thu, 12 Jan 2023 15:47:52 +0100 Subject: [PATCH] more tests for MP compat --- media/lua/client/TOC_Client.lua | 6 +++--- media/lua/client/TOC_UI.lua | 3 ++- media/lua/server/TOC_MP_server.lua | 5 ++++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/media/lua/client/TOC_Client.lua b/media/lua/client/TOC_Client.lua index b72f43c..9be70ef 100644 --- a/media/lua/client/TOC_Client.lua +++ b/media/lua/client/TOC_Client.lua @@ -12,10 +12,10 @@ local function OnTocServerCommand(module, command, args) local toc_data = patient:getModData().TOC - + -- todo maybe we cant send a table like this. Let's try something easier --local moneyAmount = playerTwo:getInventory():getCountTypeRecurse("Money") - patient:Say("Giving info") - sendClientCommand(patient, "TOC", "SendPlayerData", {surgeon_id, toc_data}) + print("Giving info") + sendClientCommand(patient, "TOC", "SendPlayerData", {surgeon_id, 69}) elseif command == 'SendTocData' then print("Sending TOC data") diff --git a/media/lua/client/TOC_UI.lua b/media/lua/client/TOC_UI.lua index 793e9e3..52c21aa 100644 --- a/media/lua/client/TOC_UI.lua +++ b/media/lua/client/TOC_UI.lua @@ -632,10 +632,11 @@ function ISNewHealthPanel.onClick_TOC(button) -- button.character is patient -- button.otherPlayer is surgeon - sendClientCommand(button.character, "TOC", "GetPlayerData", {button.otherPlayer:getOnlineID(), button.character:getOnlineID()}) -- sends 0 & 4 as arguments + sendClientCommand(button.otherPlayer, "TOC", "GetPlayerData", {button.otherPlayer:getOnlineID(), button.character:getOnlineID()}) -- sends 0 & 4 as arguments if MP_other_player_toc_data then print("It works") + print(MP_other_player_toc_data) else print("Nopepppp") end diff --git a/media/lua/server/TOC_MP_server.lua b/media/lua/server/TOC_MP_server.lua index b006105..3d7be0d 100644 --- a/media/lua/server/TOC_MP_server.lua +++ b/media/lua/server/TOC_MP_server.lua @@ -1,4 +1,7 @@ --- A rly big thx to Fenris_Wolf and Chuck to help me with that. Love you guy +if isClient() then return end + + ---Server side local Commands = {} @@ -27,7 +30,7 @@ local function OnTocClientCommand(module, command, player, args) local playerOneID = args[1] sendServerCommand(playerTwo, "TOC", "GivePlayerData", {playerOneID}) elseif command == 'SendPlayerData' then - local playerOne = getPlayerByOnlineID(args[1]) + local playerOne = getPlayerByOnlineID(args[1]) local playerOneID = args[1] local toc_data = args[2] sendServerCommand(playerOne, "TOC", "SendTocData", {playerOneID, toc_data})