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:
parent
f713439499
commit
9fcef7d652
@ -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
7
server_api.lua
Normal 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
|
Loading…
Reference in New Issue
Block a user