3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-27 21:19:31 +01:00

NetworkCore: return the server in get_server if the arg was a server

This commit is contained in:
James Lu 2017-08-11 13:13:50 -07:00
parent 046fe0c385
commit 9113b34b46

View File

@ -472,6 +472,9 @@ class PyLinkNetworkCore(utils.DeprecatedAttributesObject, utils.CamelCaseToSnake
def get_server(self, numeric): def get_server(self, numeric):
"""Finds the SID of the server a user is on.""" """Finds the SID of the server a user is on."""
if numeric in self.servers: # We got a server already (lazy hack)
return numeric
userobj = self.users.get(numeric) userobj = self.users.get(numeric)
if userobj: if userobj:
return userobj.server return userobj.server