示例#1
0
文件: Main.cs 项目: linxscc/LoveGame
    private void ForceToLoginView(bool isShowSwitch = false)
    {
        //这下面的执行顺序不要轻易修改
        UnityWebRequest.ClearCookieCache();
        SdkHelper.AccountAgent.IsLogin = false;
        _backBtn.Hide();
        ClientData.CustomerSelectedLevel        = null;
        ClientData.CustomerSelectedCapsuleLevel = null;
        GuideManager.Reset();
        ClientTimer.Instance.Cleanup();
        NetWorkManager.CookieStr = null;
        NetWorkManager.InitHead();
        ModuleManager.Instance.DestroyAllModule();
        GlobalData.InitData();
        PopupManager.CloseAllWindow();
        SdkHelper.CustomServiceAgent.Reset();
        LoadingProgress.Instance.Show();

        if (isShowSwitch)
        {
            ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_UPDATE, false, true, LoginCallbackType.Switch);
        }
        else
        {
            ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_UPDATE);
        }
    }
示例#2
0
    /// <summary>
    /// 领取音游活动任务奖励
    /// </summary>
    private void GetActivityMusicTaskAward(ActivityMissionVo vo)
    {
        GainActivityMissionAwardsReq req = new GainActivityMissionAwardsReq
        {
            ActivityId        = vo.ActivityId,
            ActivityMissionId = vo.ActivityMissionId,
        };

        byte[] data = NetWorkManager.GetByteData(req);
        NetWorkManager.Instance.Send <GainActivityMissionAwardsRes>(CMD.ACTIVITYC_GET_AWARDS, data, (res) =>
        {
            RewardUtil.AddReward(res.Awards);


            RewardVo rewardVo = null;
            foreach (var t in res.Awards)
            {
                rewardVo = new RewardVo(t);
            }

            if (rewardVo != null)
            {
                FlowText.ShowMessage(I18NManager.Get("Activity_Get", rewardVo.Name, rewardVo.Num));
            }
            _activityMissionModel.UpdateActivityMissionData(res.UserActivityMission);
            _taskWindow.SetData(_activityMissionModel.MusicUserMissionInfo);
            View.SetRedDot(_storyModel, _activityMissionModel);
            View.RefreshNum();
        });
    }
示例#3
0
    private void SendGiveGiftsRequest(FavorabilityGiveGiftsItemVO vo, int useNum)
    {
        UpgradeFavorabilityLevelReq req = new UpgradeFavorabilityLevelReq
        {
            Player = GlobalData.FavorabilityMainModel.CurrentRoleVo.Player,
            ItemId = vo.ItemId,
            Num    = useNum,
        };

        byte[] data = NetWorkManager.GetByteData(req);
        NetWorkManager.Instance.Send <UpgradeFavorabilityLevelRes>(CMD.FAVORABILITY_UPGRADEFAVORABILITYLEVEL, data, res =>
        {
            var realyExp = GlobalData.FavorabilityMainModel.GetCurExp(res.UserFavorability.Exp, res.UserFavorability.Level);
            GlobalData.PropModel.UpdateProps(new UserItemPB[] { res.UserItem });
            GlobalData.FavorabilityMainModel.UpdataCurrentRoleVo(res.UserFavorability);
            View.UpDataDummyData(res.UserItem.Num, realyExp, res.UserFavorability.Level, res.UserFavorability.Exp);
            _model.UpDataListItemNum(res.UserItem.ItemId, res.UserItem.Num);
            View.IsGetRemoteServerData = true;
            LoadingOverlay.Instance.Hide();
            var pbId = (int)GlobalData.FavorabilityMainModel.CurrentRoleVo.Player;

            SendMessage(new Message(MessageConst.CMD_FACORABLILITY_TIGGER_LIVE2D_VOICE, Message.MessageReciverType.CONTROLLER, pbId, vo.ItemId));
        }, errorVo =>
        {
            View.IsGetRemoteServerData = true;
            LoadingOverlay.Instance.Hide();
        });
    }
