Ejemplo n.º 1
0
        //调起支付
        private bool UpPayClick(int id, object obj)
        {
            NativeHandle handle = new NativeHandle();

            if (type == payType.alipay)
            {
                object payData = PayOrderInterfaceMgr.Instance.GetDatas(LoginModel.Instance.Uid, Urltype.alipay, PayOrderInterfaceMgr.Instance.payfor, GetPayCount());
                if (payData != null)
                {
                    handle.Alipay(payData.ToString());

                    type = payType.none;
                }
            }
            else if (type == payType.wechat)
            {
                object o = PayOrderInterfaceMgr.Instance.GetDatas(LoginModel.Instance.Uid, Urltype.wx, PayOrderInterfaceMgr.Instance.payfor, GetPayCount());
                if (o != null)
                {
                    PayData payData = o as PayData;
                    handle.WechatPay(payData.appid, payData.partnerid, payData.prepayid, payData.noncestr, payData.timestamp, payData.package, payData.sign);
                    type = payType.none;
                }
            }
            else
            {
                SystemMsgView.SystemFunction(Function.Tip, Info.Chooseone);
            }
            return(false);
        }
Ejemplo n.º 2
0
        //1-0 普通手机号登录方法
        private void SendLoginSDKReq()
        {
            if (inputAccount.text != "" && password.text != "")
            {
                if (Regex.IsMatch(inputAccount.text, pattern))
                {
                    LoadingImageManager.Instance.AddLoadingItem();
                    LoginModel.Instance.Account  = inputAccount.text;
                    LoginModel.Instance.Password = password.text;

#if UNITY_ANDROID && !UNITY_EDITOR
                    LoginController.Instance.SendloginSDKReq(inputAccount.text, password.text,
                                                             (int)Application.platform, "11111111", 1.ToString(), "");
                    //TODO
                    //                    LoginController.Instance.SendloginSDKReq(inputAccount.text, password.text,
                    //                        (int)Application.platform, GetSignatureMD5Hash(), 1.ToString());

                    Debug.Log(string.Format("<color=#ffffffff><---{0}-{1}----></color>", EncryptManager.GetSignatureMD5Hash(), "test1"));
#else
                    LoginController.Instance.SendloginSDKReq(inputAccount.text, password.text,
                                                             (int)Application.platform, "000000000", 1.ToString(), "code");
#endif
                }
                else
                {
                    SystemMsgView.SystemFunction(Function.Tip, Info.PhoneNum, 1.5f);
                }
            }
            else
            {
                SystemMsgView.SystemFunction(Function.Tip, Info.InputFieldNotNull, 1.5f);
            }
        }
Ejemplo n.º 3
0
        //此时为微信点击,绑定面板
        void onclick()
        {
            if (rv.Input.text != "" && rv.code.text != "" && rv.Password.text != "" && rv.ConfirmPw.text != "")
            {
                Debug.Log(string.Format("<color=#ffffffff><---{0}-{1}----></color>", "test", "test1"));

                if (rv.regex.IsMatch(rv.Password.text))
                {
                    if (rv.Password.text == rv.ConfirmPw.text)
                    {
                        SendloginSDKReq(rv.Input.text, rv.Password.text, (int)Application.platform, "md5", "2", rv.code.text);
                    }
                    else
                    {
                        SystemMsgView.SystemFunction(Function.Tip, Info.PWNotSame);
                    }
                }
                else
                {
                    SystemMsgView.SystemFunction(Function.Tip, Info.PWPattern);
                }
            }
            else
            {
                SystemMsgView.SystemFunction(Function.Tip, Info.SelectionNull);
            }
        }
Ejemplo n.º 4
0
 //pattern=1表示注册,2为忘记密码
 public void ConfirmRegisterInfo(int pattern)
 {
     if (Input.text != "" && code.text != "" && Password.text != "" && ConfirmPw.text != "")
     {
         if (regex.IsMatch(Password.text))
         {
             if (Password.text == ConfirmPw.text)
             {
                 if (pattern == 1)
                 {
                     LoginController.Instance.SendRegisterReq(Input.text, code.text, Password.text, pattern, invite.text);
                 }
                 else
                 {
                     LoginController.Instance.SendRegisterReq(Input.text, code.text, Password.text, pattern);
                 }
             }
             else
             {
                 SystemMsgView.SystemFunction(Function.Tip, Info.PWNotSame);
             }
         }
         else
         {
             SystemMsgView.SystemFunction(Function.Tip, Info.PWPattern);
         }
     }
     else
     {
         SystemMsgView.SystemFunction(Function.Tip, Info.SelectionNull);
     }
 }
