public void OnDebugMessage(ServerRoom room, DebugCommand message, PlayerEntity player, SessionStateMachine sessionStateMachine) { FreeDebugCommandHandler.Handle(room.ContextsWrapper.FreeArgs, message, player); SharedCommandHandler.ProcessGameSettingCommnands(message, sessionStateMachine); SharedCommandHandler.ProcessDebugCommand(message, _contexts); SharedCommandHandler.ProcessHitBoxCommands(message); SharedCommandHandler.ProcessPlayerCommands(message, _contexts, player, _contexts.session.commonSession, _contexts.session.currentTimeObject); SharedCommandHandler.ProcessVehicleCommand(message, _contexts.vehicle, player); SharedCommandHandler.ProcessSceneObjectCommand(message, _contexts.sceneObject, _contexts.session.entityFactoryObject.SceneObjectEntityFactory, player); SharedCommandHandler.ProcessMapObjectCommand(message, _contexts.mapObject, _contexts.session.entityFactoryObject.MapObjectEntityFactory, player); SharedCommandHandler.ProcessCommands(message, _contexts, player); }
protected override void BuildMessage(IEventArgs args) { builder.Key = FreeMessageConstant.RegisterCommand; builder.Ss.Add(command); if (desc == null) { desc = ""; } builder.Ss.Add(desc); if (usage == null) { usage = ""; } builder.Ss.Add(usage); if (action != null) { FreeDebugCommandHandler.RegisterCommand(command, action); } }
protected override void BuildMessage(IEventArgs args) { _logger.InfoFormat("RegisterCommandAction :{0} {1} {2} ", command, desc, usage); builder.Key = FreeMessageConstant.RegisterCommand; builder.Ss.Add(command); if (desc == null) { desc = ""; } builder.Ss.Add(desc); if (usage == null) { usage = ""; } builder.Ss.Add(usage); if (action != null) { FreeDebugCommandHandler.RegisterCommand(command, action); } }
public override void DoAction(IEventArgs args) { string[] cmdSplit = cmd.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries); if (cmdSplit.Length <= 0) { return; } if (cmdSplit.Length == 1) { DebugCommand debug = new DebugCommand(cmdSplit[0]); FreeDebugCommandHandler.Handle(args, debug, GetPlayerEntity(args)); } else { string[] cmdArgs = new string[cmdSplit.Length - 1]; for (int i = 1; i < cmdSplit.Length; i++) { cmdArgs[i - 1] = cmdSplit[i]; } DebugCommand debug = new DebugCommand(cmdSplit[0], cmdArgs); FreeDebugCommandHandler.Handle(args, debug, GetPlayerEntity(args)); } }