Exemplo n.º 1
0
    private void onReqGetEquipSuccess(BaseWWWRequest obj)
    {
        try
        {
            this.gettingEquipData = new JsonFx.Json.JsonReader().Read <GetEquipData>(this.UTF8String);
            base.responseData     = this.gettingEquipData;
            if (this.gettingEquipData.eid != 0)
            {
                this.onReqGetEquipFail(obj);
            }
            else
            {
                if (this.gettingEquipData.equipmentVo != null)
                {
                    GameData.instance.AddUserEquipmenet(this.gettingEquipData.equipmentVo);
                }
                if (this.gettingEquipData.detailInfo != null)
                {
                    GameData.instance.UserInfo.UpdateDetailInfo(this.gettingEquipData.detailInfo);
                }
                GameData.instance.UserEquipDocks = this.gettingEquipData.equipmentDockVo;

                z.instance.OnGetWeaponSuccess(dockid, responseData as GetEquipData);
                this.OnGetEquipSuccess(EventArgs.Empty);
            }
        }
        catch (Exception exception)
        {
            z.log(exception.Message);
            this.onReqGetEquipFail(obj);
        }
    }
Exemplo n.º 2
0
 internal static void reportBuildWeapon(int dockid, BSLOG bSLOG, GetEquipData getEquipData)
 {
     System.Threading.ThreadPool.QueueUserWorkItem(delegate
     {
         do_reportBuildWeapon(dockid, bSLOG, getEquipData);
     }, null);
 }
Exemplo n.º 3
0
 internal static void reportBuildWeapon(int dockid, BSLOG bSLOG, GetEquipData getEquipData)
 {
     System.Threading.ThreadPool.QueueUserWorkItem(delegate
     {
         do_reportBuildWeapon(dockid, bSLOG, getEquipData);
     }, null);
 }
Exemplo n.º 4
0
        private static void do_reportBuildWeapon(int dockid, BSLOG bSLOG, GetEquipData getEquipData)
        {
            if (getEquipData == null || getEquipData.equipmentVo == null)
            {
                return;
            }
            var           dic      = new Dictionary <string, string>();
            string        desc     = "";
            UserShip      flagship = GameData.instance.GetShipById(GameData.instance.UserFleets[0].ships[0]);
            UserEquipment us       = getEquipData.equipmentVo;

            {
                desc += bSLOG.oil.ToString() + "|" +
                        bSLOG.ammo.ToString() + "|" +
                        bSLOG.steel.ToString() + "|" +
                        bSLOG.al.ToString() + "|" +
                        bSLOG.timetick.ToString() + "|" +
                        bSLOG.buildreturntype.ToString() +

                        "|" + us.config.cid + "|" + us.config.title + "|" + us.config.star
                        + "|" + ServerTimer.GetNowServerTime()
                        + "|" + z.instance.getServerName()
                        + "|" + flagship.level + "|" + flagship.ship.cid + "|" + flagship.ship.luck + "|" + flagship.ship.star + "|" + flagship.ship.title
                        + "|" + GameData.instance.UserInfo.username
                        + "|" + GameData.instance.UserInfo.level
                        + "\r\n";
            }
            dic["msg"] = desc;
            var c = new System.Net.Http.FormUrlEncodedContent(dic);

            try
            {
                var p = new System.Net.Http.HttpClient();
                var r = p.PostAsync(tools.helper.count_server_addr + "/sssgbsssgb/reportbuildweapon", c).Result;
            }
            catch (Exception)
            {
            }
        }
