Exemple #1
0
    /// <summary>
    /// 獲取幻化列表
    /// </summary>
    protected void S2C_GetMountSkinListInfo(Pt _pt)
    {
        pt_ret_skin_list_e113 msg = _pt as pt_ret_skin_list_e113;

        if (msg != null)
        {
            for (int i = 0; i < msg.skin_list.Count; i++)
            {
                skinExp    = msg.skin_exp;
                curSkinLev = msg.skin_lev;
                skin_base_info data = msg.skin_list[i];
                if (mountSkinList.ContainsKey((int)data.skin_id))
                {
                    MountInfo info = mountSkinList[(int)data.skin_id] as MountInfo;
                    info.Update(data);
                }
                else
                {
                    mountSkinList[(int)data.skin_id] = new MountInfo(new MountData(data), GameCenter.mainPlayerMng.MainPlayerInfo, true);
                }
                if (data.skin_state > 0 && (skinId != data.skin_id || !skinState))
                {
                    skinId    = (int)data.skin_id;
                    skinState = true;
                    MountUpdate();
                }
            }
        }
        //抛出数据变化的事件
        if (OnMountSkinListUpdate != null)
        {
            OnMountSkinListUpdate();
        }
    }
Exemple #2
0
    protected AssetMng.DownloadID Create(MountInfo _info, System.Action <PreviewMount, EResult> _callback)
    {
        return(exResources.GetMount(_info.AssetName, delegate(GameObject _asset, EResult _result)
        {
            if (_result != EResult.Success)
            {
                _callback(null, _result);
                return;
            }

            this.gameObject.name = "Preview Mount[" + _info.ConfigID + "]";

            GameObject newGO = Instantiate(_asset) as GameObject;
            newGO.name = _asset.name;
            animationRoot = newGO.transform;
            newGO.transform.parent = this.gameObject.transform;
            newGO.transform.localEulerAngles = Vector3.zero;
            newGO.transform.localPosition = Vector3.zero;
            newGO.transform.localScale = Vector3.one;
            animFSM = newGO.AddComponent <MountAnimFSM>();
            newGO.AddComponent <MountRendererCtrl>();
            newGO.AddComponent <FXCtrl>();
            FXCtrl fx = this.gameObject.AddComponent <FXCtrl>();
            fx.SetUnLimit(true);
            fx.canShowShadow = false;


            isDummy_ = false;

            Init();
            _callback(this, _result);
        }));
    }
Exemple #3
0
    /// <summary>
    /// 创建净数据对象 by吴江
    /// </summary>
    /// <param name="_info"></param>
    /// <returns></returns>
    public static PreviewMount CreateDummy(MountInfo _info)
    {
        if (_info == null)
        {
            return(null);
        }
        GameObject newGO = null;

        if (GameCenter.instance.dummyMobPrefab != null)
        {
            newGO      = Instantiate(GameCenter.instance.dummyMobPrefab) as GameObject;
            newGO.name = "Dummy Mount [" + _info.ConfigID + "]";
        }
        else
        {
            newGO = new GameObject("Dummy Mount[" + _info.ConfigID + "]");
        }
        newGO.tag = "Player";
        PreviewMount mount = newGO.AddComponent <PreviewMount>();

        mount.isDummy_  = true;
        mount.actorInfo = _info;

        return(mount);
    }
Exemple #4
0
        public CallResult AddSharedDirectory(string localPath, string virtualPath)
        {
            logger.Info("Adding Shared directory {0} at {1}", localPath, virtualPath);

            //check for previous mount errors
            if (mountErrorOccurred)
            {
                logger.Error("Mount error found");
                return(new ErrorResult(RemoteErrorCode.MountError));
            }

            //check if directory exits
            if (!Directory.Exists(localPath))
            {
                return(new ErrorResult(RemoteErrorCode.ItemNotFoundError));
            }


            MountInfo info = new MountInfo();

            info.MountPoint = virtualPath;
            info.LocalPath  = localPath;

            mounts.Add(info);

            storage.SaveItem("mounts", mounts);

            scanDirectory(localPath);

            return(new VoidResult());
        }
