예제 #1
0
 public TalkCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "talk";
     Description = "Opens a chat view.";
     Arguments = "[text]";
 }
예제 #2
0
 public QuitCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "quit";
     Description = "Quits the game.";
     Arguments = "";
 }
예제 #3
0
 public SecondaryCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "secondary";
     Description = "Makes the player attack secondarily.";
     Arguments = "";
 }
예제 #4
0
 public ItemselCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "itemsel";
     Description = "Selects an item to hold by the given number.";
     Arguments = "<slot number>";
 }
예제 #5
0
 public UpwardCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "upward";
     Description = "Moves the player upward (jumps).";
     Arguments = "";
 }
예제 #6
0
 public QuickItemCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "quickitem";
     Description = "Switches to and uses an item by the given number.";
     Arguments = "'hold'/'throw'/'click'/'alt'/'drop' <slot number>";
 }
예제 #7
0
 public ItemdownCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "itemdown";
     Description = "Adjust the item (down version).";
     Arguments = "";
 }
예제 #8
0
 public ItemStack(Client tclient, byte[] data)
 {
     TheClient = tclient;
     DataStream ds = new DataStream(data);
     DataReader dr = new DataReader(ds);
     Load(dr, (b) => new ItemStack(tclient, b));
 }
예제 #9
0
 public UIScreen(Client tclient)
     : base(UIAnchor.TOP_LEFT, () => 0, () => 0, () => 0, () => 0)
 {
     TheClient = tclient;
     Width = () => Parent == null ? TheClient.Window.Width : Parent.GetWidth();
     Height = () => Parent == null ? TheClient.Window.Height : Parent.GetHeight();
 }
예제 #10
0
 public DisconnectCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "disconnect";
     Description = "Disconnects from the server.";
     Arguments = "";
 }
예제 #11
0
 public MovedownCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "movedown";
     Description = "Makes the player crouch.";
     Arguments = "";
 }
예제 #12
0
 public ItemnextCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "itemnext";
     Description = "Selects the next item.";
     Arguments = "";
 }
예제 #13
0
 public BindblockCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "bindblock";
     Description = "Binds a script block to a key.";
     Arguments = "<key>";
 }
예제 #14
0
 public void Init(Client tclient, ClientCVar cvar)
 {
     if (Context != null)
     {
         Context.Dispose();
     }
     TheClient = tclient;
     CVars = cvar;
     Context = new AudioContext(AudioContext.DefaultDevice, 0, 0, false, true);
     Context.MakeCurrent();
     try
     {
         if (Microphone != null)
         {
             Microphone.StopEcho();
         }
         Microphone = new MicrophoneHandler(this);
     }
     catch (Exception ex)
     {
         SysConsole.Output("Loading microphone handling", ex);
     }
     if (Effects != null)
     {
         foreach (SoundEffect sfx in Effects.Values)
         {
             sfx.Internal = -2;
         }
     }
     Effects = new Dictionary<string, SoundEffect>();
     PlayingNow = new List<ActiveSound>();
     Noise = LoadSound(new DataStream(Convert.FromBase64String(NoiseDefault.NoiseB64)), "noise");
 }
예제 #15
0
 public ReloadGameCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "reloadgame";
     Description = "Reloads all or part of the game.";
     Arguments = "<chunks/screen/shaders/audio/textures/all>"; // TODO: List input?
 }
예제 #16
0
 public AttackCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "attack";
     Description = "Makes the player attack.";
     Arguments = "";
 }
예제 #17
0
 public NetusageCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "netusage";
     Description = "Shows information on network usage.";
     Arguments = "";
 }
예제 #18
0
 public RightwardCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "rightward";
     Description = "Moves the player rightward.";
     Arguments = "";
 }
예제 #19
0
 public CdevelCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "cdevel";
     Description = "Clientside developmental commands.";
     Arguments = "";
 }
예제 #20
0
 public ConnectCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "connect";
     Description = "Connects to a server.";
     Arguments = "<ip> <port>";
 }
예제 #21
0
 public ItemprevCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "itemprev";
     Description = "Selects the previous item.";
     Arguments = "";
 }
예제 #22
0
 public SprintCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "sprint";
     Description = "Makes the player sprint.";
     Arguments = "";
 }
