public void SendMapMotd()
        {
            string motd = GetMotd();

            motd = Chat.Format(motd, this);
            OnSendingMotdEvent.Call(this, ref motd);

            // Change -hax into +hax etc when in Referee mode
            //  (can't just do Replace('-', '+') though, that breaks -push)
            if (Game.Referee)
            {
                motd = motd
                       .Replace("-hax", "+hax").Replace("-noclip", "+noclip")
                       .Replace("-speed", "+speed").Replace("-respawn", "+respawn")
                       .Replace("-fly", "+fly").Replace("-thirdperson", "+thirdperson");
            }
            byte[] packet = Packet.Motd(this, motd);
            Send(packet);

            if (!Supports(CpeExt.HackControl))
            {
                return;
            }
            Send(Hacks.MakeHackControl(this, motd));
        }
Esempio n. 2
0
        public void SendMapMotd()
        {
            string motd = GetMotd();

            motd = Chat.Format(motd, this);
            OnSendingMotdEvent.Call(this, ref motd);

            // Change -hax into +hax etc when in Referee mode
            //  (can't just do Replace('-', '+') though, that breaks -push)
            if (Game.Referee)
            {
                motd = motd
                       .Replace("-hax", "+hax").Replace("-noclip", "+noclip")
                       .Replace("-speed", "+speed").Replace("-respawn", "+respawn")
                       .Replace("-fly", "+fly").Replace("-thirdperson", "+thirdperson");
            }
            Session.SendMotd(motd);
        }
Esempio n. 3
0
        public void SendMapMotd()
        {
            string motd = GetMotd();

            motd = Chat.Format(motd, this);
            OnSendingMotdEvent.Call(this, ref motd);

            byte[] packet = Packet.Motd(this, motd);
            Send(packet);

            if (!Supports(CpeExt.HackControl))
            {
                return;
            }
            Send(Hacks.MakeHackControl(this, motd));
            if (Game.Referee)
            {
                Send(Packet.HackControl(true, true, true, true, true, -1));
            }
        }
        public void SendMapMotd()
        {
            string motd = GetMotd();

            motd = Chat.Format(motd, this);
            OnSendingMotdEvent.Call(this, ref motd);

            // change -hax into +hax etc
            if (Game.Referee)
            {
                motd = motd.Replace('-', '+');
            }
            byte[] packet = Packet.Motd(this, motd);
            Send(packet);

            if (!Supports(CpeExt.HackControl))
            {
                return;
            }
            Send(Hacks.MakeHackControl(this, motd));
        }
Esempio n. 5
0
 public override void Unload(bool shutdown)
 {
     OnSendingMotdEvent.Unregister(HandleGettingMOTD);
     OnPlayerCommandEvent.Unregister(OnPlayerCommand);
 }
Esempio n. 6
0
 public override void Load(bool startup)
 {
     OnSendingMotdEvent.Register(HandleGettingMOTD, Priority.Low);
     OnPlayerCommandEvent.Register(OnPlayerCommand, Priority.Low);
 }