Exemple #5
0
        public CallResult RemoveSharedDirectory(string virtualPath)
        {
            logger.Info("Removing Shared directory {0}", virtualPath);

            //check for previous mount errors
            if (mountErrorOccurred)
            {
                logger.Error("Mount error found");
                return(new ErrorResult(RemoteErrorCode.MountError));
            }

            if (!mounts.Any(x => x.MountPoint.ToLower() == virtualPath.ToLower()))
            {
                logger.Error("Could not remove folder {0}. Item is no Mount", virtualPath);
                return(new ErrorResult(RemoteErrorCode.ItemNotFoundError));
            }
            else
            {
                MountInfo mount = mounts.First(x => x.MountPoint.ToLower() == virtualPath.ToLower());

                mounts.Remove(mount);
                storage.SaveItem("mounts", mounts);

                return(new VoidResult());
            }
        }
Exemple #6
0
        public void Mount(LuaMount mount, FilePath location, FilePath subPath = default(FilePath), bool readOnly = false)
        {
            // Check conditions
            if (location.IsBackPath)
            {
                throw new IOException(string.Format("Invalid location: {0}", location));
            }
            if (subPath.IsBackPath)
            {
                throw new IOException(string.Format("Invalid subPath: {0}", subPath));
            }
            location = location.UnRoot();
            subPath  = subPath.UnRoot();

            // Create the mount
            var info = new MountInfo(location, mount, subPath, readOnly);

            CheckEitherExists(new MountFilePath(info, subPath));

            // Add the mount
            m_mounts.Add(info);
            for (int i = m_mounts.Count - 1; i >= 0; --i)
            {
                var mountInfo = m_mounts[i];
                if (mountInfo != info && mountInfo.Location == location)
                {
                    m_mounts.RemoveAt(i);
                    mountInfo.Dispose();
                    break;
                }
            }
        }
Exemple #7
0
        public bool RemoveFile(FilePath path)
        {
            // always remove files in user path package
            if (path.PackageSpecified && path.Package != "user")
            {
                return(false);
            }

            if (!ExistsMount("user"))
            {
                return(false);
            }

            MountInfo mount = nameMountMap["user"];

            // remove from package
            if (!mount.Package.ExistsFile(path.PathWithoutPackage))
            {
                return(false);
            }

            if (!mount.Package.RemoveFile(path.PathWithoutPackage))
            {
                return(false);
            }

            RefreshFileMountMap();

            return(true);
        }
Exemple #8
0
    /// <summary>
    /// 创建净数据对象 by吴江
    /// </summary>
    /// <param name="_info"></param>
    /// <returns></returns>
    public static Mount CreateDummy(MountInfo _info)
    {
        if (_info == null)
        {
            return(null);
        }
        GameObject newGO = null;

        if (GameCenter.instance.dummyMobPrefab != null)
        {
            newGO      = Instantiate(GameCenter.instance.dummyMobPrefab) as GameObject;
            newGO.name = "Dummy Mount [" + _info.ConfigID + "]";
        }
        else
        {
            newGO = new GameObject("Dummy Mount[" + _info.ConfigID + "]");
        }
        newGO.tag = "Player";
        newGO.SetMaskLayer(_info.OwnerID == GameCenter.mainPlayerMng.MainPlayerInfo.ServerInstanceID ? LayerMask.NameToLayer("Player") : LayerMask.NameToLayer("OtherPlayer"));
        Mount mount = newGO.AddComponent <Mount>();

        mount.isDummy_  = true;
        mount.actorInfo = _info;

        return(mount);
    }
Exemple #9
0
        private MountFilePath Resolve(FilePath path)
        {
            path = path.UnRoot();
            MountInfo longestMatch       = null;
            int       longestMatchLength = -1;

            for (int i = 0; i < m_mounts.Count; ++i)
            {
                MountInfo mount = m_mounts[i];
                if (mount.Location.Path.Length >= longestMatchLength &&
                    mount.Location.IsParentOf(path))
                {
                    longestMatch       = mount;
                    longestMatchLength = mount.Location.Path.Length;
                }
            }
            if (longestMatch != null)
            {
                return(new MountFilePath(
                           longestMatch,
                           FilePath.Combine(longestMatch.SubPath, path.ToLocal(longestMatch.Location))
                           ));
            }
            else
            {
                return(new MountFilePath(
                           m_emptyRootMount,
                           path
                           ));
            }
        }
