public ServerFracturedChunkDetachCallback(Contexts contexts)
 {
     _sceneObjectContext       = contexts.sceneObject;
     _sceneObjectEntityFactory = contexts.session.entityFactoryObject.SceneObjectEntityFactory;
     _currentTime           = contexts.session.currentTimeObject;
     MapObjectEntityFactory = contexts.session.entityFactoryObject.MapObjectEntityFactory;
 }
Ejemplo n.º 2
0
        public VehicleRideSystem(Contexts contexts)
        {
            _context = contexts.vehicle;


            _currentTime = contexts.session.currentTimeObject;
        }
Ejemplo n.º 3
0
        public DoorRotateSystem(Contexts contexts, ITriggerObjectListener listener = null)
        {
            _doorListener = listener;
            _activeDoors  = contexts.mapObject.GetGroup(MapObjectMatcher.DoorRotate);

            _currentTime = contexts.session.currentTimeObject;
        }
Ejemplo n.º 4
0
 public ServerSoundEntityFactory(SoundContext context,
                                 PlayerContext playerContext,
                                 IEntityIdGenerator idGenerator,
                                 ICurrentTime currentTime,
                                 ISoundConfigManager soundConfigManager) : base(context, idGenerator, currentTime, soundConfigManager)
 {
     _playerContext = playerContext;
 }
Ejemplo n.º 5
0
 public ServerGlassyObjectListener(Contexts contexts) : base(contexts, ETriggerObjectType.GlassyObject,
                                                             MapObjectMatcher.AllOf(
                                                                 MapObjectMatcher.EntityKey,
                                                                 MapObjectMatcher.TriggerObjectId,
                                                                 MapObjectMatcher.GlassyData))
 {
     _currentTime = contexts.session.currentTimeObject;
 }
 public ServerSceneObjectEntityFactory(SceneObjectContext sceneObjectContext,
                                       IEntityIdGenerator entityIdGenerator,
                                       IEntityIdGenerator equipGenerator, ICurrentTime currentTime)
 {
     _sceneObjectContext = sceneObjectContext;
     _idGenerator        = entityIdGenerator;
     _equipGenerator     = equipGenerator;
     _currentTime        = currentTime;
 }
Ejemplo n.º 7
0
 public ClientSoundEntityFactory(SoundContext context,
                                 IEntityIdGenerator idGenerator,
                                 ICurrentTime currentTime,
                                 ISoundConfigManager soundConfigManager)
 {
     _soundContext       = context;
     _idGenerator        = idGenerator;
     _currentTime        = currentTime;
     _soundConfigManager = soundConfigManager;
 }
        public ServerDestructibleObjectUpdateSystem(Contexts contexts)
        {
            _destructObjListener = new ServerDestructibleObjectListener(contexts);
            _glassyObjListener   = new ServerGlassyObjectListener(contexts);
            _context             = contexts.mapObject;
            _eventObjects        = _context.GetGroup(MapObjectMatcher.AllOf(MapObjectMatcher.EntityKey,
                                                                            MapObjectMatcher.TriggerObjectId,
                                                                            MapObjectMatcher.TriggerObjectEvent,
                                                                            MapObjectMatcher.TriggerObjectEventFlag,
                                                                            MapObjectMatcher.RawGameObject));

            _currentTime = contexts.session.currentTimeObject;
        }
Ejemplo n.º 9
0
        public JiraUpdateViewModel(TasksSource tasksSource, ICurrentTime currentTime)
        {
            _tasksSource = tasksSource;
            _currentTime = currentTime;

            DisplayName = "Jira update";

            UpdateCommand  = ReactiveCommand.CreateFromTask(UpdateJira);
            UpdateProgress = -1;

            StartFromDate = currentTime.UtcNow.AddYears(-1).AddMonths(-3);

            _projects = new ObservableCollection <JiraProjectViewModel>();
        }
 public WeaponLogicComponentsFactory(
     Contexts contexts,
     IEntityIdGenerator entityIdGenerator,
     ICurrentTime currentTime,
     IAttachmentManager attachmentManager,
     ISoundEntityFactory soundEntityFactory,
     IBulletEntityFactory bulletEntityFactory) : base(attachmentManager)
 {
     _bulletContext       = contexts.bullet;
     _throwingContext     = contexts.throwing;
     _clientEffectContext = contexts.clientEffect;
     _soundContext        = contexts.sound;
     _entityIdGenerator   = entityIdGenerator;
     _currentTime         = currentTime;
     _attachmentManager   = attachmentManager;
     _soundEntityFactory  = soundEntityFactory;
     _bulletEntityFactory = bulletEntityFactory;
 }
 public ClientSceneObjectEntityFactory(SceneObjectContext sceneObjectContext, PlayerContext playerContext,
                                       IEntityIdGenerator entityIdGenerator, IEntityIdGenerator equipGenerator, ICurrentTime currentTime) : base(
         sceneObjectContext, playerContext, entityIdGenerator, equipGenerator, currentTime)
 {
 }