Ejemplo n.º 5
0
        /// <summary>
        /// 将图片上传到oos服务器
        /// </summary>
        private void OnClickSaveBtn()
        {
            try
            {
                if (headIcon.sprite.name == "headIcon_0")
                {
                    SystemMsgView.SystemFunction(Function.Tip, Info.Headhas);
                    return;
                }
                if (name.text == "")
                {
                    SystemMsgView.SystemFunction(Function.Tip, Info.namehas);
                    return;
                }
                //删除本地
                AsyncImageDownload.Instance.Delete(LoginModel.Instance.Head);

                SystemMsgView.SystemFunction(Function.Tip, Info.Uploading);

                MTRunner.Instance.StartRunner(wait2LoadIcon());
            }
            catch (Exception e)
            {
                Debug.Log(string.Format("<color=#ffffffff><---{0}-{1}----></color>", e.Message, "test1"));
            }
        }
Ejemplo n.º 6
0
 private void Fertilizer()
 {
     if (Farm_Game_StoreInfoModel.storage.Fertilizers[701].ObjectNum <= 0)
     {
         return;
     }
     SystemMsgView.SystemFunction(Function.OpenDialog, Info.Fertilizer, "", (() =>
     {
         FieldsController.ProtocalAction = ProtocalAction.Fertitlize;
         FarmUnit.SeletedFarmID = plant.FarmID;
         FieldsController.Instance.SendWFActionReq(plant.FarmID, GameAction.Fertitlize, 701);
     }));
 }
Ejemplo n.º 7
0
        private bool SuccRewad(int id, object arg)
        {
            if (arg != null)
            {
                List <DeltaStoreUnit> a = arg as List <DeltaStoreUnit>;

                if (a.Count <= 3)
                {
                    ViewMgr.Instance.Close(ViewNames.PayChooseView);
                    SystemMsgView.SystemFunction(Function.GetDialog, a);
                }
            }
            return(false);
        }
Ejemplo n.º 8
0
        public override void BuildSubViews()
        {
            inputName       = TargetGo.transform.Find("InputFieldName").GetComponent <InputField>();
            inputPhone      = TargetGo.transform.Find("InputFieldPhone").GetComponent <InputField>();
            inputAddress    = TargetGo.transform.Find("InputFieldAddress").GetComponent <InputField>();
            inputBeaty      = TargetGo.transform.Find("InputFieldBeauty").GetComponent <InputField>();
            commitBtn       = TargetGo.transform.Find("Button").GetComponent <Button>();
            commitBtnCancel = TargetGo.transform.Find("ButtonClose").GetComponent <Button>();
            ques            = TargetGo.transform.Find("ques").GetComponent <Button>();

            ques.onClick.AddListener((() => SystemMsgView.SystemFunction(Function.Tip, !string.IsNullOrEmpty(AnnouncementModel.Instance.ExpressInfo) ? AnnouncementModel.Instance.ExpressInfo : Info.Sendcash, 10f)));
            commitBtn.onClick.AddListener(OnClickCommit);
            commitBtnCancel.onClick.AddListener(Cancel);
            Provincedropdown = TargetGo.transform.Find("DropdownProvince").GetComponent <Dropdown>();
            Provincedropdown.onValueChanged.AddListener(OnProvinceChange);

            CityDropDown = TargetGo.transform.Find("DropdownCity").GetComponent <Dropdown>();
            CityDropDown.onValueChanged.AddListener(OnCityChange);
            PinPaiDropDown = TargetGo.transform.Find("PinPai").GetComponent <Dropdown>();



            CountryDropDown = TargetGo.transform.Find("DropdownCountry").GetComponent <Dropdown>();

            ExchangeGrid = TargetGo.transform.Find("DropdownBrand/grid/content").gameObject;

            Carriage = TargetGo.transform.Find("DropdownCarriage/Label").GetComponent <Text>();

            if (PlayerSave.HasKey("name"))
            {
                inputName.text = PlayerSave.GetString("name");
            }
            if (PlayerSave.HasKey("address"))
            {
                inputAddress.text = PlayerSave.GetString("address");
            }
            if (PlayerSave.HasKey("beaty"))
            {
                inputBeaty.text = PlayerSave.GetString("beaty");
            }
            if (PlayerSave.HasKey("phone"))
            {
                inputPhone.text = PlayerSave.GetString("phone");
            }

            base.BuildSubViews();
        }
