public bool GetUserByTokenIDSecure(string tokenID, int connectionID, out ClientInfo client, out string detailMessage)
{
lock (lockTokenObject)
{
if (!TokenClients.TryGetValue(tokenID, out client))
{
detailMessage = "There is no User with TokenID: " + tokenID;
Debug.LogWarning(detailMessage);
return false;
}
}
ClientInfo clientSecure;
lock (lockConnectedObject)
{
if (!ConnectedClients.TryGetValue(connectionID, out clientSecure))
{
detailMessage = "No Client Connected from: " + client.ConnectionID;
Debug.LogWarning(detailMessage);
return false;
}
}
if (!clientSecure.UserID.Equals(client.UserID))
{
detailMessage = "Client Connected from: " + client.ConnectionID+" is different from TokenID: " + tokenID;
Debug.LogWarning(detailMessage);
return false;
}
detailMessage = "Success";
return true;
}