Ejemplo n.º 12
0
 public SoundPlaySystem(Contexts contexts)
 {
     _group       = contexts.sound.GetGroup(SoundMatcher.AnyOf(SoundMatcher.AudioSourceKey).NoneOf(SoundMatcher.Playing));
     _soundPlayer = contexts.session.clientSessionObjects.SoundPlayer;
     _currentTime = contexts.session.currentTimeObject;
 }
Ejemplo n.º 13
0
		public static string GetValidPath( ICurrentTime @this )
		{
			var result = @this.Now.ToString( ValidPathTimeFormat );
			return result;
		}
Ejemplo n.º 14
0
 public BlogLogic(ISlugfyHelper slugfyHelper, ICurrentTime currentTime, IBlogManager blogManager)
 {
     _slugfyHelper = slugfyHelper;
     _currentTime  = currentTime;
     _blogManager  = blogManager;
 }
Ejemplo n.º 15
0
        public VehicleCrashedHandler(Contexts contexts)
        {
            _context = contexts.player;

            _currentTimeObject = contexts.session.currentTimeObject;
        }
Ejemplo n.º 16
0
 public ServerSceneObjectThrowingSystem(SceneObjectContext sceneObjectContext, ICurrentTime currentTime)
 {
     _throwingSceneObjectGroup = sceneObjectContext.GetGroup(SceneObjectMatcher.Throwing);
     _currentTime = currentTime;
 }
Ejemplo n.º 17
0
 public TimeManager(ICurrentTime sessionTimeComponent)
 {
     this.sessionTimeComponent = sessionTimeComponent;
 }