Ejemplo n.º 9
0
        public void OnClickCommit()
        {
            if (inputName.text != "" && inputPhone.text != "" && inputAddress.text != "" && inputBeaty.text != "")
            {
                //                if (StoreController.Instance.currentSellNumber == 0)
                //                {
                //                    CommitController.Instance.OidExchangeReq(LoginModel.Instance.Uid, 1, inputName.text, inputPhone.text, inputAddress.text + Carriage.text, inputBeaty.text);
                //                }
                //                else
                if (Provincedropdown.value != 0 && CityDropDown.value != 0 && PinPaiDropDown.value != 0)
                {
                    CommitViewModel cvm = CommitViewModel.Instance;
                    cvm.Address = inputAddress.text;

                    Debug.Log(string.Format("<color=#ffffffff><---{0}-{1}----></color>", inputAddress.text, "test1"));

                    cvm.Name         = inputName.text;
                    cvm.Beaty        = inputBeaty.text;
                    cvm.Phone        = inputPhone.text;
                    cvm.SelectPinpai = PinPaiDropDown.value;
                    cvm.Country      = CountryDropDown.captionText.text;
                    cvm.Province     = Provincedropdown.captionText.text;
                    cvm.City         = CityDropDown.captionText.text;
                    cvm.SelectPinpai = cvm.brands[PinPaiDropDown.captionText.text].id;
                    if (CommitViewModel.Instance.Postage > 0)
                    {
                        PayOrderInterfaceMgr.Instance.payfor = PayFor.Exchange;

                        ViewMgr.Instance.Open(ViewNames.PayChooseView);
                    }
                    else
                    {
                        SystemMsgView.SystemFunction(Function.Tip, Info.Null);
                    }
                    //                Debug.LogError(string.Format("<color=#ff0000ff><---{0}-{1}----></color>", "test", "test1"));
                }
                else
                {
                    SystemMsgView.SystemFunction(Function.Tip, Info.ChooseFieldNotRight);
                }
            }
            else
            {
                SystemMsgView.SystemFunction(Function.Tip, Info.InputFieldNotNull);
            }
        }
Ejemplo n.º 10
0
 /// <summary>
 /// 发送验证码按钮
 ///
 /// </summary>
 public virtual void OncodeBtnClick()
 {
     if (Input.text != "")
     {
         if (Regex.IsMatch(Input.text, pattern))
         {
             LoginController.Instance.VeriCodeReq(Input.text);
             CodeBtnListener(false);
         }
         else
         {
             SystemMsgView.SystemFunction(Function.Tip, Info.PhoneNum);
         }
     }
     else
     {
         SystemMsgView.SystemFunction(Function.Tip, Info.InputFieldNotNull);
     }
 }
Ejemplo n.º 11
0
 //点击喂狗粮
 private void OnClickFeedBtn()
 {
     if (LoginModel.Instance.DogLv >= 3)
     {
         SystemMsgView.SystemFunction(Function.Tip, Info.DogMax);
         return;
     }
     if (Farm_Game_StoreInfoModel.storage.DogFoods.Count == 0)
     {
         //SystemMsgView.SystemFunction(Function.OpenDialog, Info.DogFoodNumNotEngouth,ViewNames.ShopView,(() => ViewMgr.Instance.Close(ViewNames.DogInfoView)));
         ShopController.Instance.Model = 3;
         ViewMgr.Instance.Open(ViewNames.ShopView);
         ViewMgr.Instance.Close(ViewNames.DogInfoView);
     }
     else
     {
         DogInfoController.Instance.FeedDog();
     }
 }
Ejemplo n.º 12
0
        /// <summary>
        /// 注册成功调用事件
        /// </summary>
        /// <param name="eid"></param>
        /// <param name="args"></param>
        public virtual bool OnRegisterSucc(int eid, object args)
        {
            LoginModel.Instance.Account  = Input.text;
            LoginModel.Instance.Password = Password.text;
            if (!string.IsNullOrEmpty(LoginModel.Instance.Account))
            {
                PlayerSave.SetString("Account", LoginModel.Instance.Account);
            }
            if (!string.IsNullOrEmpty(LoginModel.Instance.Password))
            {
                PlayerSave.SetString("Password", LoginModel.Instance.Password);
            }
            ViewMgr.Instance.Open(ViewNames.SystemMsgView);
            SystemMsgView.SystemFunction(Function.Tip, Info.RegisterSucc, 2);
            //                LoginController.Instance.SendloginSDKReq(Input.text, Password.text, (int)Application.platform, "111114442");
            lv.egv.Set(Password.text, Input.text);
            CloseViewInfo info = new CloseViewInfo(3);

//            lv.egv.HideView(1, info);
            return(false);
        }