示例#4
0
    void ActivityUserDataRefresh()
    {
//        NetWorkManager.Instance.Send<ActivityRes>(CMD.ACTIVITY_ACTIVITYLIST, null, res =>
//        {
//            GlobalData.ActivityModel.GetAllActivityRes(res);
//            _model.Init(GlobalData.ActivityModel.BaseTemplateActivityRule, GlobalData.ActivityModel.ActivityListRes);
//            View.SetData(_model.GetActivityVo(), _model.LeftTime(), _model.EndTime(), _model.CurDrawTime);
//            SendMessage(new Message(MessageConst.CMD_ACTIVITY_REFRESH_ACTIVITYTOGGLE_REDDOT));
//        });

        ActivityListReq req = new ActivityListReq
        {
            ActivityId = _model.activitId,
        };

        byte[] data = NetWorkManager.GetByteData(req);

        NetWorkManager.Instance.Send <ActivityListRes>(CMD.ACTIVITY_ACTIVITYLISTS2, data, res =>
        {
            GlobalData.ActivityModel.AddDataToActivityListDic(_curActivity.ActivityType, res);
            var activityListRes = GlobalData.ActivityModel.GetActivityTemplateListRes(_curActivity.ActivityType);
            _model.Init(GlobalData.ActivityModel.BaseTemplateActivityRule, activityListRes);

            View.SetData(_model.GetActivityVo(), _model.LeftTime(), _model.EndTime(), _model.CurDrawTime);
            SendMessage(new Message(MessageConst.CMD_ACTIVITY_REFRESH_ACTIVITYTOGGLE_REDDOT));
        });
    }
示例#5
0
        private void GetRealNameAward()
        {
            //本地校验下
            int awardID   = (int)OptionalActivityTypePB.OptionalVerified;
            var awardList = GlobalData.PlayerModel.PlayerVo.ExtraAwardInfo;

            GlobalData.PlayerModel.PlayerVo.Addication = true;
            bool isGet = awardList.Contains(awardID);

            if (isGet)
            {
                return;
            }

            VerifiedInfoPB verifiedInfoPb = new VerifiedInfoPB
            {
                Account = SdkHelper.AccountAgent.AccountId,
                Pwd     = SdkHelper.AccountAgent.Token,
            };
            ReceiveUserExtraAwardsReq req = new ReceiveUserExtraAwardsReq
            {
                OptionalActivityType = OptionalActivityTypePB.OptionalVerified,
                Verified             = verifiedInfoPb,
            };

            byte[] data = NetWorkManager.GetByteData(req);
            NetWorkManager.Instance.Send <ReceiveUserExtraAwardsRes>(CMD.USERC_RECEIVEUSEREXTRAAWARDS, data, res =>
            {
                Debug.LogError(res.UserExtraInfo);
                GlobalData.PlayerModel.UpdataUserExtra(res.UserExtraInfo);
                ManualSetMailRedPoint();
            });
        }
示例#6
0
    //购买星缘回忆体力
    private void BuyEnergy()
    {
        int energyGem = _model.GetEnergyGem();

        if (energyGem != -1)
        {
            PopupManager.ShowBuyWindow(PropConst.RecolletionIconId, PropConst.GemIconId, energyGem).WindowActionCallback = evt =>
            {
                if (evt != WindowEvent.Ok)
                {
                    return;
                }

                byte[] data = NetWorkManager.GetByteData(new BuyMemoriesConsumeReq
                {
                    Type = MemoriesConsumeTypePB.MemoriesBuyPower
                });
                NetWorkManager.Instance.Send <BuyMemoriesConsumeRes>(CMD.CARDMEMORIESC_BUYMEMORIESCONSUME, data,
                                                                     OnBuyEnergySuccess);
            };
        }
        else
        {
            int lastGem = _model.GetEnergyLastGem();

            PopupManager.ShowBuyWindow(PropConst.RecolletionIconId, PropConst.GemIconId, lastGem).WindowActionCallback = evt =>
            {
                if (evt != WindowEvent.Ok)
                {
                    return;
                }
                FlowText.ShowMessage(I18NManager.Get("Recollection_Hint7"));
            };
        }
    }
