public void relogin()
 {
     relogined     = true;
     relogin_again = false;
     if (Globle.DebugMode == 2)
     {
         NetClient.instance.reConnect();
         // this.g_mgr.g_netM.reConnect();
     }
     else
     {
         HttpAppMgr.POSTSvr(Globle.curServerD.login_url, "", _getPlyInfoBack, true, "GET");
         //解决手机上断线重连的问题
         DelayDoManager.singleton.AddDelayDo(() =>
         {
             if (relogin_again == false)
             {
                 if (disconect.instance != null)
                 {
                     disconect.instance.setErrorType(disconect.ERROR_TYPE_NETWORK);
                 }
             }
         }, 3);
     }
 }
 public static void init()
 {
     if (instance == null)
     {
         instance = new HttpAppMgr();
     }
 }
Beispiel #3
0
        public void getSevenCardsCode(string code)
        {
            string path = "sid=" + Globle.curServerD.sid + "&cid=" + PlayerModel.getInstance().cid + "&shortcode=";

            debug.Log("请求激活码::::::::::::::::::" + Globle.curServerD.do_url + "?receive_card=2" + path + code);
            HttpAppMgr.POSTSvrstr(Globle.curServerD.do_url + "?receive_card=2", path + code, onHttpSevenCards);
        }
Beispiel #4
0
        private void getCardsCode()
        {
            debug.Log(string.Concat(new object[]
            {
                "请求获得新卡:",
                this.cacheGetCode.Count,
                "   ",
                this.curTransing
            }));
            bool flag = this.cacheGetCode.Count == 0;

            if (flag)
            {
                foreach (GiftCardData current in this.lGiftCards)
                {
                    debug.Log("判断有新:" + this.beginLoadingTimer + current.creattimer);
                    bool flag2 = this.beginLoadingTimer <= current.creattimer;
                    if (flag2)
                    {
                        HttpAppMgr.instance.onGetnewCard();
                        bool flag3 = current.cardType.functp == 4;
                        if (flag3)
                        {
                            ArrayList arrayList = new ArrayList();
                            arrayList.Add(current);
                            InterfaceMgr.getInstance().open(InterfaceMgr.A3_GIFTCARD, arrayList, false);
                        }
                        break;
                    }
                }
            }
            else
            {
                bool flag4 = this.curTransing != null;
                if (!flag4)
                {
                    this.curTransing = this.cacheGetCode[0];
                    this.cacheGetCode.RemoveAt(0);
                    string text = string.Concat(new object[]
                    {
                        "sid=",
                        Globle.curServerD.sid,
                        "&uid=",
                        ModelBase <PlayerModel> .getInstance().uid,
                        "&cid=",
                        ModelBase <PlayerModel> .getInstance().cid,
                        "&tp="
                    });
                    debug.Log(string.Concat(new object[]
                    {
                        "请求激活码::::::::::::::::::",
                        Globle.curServerD.do_url,
                        "?card",
                        text,
                        this.curTransing.id
                    }));
                    HttpAppMgr.POSTSvrstr(Globle.curServerD.do_url + "?card", text + this.curTransing.id, new Action <string>(this.onHttpCallback), true, "POST");
                }
            }
        }
Beispiel #5
0
        public static void init()
        {
            bool flag = HttpAppMgr.instance == null;

            if (flag)
            {
                HttpAppMgr.instance = new HttpAppMgr();
            }
        }
Beispiel #6
0
        public void getRechangeCard()
        {
            if (PlayerModel.getInstance().lvl < 10)
            {
                return;
            }

            string path = "sid=" + Globle.curServerD.sid + "&uid=" + PlayerModel.getInstance().uid + "&cid=" + PlayerModel.getInstance().cid + "&cust=2";

            HttpAppMgr.POSTSvrstr(Globle.curServerD.do_url + "?paycard", path, onRechageHandle);
        }
