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

New Files So get_online_players() work

This commit is contained in:
Toledini 2018-01-31 17:08:58 -05:00 committed by GitHub
parent f713439499
commit 9fcef7d652
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -23,6 +23,7 @@ require "tasklist"
require "autodeconstruct" require "autodeconstruct"
require "corpse_util" require "corpse_util"
require "reactor_meltdown" require "reactor_meltdown"
require "server_api"
local function player_joined(event) local function player_joined(event)
local player = game.players[event.player_index] local player = game.players[event.player_index]

7
server_api.lua Normal file
View File

@ -0,0 +1,7 @@
function get_online_players()
game.write_file("api-output", "", false,0) --delete
local online_players = game.connected_players
for _,p in pairs(online_players) do
game.write_file("api-output", p.name, true,0)
end
end