コード例 #1
0
    /// <summary>
    /// 读取字节流(完整版)
    /// </summary>
    protected override void toReadBytesFull(BytesReadStream stream)
    {
        base.toReadBytesFull(stream);

        stream.startReadObj();

        BaseData infoT = stream.readDataFullNotNull();

        if (infoT != null)
        {
            if (infoT is ClientLoginServerInfoData)
            {
                this.info = (ClientLoginServerInfoData)infoT;
            }
            else
            {
                this.info = new ClientLoginServerInfoData();
                if (!(infoT.GetType().IsAssignableFrom(typeof(ClientLoginServerInfoData))))
                {
                    stream.throwTypeReadError(typeof(ClientLoginServerInfoData), infoT.GetType());
                }
                this.info.shadowCopy(infoT);
            }
        }
        else
        {
            this.info = null;
        }

        stream.endReadObj();
    }
コード例 #2
0
    /// <summary>
    /// 读取字节流(简版)
    /// </summary>
    protected override void toReadBytesSimple(BytesReadStream stream)
    {
        this.loginInfo = (ClientLoginServerInfoData)stream.readDataSimpleNotNull();

        if (stream.readBoolean())
        {
            this.version = (ClientVersionData)stream.createData(ClientVersionData.dataID);
            this.version.readBytesSimple(stream);
        }
        else
        {
            this.version = null;
        }

        if (stream.readBoolean())
        {
            int areasLen = stream.readLen();
            if (this.areas != null)
            {
                this.areas.clear();
                this.areas.ensureCapacity(areasLen);
            }
            else
            {
                this.areas = new IntObjectMap <AreaClientData>(areasLen);
            }

            IntObjectMap <AreaClientData> areasT = this.areas;
            for (int areasI = areasLen - 1; areasI >= 0; --areasI)
            {
                AreaClientData areasV;
                if (stream.readBoolean())
                {
                    areasV = (AreaClientData)stream.readDataSimpleNotNull();
                }
                else
                {
                    areasV = null;
                }

                areasT.put(areasV.areaID, areasV);
            }
        }
        else
        {
            this.areas = null;
        }

        this.lastAreaID = stream.readInt();

        if (stream.readBoolean())
        {
            this.gameInfo = (ClientLoginServerInfoData)stream.readDataSimpleNotNull();
        }
        else
        {
            this.gameInfo = null;
        }
    }
コード例 #3
0
 /// <summary>
 /// 回池
 /// </summary>
 protected override void toRelease(DataPool pool)
 {
     this.loginInfo  = null;
     this.version    = null;
     this.areas      = null;
     this.lastAreaID = 0;
     this.gameInfo   = null;
 }
コード例 #4
0
ファイル: GameMainControl.cs プロジェクト: shineTeam7/home3
    //scene

    /** 切换scene服 */
    public void onSwitchScene(ClientLoginServerInfoData info)
    {
        //重新赋值
        _sceneInfo        = info;
        _isSwitchingScene = true;

        GameC.sceneServer.close();
        GameC.sceneServer.connect(info.host, info.port);
    }
コード例 #5
0
ファイル: GameMainControl.cs プロジェクト: shineTeam7/home3
    /** 切换game服 */
    public void onSwitchGame(ClientLoginServerInfoData info)
    {
        //重新赋值
        _gameInfo    = info;
        _isSwitching = true;

        GameC.server.close();

        GameC.server.connect(_gameInfo.host, _gameInfo.port);
    }
コード例 #6
0
    /// <summary>
    /// 复制(潜拷贝)
    /// </summary>
    protected override void toShadowCopy(BaseData data)
    {
        if (!(data is ClientLoginServerInfoData))
        {
            return;
        }

        ClientLoginServerInfoData mData = (ClientLoginServerInfoData)data;

        this.token = mData.token;
        this.host  = mData.host;
        this.port  = mData.port;
    }