Beispiel #7
0
 public void GetPlyInfo(int sid)
 {
     os.sys.loscalStorage.writeInt("sever_id", sid);
     for (int i = 0; i < this._srv_lists.Count; i++)
     {
         bool flag = this._srv_lists[i]["sid"]._int == sid;
         if (flag)
         {
             HttpAppMgr.POSTSvr(this._srv_lists[i]["login_url"]._str, "", new Action <Variant>(this._getPlyInfoBack), true, "GET");
             break;
         }
     }
 }
        //public void onSdkCallBack(Variant v)
        //{
        //    DebugTrace.print("onSdkCallBack:");
        //    DebugTrace.dumpObj(v);
        //    string cmd = v["cmd"]._str;
        //    if (AndroidSDKManager.SDKType.login.ToString() == cmd)
        //    {
        //        //_platId= "";
        //        onSelectPlatuid(v);
        //    }
        //    else
        //    {

        //    }
        //}

        private void onSelectPlatuid(Variant v)
        {
            if (!v.ContainsKey("data") || !v["data"].ContainsKey("pid") || !v["data"].ContainsKey("avatar") || !v["data"].ContainsKey("uid"))
            {
                DebugTrace.print("Erorr: Variant no`t Find <data>");
                DebugTrace.dumpObj(v);
                return;
            }

            string str1 = "platform=" + v["data"]["pid"]._str + "&sign=" + v["data"]["avatar"]._str + "&platuid=" + v["data"]["uid"]._str;

            //  str1 = "platform=qihooandroid&sign=7d065c0b871a4f280404070bc1aaa125|1439812387" + "&platuid=" + "2534758785";
            HttpAppMgr.POSTSvr(_query, str1, _getSeverListBack);
        }
Beispiel #9
0
        public void relogin()
        {
            LGPlatInfo.relogined = true;
            bool flag = Globle.DebugMode == 2;

            if (flag)
            {
                NetClient.instance.reConnect(null);
            }
            else
            {
                HttpAppMgr.POSTSvr(Globle.curServerD.login_url, "", new Action <Variant>(this._getPlyInfoBack), true, "GET");
            }
        }
 //private gameST _game;
 private void initGame(Variant data)
 {
     //Globle.game_CrossMono = new gameST();
     HttpAppMgr.init();
     Globle.game_CrossMono.init(
         data["config_url"]._str,   //"http://10.1.8.76/do.php",	/*server_config_url,*/
         data["server_ip"]._str,    //"10.1.59.138", /*server_ip, */
         data["sid"]._uint,         //3, /*server_id, */
         data["server_port"]._uint, //62999,/*port, */
         data["uid"]._uint,         //1,/*uid, */
         0,                         //data["clnt"]._uint,//0,/*clnt, */
         data["skey"]._str,         //"123",/*token, */
         "main"                     //"main" /*mainConfig */
         );
 }
Beispiel #11
0
        public void getFirstRechangeCard()
        {
            string param = string.Concat(new object[]
            {
                "sid=",
                Globle.curServerD.sid,
                "&uid=",
                ModelBase <PlayerModel> .getInstance().uid,
                "&cid=",
                ModelBase <PlayerModel> .getInstance().cid,
                "&tp=2"
            });

            HttpAppMgr.POSTSvrstr(Globle.curServerD.do_url + "?card", param, new Action <string>(this.onFirstRechange), true, "POST");
        }
 //public function test():void
 //{
 //    notify( {key:"test"} );
 //}
 public void GetPlyInfo(int sid)
 {
     os.sys.loscalStorage.writeInt("sever_id", sid);
     for (int i = 0; i < _srv_lists.Count; i++)
     {
         if (_srv_lists[i]["sid"]._int == sid)
         {
             //string requrl = _srv_lists[i]["login_url"]._str;
             //string[] strs = requrl.Split('?');
             //POSTSvr( strs[0], strs[1], _getPlyInfoBack );
             HttpAppMgr.POSTSvr(_srv_lists[i]["login_url"]._str, "", _getPlyInfoBack, true, "GET");
             break;
         }
     }
 }
Beispiel #13
0
        public void loadServerList()
        {
            bool flag = Globle.QSMY_Platform_Index == ENUM_QSMY_PLATFORM.QSPF_None;

            if (!flag)
            {
                HttpAppMgr.POSTSvr(Globle.YR_srvlists__slurl, string.Concat(new string[]
                {
                    "platform=",
                    Globle.YR_srvlists__platform,
                    "&sign=",
                    Globle.YR_srvlists__sign,
                    "&platuid=",
                    Globle.YR_srvlists__platuid
                }), new Action <Variant>(this._getSeverListBack), true, "POST");
                debug.Log("sl_url = " + Globle.YR_srvlists__slurl);
            }
        }
Beispiel #14
0
        public void getRechangeCard()
        {
            bool flag = ModelBase <PlayerModel> .getInstance().lvl < 10u;

            if (!flag)
            {
                string param = string.Concat(new object[]
                {
                    "sid=",
                    Globle.curServerD.sid,
                    "&uid=",
                    ModelBase <PlayerModel> .getInstance().uid,
                    "&cid=",
                    ModelBase <PlayerModel> .getInstance().cid,
                    "&cust=2"
                });
                HttpAppMgr.POSTSvrstr(Globle.curServerD.do_url + "?paycard", param, new Action <string>(this.onRechageHandle), true, "POST");
            }
        }
