Ejemplo n.º 1
0
        public static void ConnectOtherGatewayServer(ClientBase client, int gatewayID, int clientID)
        {
            GatewayInfo info = CenterGlobal.GetFreeGateway(gatewayID);

            if (info != null)
            {
                ReConnectGatewayPacket pkg = new ReConnectGatewayPacket();

                pkg.ClientID = clientID;
                pkg.IP = info.IP;
                pkg.Port = info.Port;

                client.SendTcp(pkg);
            }
            else
            {
                //TODO: 通知客户端服务器繁忙

                log.Warn("所有网关服务器满载 请增开新的网关服务器");

                ClientMsgPacket pkg = new ClientMsgPacket();

                pkg.MsgFlag = MsgFlag.NoneGateway;

                //ServerBusiesPacket pkg = new ServerBusiesPacket();

                //pkg.ClientID = clientID;

                client.SendTcp(pkg);
            }
        }
Ejemplo n.º 2
0
        public static void ConnectOtherGatewayServer(ClientBase client, uint gatewayID, uint clientID)
        {
            GatewayInfo info = CenterGlobal.GetNormalGateway(gatewayID);

            if (info != null)
            {
                ReConnectGatewayPacket pkg = new ReConnectGatewayPacket();

                pkg.ClientID = clientID;
                pkg.IP = info.IP;
                pkg.Port = info.Port;

                client.SendTcp(pkg);
            }
            else
            {
                //TODO: 通知客户端服务器繁忙
                ServerBusiesPacket pkg = new ServerBusiesPacket();

                pkg.ClientID = clientID;

                client.SendTcp(pkg);
            }
        }