Ejemplo n.º 1
0
    /// <summary>
    /// 断线重连
    /// </summary>
    /// <param name="bytes"></param>
    private void ReConnectHandler(byte[] bytes)
    {
        ReConnectS2C reconnectS2C = NetMgr.Instance.DeSerializes <ReConnectS2C>(bytes);

        this.HallInfo.roomCode        = reconnectS2C.roomCode;
        this.HallInfo.battleSeverIP   = reconnectS2C.roomIp;
        this.HallInfo.battleSeverPort = reconnectS2C.roomPort;
        NSocket.UpdateRoomID(reconnectS2C.roomCode == "" ? 0 : int.Parse(reconnectS2C.roomCode));
        if (reconnectS2C.roomId > 0)
        {
            this.BattleServerConnect(NotificationConstant.MEDI_HALL_CUTJOINSCENE);
        }
        else
        {
            SendNotification(NotificationConstant.MEDI_LOGIN_SWITCHHALLSCENE);
        }
    }
Ejemplo n.º 2
0
    /// <summary>
    /// 断线重连
    /// </summary>
    /// <param name="bytes"></param>
    private void ReConnectHandler(byte[] bytes)
    {
        ReConnectS2C reconnectS2C = NetMgr.Instance.DeSerializes <ReConnectS2C>(bytes);

        this.HallInfo.RoomCode        = reconnectS2C.roomCode.ToString();
        this.HallInfo.BattleSeverIP   = reconnectS2C.roomIp;
        this.HallInfo.BattleSeverPort = reconnectS2C.roomPort;
        NSocket.RoomId = HallInfo.RoomCode == "" ? 0 : int.Parse(HallInfo.RoomCode);
        if (reconnectS2C.roomId > 0)
        {
            this.BattleServerConnect(NotificationConstant.MEDI_HALL_CUTJOINSCENE);
        }
        else
        {
            if (Application.platform == RuntimePlatform.Android)
            {
                SendNotification(NotificationConstant.MEDI_LOGIN_SWITCHHALLSCENE);
            }
            else
            {
                SendNotification(NotificationConstant.MEDI_LOGIN_SWITCHHALLSCENE);
            }
        }
    }