Пример #1
0
        /// <summary>
        /// 角色日志接口
        /// </summary>
        public void PostRoleInfo()
        {
            GlobalConfig globalConfig = GlobalConfig.GetInstance();

            GlobalConfig.LoginInfoStruct loginInfo = globalConfig.LoginInfo;
            IBridge bridge = DBOSManager.getDBOSManager().getBridge();

            if (loginInfo == null || loginInfo.ServerInfo == null)
            {
                return;
            }

            string url = GlobalConfig.GetInstance().LogURLV + "RoleInfo";

            url += "?account=" + loginInfo.AccName;
            url += "&provider=" + globalConfig.SDKName;
            url += "&device_mark=" + globalConfig.DeviceMark;
            url += "&server_id=" + loginInfo.ServerInfo.ServerId;
            url += "&os=" + globalConfig.PlatformName;
            url += "&level=" + loginInfo.Level;
            url += "&role_id=" + loginInfo.RId;
            url += "&role_name=" + WWW.EscapeURL(loginInfo.Name);
            url += "&icon_id=" + loginInfo.Job;
            url += "&job=" + loginInfo.Job;
            url += "&game_mark=" + globalConfig.GameMark;
            url += "&mobile=" + bridge.getPhoneModel();
            url += "&net=" + bridge.getNetType();
            url += "&ticket=" + WWW.EscapeURL(loginInfo.Ticket);
            // 获取不到IMEI(例如玩家不给权限),就用玩家唯一id代替
            string imei = bridge.getPhoneIMEI();

            if (string.IsNullOrEmpty(imei) == false)
            {
                url += "&imei=" + imei;
            }
            else
            {
                url += "&imei=" + loginInfo.RId;
            }
            url += "&roleInfo=" + "transfer_lv:" + TransferHelper.GetTransferLevel();   // 自定义角色数据,例:roleInfo=tran_lv:213#icon_id:3#gander:man
            url += "&xg_device_id=" + globalConfig.XgDeviceId;
            url += "&vip=" + VipHelper.GetVipValidLevel();
            url += "&app_id=" + globalConfig.AppId;
            url += "&access_id=" + bridge.getXgAccessId();

            MainGame.HttpRequest.GET(url, OnPostRoleInfoFinished, null);
        }
Пример #2
0
        public override void SetSenderLevel(int level, uint transferLv)
        {
            if (mSenderPeakLvBg != null)
            {
                uint peakLv = 0;

                // 巅峰等级
                bool isPeak = TransferHelper.IsPeak((uint)level, out peakLv, transferLv);

                mSenderPeakLvBg.SetActive(isPeak);
                mSenderLevelText.text = peakLv.ToString();
            }
            else
            {
                mSenderLevelText.text = level.ToString();
            };
        }
Пример #3
0
 public bool GotoTransfer(params object[] args)
 {
     if (!SysConfigManager.GetInstance().CheckSysHasOpened(GameConst.SYS_OPEN_TRANSFER, true))
     {
         return(false);
     }
     if (!CheckSysDownloaded(GameConst.SYS_OPEN_TRANSFER))
     {
         return(false);
     }
     if (args.Length == 1 && args[0].ToString() == "2801")   //使用龙珠
     {
         List <string> levels = DBManager.Instance.QuerySqliteField <string>(GlobalConfig.DBFile, "data_transfer", "id", "4", "open_lv");
         if (TransferHelper.GetTransferLevel() < 3 || LocalPlayerManager.Instance.LocalActorAttribute.Level < int.Parse(levels[0]))
         {
             UINotice.Instance.ShowMessage(xc.DBConstText.GetText("TRANSFER_USE_GOODS_LIMIT"));
             return(false);
         }
     }
     UIManager.GetInstance().ShowSysWindow("UITransferWindow");
     return(true);
 }