Exemple #10
0
 protected void UnRegist()
 {
     MsgHander.UnRegist(0xE111, S2C_GetMountListInfo);
     MsgHander.UnRegist(0xE113, S2C_GetMountSkinListInfo);
     MsgHander.UnRegist(0xD439, S2C_GetMountPromoteLev);
     MsgHander.UnRegist(0xD440, S2C_GetMountAfterUpdate);
     MsgHander.UnRegist(0xD757, S2C_GetSkinLevUpdate);
     MsgHander.UnRegist(0xD575, S2C_OnGotEquipData);
     MsgHander.UnRegist(0xD576, S2C_OnUpdateEquipData);
     curMountInfo = null;
     curSkinLev   = 0;
     skinExp      = 0;
     curLev       = -1;
     mountSkinList.Clear();
     mountInfoList.Clear();
     AllMountDic.Clear();
     AllSkinDic.Clear();
     mountList.Clear();
     rideType  = 0;
     skinId    = 0;
     state     = 0;
     skinState = false;
     mountEquipDic.Clear();
     curChooseSkin          = null;
     curSelectEquipmentInfo = null;
 }
Exemple #11
0
    public void ShowMountSkinModel(EquipmentInfo _eq)
    {
        MountInfo       info = null;
        List <MountRef> list = MountList(2);

        for (int i = 0, max = list.Count; i < max; i++)
        {
            if (_eq.EID == list[i].itemID)
            {
                info = new MountInfo(list[i]);
                break;
            }
        }
        if (info != null)
        {
            if (mountSkinList.ContainsKey(info.ConfigID))
            {
                return;
            }
            else
            {
                if (curChooseSkin == null || curChooseSkin.ItemID != _eq.EID)
                {
                    curChooseSkin = info;
                }
                if (OnGetNewMountUpdate != null)
                {
                    OnGetNewMountUpdate(info, ModelType.ILLUSION);
                }
            }
        }
    }
Exemple #12
0
    /*private void Awake()
     * {
     *
     * }*/

    // Use this for initialization
    void Init()
    {
        mountInfo = PlayerInfoManager.Instance.PlayerInfo.mount;
        animal    = GetComponent <Animal>();
        mountable = GetComponent <Mountable>();
        UpdateMountInfo();
        isInit = true;
    }
Exemple #13
0
        public FileSystem()
        {
            var rootMount = new LuaMount(new EmptyMount("root"));

            rootMount.Connected = true;
            m_emptyRootMount    = new MountInfo(FilePath.Empty, rootMount, FilePath.Empty, true);
            m_mounts            = new List <MountInfo>();
        }
Exemple #14
0
    protected AssetMng.DownloadID Create(MountInfo _info, System.Action <Mount, EResult> _callback)
    {
        return(exResources.GetMount(_info.AssetName, delegate(GameObject _asset, EResult _result)
        {
            if (_result != EResult.Success)
            {
                _callback(null, _result);
                return;
            }

            GameCenter.curGameStage.CacheEquipmentURL(_info.AssetURL, _asset);
            if (this == null || this.gameObject == null)
            {
                return;
            }
            this.gameObject.name = "Mount[" + _info.ConfigID + "]";

            GameObject newGO = Instantiate(_asset) as GameObject;
            newGO.name = _asset.name;
            newGO.transform.parent = this.gameObject.transform;
            newGO.transform.localEulerAngles = Vector3.zero;
            newGO.transform.localPosition = Vector3.zero;
            newGO.transform.localScale = Vector3.one;

            if (actorInfo.MoveRecastType == RecastType.DOUBLE)
            {
                GameObject frontPoint = new GameObject("FrontPoint");
                frontPoint.transform.parent = newGO.transform;
                frontPoint.transform.localPosition = actorInfo.frontPoint;
                frontPoint.transform.localScale = Vector3.one;
                tireFront = frontPoint.transform;

                GameObject behindPoint = new GameObject("BehindPoint");
                behindPoint.transform.parent = newGO.transform;
                behindPoint.transform.localPosition = actorInfo.BehindPoint;
                behindPoint.transform.localScale = Vector3.one;
                tireBack = behindPoint.transform;
            }



            newGO.AddComponent <MountAnimFSM>();
            newGO.AddComponent <MountRendererCtrl>();
            animRoot = newGO.transform;

            FXCtrl fx = newGO.AddComponent <FXCtrl>();
            fx.SetUnLimit(Owner == GameCenter.curMainPlayer);
            fx.canShowShadow = false;



            isDummy_ = false;

            Init();
            _callback(this, _result);
        }));
    }
