GoreMotel Posted July 24, 2015 Share Posted July 24, 2015 Hello! I am trying to fetch the steam ids of connected players using a mod. It works fine on a listen server hosted from my PC, but it does not work on a dedicated server, where I get empty strings are results. Here is the relevant code: local function SteamID() local clients = GLOBAL.TheNet:GetClientTable() for i,j in pairs(clients) do if (j and j["playerage"] > 0) then clientsno = clientsno + 1 print(j["steamid"]) endendAddSimPostInit(function() periodic = scheduler:ExecutePeriodic(15, SteamID) end)What am I doing wrong? Thanks for any hints! Link to comment https://forums.kleientertainment.com/forums/topic/56450-steamid-empty-on-dedicated-server/ Share on other sites More sharing options...
DarkXero Posted July 24, 2015 Share Posted July 24, 2015 Nothing wrong here.The net client table for a dedicated server has all steamids empty, for some reason. Maybe because everything is handled internally? Link to comment https://forums.kleientertainment.com/forums/topic/56450-steamid-empty-on-dedicated-server/#findComment-657164 Share on other sites More sharing options...
Developer V2C Posted July 24, 2015 Developer Share Posted July 24, 2015 This is on our end, due to an assumption that GetClientTable would only be used for FE, which did not matter on dedicated servers.For the next update, I'll change it to include all available data even on dedicated servers. One thing to note is that in many cases, you would want to exclude or filter out the dedicated host (because the dedicated host shares ID's with the account that generated the server token). Here is an example:-- Return a listing of currently active playersfunction c_listplayers() local isdedicated = TheNet:GetServerIsDedicated() local index = 1 for i, v in ipairs(TheNet:GetClientTable()) do if not isdedicated or v.performance == nil then print(string.format("%s[%d] %s <%s>", v.admin and "*" or " ", index, v.name, v.prefab)) index = index + 1 end endend Link to comment https://forums.kleientertainment.com/forums/topic/56450-steamid-empty-on-dedicated-server/#findComment-657207 Share on other sites More sharing options...
GoreMotel Posted July 25, 2015 Author Share Posted July 25, 2015 Thanks a bunch! Link to comment https://forums.kleientertainment.com/forums/topic/56450-steamid-empty-on-dedicated-server/#findComment-657320 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now