示例#7
0
    public void SetRemoteGuideStep(GuideTypePB guideType, int step)
    {
        //step = 1000;
        var currentStep = GuideManager.GetRemoteGuideStep(guideType);

        //引导步骤大于要设置的步骤的时候不做处理
        Debug.LogError("currentStep" + currentStep + "step" + step);
        if (currentStep >= step)
        {
            return;
        }
        LoadingOverlay.Instance.Show();

        var req = new GuideReq
        {
            GuideType = guideType,
            GuideId   = step
        };

        Debug.LogError("guideType:" + guideType + "  step:" + step);

        var buffer = NetWorkManager.GetByteData(req);

        NetWorkManager.Instance.Send <GuideRes>(CMD.USERC_GUIDE, buffer, OnSetGuideSuccess);
    }
示例#8
0
        private void RefershTask()
        {
            var buffer = NetWorkManager.GetByteData(new MissionRefreshReq {
            });

            NetWorkManager.Instance.Send <MissionRefreshRes>(CMD.MISSION_REFRESH, buffer, DailyRefreshMission);
        }
示例#9
0
 public void Init()
 {
     time         = new Time();
     time.update += Update;
     net          = new NetWorkManager();
     net.Init(this);
 }
示例#10
0
 void Awake()
 {
     Instance     = this;
     PathURL      = Path.Combine(new DirectoryInfo(Application.dataPath).Parent.FullName, "Images");
     LocationPath = "file:///" + PathURL;
     VideoPath    = "file://" + PathURL.Replace('\\', '/');
 }
    void SendResult()
    {
        var mode = GetData <MusicRhythmModel>();

        if (mode.MusicGameType == MusicGameType.Activity)
        {
            var req = new ChallengeActivityMusicReq();
            req.Score      = mode.runningInfo.Socre;
            req.MusicId    = mode.runningInfo.musicId;
            req.DiffType   = mode.runningInfo.diff;
            req.ActivityId = mode.runningInfo.activityId;

            var dataBytes = NetWorkManager.GetByteData(req);
            NetWorkManager.Instance.Send <ChallengeActivityMusicRes>(CMD.ACTIVITYC_CHALLENGEACTIVITYMUSIC, dataBytes, OnSendResultHandler, OnSendResultHandlerError);
        }
        else if (mode.MusicGameType == MusicGameType.TrainingRoom)
        {
            EndPlayingReq req = new EndPlayingReq()
            {
                ActivityId = mode.runningInfo.activityId,
                DiffType   = (int)mode.runningInfo.diff,
                MusicId    = mode.runningInfo.musicId,
                Score      = mode.runningInfo.Socre
            };
            var dataBytes = NetWorkManager.GetByteData(req);
            NetWorkManager.Instance.Send <EndPlayingRes>(CMD.MUSICGAMEC_ENDPLAYING, dataBytes, OnEndTrainingRoomGame);
        }
    }
    //发送每天体力签到请求
    private void SendPowerGetRewardReq(EveryDayPowerVO vO)
    {
        PowerGetRewardReq req = new PowerGetRewardReq
        {
            Id = vO.Id,
        };

        byte[] data = NetWorkManager.GetByteData(req);
        NetWorkManager.Instance.Send <PowerGetRewardRes>(CMD.ACTIVITY_GET_POWER, data, res =>
        {
            for (int i = 0; i < res.Awards.Count; i++)
            {
                RewardUtil.AddReward(res.Awards[i]);
            }                                                                                    //增加奖励数据
            GlobalData.ActivityModel.UpdataUserPowerGottenIds(res.GottenIds);                    //更新ActivityModel用户每日体力签到次数集合数据
            for (int i = 0; i < res.GottenIds.Count; i++)
            {
                everydayPowerModel.UpdataEveryDayPowerList(res.GottenIds[i]);
            }                                                                        //更新用户每日体力集合
            View.RefreshData(everydayPowerModel.GetEveryDayPowerList());             //重新生成

            SendMessage(new Message(MessageConst.CMD_ACTIVITY_REFRESH_ACTIVITYTOGGLE_REDDOT));

            AudioManager.Instance.PlayEffect("buypower");
        }, errCallback => {
            everydayPowerModel.Init();
            View.RefreshData(everydayPowerModel.GetEveryDayPowerList());
        });
    }
    //发送每日体力补签请求
    private void SendRetroactiveEverydayPowerAwardReq(EveryDayPowerVO vO)
    {
        PowerBuyGetReq req = new PowerBuyGetReq
        {
            Id = vO.Id,
        };

        byte[] data = NetWorkManager.GetByteData(req);
        NetWorkManager.Instance.Send <PowerBuyGetRes>(CMD.ACTIVITY_BUY_GET_POWER, data, res =>
        {
            for (int i = 0; i < res.Awards.Count; i++)
            {
                RewardUtil.AddReward(res.Awards[i]);
                FlowText.ShowMessage(I18NManager.Get("Activity_RetroactiveSucceed"));
            }  //增加奖励数据
            GlobalData.ActivityModel.UpdataUserPowerGottenIds(res.GottenIds);                    //更新ActivityModel用户每日体力签到次数集合数据
            for (int i = 0; i < res.GottenIds.Count; i++)
            {
                everydayPowerModel.UpdataEveryDayPowerList(res.GottenIds[i]);
            }                                                                        //更新用户每日体力集合
            View.RefreshData(everydayPowerModel.GetEveryDayPowerList());             //重新生成
            GlobalData.PlayerModel.UpdateUserMoney(res.UserMoney);                   //更新用户的钱

            SendMessage(new Message(MessageConst.CMD_ACTIVITY_REFRESH_ACTIVITYTOGGLE_REDDOT));
        });

        AudioManager.Instance.PlayEffect("buypower");
    }
    private void UpdatePlayerBirthdayRefresh(int obj)
    {
        var refreshTimeStamp =
            _missionModel.GetPlayerBirthdayRefreshTimePointList()[_missionModel.GetPlayerBirthdayOpenDay()];
        var curTimeStamp  = ClientTimer.Instance.GetCurrentTimeStamp();
        var overTimeStamp = _missionModel.GetPlayerBirthdayOverTimeStamp();

        if (curTimeStamp == overTimeStamp)
        {
            ModuleManager.Instance.GoBack();
            return;
        }

        if (refreshTimeStamp == curTimeStamp)
        {
            MissionRefreshReq req = new MissionRefreshReq();
            var data = NetWorkManager.GetByteData(req);
            NetWorkManager.Instance.Send <MissionRefreshRes>(CMD.MISSION_REFRESH, data, res =>
            {
                _missionModel.UpdateUserMissionInfo(res.UserMissionInfo);
                _missionModel.UpdatePlayerBirthdayMission(res.UserMissions);

                _missionModel.PlayerBirthdayMissionsDay = _missionModel.GetPlayerBirthdayOpenDay();
                View.SetData(_missionModel, _missionModel.PlayerBirthdayMissionsDay);
            });
        }
    }