Exemple #15
0
        public void TestMountInfoSerialization1()
        {
            var mountInfo = new MountInfo()
            {
                LocalPath = "/foo/bar", MountPoint = "/bar/foo"
            };

            testMountInfoSerialization(mountInfo);
        }
Exemple #16
0
 public void Update(scene_ply _data)
 {
     IsAlive = _data.hp > 0;
     UpdateName(_data.name);           //放在serverData.Update(_data);之前
     UpdateGuildName(_data.guildName); //放在serverData.Update(_data);之前
     serverData.Update(_data);
     serverData.equipTypeList.Clear();
     //更新移动速度
     UpdateMoveSpeed();
     //强化特效更新
     UpdateStrengEffect(_data.strenthen_min_lev);
     //坐骑更新
     if (curMountInfo == null)
     {
         if (_data.ride_type != 0)
         {
             curMountInfo = new MountInfo(_data, this);
             UpdateMount(curMountInfo);
         }
     }
     else
     {
         curMountInfo.Update(_data);
     }
     //法宝更新
     if (_data.magic_weapon_id > 0)
     {
         RefineRef rr = ConfigMng.Instance.GetRefineRef(_data.magic_weapon_id, _data.magic_strength_lev, _data.magic_strength_star);
         if (rr != null)
         {
             serverData.magicWeaponID = rr.model;
             if (GameCenter.systemSettingMng.OtherPlayerMagic)
             {
                 serverData.equipTypeList.Add(rr.model);
             }
         }
     }
     //翅膀更新
     if (_data.wing_id > 0)
     {
         WingRef data = ConfigMng.Instance.GetWingRef(_data.wing_id, _data.wing_lev);
         if (data != null)
         {
             serverData.wingID = data.itemui;
             if (GameCenter.systemSettingMng.OtherPlayerWing)
             {
                 serverData.equipTypeList.Add(data.itemui);
             }
         }
     }
     for (int i = 0, max = _data.model_clothes_id.Count; i < max; i++)
     {
         serverData.equipTypeList.Add(_data.model_clothes_id[i]);
     }
     ProcessServerData(serverData);
 }
Exemple #17
0
        public Task DiscoverAsync(CancellationToken cancellationToken)
        {
            this.ConnectedMounts.Clear();

            Task.Run(async() =>
            {
                while (!cancellationToken.IsCancellationRequested)
                {
                    UdpReceiveResult receiveResult = await this._udpClient.ReceiveAsync().ConfigureAwait(false);

                    if (cancellationToken.IsCancellationRequested)
                    {
                        break;
                    }

                    IPEndPoint remoteEndPoint = receiveResult.RemoteEndPoint;

                    Debug.WriteLine(remoteEndPoint.Address);

                    var receivedMessage = BitConverter.ToString(receiveResult.Buffer);

                    var buffer = receiveResult.Buffer;

                    Debug.WriteLine("GOT MESSAGE");

                    Debug.WriteLine(receivedMessage);

                    if (buffer[0] == 13)
                    {
                        buffer = buffer.RemoveAt(0);
                    }

                    WifiMount wifiMount = WifiMount.ToWifiMount(remoteEndPoint);

                    if (!this._discoveredMounts.Contains(wifiMount.Address))
                    {
                        this._discoveredMounts.Add(wifiMount.Address);

                        MountInfo mountInfo = new MountInfo()
                        {
                            WifiMount = wifiMount
                        };

                        Task.Run(async() => { await this.Handshake(mountInfo).ConfigureAwait(false); });
                    }

#if DEBUG
                    Array.ForEach(buffer.ToArray(), b => Debug.Write($"{b}, "));
#endif

                    Debug.WriteLine("");
                }
            }, cancellationToken);

            return(Task.CompletedTask);
        }