예제 #23
0
 public TesteffectCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "testeffect";
     Description = "Quick-tests a particle effect, clientside.";
     Arguments = "effect";
 }
예제 #24
0
 public PlayCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "play";
     Description = "Plays a sound effect.";
     Arguments = "<soundname> [pitch] [volume] [location] [seek time in seconds]";
 }
예제 #25
0
 public ItemleftCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "itemleft";
     Description = "Adjust the item (left version).";
     Arguments = "";
 }
예제 #26
0
 public WalkCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "walk";
     Description = "Makes the player walk.";
     Arguments = "";
 }
예제 #27
0
 public PingCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "ping";
     Description = "Pings a a server.";
     Arguments = "<ip> <port>";
 }
예제 #28
0
 public InventoryCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "inventory";
     Description = "Opens the inventory screen.";
     Arguments = "";
 }
예제 #29
0
 public BackwardCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "backward";
     Description = "Moves the player backward.";
     Arguments = "";
 }
예제 #30
0
        /// <summary>
        /// Prepares the command system, registering all base commands.
        /// </summary>
        public void Init(Outputter _output, Client tclient)
        {
            // General Init
            TheClient = tclient;
            CommandSystem = new Commands();
            Output = _output;
            CommandSystem.Output = Output;
            CommandSystem.Init();

            // UI Commands
            CommandSystem.RegisterCommand(new AttackCommand(TheClient));
            CommandSystem.RegisterCommand(new BackwardCommand(TheClient));
            CommandSystem.RegisterCommand(new BindblockCommand(TheClient));
            CommandSystem.RegisterCommand(new BindCommand(TheClient));
            CommandSystem.RegisterCommand(new ForwardCommand(TheClient));
            CommandSystem.RegisterCommand(new ItemdownCommand(TheClient));
            CommandSystem.RegisterCommand(new ItemleftCommand(TheClient));
            CommandSystem.RegisterCommand(new ItemrightCommand(TheClient));
            CommandSystem.RegisterCommand(new ItemupCommand(TheClient));
            CommandSystem.RegisterCommand(new LeftwardCommand(TheClient));
            CommandSystem.RegisterCommand(new MovedownCommand(TheClient));
            CommandSystem.RegisterCommand(new RightwardCommand(TheClient));
            CommandSystem.RegisterCommand(new SecondaryCommand(TheClient));
            CommandSystem.RegisterCommand(new SprintCommand(TheClient));
            CommandSystem.RegisterCommand(new TalkCommand(TheClient));
            CommandSystem.RegisterCommand(new UnbindCommand(TheClient));
            CommandSystem.RegisterCommand(new UpwardCommand(TheClient));
            CommandSystem.RegisterCommand(new UseCommand(TheClient));
            CommandSystem.RegisterCommand(new WalkCommand(TheClient));

            // Common Commands
            CommandSystem.RegisterCommand(new CdevelCommand(TheClient));
            CommandSystem.RegisterCommand(new ItemnextCommand(TheClient));
            CommandSystem.RegisterCommand(new ItemprevCommand(TheClient));
            CommandSystem.RegisterCommand(new ItemselCommand(TheClient));
            CommandSystem.RegisterCommand(new PlayCommand(TheClient));
            CommandSystem.RegisterCommand(new QuickItemCommand(TheClient));
            CommandSystem.RegisterCommand(new QuitCommand(TheClient));
            CommandSystem.RegisterCommand(new ReloadGameCommand(TheClient));

            // Network Commands
            CommandSystem.RegisterCommand(new ConnectCommand(TheClient));
            CommandSystem.RegisterCommand(new DisconnectCommand(TheClient));
            CommandSystem.RegisterCommand(new NetusageCommand(TheClient));
            CommandSystem.RegisterCommand(new PingCommand(TheClient));
            CommandSystem.RegisterCommand(new StartlocalserverCommand(TheClient));

            // Game Commands
            CommandSystem.RegisterCommand(new InventoryCommand(TheClient));
            CommandSystem.RegisterCommand(new TesteffectCommand(TheClient));

            // General Tags
            CommandSystem.TagSystem.Register(new AudioTagBase(TheClient));

            // Entity Tags
            CommandSystem.TagSystem.Register(new PlayerTagBase(TheClient));

            CommandSystem.PostInit();
        }