From 98816a10b895cd281794f123d45771c85c3cec9b Mon Sep 17 00:00:00 2001 From: Oarcinae Date: Wed, 14 Dec 2016 16:00:00 -0500 Subject: [PATCH] Fixing shared player slots being taken up if player leaves within time limit. Added welcome msg insert msg here msg. --- config.lua | 5 +++-- separate_spawns.lua | 12 ++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/config.lua b/config.lua index d27a7a2..d0f9dba 100644 --- a/config.lua +++ b/config.lua @@ -5,7 +5,8 @@ -- Messages -------------------------------------------------------------------------------- -WELCOME_MSG = "Welcome to Oarc's official server! Follow @_Oarc_ for server updates." +WELCOME_MSG = "[INSERT SERVER OWNER MSG HERE!]" +-- WELCOME_MSG = "Welcome to Oarc's official server! Follow @_Oarc_ for server updates." GAME_MODE_MSG = "In the current game mode, a satellite must be launched from an existing far away rocket silo to win!" -- GAME_MODE_MSG = "The current game mode is just basic vanilla!" MODULES_ENABLED = "Mods Enabled: Separate Spawns, RSO, Gravestone Chests, Long-Reach" @@ -25,7 +26,7 @@ WELCOME_MSG5 = "Please wait for 10-20 seconds when you select your first spawn." WELCOME_MSG6 = "Contact: SteamID:Oarc | Twitter:@_Oarc_ | oarcinae@gmail.com" -SPAWN_MSG1 = "Current Spawn Mode: HARDCORE WILDERNESS (Still in BETA)" +SPAWN_MSG1 = "Current Spawn Mode: HARDCORE WILDERNESS (Always in BETA)" SPAWN_MSG2 = "In this mode, there is no default spawn. Everyone starts in the wild!" SPAWN_MSG3 = "Resources are spread out far apart but are quite rich." diff --git a/separate_spawns.lua b/separate_spawns.lua index 7bb0521..85fa7cb 100644 --- a/separate_spawns.lua +++ b/separate_spawns.lua @@ -133,6 +133,8 @@ function FindUnusedSpawns(event) local player = game.players[event.player_index] if (player.online_time < MIN_ONLINE_TIME) then + -- TODO dump items into a chest. + -- Clear out global variables for that player??? if (global.playerSpawns[player.name] ~= nil) then global.playerSpawns[player.name] = nil @@ -155,6 +157,16 @@ function FindUnusedSpawns(event) global.playerCooldowns[player.name] = nil end + -- Remove from shared spawn player slots (need to search all) + for _,sharedSpawn in pairs(global.sharedSpawns) do + for key,playerName in pairs(sharedSpawn.players) do + if (player.name == playerName) then + sharedSpawn.players[key] = nil; + end + end + end + + -- Remove the character completely game.remove_offline_players({player}) end