Beispiel #1
0
        private void _getSeverListBack(Variant data)
        {
            debug.Log("收到服务器列表信息: " + data.dump());
            bool flag = data["r"]._int == 0;

            if (flag)
            {
                bool flag2 = data.ContainsKey("errmsg");
                if (flag2)
                {
                    debug.Log("SeverListError::" + StringUtils.unicodeToStr(data["errmsg"]._str));
                }
                this.retryLoadServerList();
            }
            else
            {
                bool flag3 = data["r"]._int == 1;
                if (flag3)
                {
                    bool flag4 = data.ContainsKey("data");
                    if (flag4)
                    {
                        this._srv_lists = data["data"]["srv_lists"];
                        Variant variant = new Variant();
                        variant["svrList"] = this._srv_lists;
                        this.notify(variant);
                        Globle.initServer(this._srv_lists._arr);
                        login.instance.refresh();
                    }
                }
            }
        }
        //获取服务器列表
        private void _getSeverListBack(Variant data)
        {
            //DebugTrace.print("_getSeverListBack:");

            debug.Log("收到服务器列表信息: " + data.dump());
            //DebugTrace.dumpObj( data );

            if (data["r"]._int == 0)
            {//获取服务器列表失败
             //Variant v = new Variant();
             //v["list_err"] = data;
             //notify( v );


                if (data.ContainsKey("errmsg"))
                {
                    debug.Log("SeverListError::" + StringUtils.unicodeToStr(data["errmsg"]._str));
                }

                retryLoadServerList();
            }
            else if (data["r"]._int == 1)
            {
                if (data.ContainsKey("data"))
                {
                    _srv_lists = data["data"]["srv_lists"];
                    Variant v = new Variant();
                    v["svrList"] = _srv_lists;
                    notify(v);
                    Globle.initServer(_srv_lists._arr);
                    login.instance.refresh();
                }
                else
                {
                    //notify( {key:"list_err", data:data} );
                }

                //int sid = GetSrvSid(_srv_lists.Count - 1);
                //if (os.sys.loscalStorage.readInt("sever_id") == 0)
                //    _curSid = GetRecommend();
                //else
                //    _curSid = os.sys.loscalStorage.readInt("sever_id");
                //GetPlyInfo(_curSid);
            }
        }