Skip to content

Commit

Permalink
Add InformationServer test script
Browse files Browse the repository at this point in the history
  • Loading branch information
ddavness committed Aug 29, 2019
1 parent 82fced5 commit 4e7b489
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Tests/InformationServer.server.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
local API = require(game.ServerScriptService.Trello.Main)
local session = game:GetService("HttpService"):GenerateGUID()

local RaceBoard = API:GetBoardByName("Information Server | AUTOMATED")

function addPlayer (Host,SessionID)
local SessionList = API.new("List", tostring(SessionID), RaceBoard)
print(SessionList:GetName())
SessionList:SetProperty("pos", "bottom")
local serverCard = API.new("Card","Server",SessionList)
local clientCard = API.new("Card", Host.UserId, SessionList)
clientCard:SetDesc(Host.Name)
return print("Added!!")
end

-- Check for players yet to come
game:GetService('Players').PlayerAdded:Connect(function(p)
addPlayer(p, session)
end)

-- Check for players that already arrived
for _,p in pairs(game:GetService('Players'):GetPlayers()) do
addPlayer(p, session)
end

0 comments on commit 4e7b489

Please sign in to comment.