Ejemplo n.º 13
0
        public void GetData()
        {
            //Debug.LogError("getdata");
            List <string>  LogList = ReadFile();
            List <MsgUnit> _orders = new List <MsgUnit>();

            for (int i = 0; i < LogList.Count; i++)
            {
                //Debug.LogError(LogList[i]);
                MsgUnit c = new MsgUnit();
                c = JsonUtility.FromJson <MsgUnit>(LogList[i]);
                _orders.Add(c);
            }
            orders = _orders;
            if (orders.Count == 0)
            {
                SystemMsgView.SystemFunction(Function.Tip, "当前没有订单");
                return;
            }
            CommitController.Instance.GetDispatcher().Dispatch(CommitController.CommitControllerEvent.OnOrderCallback);
        }
Ejemplo n.º 14
0
        //别家看看
        public void OnClickSeedFriend()
        {
            CommonActionBarView.Action1 = GameAction.None;
            bool isHas = false;
            Dictionary <int, PlayerInfo> friends = FriendsInfoModel.Instance.playerInfos;

            foreach (PlayerInfo friend in friends.Values)
            {
                if (friend.Aciton == 1 && !hasSteal.Contains(friend.UserGameId))
                {
                    FriendFarmManager.Instance.GoFriendFarm(friend.UserGameId);
                    hasSteal.Add(friend.UserGameId);
                    isHas = true;
                    break;
                }
            }
            if (isHas == false)
            {
                SystemMsgView.SystemFunction(Function.Tip, Info.NoFriendCanSteal);
            }
        }
Ejemplo n.º 15
0
        public override bool OnRegisterSucc(int eid, object args)
        {
            LoginModel.Instance.Account  = Input.text;
            LoginModel.Instance.Password = Password.text;
            if (!string.IsNullOrEmpty(LoginModel.Instance.Account))
            {
                PlayerSave.SetString("Account", LoginModel.Instance.Account);
            }
            if (!string.IsNullOrEmpty(LoginModel.Instance.Password))
            {
                PlayerSave.SetString("Password", LoginModel.Instance.Password);
            }

            SystemMsgView.SystemFunction(Function.Tip, Info.RegisterSucc, 2);
            lv.egv.Set(Password.text, Input.text);
            CloseViewInfo info = new CloseViewInfo(4);

            lv.egv.HideView(1, info);

            return(false);
        }
Ejemplo n.º 16
0
        private void OnEnsurePayClik()
        {
            //直接登录模式直接调起
            if (PayOrderInterfaceMgr.Instance.payfor == PayFor.Login && !PlayerSave.HasKey("Login"))
            {
                NativeHandle handle = new NativeHandle();
                if (type == payType.alipay)
                {
                    object payData = PayOrderInterfaceMgr.Instance.GetDatas(LoginModel.Instance.Uid, Urltype.alipay, PayOrderInterfaceMgr.Instance.payfor, GetPayCount());
                    if (payData != null)
                    {
                        handle.Alipay(payData.ToString());

                        Debug.Log(string.Format("<color=#ffffffff><---{0}-{1}----></color>", payData.ToString(), "test1"));
                    }
                }
                else if (type == payType.wechat)
                {
                    object o = PayOrderInterfaceMgr.Instance.GetDatas(LoginModel.Instance.Uid, Urltype.wx, PayOrderInterfaceMgr.Instance.payfor, GetPayCount());
                    if (o != null)
                    {
                        PayData payData = o as PayData;
                        handle.WechatPay(payData.appid, payData.partnerid, payData.prepayid, payData.noncestr, payData.timestamp, payData.package, payData.sign);
                    }
                }
                else
                {
                    SystemMsgView.SystemFunction(Function.Tip, Info.Chooseone);
                }
            }
            else if (PayOrderInterfaceMgr.Instance.payfor == PayFor.Exchange)
            {
                CommitViewModel cvm = CommitViewModel.Instance;
                CommitController.Instance.OidExchangeReq(LoginModel.Instance.Uid, 1, cvm.Name, cvm.Phone, cvm.Province, cvm.City, cvm.Country, cvm.SelectPinpai, cvm.Address, cvm.Beaty, (int)type);
            }
            EnsurePay.onClick.RemoveListener(OnEnsurePayClik);
        }