示例#15
0
    // Use this for initialization

    public override void Init()
    {
        Application.targetFrameRate = 45;
        Debug.Log("GameManager LoadStart");
        _loadIndex = 0;

        _stateList    = new List <string>();
        _loadFuncList = new List <UnityAction>();

        //加载地址文件
        _stateList.Add(GAME_LOAD_SETP_EVENT.LOAD_PATH);
        _loadFuncList.Add(PathManager.ParsePath);
        //加载本地化文本
        _stateList.Add(GAME_LOAD_SETP_EVENT.LOAD_WORD);
        _loadFuncList.Add(LocalString.ParseWord);

        //加载表情资源
        //_stateList.Add(GAME_LOAD_SETP_EVENT.LOAD_FACE_ASSET);
        //_loadFuncList.Add(SpriteFaceCache.ParseAsset);

        LoadDataIndex();

        if (NetWorkConst.IsOpenNetWork)
        {
            NetWorkManager.GetInstance().Init();
            NetWorkManager.GetInstance().RequestConnect();
        }
    }
示例#16
0
    private void OkBtn()
    {
        if (input.text == "")
        {
            FlowText.ShowMessage(I18NManager.Get("GameMain_SetPanelHint5")); return;
        }

        string str = input.text;

        Debug.LogError(str);
        UserModifyNameReq req = new UserModifyNameReq
        {
            NewUserName = str,
        };

        byte[] data = NetWorkManager.GetByteData(req);
        NetWorkManager.Instance.Send <UserModifyNameRes>(CMD.USERC_USERMODIFYNAME, data, res =>
        {
            GlobalData.PlayerModel.UpdateUserMoney(res.UserMoney);
            GlobalData.PlayerModel.UpdataUserGameName(res.User, res.UserExtraInfo);

            EventDispatcher.TriggerEvent(EventConst.UpDataSetPanelName);
            FlowText.ShowMessage(I18NManager.Get("GameMain_SetPanelHint4"));
            EventDispatcher.TriggerEvent(EventConst.UpdataSupporterFansViewName);
            Close();
        });
    }
