C1OSE
|
  |
| Joined: 29 May 2011 |
| Total Posts: 604 |
|
|
| 18 Sep 2016 09:08 PM |
Should be refreshing showing servers on a gui but its not? anyone know the issue?
script: local FrameDetails = script:WaitForChild("FrameDetails") local debounce = require(game.ReplicatedStorage.Abstract.Debounce)
game.ReplicatedStorage.RemoteEvents.GetServerList.OnClientEvent:connect(function(serverList) print("Server: "..tostring(serverList)) script.Parent.Parent.SFServerList:ClearAllChildren() local canvasSizeHeight = 0 for _, obj in pairs(serverList) do --[[print("serverList["..tostring(_).."] = "..tostring(obj)) for _2, obj2 in pairs(obj) do print("serverList["..tostring(_).."] ["..tostring(_2).."] = "..tostring(obj2)) end for _3, obj3 in pairs(obj[3]) do print("serverList["..tostring(_).."] [3] ["..tostring(_3).."] = "..tostring(obj3)) end]] local data = {} data.session = obj[1] data.players = obj[2] data.data = obj[3] local dataframe = script.FrameDetails:Clone() dataframe.TLTitle.Text = "Clue Session" --data.data.GameName dataframe.TLInfo.Text = data.players.." Players" --if (game.JobId~="") then dataframe.TBJoin.MouseButton1Click:connect(function() print("Joining "..tostring(data.session)) game.ReplicatedStorage:WaitForChild("RETPPlayer"):FireServer(game.ReplicatedStorage.Settings.GamePlaceId.Value, data.session, true) end) --end dataframe.Position = UDim2.new(0, 0, 0, (((_)-1)*40)+8) dataframe.Parent = script.Parent.Parent.SFServerList canvasSizeHeight = canvasSizeHeight+40 end script.Parent.Parent.SFServerList.CanvasSize = UDim2.new(0,0,0,canvasSizeHeight) end)
script.Parent.MouseButton1Click:connect(debounce(function() local event = game.ReplicatedStorage:WaitForChild("RemoteEvents"):WaitForChild("GetServerList") event:FireServer() end)) |
|
|
| Report Abuse |
|
|
litalela
|
  |
| Joined: 30 Mar 2010 |
| Total Posts: 6267 |
|
|
| 18 Sep 2016 09:11 PM |
learn to debug yourself
do some print debugging
|
|
|
| Report Abuse |
|
|
C1OSE
|
  |
| Joined: 29 May 2011 |
| Total Posts: 604 |
|
|
| 18 Sep 2016 09:14 PM |
also this is another script in serverscriptservice that also does it, and prints 0 servers when there is servers when you click refresh...
local serverListReturn = {} local event = game.ReplicatedStorage:WaitForChild("RemoteEvents"):WaitForChild("GetServerList")
event.OnServerEvent:connect(function(player) print("Servers: "..(#serverListReturn)) event:FireClient(player, serverListReturn) end) wait(0.5)
local lobby = require(266813685)
function update() local serverdetails = lobby.getServerList(game.ReplicatedStorage.Settings.GamePlaceId.Value, 1) --[[for _, obj in pairs(serverdetails) do print("serverdetails["..tostring(_).."] = "..tostring(obj)) end]] if(serverdetails["servers"]) then serverListReturn = serverdetails.servers else serverListReturn = {} end end
update()
while wait(10) do update() end
|
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 18 Sep 2016 09:48 PM |
print to see how far the script is getting. what is being returned?
|
|
|
| Report Abuse |
|
|
C1OSE
|
  |
| Joined: 29 May 2011 |
| Total Posts: 604 |
|
|
| 18 Sep 2016 09:50 PM |
goes all the way
but the issue is it says 0 severs when there is 1 server ( i tried with only 1 because i dont got that many ppl to test with lol )
|
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 18 Sep 2016 09:52 PM |
your problem is in the following code.
check to see why there is nothing being returned in the table
local lobby = require(266813685)
function update() local serverdetails = lobby.getServerList(game.ReplicatedStorage.Settings.GamePlaceId.Value, 1) --[[for _, obj in pairs(serverdetails) do print("serverdetails["..tostring(_).."] = "..tostring(obj)) end]] if(serverdetails["servers"]) then serverListReturn = serverdetails.servers else serverListReturn = {} end end
|
|
|
| Report Abuse |
|
|
C1OSE
|
  |
| Joined: 29 May 2011 |
| Total Posts: 604 |
|
| |
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 18 Sep 2016 09:54 PM |
what does this print?
local serverdetails = lobby.getServerList(game.ReplicatedStorage.Settings.GamePlaceId.Value, 1)
for i,v in next, serverdetails do print(i,v) end
|
|
|
| Report Abuse |
|
|
C1OSE
|
  |
| Joined: 29 May 2011 |
| Total Posts: 604 |
|
| |
|
C1OSE
|
  |
| Joined: 29 May 2011 |
| Total Posts: 604 |
|
|
| 18 Sep 2016 10:28 PM |
when you click refresh it says that but with a random table every time.
|
|
|
| Report Abuse |
|
|
|
| 18 Sep 2016 10:30 PM |
| It's not a random table, that's the address of the table in memory(I think) |
|
|
| Report Abuse |
|
|
C1OSE
|
  |
| Joined: 29 May 2011 |
| Total Posts: 604 |
|
| |
|
C1OSE
|
  |
| Joined: 29 May 2011 |
| Total Posts: 604 |
|
| |
|