Ejemplo n.º 18
0
        public static string ProcessPlayerCommands(DebugCommand message, Contexts contexts, PlayerEntity player, ICommonSessionObjects sessionObjects, ICurrentTime currentTime)
        {
            var result = "";

            switch (message.Command)
            {
            case DebugCommands.ClientMove:
                var pos = new Vector3(0, 1000, 0).ShiftedPosition();
                var yaw = 0f;
                switch (message.Args.Length)
                {
                case 2:
                    break;

                case 3:
                    break;

                case 4:
                    break;
                }
                if (message.Args.Length > 0)
                {
                    float x;
                    if (float.TryParse(message.Args[0], out x))
                    {
                        pos.x = x;
                    }
                }
                if (message.Args.Length == 2)
                {
                    pos.y = 10000;
                    float z;
                    if (float.TryParse(message.Args[1], out z))
                    {
                        pos.z = z;
                    }
                }
                if (message.Args.Length == 3)
                {
                    float y;
                    if (float.TryParse(message.Args[1], out y))
                    {
                        pos.y = y;
                    }
                    float z;
                    if (float.TryParse(message.Args[2], out z))
                    {
                        pos.z = z;
                    }
                }
                pos = pos.ShiftedPosition();
                var        ray = new Ray(pos, Vector3.down);
                RaycastHit hit;
                if (Physics.Raycast(ray, out hit))
                {
                    player.position.Value = hit.point;
                    result = "ok";
                }
                else
                {
                    player.position.Value = pos;
                    result = "没有检测到碰撞,资源未加载完成或此位置没有碰撞,请指定y值";
                }

                break;

            case DebugCommands.KillMe:
                player.gamePlay.CurHp = 0;
                player.gamePlay.ChangeLifeState(EPlayerLifeState.Dead, currentTime.CurrentTime);
                break;

            case DebugCommands.DyingMe:
                player.gamePlay.ChangeLifeState(EPlayerLifeState.Dying, currentTime.CurrentTime);
                break;

            case DebugCommands.ShowAniInfo:
                result = string.Format("{0}\n{1}", player.state, player.thirdPersonAnimator.DebugJumpInfo());
                break;

            case DebugCommands.Speed:
                if (message.Args.Length < 1)
                {
                    return("Argument Error!");
                }

                float i;
                if (!float.TryParse(message.Args[0], out i))
                {
                    return("Argument Error! speed should be float");
                }

                if (player != null && player.hasPlayerMove)
                {
                    result = string.Format("change player:{0} speedAffect from:{1}, to:{2}", player.entityKey.Value.ToString(), player.playerMove.SpeedAffect, i);
                    player.playerMove.SpeedAffect = i;
                    if (message.Args.Length >= 2)
                    {
                        float j;
                        if (!float.TryParse(message.Args[0], out j))
                        {
                            return("Argument Error! jump should be float");
                        }
                        player.playerMove.JumpAffect = j;
                    }
                    return(result);
                }
                break;

            case DebugCommands.TestMap:
                result = BigMapDebug.HandleCommand(player, message.Args);
                break;

            case DebugCommands.ChangeBag:
                player.WeaponController().SwitchBag(int.Parse(message.Args[0]));
                //   contexts.session.clientSessionObjects.UserCmdGenerator.SetUserCmd((cmd) => cmd.BagIndex = 1);
                break;

            case DebugCommands.ChangeHp:
                player.gamePlay.CurHp = int.Parse(message.Args[0]);
                break;

            case DebugCommands.SetCurBullet:
                player.WeaponController().HeldWeaponAgent.BaseComponent.Bullet = int.Parse(message.Args[0]);
                break;

            case DebugCommands.SetReservedBullet:
                if (message.Args.Length > 1)
                {
                    int slot  = int.Parse(message.Args[0]);
                    int count = int.Parse(message.Args[1]);

                    player.WeaponController().SetReservedBullet((EWeaponSlotType)slot, count);
                }
                else
                {
                    int count = int.Parse(message.Args[0]);
                    player.WeaponController().SetReservedBullet(count);
                }
                break;

            case DebugCommands.SetGrenade:
                //IGrenadeCacheHelper helper = player.WeaponController().GrenadeHelper;
                //helper.AddCache(37);
                //helper.AddCache(37);
                //helper.AddCache(38);
                //helper.AddCache(39);
                player.WeaponController().PickUpWeapon(WeaponUtil.CreateScan(37));
                break;

            case DebugCommands.AudioEmitter:
                var sceneObjectEntityFactory = contexts.session.entityFactoryObject.SceneObjectEntityFactory;
                sceneObjectEntityFactory.CreateSceneAudioEmitterEntity(player.position.Value, player.entityKey.Value);

                break;

            case DebugCommands.AudioBgm:
                var sceneObjectEntityFactory2 = contexts.session.entityFactoryObject.SceneObjectEntityFactory;
                sceneObjectEntityFactory2.CreateSceneAudioBgEmitterEntity(player.position.Value, player.entityKey.Value);

                break;

            case DebugCommands.Shoot:
                if (message.Args.Length > 0)
                {
                    string s = message.Args[0];
                    if (s == "clean")
                    {
                        GMVariable.CleanShowShootText = true;
                    }
                }
                else
                {
                    GMVariable.ShowShootText = !GMVariable.ShowShootText;
                }


                break;

            case DebugCommands.SetAudio:
                if (message.Args.Length > 0)
                {
                    string arg1 = message.Args[0];
                    switch (arg1)
                    {
                    case "step":
                        int matType = int.Parse(message.Args[1].Trim());
                        var isUse   = (matType > -1);
                        GMVariable.AudioFoostepMatType = matType;
                        player.AudioController().SetGMFootstep(isUse);
                        break;

                    case "log":
                        int logType = int.Parse(message.Args[1].Trim());
                        if (logType == 1)
                        {
                            GMVariable.AudioPostEventLog = !GMVariable.AudioPostEventLog;
                        }
                        else if (logType == 2)
                        {
                            GMVariable.AudioListenerLog = !GMVariable.AudioListenerLog;
                        }
                        else if (logType == 3)
                        {
                            GMVariable.AudioFootstepLog = !GMVariable.AudioFootstepLog;
                        }

                        break;
                    }
                }

                break;

            case DebugCommands.SetWeapon:
                int weaponIdToSet   = 0;
                int avatarId        = 0;
                var weaponSlotToSet = 0;
                if (message.Args.Length > 0)
                {
                    weaponIdToSet = int.Parse(message.Args[0].Trim());
                }
                if (message.Args.Length > 2)
                {
                    avatarId = int.Parse(message.Args[1].Trim());
                }
                if (message.Args.Length > 3)
                {
                    weaponSlotToSet = int.Parse(message.Args[2].Trim());
                }
                var weaponInfo = WeaponUtil.CreateScan(weaponIdToSet, (val) => val.AvatarId = avatarId > 0 ? avatarId : 0);
                weaponInfo.Bullet         = 100;
                weaponInfo.ReservedBullet = 100;
                if (weaponSlotToSet != 0)
                {
                    player.WeaponController().ReplaceWeaponToSlot((EWeaponSlotType)weaponSlotToSet, weaponInfo);
                }
                else
                {
                    player.WeaponController().PickUpWeapon(weaponInfo);
                }
                break;

            case DebugCommands.DropWeapon:
                var dropSlot = int.Parse(message.Args[0]);
                player.WeaponController().DropWeapon((EWeaponSlotType)dropSlot);
                break;

            case DebugCommands.TestWeaponAssemble:
                if (null == _twaRootGo)
                {
                    _twaRootGo = new GameObject("TwaRoot");
                    _twaRootGo.transform.parent           = Camera.main.transform;
                    _twaRootGo.transform.localPosition    = new Vector3(0, 0, 2);
                    _twaRootGo.transform.localEulerAngles = new Vector3(0, 90, 0);
                }
                if (null == _weaponModelController)
                {
                    _weaponModelController = new WeaponModelController(
                        //SingletonManager.Get<WeaponResourceConfigManager>(),
                        //SingletonManager.Get<WeaponPartsConfigManager>(),
                        //SingletonManager.Get<WeaponAvatarConfigManager>(),
                        new WeaponModelLoadController <object>(
                            new WeaponModelLoader(sessionObjects.AssetManager),
                            new WeaponModelAssemblyController(_twaRootGo))
                        );
                }
                var operate = int.Parse(message.Args[0]);
                var dataId  = int.Parse(message.Args[1]);
                switch (operate)
                {
                case 0:
                    _weaponModelController.SetWeapon(dataId);
                    break;

                case 1:
                    _weaponModelController.SetPart(dataId);
                    break;

                case 2:
                    _weaponModelController.RemovePart(dataId);
                    break;
                }
                break;

            case DebugCommands.TestCmd:
                var targ1 = int.Parse(message.Args[0]);
                switch (targ1)
                {
                case 1:
                    GMVariable.ShowSessionTimer = !GMVariable.ShowSessionTimer;
                    //    LocalObjectGenerator.Dispose(true);
                    break;

                case 2:
                    GMVariable.SpreadOffsetFactor = int.Parse(message.Args[1]);
                    break;
                }
                break;

            case DebugCommands.SetAttachment:
                var res   = Core.Enums.EFuncResult.Failed;
                var apply = 0;
                if (message.Args.Length == 2)
                {
                    var slot = int.Parse(message.Args[0]);
                    apply = int.Parse(message.Args[1]);
                    res   = player.WeaponController().SetWeaponPart((EWeaponSlotType)slot, apply) ? Core.Enums.EFuncResult.Success : Core.Enums.EFuncResult.Failed;
                }
                else
                {
                    apply = int.Parse(message.Args[0]);
                    res   = player.WeaponController().SetWeaponPart(apply) ? Core.Enums.EFuncResult.Success : Core.Enums.EFuncResult.Failed;
                }

                switch (res)
                {
                case Core.Enums.EFuncResult.Exception:
                    result = "exception occurs";
                    break;

                case Core.Enums.EFuncResult.Failed:
                    result = "attachment doesn't match";
                    break;

                case Core.Enums.EFuncResult.Success:
                    result = "attach " + apply + " to weapon";
                    break;
                }
                break;

            case DebugCommands.SetWeaponAttachment:
                var resu = Core.Enums.EFuncResult.Failed;
                var id   = 0;
                if (message.Args.Length == 2)
                {
                    var slot = int.Parse(message.Args[0]);
                    id   = int.Parse(message.Args[1]);
                    resu = player.WeaponController().SetWeaponPartByPartId((EWeaponSlotType)slot, id) ? Core.Enums.EFuncResult.Success : Core.Enums.EFuncResult.Failed;
                }
                else
                {
                    id   = int.Parse(message.Args[0]);
                    resu = player.WeaponController().SetWeaponPartByPartId(id) ? Core.Enums.EFuncResult.Success : Core.Enums.EFuncResult.Failed;
                }

                switch (resu)
                {
                case Core.Enums.EFuncResult.Exception:
                    result = "exception occurs";
                    break;

                case Core.Enums.EFuncResult.Failed:
                    result = "attachment doesn't match";
                    break;

                case Core.Enums.EFuncResult.Success:
                    result = "attach " + id + " to weapon";
                    break;
                }
                break;

            case DebugCommands.ClearAttachment:
                var weaponSlot = (EWeaponSlotType)int.Parse(message.Args[0]);
                var part       = (EWeaponPartType)int.Parse(message.Args[1]);
                player.WeaponController().DeleteWeaponPart(weaponSlot, part);
                break;

            case DebugCommands.SwitchAttachment:
                break;

            case DebugCommands.SetEquip:
                player.appearanceInterface.Appearance.ChangeAvatar(int.Parse(message.Args[0]));
                break;

            case DebugCommands.ShowAvaliablePartType:
                int weaponId = player.WeaponController().HeldWeaponAgent.ConfigId;
                if (weaponId > 0)
                {
                    var list = SingletonManager.Get <WeaponConfigManagement>().FindConfigById(weaponId).ApplyParts;
                    for (int j = 0; j < list.Count; j++)
                    {
                        result += list[j] + ",";
                    }
                }
                break;

            case DebugCommands.ReloadConfig:
                ConfigReloadSystem.Reload = true;
                break;

            case DebugCommands.ShowArtTools:
                GameObject.Instantiate(Resources.Load <GameObject>("RuntimeTestTools"));
                result = "RuntimeTestTools";
                break;

            case DebugCommands.ShowTerrainTrace:
                SharedConfig.IsShowTerrainTrace = !SharedConfig.IsShowTerrainTrace;
                break;

            case DebugCommands.Revive:
                player.gamePlay.LifeState     = (int)EPlayerLifeState.Alive;
                player.gamePlay.CurHp         = player.gamePlay.MaxHp;
                player.gamePlay.InHurtedCount = 0;
                break;
            }
            return(result);
        }