コード例 #7
0
    /// <summary>
    /// 复制(潜拷贝)
    /// </summary>
    protected override void toShadowCopy(BaseData data)
    {
        if (!(data is ClientLoginResultData))
        {
            return;
        }

        ClientLoginResultData mData = (ClientLoginResultData)data;

        this.loginInfo  = mData.loginInfo;
        this.version    = mData.version;
        this.areas      = mData.areas;
        this.lastAreaID = mData.lastAreaID;
        this.gameInfo   = mData.gameInfo;
    }
コード例 #8
0
ファイル: GameMainControl.cs プロジェクト: shineTeam7/home3
    public virtual void onLoginHttpSuccess(ClientLoginResultData data)
    {
        _httpLoginSended.unlock();

        //已不在登录中
        if (!isHttpLogining())
        {
            return;
        }

        //分区分服的
        if (CommonSetting.isAreaSplit())
        {
            LocalSetting.setLoginURL(data.loginInfo.host, data.loginInfo.port);

            _loginToken = data.loginInfo.token;
            serverList  = new SList <AreaClientData>(data.areas.size());

            foreach (int k in data.areas.getSortedKeyList())
            {
                serverList.add(data.areas.get(k));
            }

            this.lastAreaID = data.lastAreaID;
        }
        else
        {
            _gameInfo = data.gameInfo;
        }

        //未等待中
        if (!_waitHotfixForHttpLogin.isLocking())
        {
            //比较更新
            if (GameC.mainLogin.clientHotfix(data.version))
            {
                loginHttpNext();
            }
            else
            {
                _waitHotfixForHttpLogin.lockOn();
            }
        }
    }
コード例 #9
0
    /// <summary>
    /// 是否数据一致
    /// </summary>
    protected override bool toDataEquals(BaseData data)
    {
        ClientLoginServerInfoData mData = (ClientLoginServerInfoData)data;

        if (this.token != mData.token)
        {
            return(false);
        }

        if (this.host != mData.host)
        {
            return(false);
        }

        if (this.port != mData.port)
        {
            return(false);
        }

        return(true);
    }
コード例 #10
0
 /// <summary>
 /// 初始化初值
 /// </summary>
 public override void initDefault()
 {
     this.loginInfo = new ClientLoginServerInfoData();
     this.loginInfo.initDefault();
 }
コード例 #11
0
    /// <summary>
    /// 读取字节流(完整版)
    /// </summary>
    protected override void toReadBytesFull(BytesReadStream stream)
    {
        stream.startReadObj();

        BaseData loginInfoT = stream.readDataFullNotNull();

        if (loginInfoT != null)
        {
            if (loginInfoT is ClientLoginServerInfoData)
            {
                this.loginInfo = (ClientLoginServerInfoData)loginInfoT;
            }
            else
            {
                this.loginInfo = new ClientLoginServerInfoData();
                if (!(loginInfoT.GetType().IsAssignableFrom(typeof(ClientLoginServerInfoData))))
                {
                    stream.throwTypeReadError(typeof(ClientLoginServerInfoData), loginInfoT.GetType());
                }
                this.loginInfo.shadowCopy(loginInfoT);
            }
        }
        else
        {
            this.loginInfo = null;
        }

        if (stream.readBoolean())
        {
            this.version = (ClientVersionData)stream.createData(ClientVersionData.dataID);
            this.version.readBytesFull(stream);
        }
        else
        {
            this.version = null;
        }

        if (stream.readBoolean())
        {
            int areasLen = stream.readLen();
            if (this.areas != null)
            {
                this.areas.clear();
                this.areas.ensureCapacity(areasLen);
            }
            else
            {
                this.areas = new IntObjectMap <AreaClientData>(areasLen);
            }

            IntObjectMap <AreaClientData> areasT = this.areas;
            for (int areasI = areasLen - 1; areasI >= 0; --areasI)
            {
                AreaClientData areasV;
                if (stream.readBoolean())
                {
                    BaseData areasVT = stream.readDataFullNotNull();
                    if (areasVT != null)
                    {
                        if (areasVT is AreaClientData)
                        {
                            areasV = (AreaClientData)areasVT;
                        }
                        else
                        {
                            areasV = new AreaClientData();
                            if (!(areasVT.GetType().IsAssignableFrom(typeof(AreaClientData))))
                            {
                                stream.throwTypeReadError(typeof(AreaClientData), areasVT.GetType());
                            }
                            areasV.shadowCopy(areasVT);
                        }
                    }
                    else
                    {
                        areasV = null;
                    }
                }
                else
                {
                    areasV = null;
                }

                areasT.put(areasV.areaID, areasV);
            }
        }
        else
        {
            this.areas = null;
        }

        this.lastAreaID = stream.readInt();

        if (stream.readBoolean())
        {
            BaseData gameInfoT = stream.readDataFullNotNull();
            if (gameInfoT != null)
            {
                if (gameInfoT is ClientLoginServerInfoData)
                {
                    this.gameInfo = (ClientLoginServerInfoData)gameInfoT;
                }
                else
                {
                    this.gameInfo = new ClientLoginServerInfoData();
                    if (!(gameInfoT.GetType().IsAssignableFrom(typeof(ClientLoginServerInfoData))))
                    {
                        stream.throwTypeReadError(typeof(ClientLoginServerInfoData), gameInfoT.GetType());
                    }
                    this.gameInfo.shadowCopy(gameInfoT);
                }
            }
            else
            {
                this.gameInfo = null;
            }
        }
        else
        {
            this.gameInfo = null;
        }

        stream.endReadObj();
    }
