public void Disconnect() { if (mNetwork != null) { mNetwork.Disconnect(); } mNetwork = null; }
public void ConnectServer(ServerType type, string address) { mServerType = type; switch (type) { case ServerType.Login: mNetwork = HttpNetwork.NewObject(address); break; case ServerType.Game: string[] svrIp = address.Split(':'); mNetwork = SocketNetwork.NewObject(svrIp[0], Convert.ToInt32(svrIp[1])); break; default: mServerType = ServerType.None; break; } }