Пример #4
0
        /// <summary>
        /// 飞鞋
        /// </summary>
        public static bool TravelBootsJump(Vector3 pos, uint instanceId = 0, bool isFree = false, uint line = 1, bool isAutoFighting = false)
        {
            if (instanceId == 0)
            {
                instanceId = SceneHelp.Instance.CurSceneID;
            }

            if (PKModeManagerEx.Instance.TryToOtherDungeonScene() == false)
            {
                return(false);
            }

            DBInstance.InstanceInfo instanceInfo = DBInstance.Instance.GetInstanceInfo(instanceId);
            if (instanceInfo == null)
            {
                GameDebug.LogError("Travel boots ump to scene " + instanceId + " error, can not find instance info!!!");
                return(false);
            }

            // 本地玩家处于护送状态不能用飞鞋
            if (CheckLocalPlayerEscortTaskState() == false)
            {
                return(false);
            }

            // 检查道具
            if (isFree == false)
            {
                if (VipHelper.GetIsFlyFree() == false)
                {
                    uint need_goods = GameConstHelper.GetUint("GAME_ITEM_TRAVEL_BOOTS");
                    if (need_goods > 0)
                    {
                        var num = ItemManager.Instance.GetGoodsNumForBagByTypeId(need_goods);
                        if (num <= 0)
                        {
                            UINotice.Instance.ShowMessage(DBConstText.GetText("ITME_NUM_NOTENOUGH"));
                            return(false);
                        }
                    }
                }
            }

            bool isInstance = false;

            if (instanceInfo.mWarType == GameConst.WAR_TYPE_DUNGEON)
            {
                isInstance = true;
            }

            // 检查是否达到等级
            uint needLv = InstanceHelper.GetInstanceNeedRoleLevel(instanceId);

            if (LocalPlayerManager.Instance.LocalActorAttribute.Level < needLv)
            {
                // 巅峰等级
                uint   peakLv   = 0;
                bool   isPeak   = TransferHelper.IsPeak(needLv, out peakLv);
                string levelStr = "";
                if (isPeak)
                {
                    levelStr = string.Format(DBConstText.GetText("UI_PLAYER_PEAK_LEVEL_FORMAT_2"), peakLv); // 巅峰{0}
                }
                else
                {
                    levelStr = peakLv.ToString(); // {0}
                }
                if (isInstance == true)
                {
                    UINotice.Instance.ShowMessage(string.Format(DBConstText.GetText("INSTANCE_IS_NOT_UNLOCK_NEED_LEVEL"), levelStr));
                }
                else
                {
                    UINotice.Instance.ShowMessage(string.Format(DBConstText.GetText("WILD_INSTANCE_IS_NOT_UNLOCK_NEED_LEVEL"), levelStr));
                }
                return(false);
            }

            // 检查是否通关某主线任务
            uint needTaskId = instanceInfo.mNeedTaskId;

            if (needTaskId > 0)
            {
                if (TaskHelper.MainTaskIsPassed(needTaskId) == false)
                {
                    TaskDefine needTaskDefine = TaskDefine.MakeDefine(needTaskId);
                    if (needTaskDefine != null)
                    {
                        // 巅峰等级
                        uint   peakLv   = 0;
                        bool   isPeak   = TransferHelper.IsPeak((uint)needTaskDefine.RequestLevelMin, out peakLv);
                        string levelStr = "";
                        if (isPeak)
                        {
                            levelStr = string.Format(DBConstText.GetText("UI_PLAYER_PEAK_LEVEL_FORMAT_2"), peakLv); // 巅峰{0}
                        }
                        else
                        {
                            levelStr = peakLv.ToString(); // {0}
                        }
                        if (isInstance == true)
                        {
                            UINotice.Instance.ShowMessage(string.Format(DBConstText.GetText("INSTANCE_IS_NOT_UNLOCK_NEED_TASK"), levelStr, needTaskDefine.Name, instanceInfo.mName));
                        }
                        else
                        {
                            UINotice.Instance.ShowMessage(string.Format(DBConstText.GetText("WILD_INSTANCE_IS_NOT_UNLOCK_NEED_TASK"), levelStr, needTaskDefine.Name, instanceInfo.mName));
                        }
                    }
                    return(false);
                }
            }

            // 判断是否可到达
            if (instanceId == SceneHelp.Instance.CurSceneID)
            {
                if (InstanceHelper.CanWalkTo(pos) == false)
                {
                    UINotice.Instance.ShowMessage(DBConstText.GetText("MAP_POS_CAN_NOT_REACH"));
                    return(false);
                }
            }

            // 跳往不同的场景需要加个转圈,防止同时多次跳转
            if (instanceId != SceneHelp.Instance.CurSceneID)
            {
                ui.ugui.UIManager.GetInstance().ShowWaitScreen(true);
            }

            C2STravelBootsJump data = new C2STravelBootsJump();

            data.dungeon_id = instanceId;
            data.line       = line;
            PkgNwarPos pkgNwarPos = new PkgNwarPos();

            pkgNwarPos.px = (int)(pos.x / GlobalConst.UnitScale);
            pkgNwarPos.py = (int)(pos.z / GlobalConst.UnitScale);
            data.pos      = pkgNwarPos;
            if (isFree == true)
            {
                data.is_free = 1;
            }
            else
            {
                data.is_free = 0;
            }

            NetClient.BaseClient.SendData <C2STravelBootsJump>(NetMsg.MSG_TRAVEL_BOOTS_JUMP, data);

            SceneHelp.Instance.IsAutoFightingAfterSwitchInstance = isAutoFighting;

            InstanceManager.Instance.IsAutoFighting = false;

            return(true);
        }