1
0
mirror of https://github.com/Oarcinae/FactorioScenarioMultiplayerSpawn.git synced 2025-01-18 02:58:37 +02:00

Fixing shared player slots being taken up if player leaves within time limit. Added welcome msg insert msg here msg.

This commit is contained in:
Oarcinae 2016-12-14 16:00:00 -05:00
parent acbffca830
commit 98816a10b8
2 changed files with 15 additions and 2 deletions

View File

@ -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."

View File

@ -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