示例#17
0
    private void Awake()
    {
        _instance = this;
        NetWorkManager nw = new NetWorkManager();

        nw.InitNetWork(1024);
    }
    //扭蛋
    private void SendDrawReq(System.Action <int> finishCallback = null)
    {
        ActivityCapsuleTemplateModel model = GetData <ActivityCapsuleTemplateModel>();

        if (model.costItem != null)
        {
            int num = PropUtils.GetUserPropNum(model.costItem.ResourceId);
            if (num < model.costItem.Num)
            {
                PopupManager.ShowAlertWindow(I18NManager.Get("ActivityCapsuleTemplate_drawNoEnoughItem"));
                return;
            }
        }

        DrawAwardReq req = new DrawAwardReq
        {
            ActivityId = model.CurActivityId
        };

        byte[] data = NetWorkManager.GetByteData(req);
        NetWorkManager.Instance.Send <DrawAwardRes>(CMD.ACTIVITYC_CAPSULE_DRAW_AWARD, data, (res) =>
        {
            GlobalData.PropModel.UpdateProps(new[] { res.UserItem });
            View.UpdateUserProp(GetData <ActivityCapsuleTemplateModel>());
            if (finishCallback != null)
            {
                finishCallback(res.AwardId);
            }
        });
    }
示例#19
0
    /// <summary>
    ///     设置新手引导统计点
    /// </summary>
    /// <param name="step"></param>
    /// <param name="guideType"></param>
    public void SetStatisticsRemoteGuideStep(int step)
    {
        var type     = GuideTypePB.MainGuideRecord;
        var lastStep = GuideManager.GetRemoteGuideStep(type); //获取上次的点

        Debug.LogError("获取统计上次的点===>" + lastStep);
        if (step <= lastStep)
        {
            Debug.LogError("拦截掉重复发的点===>" + step);
            return;
        }

        ClientTimer.Instance.DelayCall(() =>
        {
            Debug.LogError("发送统计的点p===>" + step);
            var req = new GuideReq
            {
                GuideType = type,
                GuideId   = step
            };
            var buffer = NetWorkManager.GetByteData(req);
            NetWorkManager.Instance.Send <GuideRes>(CMD.USERC_GUIDE, buffer, res =>
            {
                Debug.LogError("更新统计点===>" + res.UserGuide.GuideId + "更新的统计类型===>" + res.UserGuide.GuideType);
                GuideManager.UpdateRemoteGuide(res.UserGuide);
            });
        }, 0.3f);
    }
