Ejemplo n.º 1
0
 public TalkCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "talk";
     Description = "Opens a chat view.";
     Arguments = "[text]";
 }
Ejemplo n.º 2
0
 public QuitCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "quit";
     Description = "Quits the game.";
     Arguments = "";
 }
Ejemplo n.º 3
0
 public SecondaryCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "secondary";
     Description = "Makes the player attack secondarily.";
     Arguments = "";
 }
Ejemplo n.º 4
0
 public ItemselCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "itemsel";
     Description = "Selects an item to hold by the given number.";
     Arguments = "<slot number>";
 }
Ejemplo n.º 5
0
 public UpwardCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "upward";
     Description = "Moves the player upward (jumps).";
     Arguments = "";
 }
Ejemplo n.º 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>";
 }
Ejemplo n.º 7
0
 public ItemdownCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "itemdown";
     Description = "Adjust the item (down version).";
     Arguments = "";
 }
Ejemplo n.º 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));
 }
Ejemplo n.º 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();
 }
Ejemplo n.º 10
0
 public DisconnectCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "disconnect";
     Description = "Disconnects from the server.";
     Arguments = "";
 }
Ejemplo n.º 11
0
 public MovedownCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "movedown";
     Description = "Makes the player crouch.";
     Arguments = "";
 }
Ejemplo n.º 12
0
 public ItemnextCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "itemnext";
     Description = "Selects the next item.";
     Arguments = "";
 }
Ejemplo n.º 13
0
 public BindblockCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "bindblock";
     Description = "Binds a script block to a key.";
     Arguments = "<key>";
 }
Ejemplo n.º 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");
 }
Ejemplo n.º 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?
 }
Ejemplo n.º 16
0
 public AttackCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "attack";
     Description = "Makes the player attack.";
     Arguments = "";
 }
Ejemplo n.º 17
0
 public NetusageCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "netusage";
     Description = "Shows information on network usage.";
     Arguments = "";
 }
Ejemplo n.º 18
0
 public RightwardCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "rightward";
     Description = "Moves the player rightward.";
     Arguments = "";
 }
Ejemplo n.º 19
0
 public CdevelCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "cdevel";
     Description = "Clientside developmental commands.";
     Arguments = "";
 }
Ejemplo n.º 20
0
 public ConnectCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "connect";
     Description = "Connects to a server.";
     Arguments = "<ip> <port>";
 }
Ejemplo n.º 21
0
 public ItemprevCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "itemprev";
     Description = "Selects the previous item.";
     Arguments = "";
 }
Ejemplo n.º 22
0
 public SprintCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "sprint";
     Description = "Makes the player sprint.";
     Arguments = "";
 }
Ejemplo n.º 23
0
 public TesteffectCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "testeffect";
     Description = "Quick-tests a particle effect, clientside.";
     Arguments = "effect";
 }
Ejemplo n.º 24
0
 public PlayCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "play";
     Description = "Plays a sound effect.";
     Arguments = "<soundname> [pitch] [volume] [location] [seek time in seconds]";
 }
Ejemplo n.º 25
0
 public ItemleftCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "itemleft";
     Description = "Adjust the item (left version).";
     Arguments = "";
 }
Ejemplo n.º 26
0
 public WalkCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "walk";
     Description = "Makes the player walk.";
     Arguments = "";
 }
Ejemplo n.º 27
0
 public PingCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "ping";
     Description = "Pings a a server.";
     Arguments = "<ip> <port>";
 }
Ejemplo n.º 28
0
 public InventoryCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "inventory";
     Description = "Opens the inventory screen.";
     Arguments = "";
 }
Ejemplo n.º 29
0
 public BackwardCommand(Client tclient)
 {
     TheClient = tclient;
     Name = "backward";
     Description = "Moves the player backward.";
     Arguments = "";
 }
Ejemplo n.º 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();
        }