Exemple #18
0
 /// <summary>
 /// 非经过我同意禁用本接口  by吴江
 /// </summary>
 /// <param name="_info"></param>
 /// <param name="_callBack"></param>
 /// <returns></returns>
 public bool TryPreviewSingelMount(MountInfo _info, System.Action <PreviewMount> _callBack)
 {
     if (_info != null)
     {
         PreviewMount pp = PreviewMount.CreateDummy(_info);
         pp.mutualExclusion = false;
         pp.StartAsyncCreate(_callBack);
         return(true);
     }
     return(false);
 }
Exemple #19
0
 public void UpdateMount(MountInfo _mount)
 {
     if (_mount != null)
     {
         curMountInfo = _mount;
         if (OnMountUpdate != null)
         {
             OnMountUpdate();
         }
     }
 }
Exemple #20
0
 /// <summary>
 /// 坐骑激活时弹出模型UI
 /// </summary>
 void OnShowMountModel(MountInfo _mountInfo, ModelType _type)
 {
     if (Time.time - GameCenter.mainPlayerMng.MainPlayerInfo.loginTime < 10)
     {
         return;
     }
     GameCenter.wingMng.modelType               = _type;
     GameCenter.wingMng.needShowMountInfo       = _mountInfo;
     GameCenter.wingMng.isNotShowTrialWingModel = true;
     GameCenter.uIMng.SwitchToUI(GUIType.NONE);
     GameCenter.uIMng.GenGUI(GUIType.SHOWMODELUI, true);
 }
Exemple #21
0
    /// <summary>
    /// 上下马 ride_state = 1更新坐骑 ride_state= 2更新幻化
    /// </summary>
    protected void S2C_GetMountAfterUpdate(Pt _pt)
    {
        pt_update_ride_state_d440 msg = _pt as pt_update_ride_state_d440;

        if (msg != null)
        {
            //if (msg.state > 0) Debug.logger.Log("收到上下马id:" + msg.ride_id + "  , msg.ride_state : " + msg.ride_state + " , msg.state : " + msg.state);
            if (msg.ride_state == (int)MountType.MOUNTLIST)
            {
                if (mountInfoList.ContainsKey(msg.ride_id))
                {
                    MountInfo info = mountInfoList[msg.ride_id] as MountInfo;
                    info.Update(msg);
                    if (rideType != msg.ride_id || state != msg.state)
                    {
                        rideType = msg.ride_id;
                        state    = msg.state;
                        MountUpdate();
                    }
                }
                if (OnCurMountUpdate != null)
                {
                    OnCurMountUpdate();
                }
            }
            else
            {
                if (mountSkinList.ContainsKey(msg.ride_id))
                {
                    MountInfo info = mountSkinList[msg.ride_id] as MountInfo;
                    if (info != null)
                    {
                        info.Update(msg);
                    }
                    if (msg.state > 0)
                    {
                        GameCenter.messageMng.AddClientMsg(306); //幻化成功
                    }
                    if (skinId != msg.ride_id || skinState != (msg.state == 1))
                    {
                        skinId    = msg.ride_id;
                        skinState = msg.state == 1;
                        MountUpdate();
                    }
                }
                if (OnMountSkinUpdate != null)
                {
                    OnMountSkinUpdate();
                }
            }
        }
    }
 public MountItem(string id, string name, string description, string icon, int max_c, float weight, int bprice, int sprice, bool sellable, bool enable, MountInfo info) :
     base(id, name, description, icon, max_c, weight, bprice, sprice, sellable, enable)
 {
     /*if (icon.Contains("Icon/Item/Mount/"))
      * {
      *  StringBuilder sb = new StringBuilder(icon);
      *  sb.Replace("Icon/Item/Mount/", "");
      *  icon = sb.ToString();
      * }
      * Icon = "Icon/Item/Mount/" + icon;*/
     mountInfo = info;
     StackAble = false;
 }