示例#20
0
    private void SendMailGottenReq()
    {
        Transform parent = _yesAttachment.Find("Award/Awards/Content");

        MailGottenReq req = new MailGottenReq
        {
            Id = _data.Id,
        };

        byte [] data = NetWorkManager.GetByteData(req);
        NetWorkManager.Instance.Send <MailGottenRes>(CMD.MAIL_GOTTEN, data, res => {
            if (res.UserMail.Awards.Count != 0)
            {
                for (int i = 0; i < res.UserMail.Awards.Count; i++)
                {
                    RewardUtil.AddReward(res.UserMail.Awards[i]);
                }
                FlowText.ShowMessage(I18NManager.Get("Mail_GetAward"));//("奖励已领取");
                for (int i = 0; i < parent.childCount; i++)
                {
                    parent.GetChild(i).Find("Mask").gameObject.SetActive(true);
                }

                StatisticsMailGetGemNums(res.UserMail.Awards.ToList());
            }

            _data.ReadStatus = res.UserMail.MailStatus;
            HideBtn();
            EventDispatcher.TriggerEvent(EventConst.GetOneMailAwardSucceed, _data);
        });
    }
示例#21
0
    public void SendBlessingMsg(BlessResult bless)
    {
        Debug.Log(_curVisitVo.NpcId + "  " + _curVisitVo.CurWeatherName);
        Debug.Log(bless);


        if (GlobalData.PlayerModel.PlayerVo.Gem < _curVisitVo.BlessCost)
        {
            FlowText.ShowMessage(I18NManager.Get("Shop_NotEnoughGem"));
            WeatherView.FailedBless();
            return;
        }


        if (_curVisitVo.CurWeather == VISIT_WEATHER.Fine)
        {
            return;
        }

        BlessReq req = new BlessReq
        {
            Player = _curVisitVo.NpcId,
            Level  = (int)bless
        };
        var dataBytes = NetWorkManager.GetByteData(req);

        NetWorkManager.Instance.Send <BlessRes>(CMD.VISITINGC_BLESS, dataBytes, OnVisitingBlessHandler, OnVisitingBlessHandlerError);
    }
示例#22
0
    private void DeleteBtn()
    {
        var curTimeStamp = ClientTimer.Instance.GetCurrentTimeStamp();

        if (curTimeStamp < _data.OutDateTime)
        {
            //触发删除指定邮件
            ClearOneReq req = new ClearOneReq
            {
                Id = _data.Id
            };
            byte [] data = NetWorkManager.GetByteData(req);
            NetWorkManager.Instance.Send <ClearOneRes>(CMD.MAIL_CLEARONE, data, res =>
            {
                var id = res.UserMail.Id;
                EventDispatcher.TriggerEvent(EventConst.DeleteOneMail, id);
                Close();
            });
        }
        else
        {
            FlowText.ShowMessage(I18NManager.Get("Mail_MailOverdue"));// ("该邮件已过期");
            EventDispatcher.TriggerEvent(EventConst.MailPastDue, _data.Id);
            Close();
        }
    }
示例#23
0
    public void UpdateStoryEndData(int[] array)
    {
        var appointmentgate = array[0];
        var appointmentid   = array[1];
//		Debug.LogError("Appointmentdata"+array[0]);
        var userapoointment = GlobalData.AppointmentData.GetUserAppointment(appointmentid);
        var state           = GlobalData.AppointmentData.IsGateActive(userapoointment.AppointmentId,
                                                                      appointmentgate);

        if (state != GateState.Finish)
        {
            var buffer = NetWorkManager.GetByteData(new PassGateReq()
            {
                AppointmentId = appointmentid,
                Gate          = appointmentgate
            });

            LoadingOverlay.Instance.Show();
            NetWorkManager.Instance.Send <PassGateRes>(CMD.APPOINTMENT_PASSGATE, buffer,
                                                       UpdateAppointmentInfo);
        }
        else
        {
            Debug.LogError("Has pass");
            //这里有BUG了!
            //ModuleManager.Instance.GoBack();
        }
    }