Beispiel #15
0
        public void getShortCardsCode(string code)
        {
            string text = string.Concat(new object[]
            {
                "sid=",
                Globle.curServerD.sid,
                "&cid=",
                ModelBase <PlayerModel> .getInstance().cid,
                "&shortcode="
            });

            debug.Log(string.Concat(new string[]
            {
                "请求激活码::::::::::::::::::",
                Globle.curServerD.do_url,
                "?card=2",
                text,
                code
            }));
            HttpAppMgr.POSTSvrstr(Globle.curServerD.do_url + "?card=2", text + code, new Action <string>(this.onHttpShortCars), true, "POST");
        }
Beispiel #16
0
        public void sendMsg(string words, string name, uint type, bool isvoice, uint xtp = 0)
        {
            Variant msg = new Variant();

            msg["tp"]   = type;
            msg["name"] = name;


            if (isvoice)
            {
                msg["msg"] = "";
                msg["url"] = words;
            }
            else
            {
                msg["msg"] = words;
            }

            if (xtp != 0)
            {
                msg["xtp"] = xtp;
            }
            else
            {
                analysisStr(words, msg);
            }
            sendRPC(PKG_NAME.S2C_CHAT_MSG, msg);


            //屏蔽装备和坐标
            //if (msg.ContainsKey("coordinate") || msg.ContainsKey("itm_ids"))
            //    return;

            //添加聊天上报
            string path = "sid=" + Globle.curServerD.sid + "&uid=" + PlayerModel.getInstance().uid + "&cid=" + PlayerModel.getInstance().cid + "&tp=" + type
                          + "&cname=" + name + "&vip=" + PlayerModel.getInstance().vip + "&content=" + words;

            //debug.Log("聊天上报::::::::::::::::::" + Globle.curServerD.do_url + "?msg=1" + path);
            HttpAppMgr.POSTSvrstr(Globle.curServerD.do_url + "?msg=1", path, onHttpChatMsg);
        }
Beispiel #17
0
        private void onSelectPlatuid(Variant v)
        {
            bool flag = !v.ContainsKey("data") || !v["data"].ContainsKey("pid") || !v["data"].ContainsKey("avatar") || !v["data"].ContainsKey("uid");

            if (flag)
            {
                DebugTrace.print("Erorr: Variant no`t Find <data>");
                DebugTrace.dumpObj(v);
            }
            else
            {
                string param = string.Concat(new string[]
                {
                    "platform=",
                    v["data"]["pid"]._str,
                    "&sign=",
                    v["data"]["avatar"]._str,
                    "&platuid=",
                    v["data"]["uid"]._str
                });
                HttpAppMgr.POSTSvr(this._query, param, new Action <Variant>(this._getSeverListBack), true, "POST");
            }
        }
        //public void logSDKCustomAP(string id)
        //{
        //    //新的埋点策略
        //    string event_name = "qsmy_" + id;
        //    string gatajsonString = "{\"portname\":\"setEvent\",\"identifier\":\"" + event_name + "\"}";
        //    AnyPlotformSDK.Call_Cmd("gataroleplatform", "lanGaiya", gatajsonString);
        //}

        ////设置SDK的埋点
        //public void logSDKAP(string pname)
        //{
        //    //在埋点中更新相关的角色信息
        //    //string exitRoleInfoJsonString = "{\"roleId\":\"1\",\"roleName\":\"chasname\",\"roleLevel\":\"101\",\"roleGold\":\"300\",\"roleYb\":\"200\",\"roleServerId\":\"1\",\"roleServerName\":\"servername\"}";
        //    //AnyPlotformSDK.Add_moreCmdInfo("lanRole", exitRoleInfoJsonString);

        //    try
        //    {
        //        Variant v = new Variant();
        //        v["roleId"] = PlayerModel.getInstance().cid;
        //        v["roleName"] = PlayerModel.getInstance().name;
        //        v["roleLevel"] = PlayerModel.getInstance().lvl;
        //        v["roleGold"] = PlayerModel.getInstance().money;
        //        v["roleYb"] = PlayerModel.getInstance().gold;
        //        v["roleServerId"] = Globle.curServerD.sid;
        //        v["roleServerName"] = Globle.curServerD.server_name;
        //        string exitRoleInfoJsonString = JsonManager.VariantToString(v);
        //        AnyPlotformSDK.Add_moreCmdInfo("lanRole", exitRoleInfoJsonString);

        //        string gatajsonString = "{\"portname\":\"" + pname + "\"}";
        //        //string gatajsonString = "{\"portname\":\"" + pname + "\",\"identifier\":\"create-role-begin\"}";
        //        AnyPlotformSDK.Call_Cmd("gataroleplatform", "lanGaiya", gatajsonString);
        //    }
        //    catch (System.Exception e)
        //    {
        //        Debug.LogWarning(pname);
        //    }
        //}

        ////获取埋点的返回
        //private void _getLogAPBack(Variant data)
        //{
        //    debug.Log("http = " + data.dump());
        //}
        public void loadServerList()
        {
            //AndroidSDKManager.actFlag = true;
            //DebugTrace.print("============= test act ===================");

            if (Globle.QSMY_Platform_Index == ENUM_QSMY_PLATFORM.QSPF_None)
            {
                //内网服务器的列表地址
                //  HttpAppMgr.POSTSvr("http://10.1.8.76/ifacec/sdk_srvlists.php", "platform=" + Globle.YR_srvlists__platform + "&sign=&platuid=" + Globle.YR_srvlists__platuid, _getSeverListBack);
            }
            else
            {
                //外网平台的列表地址
                // POSTSvr("http://qsmy-mobile.8090mt.com/qsmy_mobile/ifacec/sdk_srvlists.php", "platform=" + Globle.YR_srvlists__platform + "&sign=&platuid=" + Globle.YR_srvlists__platuid, _getSeverListBack);

                //HttpAppMgr.POSTSvr("http://123.59.51.193/ifacec/sdk_srvlists.php", "platform=" + Globle.YR_srvlists__platform + "&sign=" + Globle.YR_srvlists__sign + "&platuid=" + Globle.YR_srvlists__platuid, _getSeverListBack);
                //debug.Log("http://123.59.51.193/ifacec/sdk_srvlists.php?platform=" + Globle.YR_srvlists__platform + "&sign=" + Globle.YR_srvlists__sign + "&platuid=" + Globle.YR_srvlists__platuid);

                HttpAppMgr.POSTSvr(Globle.YR_srvlists__slurl, "platform=" + Globle.YR_srvlists__platform + "&sign=" + Globle.YR_srvlists__sign + "&platuid=" + Globle.YR_srvlists__platuid + "&ver=1.0.1", _getSeverListBack);
                debug.Log("sl_url = " + Globle.YR_srvlists__slurl);
                //debug.Log(Globle.YR_srvlists__slurl + Globle.YR_srvlists__platform + "&sign=" + Globle.YR_srvlists__sign + "&platuid=" + Globle.YR_srvlists__platuid);
            }
        }