Ejemplo n.º 17
0
        //http请求,得到json数据
        private string GetPage(string requestUrl)
        {
            Stream          instream = null;
            StreamReader    sr       = null;
            HttpWebResponse response = null;
            HttpWebRequest  request  = null;

            // 准备请求...
            try
            {
                // 设置参数
                request = WebRequest.Create(requestUrl) as HttpWebRequest;
                CookieContainer cookieContainer = new CookieContainer();
                request.CookieContainer   = cookieContainer;
                request.AllowAutoRedirect = true;
                request.Method            = "GET"; //请求方式GET或POST
                request.ContentType       = "application/x-www-form-urlencoded";
                request.Headers.Add("Authorization", "Basic YWRtaW46YWRtaW4=");

                //发送请求并获取相应回应数据
                response = request.GetResponse() as HttpWebResponse;
                //直到request.GetResponse()程序才开始向目标网页发送Post请求
                instream = response.GetResponseStream();
                sr       = new StreamReader(instream, Encoding.UTF8);
                //返回结果网页(html)代码
                string content = sr.ReadToEnd();
                string err     = string.Empty;
                return(content);
            }
            catch (Exception ex)
            {
                Debug.LogError(ex);
                SystemMsgView.SystemFunction(Function.Tip, Info.ConnectFailed);
                return("");
            }
        }
Ejemplo n.º 18
0
 private void OnClickQuesBtn()
 {
     SystemMsgView.SystemFunction(Function.CloseDialog, "<size=22>合成规则:\r\n1.初级工厂中100个果实数量可以合成1个初级精油。\r\n\n2.高级工厂中2个初级精油可以合成1个半成品的精油\r\n\n3.当有40个半成品精油时,系统将自动合1个高级精油\r\n\n4.实物工厂中高级精油可以配合神秘配方等材料合成用于兑换的实物</size>");
 }
Ejemplo n.º 19
0
 //3-11
 protected void AnwFriendsCallBack(MsgRec msgRec)
 {
     SystemMsgView.SystemFunction(Function.Tip, Info.AddFriendSucc, 2);
 }
Ejemplo n.º 20
0
        public object GetDatas(int uid, Urltype type, PayFor payfor, int count = 0)
        {
            string url = "";

            switch (type)
            {
            case Urltype.wx:
                if (payfor == PayFor.Login)
                {
                    url = @"http://" + LoginConfig.Instance.serverIP + ":8080/api/unifiedorder?uid=" + uid + "&type=init";
                    if (string.IsNullOrEmpty(url))
                    {
                        SystemMsgView.SystemFunction(Function.Tip, Info.ConnectFailed2);
                        return(null);
                    }
                    string _json = GetPage(url);
                    if (string.IsNullOrEmpty(_json))
                    {
                        SystemMsgView.SystemFunction(Function.Tip, Info.ConnectFailed2);

                        return(null);
                    }
                    textData = JsonUtility.FromJson <PayData>(_json);

                    Debug.Log(string.Format("<color=#ffffffff><---{0}-{1}----></color>", textData.ToString(), "test1"));

                    return(textData);
                }
                else if (payfor == PayFor.Exchange)
                {
                    url = @"http://" + LoginConfig.Instance.serverIP + ":8080/api/unifiedorder?uid=" + uid + "&type=exchange" + "&count=" +
                          count;



                    if (string.IsNullOrEmpty(url))
                    {
                        SystemMsgView.SystemFunction(Function.Tip, Info.ConnectFailed2);
                        return(null);
                    }
                    string _json = GetPage(url);
                    if (string.IsNullOrEmpty(_json))
                    {
                        SystemMsgView.SystemFunction(Function.Tip, Info.ConnectFailed2);

                        return(null);
                    }
                    textData = JsonUtility.FromJson <PayData>(_json);
                    Debug.Log(string.Format("<color=#ffffffff><---{0}-{1}----></color>", textData.ToString(), "test1"));

                    return(textData);
                }

                break;

            case Urltype.alipay:
                if (payfor == PayFor.Login)
                {
                    url = @"http://" + LoginConfig.Instance.serverIP + ":8080/api/aliPay?uid=" + uid + "&type=init";
                    if (string.IsNullOrEmpty(url))
                    {
                        SystemMsgView.SystemFunction(Function.Tip, Info.ConnectFailed2);
                        return(null);
                    }
                    string payorder = GetPage(url);
                    Debug.Log(string.Format("<color=#ffffffff><---{0}-{1}----></color>", payorder.ToString(), "test1"));

                    return(payorder);
                }
                else if (payfor == PayFor.Exchange)
                {
                    url = @"http://" + LoginConfig.Instance.serverIP + ":8080/api/aliPay?uid=" + uid + "&type=exchange" + "&count=" +
                          count;
                    if (string.IsNullOrEmpty(url))
                    {
                        SystemMsgView.SystemFunction(Function.Tip, Info.ConnectFailed2);
                        return(null);
                    }
                    string _json = GetPage(url);
                    if (string.IsNullOrEmpty(_json))
                    {
                        SystemMsgView.SystemFunction(Function.Tip, Info.ConnectFailed2);

                        return(null);
                    }
                    Debug.Log(string.Format("<color=#ffffffff><---{0}-{1}----></color>", _json.ToString(), "test1"));

                    return(_json);
                }
                return(textData);

                break;
            }
            return(textData);
        }