示例#24
0
    //发送更换头像请求
    private void SendChangeHeadReq()
    {
        //本地校验

        var isHeadUnlock      = _model.GetHeadInfo(_headId).IsUnlock;
        var isHeadFrameUnlock = _model.GetHeadFrameVo(_headFrameId).IsUnlock;

        if (!isHeadUnlock || !isHeadFrameUnlock)
        {
            if (!isHeadUnlock)
            {
                FlowText.ShowMessage("当前头像未解锁~");
            }

            if (!isHeadFrameUnlock)
            {
                FlowText.ShowMessage("当前头像框未解锁~");
            }

            return;
        }

        //发更换请求
        LoadingOverlay.Instance.Show();
        ReplaceUserAvatarOrBoxReq req = new ReplaceUserAvatarOrBoxReq {
            Avatar = _headId, AvatarBox = _headFrameId,
        };

        byte[] data = NetWorkManager.GetByteData(req);
        NetWorkManager.Instance.Send <ReplaceUserAvatarOrBoxRes>(CMD.USERC_REPLACEUSERAVATARORBOX, data,
                                                                 GetChangeHeadRes);
    }
示例#25
0
        private void SetCommentRes(bool comtype, string comment, int star)
        {
            var buffer = NetWorkManager.GetByteData(new CommentReq
            {
                Comment = comment, Star = star, Type = comtype ? 1 : 0
            });

            NetWorkManager.Instance.Send <CommentRes>(CMD.STORESCORE_Comment, buffer, res =>
            {
                GlobalData.PlayerModel.UpdateUserMoney(res.UserMoney);
                _storeScoreWindow.Close();
                if (_awardWindow == null)
                {
                    _awardWindow = PopupManager.ShowWindow <AwardWindow>("GameMain/Prefabs/AwardWindow/AwardWindow");
                }
                RepeatedField <AwardPB> gemAward = new RepeatedField <AwardPB>();
                AwardPB awardPb = new AwardPB()
                {
                    Num = 10, Resource = ResourcePB.Gem, ResourceId = 30001
                };
                gemAward.Add(awardPb);

                _awardWindow.SetData(gemAward);


                //评分完成且拿完奖励后去商店评分!
                if (comtype)
                {
                    Debug.LogError("COMMENT URL" + GlobalData.VersionData.ForceUpdateAddr);
                    Application.OpenURL(GlobalData.VersionData.ForceUpdateAddr);
                }
            });
        }
    private void GetCardAward(SevenSigninTemplateAwardVo vo)
    {
        GainSevenDayAwardReq req = new GainSevenDayAwardReq
        {
            ActivityId = vo.ActivityId,
        };

        byte[] data = NetWorkManager.GetByteData(req);
        NetWorkManager.Instance.Send <GainSevenDayAwardRes>(CMD.ACTIVITY_GAINSEVENDAYAWARD, data, res =>
        {
            RewardUtil.AddReward(res.Awards);
            _model.UpdateUserSevenDaySigninTemplateInfo(res.UserSevenDaySigninIndo);
            _model.UpdateSevenDayAwardList(res.UserSevenDaySigninIndo.SignDay);
            View.Refresh(vo.DayId);//刷新特殊处理下
            SendMessage(new Message(MessageConst.CMD_ACTIVITY_REFRESH_ACTIVITYTOGGLE_REDDOT));
            Action finish = () =>
            {
                SendMessage(new Message(MessageConst.CMD_ACTIVITY_SHOW_BAR_AND_BACKBTN));
            };
            SendMessage(new Message(MessageConst.CMD_ACTIVITY_HINT_BAR_AND_BACKBTN));

            List <AwardPB> temp = res.Awards.ToList();
            ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_DRAWCARD,
                                               false, false, "DrawCard_CardShow", temp, finish, false);
        });
    }