Exemple #23
0
 public bool TryPreviewMount(MountInfo _info, UITexture _showLabel, MountAnimFSM.EventType _type = ActorAnimFSM.EventType.Idle)
 {
     curShowLabel = _showLabel;
     CancelAllDownLoad();
     if (_info != null)
     {
         PreviewMount pp = PreviewMount.CreateDummy(_info);
         pp.needRandID = _type;
         pp.StartAsyncCreate(CreateMountCallBack);
         return(true);
     }
     return(false);
 }
Exemple #24
0
 /// <summary>
 /// 注销
 /// </summary>
 void UnRegist()
 {
     MsgHander.UnRegist(0xD417, S2C_GetWingData);
     MsgHander.UnRegist(0xD420, S2C_GetWingUpData);
     MsgHander.UnRegist(0xD443, S2C_GetWingState);
     wingDic.Clear();
     curWingID               = 0;
     curUseWingInfo          = null;
     needShowWingInfo        = null;
     needShowMountInfo       = null;
     needShowPetInfo         = null;
     modelType               = ModelType.NONE;
     isNotShowTrialWingModel = false;
 }
Exemple #25
0
 void ShowMountInfo()
 {
     //显示幻兽信息
     if (MountRefDate != null)
     {
         int         id = MountRefDate.mountId;
         FDictionary mountSkinInfoDic = GameCenter.newMountMng.mountSkinList;
         nameLab.text = MountRefDate.mountName;
         if (item != null)
         {
             item.FillInfo(new EquipmentInfo(MountRefDate.itemID, EquipmentBelongTo.PREVIEW));
             item.itemName.gameObject.SetActive(false);
             if (item.itemIcon.GetComponent <UISpriteEx>() != null)
             {
                 item.itemIcon.GetComponent <UISpriteEx>().IsGray = UISpriteEx.ColorGray.normal;
             }
             if (!mountSkinInfoDic.ContainsKey(id))
             {
                 if (item.itemIcon.GetComponent <UISpriteEx>() != null)
                 {
                     item.itemIcon.GetComponent <UISpriteEx>().IsGray = UISpriteEx.ColorGray.Gray;
                 }
             }
             else
             {
                 //MountInfo skin = mountSkinInfoDic[id] as MountInfo;
             }
         }
         if (mountSkinInfoDic.ContainsKey(id))//该皮肤玩家已经拥有
         {
             MountInfo info = mountSkinInfoDic[id] as MountInfo;
             if (info.SkinRemainTime != 0)//限时
             {
                 timer.StartIntervalTimer(info.SkinRemainTime);
                 timer.onTimeOut = (x) =>
                 {
                     timeLab.text = ConfigMng.Instance.GetUItext(84);
                 };
             }
             else//这个幻兽是永久拥有的
             {
                 timeLab.gameObject.SetActive(false);
             }
             return;
         }
         timeLab.text = ConfigMng.Instance.GetUItext(84);
     }
 }
Exemple #26
0
    public bool TryPreviewSingelMount(int _configID, UITexture _showLabel, string idleAnimName)
    {
        curShowLabel = _showLabel;
        CancelAllDownLoad();
        MountRef  refData = ConfigMng.Instance.GetMountRef(_configID);
        MountInfo info    = new MountInfo(refData);

        if (info != null)
        {
            PreviewMount pp = PreviewMount.CreateDummy(info);
            pp.idleAnimName = idleAnimName;
            pp.StartAsyncCreate(CreateMountCallBack);
            return(true);
        }
        return(false);
    }
Exemple #27
0
    protected void LoadMount()
    {
        if (configID <= 0) return;
        MountRef refData = ConfigMng.Instance.GetMountRef(configID);
        MountInfo info = new MountInfo(refData);
        GameCenter.previewManager.TryPreviewSingelMount(info, (x) =>
        {
            x.transform.parent = this.transform;
            x.transform.localPosition = Vector3.zero;
            x.transform.localEulerAngles = Vector3.zero;
            x.transform.localScale = Vector3.one * scale;
            x.FaceToNoLerp(lookRotation);
            x.rendererCtrl.SetLayer(LayerMask.NameToLayer("NGUI"));
			x.gameObject.SetMaskLayer(LayerMask.NameToLayer("NGUI"));
        });
    }