Beispiel #19
0
        private void getCardsCode()
        {
            debug.Log("请求获得新卡:" + cacheGetCode.Count + "   " + curTransing);
            if (cacheGetCode.Count == 0)
            {
                foreach (GiftCardData d in lGiftCards)
                {
                    debug.Log("判断有新:" + beginLoadingTimer + d.creattimer);
                    if (beginLoadingTimer <= d.creattimer)
                    {
                        HttpAppMgr.instance.onGetnewCard();
                        if (d.cardType.functp == 4)
                        {
                            ArrayList arr = new ArrayList();
                            arr.Add(d);
                            InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_GIFTCARD, arr);
                        }
                        return;
                    }
                }
                return;
            }
            if (curTransing != null)
            {
                return;
            }

            curTransing = cacheGetCode[0];
            cacheGetCode.RemoveAt(0);


            string path = "sid=" + Globle.curServerD.sid + "&uid=" + PlayerModel.getInstance().uid + "&cid=" + PlayerModel.getInstance().cid + "&tp=";

            debug.Log("请求激活码::::::::::::::::::" + Globle.curServerD.do_url + "?card" + path + curTransing.id);
            HttpAppMgr.POSTSvrstr(Globle.curServerD.do_url + "?card", path + curTransing.id, onHttpCallback);
        }
Beispiel #20
0
        public void getFirstRechangeCard()
        {
            string path = "sid=" + Globle.curServerD.sid + "&uid=" + PlayerModel.getInstance().uid + "&cid=" + PlayerModel.getInstance().cid + "&tp=2";

            HttpAppMgr.POSTSvrstr(Globle.curServerD.do_url + "?card", path, onFirstRechange);
        }
Beispiel #21
0
 private void initGame(Variant data)
 {
     HttpAppMgr.init();
     Globle.game_CrossMono.init(data["config_url"]._str, data["server_ip"]._str, data["sid"]._uint, data["server_port"]._uint, data["uid"]._uint, 0u, data["skey"]._str, "main");
 }
Beispiel #22
0
 public void sendLogin(string login_url)
 {
     HttpAppMgr.POSTSvr(login_url, "", new Action <Variant>(this._getPlyInfoBack), true, "GET");
 }
 public void sendLogin(string login_url)
 {
     HttpAppMgr.POSTSvr(login_url, "", _getPlyInfoBack, true, "GET");
 }