1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2024-12-14 10:13:13 +02:00

Merge pull request #148 from Valansch/dev_usergroups_autoupdate_cleanup

Dev usergroups autoupdate cleanup
This commit is contained in:
Valansch 2018-01-09 20:49:26 +01:00 committed by GitHub
commit 215d68c946
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 147 deletions

View File

@ -1,8 +1,6 @@
global.scenario = {} global.scenario = {}
global.spys = {"valansch", "air20"} global.spys = {"valansch", "air20"}
global.scenario.variables = {} global.scenario.variables = {}
global.scenario.variables.mods = require "locale.resources.mods"
global.scenario.variables.regulars = require "locale.resources.regulars"
global.scenario.variables.player_positions = {} global.scenario.variables.player_positions = {}
-- global.scenario.variables.player_walk_distances = {} -- global.scenario.variables.player_walk_distances = {}
global.scenario.variables.player_deaths = {} global.scenario.variables.player_deaths = {}

View File

@ -1,10 +0,0 @@
return
{
["dpoba"] = "",
["masjazz"] = "",
["-slug-"] = "",
["mbas"] = "",
["selen"] = "",
["sholvo"] = "",
["animal"] = "",
}

View File

@ -1,126 +0,0 @@
return
{
["helpower2"] = "",
["rorror"] = "",
["medival3"] = "",
["dpoba"] = "",
["settdigger"] = "",
["cheeselicker"] = "",
["cpaca0"] = "",
["utidi"] = "",
["jokerofthez"] = "",
["saltlands"] = "",
["maniah"] = "",
["cool"] = "",
["boail"] = "",
["hunter117x"] = "",
["tonytroll"] = "",
["highinfiberoptics"] = "",
["atoms"] = "",
["adlmr"] = "",
["rayijin"] = "",
["sephir"] = "",
["inator1192"] = "",
["tezwo"] = "",
["neumond"] = "",
["bhenoa"] = "",
["jbc363"] = "",
["kaig3n"] = "",
["factorioio"] = "",
["bawz"] = "",
["crazystephen"] = "",
["eithel"] = "",
["coyote101"] = "",
["jedifan"] = "",
["xsidd"] = "",
["maxthespunkymunk"] = "",
["tarpon907"] = "",
["bighamster"] = "",
["sir"] = "",
["arnietom"] = "",
["animal"] = "",
["banakeg"] = "",
["philip017"] = "",
["ninjrkillr"] = "",
["marckhardt"] = "",
["brainclot"] = "",
["blzz"] = "",
["watchinghawk"] = "",
["farcear"] = "",
["selen"] = "",
["trekie4747"] = "",
["gizan"] = "",
["slastraf"] = "",
["zacman0510"] = "",
["theorangeangle"] = "",
["williambellwisdo"] = "",
["extraxyz"] = "",
["markupolioncz"] = "",
["bjhunter"] = "",
["ztx"] = "",
["bigglesthepirate"] = "",
["g-h-o-s-t"] = "",
["wekkka"] = "",
["beelzemon"] = "",
["rododendro"] = "",
["mrkoss"] = "",
["koretego"] = "",
["cogito123"] = "",
["palulukan"] = "",
["radianraze"] = "",
["kostrahb"] = "",
["mafisch3"] = "",
["cydes"] = "",
["ccaspanello"] = "",
["wickvitaminc"] = "",
["newcott"] = "",
["craigrood"] = "",
["lillepallt"] = "",
["skykittena"] = "",
["rico2403"] = "",
["claude47"] = "",
["mrsjaakbraak"] = "",
["heretek"] = "",
["factorian12321"] = "",
["steponitnicejob"] = "",
["cchpucky"] = "",
["rulerofdabacon"] = "",
["tcp"] = "",
["marucan"] = "",
["twltriston"] = "",
["bemm"] = "",
["lordxleasy"] = "",
["judaires"] = "",
["flowild"] = "",
["aalexx"] = "",
["zila"] = "",
["pyroguy"] = "",
["tickterd"] = "",
["trevoqr"] = "",
["pietloke"] = "",
["bloodydevil"] = "",
["mike-_-"] = "",
["asddsa76"] = "",
["tomymy"] = "",
["geckozila"] = "",
["starlite"] = "",
["ducktaperules"] = "",
["tvardero"] = "",
["thethane"] = "",
["lejnel"] = "",
["griffinonetwo"] = "",
["stat0x00"] = "",
["gynox"] = "",
["miniman10000"] = "",
["aliiien0110"] = "",
["gespenstdermaschine"] = "",
["brathahn"] = "",
["leadhades27"] = "",
["sl"] = "",
["phountix"] = "",
["yago2003"] = "",
["saneman"] = "",
["mesohorknee"] = "",
["brl_chacal"] = "",
["spechok"] = "",
}