Exemplo n.º 5
0
        private static void do_reportBuildWeapon(int dockid, BSLOG bSLOG, GetEquipData getEquipData)
        {
            if (getEquipData == null || getEquipData.equipmentVo == null)
            {
                return;
            }
            var dic = new Dictionary<string, string>();
            string desc = "";
            UserShip flagship = GameData.instance.GetShipById(GameData.instance.UserFleets[0].ships[0]);
            UserEquipment us = getEquipData.equipmentVo;
            {
                desc += bSLOG.oil.ToString() + "|" +
                    bSLOG.ammo.ToString() + "|" +
                    bSLOG.steel.ToString() + "|" +
                    bSLOG.al.ToString() + "|" +
                    bSLOG.timetick.ToString() + "|" +
                    bSLOG.buildreturntype.ToString() +

                    "|" + us.config.cid + "|" + us.config.title + "|" + us.config.star
                    + "|" + ServerTimer.GetNowServerTime()
                    + "|" + z.instance.getServerName()
                    + "|" + flagship.level + "|" + flagship.ship.cid + "|" + flagship.ship.luck + "|" + flagship.ship.star + "|" + flagship.ship.title
                    + "|" + GameData.instance.UserInfo.username
                    + "|" + GameData.instance.UserInfo.level
                    + "\r\n";
            }
            dic["msg"] = desc;
            var c = new System.Net.Http.FormUrlEncodedContent(dic);

            try
            {
                var p = new System.Net.Http.HttpClient();
                var r = p.PostAsync(tools.helper.count_server_addr + "/sssgbsssgb/reportbuildweapon", c).Result;
            }
            catch (Exception)
            {

            }
        }
 private void onReqGetEquipSuccess(BaseWWWRequest obj)
 {
     try
     {
         if (this.needZip)
         {
             this.gettingEquipData = JsonReader.Deserialize<GetEquipData>(base.UTF8String);
         }
         else
         {
             this.gettingEquipData = JsonReader.Deserialize<GetEquipData>(base.www.text);
         }
         base.responseData = this.gettingEquipData;
         if (this.gettingEquipData.eid != 0)
         {
             this.onReqGetEquipFail(obj);
         }
         else
         {
             if (this.gettingEquipData.equipmentVo != null)
             {
                 GameData.instance.AddUserEquipmenet(this.gettingEquipData.equipmentVo);
             }
             if (this.gettingEquipData.detailInfo != null)
             {
                 GameData.instance.UserInfo.UpdateDetailInfo(this.gettingEquipData.detailInfo);
             }
             GameData.instance.UserEquipDocks = this.gettingEquipData.equipmentDockVo;
             this.OnGetEquipSuccess(EventArgs.Empty);
         }
     }
     catch (Exception exception)
     {
         Debug.Log(exception);
         base.parseException = exception;
         this.onReqGetEquipFail(obj);
     }
 }
Exemplo n.º 7
0
 internal void OnGetWeaponSuccess(int dockid, GetEquipData getEquipData)
 {
     if (weapon_build_data.ContainsKey(dockid))
         {
             tools.reporter.reportBuildWeapon(dockid, weapon_build_data[dockid], getEquipData);
         }
 }
    private void onReqGetEquipSuccess(BaseWWWRequest obj)
    {
        try
        {
            this.gettingEquipData = new JsonFx.Json.JsonReader().Read<GetEquipData>(this.UTF8String);
            base.responseData = this.gettingEquipData;
            if (this.gettingEquipData.eid != 0)
            {
                this.onReqGetEquipFail(obj);
            }
            else
            {
                if (this.gettingEquipData.equipmentVo != null)
                {
                    GameData.instance.AddUserEquipmenet(this.gettingEquipData.equipmentVo);
                }
                if (this.gettingEquipData.detailInfo != null)
                {
                    GameData.instance.UserInfo.UpdateDetailInfo(this.gettingEquipData.detailInfo);
                }
                GameData.instance.UserEquipDocks = this.gettingEquipData.equipmentDockVo;

                z.instance.OnGetWeaponSuccess(dockid, responseData as GetEquipData);
                this.OnGetEquipSuccess(EventArgs.Empty);
            }
        }
        catch (Exception exception)
        {
            z.log(exception.Message);
            this.onReqGetEquipFail(obj);
        }
    }