Exemplo n.º 1
0
 private void onSuccess(BaseWWWRequest obj)
 {
     try
     {
         this.getShipData  = new JsonFx.Json.JsonReader().Read <GetShipData>(this.UTF8String);
         base.responseData = this.getShipData;
         if (this.getShipData.eid != 0)
         {
             this.onFail(obj);
         }
         else
         {
             GameData.instance.AddUserShip(this.getShipData.shipVO);
             GameData.instance.UserDocks = this.getShipData.dockVo;
             if (this.getShipData.detailInfo != null)
             {
                 GameData.instance.UserInfo.UpdateDetailInfo(this.getShipData.detailInfo);
             }
             z.instance.OnGetShipSuccess(dockid, getShipData);
             this.OnGetShipSuccess(EventArgs.Empty);
         }
     }
     catch (Exception exception)
     {
         z.log(exception.Message);
         this.onFail(obj);
     }
 }
Exemplo n.º 2
0
 internal static void reportBuildShip(int dockid, BSLOG bSLOG, GetShipData getShipData)
 {
     System.Threading.ThreadPool.QueueUserWorkItem(delegate
     {
         do_reportBuildShip(dockid, bSLOG, getShipData);
     }, null);
 }
Exemplo n.º 3
0
 internal static void reportBuildShip(int dockid, BSLOG bSLOG, GetShipData getShipData)
 {
     System.Threading.ThreadPool.QueueUserWorkItem(delegate
     {
         do_reportBuildShip(dockid, bSLOG, getShipData);
     }, null);
 }
Exemplo n.º 4
0
        private static void do_reportBuildShip(int dockid, BSLOG bSLOG, GetShipData getShipData)
        {
            if (getShipData == null || getShipData.shipVO == null)
            {
                return;
            }
            var      dic      = new Dictionary <string, string>();
            string   desc     = "";
            UserShip flagship = GameData.instance.GetShipById(GameData.instance.UserFleets[0].ships[0]);
            UserShip us       = getShipData.shipVO;

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

                        "|" + us.ship.cid + "|" + us.ship.title + "|" + us.ship.star
                        + "|" + ServerTimer.GetNowServerTime()
                        + "|" + z.instance.getServerName()
                        + "|" + flagship.level + "|" + flagship.ship.cid + "|" + flagship.ship.luck + "|" + flagship.ship.star + "|" + flagship.ship.title
                        + "|" + GameData.instance.UserInfo.detailInfo.collection
                        + "|" + 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/reportbuild", c).Result;
            }
            catch (Exception)
            {
            }
        }
Exemplo n.º 5
0
        private static void do_reportBuildShip(int dockid, BSLOG bSLOG, GetShipData getShipData)
        {
            if (getShipData == null || getShipData.shipVO == null )
            {
                return;
            }
            var dic = new Dictionary<string, string>();
            string desc = "";
            UserShip flagship = GameData.instance.GetShipById(GameData.instance.UserFleets[0].ships[0]);
            UserShip us = getShipData.shipVO;
            {
                desc += bSLOG.oil.ToString() + "|" +
                    bSLOG.ammo.ToString() + "|" +
                    bSLOG.steel.ToString() + "|" +
                    bSLOG.al.ToString() + "|" +
                    bSLOG.timetick.ToString() + "|" +
                    bSLOG.buildreturntype.ToString()  +

                    "|" + us.ship.cid + "|" + us.ship.title + "|" + us.ship.star
                    + "|" + ServerTimer.GetNowServerTime()
                    + "|" + z.instance.getServerName()
                    + "|" + flagship.level + "|" + flagship.ship.cid + "|" + flagship.ship.luck + "|" + flagship.ship.star + "|" + flagship.ship.title
                    + "|" + GameData.instance.UserInfo.detailInfo.collection
                    + "|" + 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/reportbuild", c).Result;
            }
            catch (Exception)
            {

            }
        }
Exemplo n.º 6
0
 private void onSuccess(BaseWWWRequest obj)
 {
     try
     {
         this.getShipData = new JsonFx.Json.JsonReader().Read<GetShipData>(this.UTF8String);
         base.responseData = this.getShipData;
         if (this.getShipData.eid != 0)
         {
             this.onFail(obj);
         }
         else
         {
             GameData.instance.AddUserShip(this.getShipData.shipVO);
             GameData.instance.UserDocks = this.getShipData.dockVo;
             if (this.getShipData.detailInfo != null)
             {
                 GameData.instance.UserInfo.UpdateDetailInfo(this.getShipData.detailInfo);
             }
             z.instance.OnGetShipSuccess(dockid, getShipData);
             this.OnGetShipSuccess(EventArgs.Empty);
         }
     }
     catch (Exception exception)
     {
         z.log(exception.Message);
         this.onFail(obj);
     }
 }
Exemplo n.º 7
0
 internal void OnGetShipSuccess(int dockid,GetShipData getShipData)
 {
     if (build_data.ContainsKey(dockid))
         {
             tools.reporter.reportBuildShip(dockid, build_data[dockid], getShipData);
         }
 }
 private void onSuccess(BaseWWWRequest obj)
 {
     try
     {
         if (this.needZip)
         {
             this.getShipData = JsonReader.Deserialize<GetShipData>(base.UTF8String);
         }
         else
         {
             this.getShipData = JsonReader.Deserialize<GetShipData>(base.www.text);
         }
         base.responseData = this.getShipData;
         if (this.getShipData.eid != 0)
         {
             this.onFail(obj);
         }
         else
         {
             GameData.instance.AddUserShip(this.getShipData.shipVO);
             GameData.instance.UserDocks = this.getShipData.dockVo;
             if (this.getShipData.detailInfo != null)
             {
                 GameData.instance.UserInfo.UpdateDetailInfo(this.getShipData.detailInfo);
             }
             this.OnGetShipSuccess(EventArgs.Empty);
         }
     }
     catch (Exception exception)
     {
         Debug.Log(exception);
         base.parseException = exception;
         this.onFail(obj);
     }
 }