コード例 #12
0
    /// <summary>
    /// 复制(深拷贝)
    /// </summary>
    protected override void toCopy(BaseData data)
    {
        if (!(data is ClientLoginResultData))
        {
            return;
        }

        ClientLoginResultData mData = (ClientLoginResultData)data;

        if (mData.loginInfo != null)
        {
            this.loginInfo = (ClientLoginServerInfoData)mData.loginInfo.clone();
        }
        else
        {
            this.loginInfo = null;
            nullObjError("loginInfo");
        }

        if (mData.version != null)
        {
            this.version = (ClientVersionData)BytesControl.createData(ClientVersionData.dataID);
            this.version.copy(mData.version);
        }
        else
        {
            this.version = null;
        }

        if (mData.areas != null)
        {
            if (this.areas != null)
            {
                this.areas.clear();
                this.areas.ensureCapacity(mData.areas.size());
            }
            else
            {
                this.areas = new IntObjectMap <AreaClientData>(mData.areas.size());
            }

            IntObjectMap <AreaClientData> areasT = this.areas;
            if (!mData.areas.isEmpty())
            {
                AreaClientData[] areasVValues = mData.areas.getValues();
                for (int areasVI = areasVValues.Length - 1; areasVI >= 0; --areasVI)
                {
                    AreaClientData areasV = areasVValues[areasVI];
                    if (areasV != null)
                    {
                        AreaClientData areasU;
                        if (areasV != null)
                        {
                            areasU = (AreaClientData)areasV.clone();
                        }
                        else
                        {
                            areasU = null;
                        }

                        areasT.put(areasU.areaID, areasU);
                    }
                }
            }
        }
        else
        {
            this.areas = null;
        }

        this.lastAreaID = mData.lastAreaID;

        if (mData.gameInfo != null)
        {
            this.gameInfo = (ClientLoginServerInfoData)mData.gameInfo.clone();
        }
        else
        {
            this.gameInfo = null;
        }
    }
コード例 #13
0
ファイル: GameMainControl.cs プロジェクト: shineTeam7/home3
 /** 获取服务器列表成功 */
 public void onLoginSelectSuccess(ClientLoginServerInfoData info)
 {
     _httpLoginSelectAffair.stop();
     _gameInfo = info;
     _stepTool.completeStepAbs(LoginSelect);
 }
コード例 #14
0
    /// <summary>
    /// 读取字节流(简版)
    /// </summary>
    protected override void toReadBytesSimple(BytesReadStream stream)
    {
        base.toReadBytesSimple(stream);

        this.info = (ClientLoginServerInfoData)stream.readDataSimpleNotNull();
    }
コード例 #15
0
    /// <summary>
    /// 回池
    /// </summary>
    protected override void toRelease(DataPool pool)
    {
        base.toRelease(pool);

        this.info = null;
    }