Ejemplo n.º 21
0
        public override void OnClicked(WorldObject worldObject)
        {
            base.OnClicked(worldObject);


            //开始进入播种模�?&& this.Brand == null
            if (CommonActionBarView.Action1 == GameAction.None && this.Plant == null)
            {
                if (!FriendFarmManager.Instance.isVisiting)
                {
                    //打开播种栏
                    ViewMgr.Instance.Open(ViewNames.SeedBarView);
                    if (ViewMgr.Instance.isOpen(ViewNames.FriendsListView))
                    {
                        ViewMgr.Instance.Close(ViewNames.FriendsListView);
                    }
                }
            }
            //判断翻地清除植物
            if (FieldsController.ProtocalAction == ProtocalAction.None && CommonActionBarView.Action1 == GameAction.Plow && this.Plant != null && this.EnablePlant == 1)
            {
                SystemMsgView.SystemFunction(Function.OpenDialog, Info.Reclaim, null, (delegate
                {
                    FieldsController.Instance.ReqSenPlowdAction(this.FarmID);
                    loadAni("Animation/fandi");
                }));
            }

            if (this.Plant == null)
            {
                //当前地块没有植物,进入无模�?
                CommonActionBarView.Action1 = GameAction.None;
                if (ViewMgr.Instance.isOpen(ViewNames.TimeBarView))
                {
                    ViewMgr.Instance.Close(ViewNames.TimeBarView);
                }
            }

            //施肥浇水除虫除草
            if (FieldsController.ProtocalAction == ProtocalAction.None && (CommonActionBarView.Action1 == GameAction.weed || CommonActionBarView.Action1 == GameAction.Debug || CommonActionBarView.Action1 == GameAction.Fertitlize || CommonActionBarView.Action1 == GameAction.Water))
            {
                SeletedFarmID = FarmID;

                switch (CommonActionBarView.Action1)
                {
                case GameAction.Debug:
                    if (this.plant.IsWorm == 1)
                    {
                        loadAni("Animation/chuchong");
//                            MusicManager.Instance.Playsfx(AudioNames.Debug);
                        FieldsController.Instance.SendWFActionReq(this.FarmID, CommonActionBarView.Action1, 701);
                        FieldsController.ProtocalAction = (ProtocalAction)((int)CommonActionBarView.Action1);
                    }
                    else
                    {
                        SystemMsgView.SystemFunction(Function.Tip, Info.PlantNoBug);
                    }
                    break;

                case GameAction.Fertitlize:
                    //                        loadAni("Animation/chuchong");
                    //    0                    FieldsController.ProtocalAction =ProtocalAction.Fertitlize;
                    //
                    //                        MusicManager.Instance.Playsfx(AudioNames.Fertilizer);
                    break;

                case GameAction.Water:
                    if (this.plant.IsWater == 1)
                    {
                        loadAni("Animation/jiaoshui");

//                            MusicManager.Instance.Playsfx(AudioNames.Water);

                        FieldsController.Instance.SendWFActionReq(this.FarmID, CommonActionBarView.Action1, 701);
                        FieldsController.ProtocalAction = (ProtocalAction)((int)CommonActionBarView.Action1);
                    }
                    else
                    {
                        SystemMsgView.SystemFunction(Function.Tip, Info.PlantNoNeedWater);
                    }
                    break;

                case GameAction.weed:

                    if (this.plant.IsGrass == 1)
                    {
                        loadAni("Animation/chucao");

//                            MusicManager.Instance.Playsfx(AudioNames.Weed);
                        FieldsController.Instance.SendWFActionReq(this.FarmID, CommonActionBarView.Action1, 701);
                        FieldsController.ProtocalAction = (ProtocalAction)((int)CommonActionBarView.Action1);
                    }
                    else
                    {
                        SystemMsgView.SystemFunction(Function.Tip, Info.PlantNoNeedWeed);
                    }
                    break;
                }
            }
            //如果当前已经打开播种栏,则可以播�?&& this.Brand == null
            if (FieldsController.ProtocalAction == ProtocalAction.None && this.EnablePlant == 1 &&
                this.Plant == null & ViewMgr.Instance.isOpen(ViewNames.SeedBarView) && SeedActionModel.currentId_Seed != 0)
            {
                //
                if (Farm_Game_StoreInfoModel.storage.Seeds.ContainsKey(SeedActionModel.currentId_Seed))
                {
                    SeletedFarmID = this.farmID;
                    FieldsController.Instance.ReqSeedAction(this.farmID, SeedActionModel.currentId_Seed);
                }
            }
            else if ((this.Plant != null || this.Brand != null) && CommonActionBarView.Action1 == GameAction.None)
            {
                //复位
                SeedBarView.PlayBack();

                SeedActionModel.currentId_Seed = 0;
                //当前时间条不等于4
                if (this.Plant != null)
                {
                    GlobalDispatcher.Instance.AddListener(GlobalEvent.OnViewLoadFinished, Flash);
                    GlobalDispatcher.Instance.DispathDelay(GlobalEvent.OnFarmUnitClick, plant);


                    ViewMgr.Instance.Open(ViewNames.TimeBarView);
                }
            }
            //如果单个植物可以收获
            if (FieldsController.ProtocalAction == ProtocalAction.None && CommonActionBarView.Action1 == GameAction.None && plant != null && plant.CurrentType == 4)
            {
                if (FriendFarmManager.Instance.isVisiting == false)
                {
                    Debug.Log(string.Format("<color=#ffffffff><---{0}-{1}----></color>", "FieldId", FarmID));

                    FieldsController.Instance.SendPluckReq(this.FarmID, LoginModel.Instance.Uid);
                }
                else
                {
                    if (plant.IsSteal == 0)
                    {
                        Debug.Log(string.Format("<color=#ffffffff><---{0}-{1}----></color>", "FieldId", FarmID));

                        FieldsController.Instance.SendPluckReq(this.FarmID, FriendFarmManager.Instance.FriendUid);
                    }
                }
            }
        }