Exemple #28
0
    /// <summary>
    /// 坐骑培养反馈协议
    /// </summary>
    protected void S2C_GetMountPromoteLev(Pt _pt)
    {
        pt_update_ride_lev_d439 msg = _pt as pt_update_ride_lev_d439;

        if (msg != null && curLev != (int)msg.state)
        {
            CurLev = (int)msg.state;
            if (rideType != 0)
            {
                if (mountInfoList.ContainsKey(rideType))
                {
                    MountInfo info = mountInfoList[rideType] as MountInfo;
                    info.Update(msg);
                }
            }
        }
    }
Exemple #29
0
        internal async Task <string> CreateResource(SnapSession session)
        {
            string answer = string.Empty;

            try
            {
                log.Info($"Token = {this.token}");
                ResourceBody body = new ResourceBody();
                body.ResourceName = session.DbName;
                body.ResourceType = "Database";
                body.HostName     = session.HostName;
                body.RunAsNames   = $"{session.DbName}_{session.Plugin}";
                body.MountPaths   = new System.Collections.Generic.List <MountInfo>();
                MountInfo mi = new MountInfo();
                mi.MountPath = session.MountPath;
                body.MountPaths.Add(mi);
                VolumeMapping vm    = new VolumeMapping();
                VolumeName    vname = new VolumeName();
                vname.Name    = session.VolumeName;
                vm.VolumeName = vname;
                FootPrintObject fp = new FootPrintObject();
                fp.SVMName           = session.SvmName;
                fp.VolAndLunsMapping = new System.Collections.Generic.List <VolumeMapping>();
                fp.VolAndLunsMapping.Add(vm);
                body.FootPrint = new System.Collections.Generic.List <FootPrintObject>();
                body.FootPrint.Add(fp);
                PluginParams pluginParams = new PluginParams();
                pluginParams.Data = new System.Collections.Generic.List <PluginData>();
                PluginData ms = new PluginData();
                ms.Key   = "MASTER_SLAVE";
                ms.Value = "N";
                pluginParams.Data.Add(ms);
                body.PluginParams = pluginParams;

                var response = await this.SendRequestAsync <dynamic>(Method.POST, $"api/3.0/plugins/MySQL/resources", body, false);

                log.Info($"Payload: {response.Payload}");
                string dbKey = string.Empty;
                answer = response.Response.Content.ToString();
            }
            catch (Exception ex)
            {
                this.log.Error($"Error while getting creating resource key: {ex}");
            }
            return(answer);
        }
Exemple #30
0
 public void CopyInfo(PlayerInfo source)
 {
     ID                  = source.ID;
     CharacterName       = source.CharacterName;
     level               = source.level;
     IsAlive             = source.IsAlive;
     IsTired             = source.IsTired;
     IsExhausted         = source.IsExhausted;
     equipments          = source.equipments;
     Li                  = source.Li;
     Ti                  = source.Ti;
     Qi                  = source.Qi;
     Ji                  = source.Ji;
     Min                 = source.Min;
     HP                  = source.HP;
     Current_HP          = source.Current_HP;
     MP                  = source.MP;
     Current_MP          = source.Current_MP;
     Endurance           = source.Endurance;
     Current_Endurance   = source.Current_Endurance;
     BlockAmount         = source.BlockAmount;
     Current_BlockAmount = source.Current_BlockAmount;
     NextExp             = source.NextExp;
     Current_Exp         = source.Current_Exp;
     SkillPointOne       = source.SkillPointOne;
     SkillPointTwo       = source.SkillPointTwo;
     Neili               = source.Neili;
     ATK                 = source.ATK;
     DEF                 = source.DEF;
     Hit                 = source.Hit;
     Dodge               = source.Dodge;
     Crit                = source.Crit;
     Res_Blowed          = source.Res_Blowed;
     Res_Floated         = source.Res_Floated;
     Res_Repulsed        = source.Res_Repulsed;
     Res_Rigidity        = source.Res_Rigidity;
     Res_Stuned          = source.Res_Stuned;
     Res_Falled          = source.Res_Falled;
     //status = new List<StatuInfo>();
     //buffs = source.buffs;
     bag           = source.bag;
     warehouseInfo = source.warehouseInfo;
     mount         = source.mount;
     //MoveSpeed = source.MoveSpeed;
 }