private string getPlayIDByWSProxy(IWebSocketConnection proxy) { if (proxy != null) { foreach (KeyValuePair <string, IPlayer> entry in this.PlayersProxy) { if (entry.Value is PlayerWSImpl && proxy.Equals(((PlayerWSImpl)entry.Value).Socket)) { return((string)entry.Key); } } } return(""); }