Ejemplo n.º 22
0
        IEnumerator wait()
        {
            yield return(0.3f);

            SystemMsgView.SystemFunction(Function.Tip, Game.Info.SeniorOilNotEnough);
        }
Ejemplo n.º 23
0
        //仓库信息输入
        public static void SetStoreAnwData(IList <PMsg_StagePropUnit> list)
        {
            StorageDeltaList storageDeltaList = Farm_Game_StoreInfoModel.storage;

            if (list != null)
            {
                for (int i = 0; i < list.Count; i++)
                {
                    //移除该id的信息,后面重新输入
                    storageDeltaList.Seeds.Remove(list[i].Id);
                    storageDeltaList.Results.Remove(list[i].Id);
                    storageDeltaList.Oils.Remove(list[i].Id);
                    storageDeltaList.DogFoods.Remove(list[i].Id);
                    storageDeltaList.Fertilizers.Remove(list[i].Id);
                    storageDeltaList.Elixirs.Remove(list[i].Id);
                    storageDeltaList.Formulas.Remove(list[i].Id);
                    //若数量为0,则表示该物品已从仓库移除

                    BaseAtrribute item = LoadObjctDateConfig.Instance.GetAtrribute(list[i].Id);

                    if (list[i].Count == 0)
                    {
                        switch (item.Type)
                        {
                        case ObjectType.Seed:
                            Debug.Log(string.Format("<color=#ffffffff><---{0}-{1}----></color>", list[i].Id, "test1"));

                            storageDeltaList.Seeds.Remove(list[i].Id);
                            Seed seed;
                            if (storageDeltaList.Seeds.TryGetValue(list[i].Id, out seed))
                            {
                                Debug.Log(string.Format("<color=#ffffffff><---{0}-{1}----></color>", seed.Name, "test1"));
                            }

                            Debug.Log(string.Format("<color=#ffffffff><---{0}-{1}----></color>", "test", "test1"));

                            break;

                        case ObjectType.Result:
                            storageDeltaList.Results.Remove(list[i].Id);
                            break;

                        case ObjectType.SeniorOil:
                        case ObjectType.PrimaryOil:
                        case ObjectType.SemiOil:
                            storageDeltaList.Oils.Remove(list[i].Id);
                            break;

                        case ObjectType.DogFood:
                            storageDeltaList.DogFoods.Remove(list[i].Id);
                            break;

                        case ObjectType.Fertilizer:
                            storageDeltaList.Fertilizers.Remove(list[i].Id);
                            break;

                        case ObjectType.elixir:
                            storageDeltaList.Elixirs.Remove(list[i].Id);
                            break;

                        case ObjectType.formula:
                            storageDeltaList.Formulas.Remove(list[i].Id);
                            break;

                        default:
                            Debug.LogError("后台返回了不该在仓库的东西:" + item.Name);
                            break;
                        }
                    }
                    else
                    {
                        if (item != null)
                        {
                            switch (item.Type)
                            {
                            case ObjectType.Seed:

                                storageDeltaList.Seeds.Add(list[i].Id, SetSeedAnwData(list[i]));
                                //                                Debug.Log(string.Format("<color=#ffffffff><---{0}-{1}----></color>", storageDeltaList.Seeds[list[i].Id].Name, storageDeltaList.Seeds[list[i].Id].ObjectNum));

                                break;

                            case ObjectType.Result:
                                storageDeltaList.Results.Add(list[i].Id, SetResultAnwData(list[i]));
                                break;

                            case ObjectType.SeniorOil:
                            case ObjectType.PrimaryOil:
                            case ObjectType.SemiOil:
                                storageDeltaList.Oils.Add(list[i].Id, SetOilAnwData(list[i]));
                                break;

                            case ObjectType.DogFood:
                                storageDeltaList.DogFoods.Add(list[i].Id, SetDogFoodAnwData(list[i]));
                                break;

                            case ObjectType.Fertilizer:
                                storageDeltaList.Fertilizers.Add(list[i].Id, SetFertilizerAnwData(list[i]));
                                break;

                            case ObjectType.elixir:
                                storageDeltaList.Elixirs.Add(list[i].Id, SetElixirAnwData(list[i]));
                                break;

                            case ObjectType.formula:
                                storageDeltaList.Formulas.Add(list[i].Id, SetFormulaAnwData(list[i]));
                                break;

                            default:
                                Debug.LogError("后台返回了不该在仓库的东西:" + item.Name);
                                break;
                            }
                        }
                    }
                }

                if (storageDeltaList.Seeds.Count == 0)
                {
                    if (ViewMgr.Instance.isOpen(ViewNames.SeedBarView))
                    {
                        SystemMsgView.SystemFunction(Function.OpenDialog, Info.SeedNumNotEngouth, ViewNames.ShopView, (
                                                         () =>
                        {
                            SeedBarView.PlayBack();
                        }));
                    }
                }
            }
            Farm_Game_StoreInfoModel.storage = storageDeltaList;
        }