Ejemplo n.º 19
0
 public ProcessInformationTracker(ICurrentTime time)
 {
     _time   = time;
     _lookup = new Dictionary <IProcessInformation, TimeSpan>();
 }
 public ClientOnline(ICurrentTime currentTime)
 {
     _currentTime = currentTime;
 }
Ejemplo n.º 21
0
 public ShowTimeController(ICurrentTime iCurrentTime)
 {
     _iCurrentTime = iCurrentTime;
 }
Ejemplo n.º 22
0
 public DistinctMonthHelper(ICurrentTime currentTime)
 {
     _currentTime = currentTime;
 }
Ejemplo n.º 23
0
 protected LogFactoryBase(ICurrentTime currentTime)
 {
     _currentTime = currentTime;
 }
Ejemplo n.º 24
0
 public TimeManager(ICurrentTime currentTime)
 {
     _currentTime = currentTime;
 }
Ejemplo n.º 25
0
 public DoorRotateSystem(Contexts contexts)
 {
     _activeDoors = contexts.mapObject.GetGroup(MapObjectMatcher.DoorRotate);
     _currentTime = contexts.session.currentTimeObject;
 }
Ejemplo n.º 26
0
        public static string ProcessPlayerCommands(DebugCommand message, PlayerEntity player, ICommonSessionObjects sessionObjects, ICurrentTime currentTime)
        {
            var            result = "";
            WeaponBagLogic bagLogicImp;

            switch (message.Command)
            {
            case DebugCommands.ClientMove:
                var pos = new Vector3(0, 1000, 0);
                var yaw = 0f;
                switch (message.Args.Length)
                {
                case 2:
                    break;

                case 3:
                    break;

                case 4:
                    break;
                }
                if (message.Args.Length > 0)
                {
                    float x;
                    if (float.TryParse(message.Args[0], out x))
                    {
                        pos.x = x;
                    }
                }
                if (message.Args.Length == 2)
                {
                    pos.y = 10000;
                    float z;
                    if (float.TryParse(message.Args[1], out z))
                    {
                        pos.z = z;
                    }
                }
                if (message.Args.Length == 3)
                {
                    float y;
                    if (float.TryParse(message.Args[1], out y))
                    {
                        pos.y = y;
                    }
                    float z;
                    if (float.TryParse(message.Args[2], out z))
                    {
                        pos.z = z;
                    }
                }
                var        ray = new Ray(pos, Vector3.down);
                RaycastHit hit;
                if (Physics.Raycast(ray, out hit))
                {
                    player.position.Value = hit.point;
                    result = "ok";
                }
                else
                {
                    player.position.Value = pos;
                    result = "没有检测到碰撞,资源未加载完成或此位置没有碰撞,请指定y值";
                }
                break;

            case DebugCommands.KillMe:
                player.gamePlay.CurHp = 0;
                player.gamePlay.ChangeLifeState(Components.Player.EPlayerLifeState.Dead, currentTime.CurrentTime);
                break;

            case DebugCommands.ShowAniInfo:
                result = string.Format("{0}\n{1}", player.state, player.thirdPersonAnimator.DebugJumpInfo());
                break;

            case DebugCommands.TestMap:
                result = BigMapDebug.HandleCommand(player, message.Args);
                break;

            case DebugCommands.ChangeHp:
                player.gamePlay.CurHp = int.Parse(message.Args[0]);
                break;

            case DebugCommands.SetCurBullet:
                player.GetBagLogicImp().SetWeaponBullet(int.Parse(message.Args[0]));
                break;

            case DebugCommands.SetReservedBullet:
                if (message.Args.Length > 1)
                {
                    int slot  = int.Parse(message.Args[0]);
                    int count = int.Parse(message.Args[1]);

                    player.GetBagLogicImp().SetReservedBullet((EWeaponSlotType)slot, count);
                }
                else
                {
                    int count = int.Parse(message.Args[0]);
                    player.GetBagLogicImp().SetReservedBullet(player.GetBagLogicImp().GetCurrentWeaponSlot(), count);
                }
                break;

            case DebugCommands.SetWeapon:
            {
                int weaponIdToSet   = 0;
                int avatarId        = 0;
                var weaponSlotToSet = 0;
                if (message.Args.Length > 0)
                {
                    weaponIdToSet = int.Parse(message.Args[0].Trim());
                }
                if (message.Args.Length > 2)
                {
                    avatarId = int.Parse(message.Args[1].Trim());
                }
                if (message.Args.Length > 3)
                {
                    weaponSlotToSet = int.Parse(message.Args[2].Trim());
                }
                var weaponInfo = new WeaponInfo
                {
                    Id       = weaponIdToSet,
                    AvatarId = avatarId > 0 ? avatarId : 0,
                };
                if (weaponSlotToSet != 0)
                {
                    player.playerAction.Logic.ReplaceWeaponToSlot((EWeaponSlotType)weaponSlotToSet, weaponInfo);
                }
                else
                {
                    player.playerAction.Logic.PickUpWeapon(weaponInfo);
                }
            }
            break;

            case DebugCommands.DropWeapon:
                var dropSlot = int.Parse(message.Args[0]);
                player.playerAction.Logic.DropWeapon((EWeaponSlotType)dropSlot);
                break;

            case DebugCommands.TestWeaponAssemble:
                if (null == _twaRootGo)
                {
                    _twaRootGo = new GameObject("TwaRoot");
                    _twaRootGo.transform.parent           = Camera.main.transform;
                    _twaRootGo.transform.localPosition    = new Vector3(0, 0, 2);
                    _twaRootGo.transform.localEulerAngles = new Vector3(0, 90, 0);
                }
                if (null == _weaponModelController)
                {
                    _weaponModelController = new WeaponModelController(
                        SingletonManager.Get <WeaponConfigManager>(),
                        SingletonManager.Get <WeaponPartsConfigManager>(),
                        SingletonManager.Get <WeaponAvatarConfigManager>(),
                        new WeaponModelLoadController <object>(
                            new WeaponModelLoader(sessionObjects.LoadRequestManager),
                            new WeaponModelAssemblyController(_twaRootGo))
                        );
                }
                var operate = int.Parse(message.Args[0]);
                var dataId  = int.Parse(message.Args[1]);
                switch (operate)
                {
                case 0:
                    _weaponModelController.SetWeapon(dataId);
                    break;

                case 1:
                    _weaponModelController.SetPart(dataId);
                    break;

                case 2:
                    _weaponModelController.RemovePart(dataId);
                    break;
                }
                break;

            case DebugCommands.SetAttachment:
                var res = Core.Enums.EFuncResult.Failed;
                var id  = 0;
                if (message.Args.Length == 2)
                {
                    var slot = int.Parse(message.Args[0]);
                    id = int.Parse(message.Args[1]);


                    res = player.GetBagLogicImp().SetWeaponPart((EWeaponSlotType)slot, id);
                }
                else
                {
                    id  = int.Parse(message.Args[0]);
                    res = player.GetBagLogicImp().SetCurrentWeaponPart(id);
                }

                switch (res)
                {
                case Core.Enums.EFuncResult.Exception:
                    result = "exception occurs";
                    break;

                case Core.Enums.EFuncResult.Failed:
                    result = "attachment doesn't match";
                    break;

                case Core.Enums.EFuncResult.Success:
                    result = "attach " + id + " to weapon";
                    break;
                }
                break;

            case DebugCommands.ClearAttachment:
                var weaponSlot = (EWeaponSlotType)int.Parse(message.Args[0]);
                var part       = (EWeaponPartType)int.Parse(message.Args[1]);
                player.GetBagLogicImp().DeleteWeaponPart(weaponSlot, part);
                break;

            case DebugCommands.SwitchAttachment:
                break;

            case DebugCommands.SetEquip:
                player.appearanceInterface.Appearance.ChangeAvatar(int.Parse(message.Args[0]));
                break;

            case DebugCommands.ShowAvaliablePartType:
                var weapon = player.GetBagLogicImp().GetCurrentWeaponInfo();
                if (weapon.Id > 0)
                {
                    var list = SingletonManager.Get <WeaponPartsConfigManager>().GetAvaliablePartTypes(weapon.Id);
                    for (int i = 0; i < list.Count; i++)
                    {
                        result += list[i] + ",";
                    }
                }
                break;

            case DebugCommands.ReloadConfig:
                ConfigReloadSystem.Reload = true;
                break;

            case DebugCommands.ShowArtTools:
                GameObject.Instantiate(Resources.Load <GameObject>("RuntimeTestTools"));
                result = "RuntimeTestTools";
                break;

            case DebugCommands.ShowTerrainTrace:
                SharedConfig.IsShowTerrainTrace = !SharedConfig.IsShowTerrainTrace;
                break;
            }
            return(result);
        }
Ejemplo n.º 27
0
 public SimplePlayerLifeSystem(Contexts contexts, ICurrentTime currentTimeObject) : base(contexts.player)
 {
     _players           = contexts.player.GetGroup(PlayerMatcher.GamePlay);
     _currentTimeObject = currentTimeObject;
     _contexts          = contexts;
 }
Ejemplo n.º 28
0
 public ServerSceneObjectThrowingSystem(SceneObjectContext sceneObjectContext, ICurrentTime currentTime, RuntimeGameConfig config)
 {
     _throwingSceneObjectGroup = sceneObjectContext.GetGroup(SceneObjectMatcher.Throwing);
     _currentTime = currentTime;
     _gameConfig  = config;
 }