//TODO: Add code here #endregion #region Register Realm Events private void RegisterRealmProxyEvents(RealmProxy proxy) { proxy.OnJoinGameRequest += this.OnJoinGameRequest; proxy.OnJoinGameResponse += this.OnJoinGameResponse; //TODO: Add the rest of the events }
public static RealmProxy FindRealmProxyForGame(string characterName) { if (string.IsNullOrEmpty(characterName)) { return(RealmProxyJoiningGame); } RealmProxy result = null; foreach (RealmProxy proxy in RealmProxies) { if (proxy.CharacterName == characterName) { result = proxy; break; } } return(result); }
private void OnAcceptTcpClient(IAsyncResult ar) { TcpClient tcpClient = tcpListener.EndAcceptTcpClient(ar); BaseProxy proxyClient = null; try { tcpListener.BeginAcceptTcpClient(new AsyncCallback(OnAcceptTcpClient), null); } catch (Exception) { tcpListener = null; throw; } switch (proxyType) { case ProxyType.Bnet: proxyClient = new BnetProxy(tcpClient); proxyClient.ProxyServer = this; BnetProxies.Add((BnetProxy)proxyClient); break; case ProxyType.Realm: proxyClient = new RealmProxy(tcpClient); RealmProxies.Add((RealmProxy)proxyClient); break; case ProxyType.Game: proxyClient = new GameProxy(tcpClient); GameProxies.Add((GameProxy)proxyClient); break; } this.ClientConnected(proxyClient, new EventArgs()); }
private void OnAcceptTcpClient(IAsyncResult ar) { TcpClient tcpClient = tcpListener.EndAcceptTcpClient(ar); BaseProxy proxyClient = null; try { tcpListener.BeginAcceptTcpClient(new AsyncCallback(OnAcceptTcpClient), null); } catch (Exception) { tcpListener = null; throw; } switch (proxyType) { case ProxyType.Bnet : proxyClient = new BnetProxy(tcpClient); proxyClient.ProxyServer = this; BnetProxies.Add((BnetProxy)proxyClient); break; case ProxyType.Realm : proxyClient = new RealmProxy(tcpClient); RealmProxies.Add((RealmProxy)proxyClient); break; case ProxyType.Game : proxyClient = new GameProxy(tcpClient); GameProxies.Add((GameProxy)proxyClient); break; } this.ClientConnected(proxyClient, new EventArgs()); }