Ejemplo n.º 24
0
        //0-2
        /// <summary>
        /// 弹出对话框
        /// </summary>
        /// <param name="msg"></param>
        private void AnwErrorInfoCallBack(MsgRec msg)
        {
            FieldsController.ProtocalAction = ProtocalAction.None;

            var info = (Farm_CommAnswer)msg._proto;

            errorInfo = (ErrorInfo)info.Result;
            string temp = info.Content;

            Debug.LogError(string.Format("<color=#ff0000ff><---{0}-{1}----></color>", "错误码", info.Result));
            if (temp != "")
            {
                SystemMsgView.SystemFunction(Function.Tip, temp, 2);
                return;
            }
            if (Info.Instance().infos.ContainsKey(info.Result))
            {
                string content = Info.Instance().infos[info.Result];

                Debug.Log(string.Format("<color=#ffffffff><---{0}-{1}----></color>", content, "test1"));

                if (info.Result == 119)
                {
                    SocketMgr.Instance._isneed2loginview = false;
                    SystemMsgView.SystemFunction(Function.Quit, content, 2);
                }
                else if (info.Result == 110)
                {
                }
                else if (info.Result == 124)
                {
                    MTRunner.Instance.StartRunner(Wait(1.5f, content));
                }
                else if (info.Result == 121)
                {
                }
                else if (info.Result == 130)
                {
                    GlobalDispatcher.Instance.Dispatch(GlobalEvent.OnDogCatch);
                    SystemMsgView.SystemFunction(Function.Tip, content, 2);

                    Debug.Log(string.Format("<color=#ffffffff><---{0}-{1}----></color>", FieldsController.Instance.currentFarmID, "test1"));

                    FieldsModel.Instance.DogCatch(FieldsController.Instance.currentFarmID);
                }
                else if (info.Result == 132)
                {
                    SystemMsgView.SystemFunction(Function.Tip, Info.BUYGAME, 2);
                    PayOrderInterfaceMgr.Instance.payfor = PayFor.Login;
                    ViewMgr.Instance.Open(ViewNames.PayChooseView);
                }
                else
                {
                    SystemMsgView.SystemFunction(Function.Tip, content, 2);
                }
            }


            //停止旋转
            LoadingImageManager.Instance.Ending();
        }
Ejemplo n.º 25
0
        IEnumerator Wait(float time, string content)
        {
            yield return(time);

            SystemMsgView.SystemFunction(Function.Tip, content, 2);
        }