示例#27
0
    private void InitGetData()
    {
        ActivityListReq req = new ActivityListReq
        {
            ActivityId = _curActivity.ActivityId,
        };

        byte[] data = NetWorkManager.GetByteData(req);

        NetWorkManager.Instance.Send <ActivityListRes>(CMD.ACTIVITY_ACTIVITYLISTS2, data, res =>
        {
            GlobalData.ActivityModel.AddDataToActivityListDic(_curActivity.ActivityType, res);
            _model = new ActivityMusicTemplateModel(_curActivity);
            View.SetEntranceShow(_model.IsOpenMusicTemplateStoryEntrance, _model.IsOpenMusicExchangeShopEntrance, _model.IsOpenMusicTemplateTaskEntrance);
            GlobalData.CapsuleLevelModel.SetCapsuleBattleData(_curActivity);
            GlobalData.CapsuleLevelModel.SetMyCapsuleBattleLevelData();
            var list = GlobalData.CapsuleLevelModel.GetLevelRule(_curActivity.ActivityId);

            View.SetData(_curActivity, list);
            View.FirstShowRuleWindow(_model.GetPlayRule());
            InitModel();
            View.SetRedDot(_storyModel, _activityMissionModel);

            NetWorkManager.Instance.Send <Rules>(CMD.MUSICGAMEC_RULES, null, OnGetMusicGameRule, null, true, GlobalData.VersionData.VersionDic[CMD.MUSICGAMEC_RULES]);
        });
    }
示例#28
0
    protected void OnPaySuccess(string data)
    {
        Debug.LogWarning("===SDK===OnPaySuccess=======" + data);

        CheckOrderReqs reqList = new CheckOrderReqs();

        CheckOrderReq req = new CheckOrderReq()
        {
            Channel       = PayAgent.GetPaySdk(payType),
            Origin        = PayChannel,
            Environment   = 0,
            Params        = "",
            OrderId       = data,
            PayType       = (int)payType,
            Tag           = AppConfig.Instance.payKey,
            SdkVersion    = PayVersion.GetPayVersion(payType),
            Version       = PayVersion.GetPaySdkVersion(payType),
            TriggerGiftId = new TriggerGiftIdPb()
            {
                Id = _product.ExtInt
            }
        };

        req.ExtInfo = GalaSDKBaseFunction.SdkFetchTokenWithType("");

        reqList.CheckOrderReqs_.Add(req);
        payChecker.AddToCheckList(req.OrderId);

        Debug.LogWarning("===SDK===OnPaySuccess==>" + ObjectDumper.Dump(reqList));

        byte[] bytes = NetWorkManager.GetByteData(reqList);

        NetWorkManager.Instance.Send <CheckOrderRess>(CMD.RECHARGEC_CHECKORDER, bytes, OnCheckOrdersSuccess,
                                                      OnCheckOrdersFail);
    }
示例#29
0
 /// <summary>
 /// 连接上服务器
 /// </summary>
 void OnConnect(IAsyncResult asr)
 {
     outStream = client.GetStream();
     isConnect = true;
     client.GetStream().BeginRead(byteBuffer, 0, MAX_READ, new AsyncCallback(OnRead), null);
     NetWorkManager.AddEvent(Protocal.Connect, new ByteBuffer());
 }
示例#30
0
 void joinFunc()
 {
     publicVariable.setRoomName(JoinInputField.text);
     publicVariable.setIsCreate(false);
     NetWorkManager.SetActive(true);
     aud.PlayOneShot(ButtonSound);
 }