View File

@ -1,7 +1,7 @@
function update_group(position) function update_group(position)
local file = position .. ".lua" local file = position .. ".lua"
game.write_file(file, "{", false, 0) game.write_file(file, "{", false, 0)
local group = global.scenario.variables[position] local group = global[position]
local line = "" local line = ""
for player_name,_ in pairs(group) do for player_name,_ in pairs(group) do
line = string.format('["%s"] = "",\n', player_name) line = string.format('["%s"] = "",\n', player_name)
@ -16,11 +16,11 @@ function get_actor()
end end
function is_mod(player_name) function is_mod(player_name)
return global.scenario.variables.mods[player_name:lower()] return global.mods[player_name:lower()]
end end
function is_regular(player_name) function is_regular(player_name)
return global.scenario.variables.regulars[player_name:lower()] return global.regulars[player_name:lower()]
end end
function add_regular(player_name) function add_regular(player_name)
@ -29,7 +29,7 @@ function add_regular(player_name)
else else
if game.players[player_name] then if game.players[player_name] then
game.print(actor .. " promoted " .. player_name .. " to regular.") game.print(actor .. " promoted " .. player_name .. " to regular.")
global.scenario.variables.regulars[player_name:lower()] = "" global.regulars[player_name:lower()] = ""
update_group("regulars") update_group("regulars")
else else
player_print(player_name .. " does not exist.") player_print(player_name .. " does not exist.")
@ -43,7 +43,7 @@ function add_mod(player_name)
else else
if game.players[player_name] then if game.players[player_name] then
game.print(actor .. " promoted " .. player_name .. " to moderator.") game.print(actor .. " promoted " .. player_name .. " to moderator.")
global.scenario.variables.mods[player_name:lower()] = "" global.mods[player_name:lower()] = ""
update_group("mods") update_group("mods")
else else
player_print(player_name .. " does not exist.") player_print(player_name .. " does not exist.")
@ -54,25 +54,25 @@ end
function remove_regular(player_name) function remove_regular(player_name)
local actor = get_actor() local actor = get_actor()
if is_regular(player_name) then game.print(player_name .. " was demoted from regular by " .. actor .. ".") end if is_regular(player_name) then game.print(player_name .. " was demoted from regular by " .. actor .. ".") end
global.scenario.variables.regulars[player_name] = nil global.regulars[player_name] = nil
update_group("regulars") update_group("regulars")
end end
function remove_mod(player_name) function remove_mod(player_name)
local actor = get_actor() local actor = get_actor()
if is_mod(player_name) then game.print(player_name .. " was demoted from mod by " .. actor .. ".") end if is_mod(player_name) then game.print(player_name .. " was demoted from mod by " .. actor .. ".") end
global.scenario.variables.mods[player_name] = nil global.mods[player_name] = nil
update_group("mods") update_group("mods")
end end
function print_regulars() function print_regulars()
for k,_ in pairs(global.scenario.variables.regulars) do for k,_ in pairs(global.regulars) do
player_print(k) player_print(k)
end end
end end
function print_mods() function print_mods()
for k,_ in pairs(global.scenario.variables.mods) do for k,_ in pairs(global.mods) do
player_print(k) player_print(k)
end end
end end