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)); }
static void SetMotd(Player p, Level lvl, string value) { lvl.motd = value == "" ? "ignore" : value; lvl.ChatLevel("Map's MOTD was changed to: &b" + lvl.motd); Player[] players = PlayerInfo.Online.Items; foreach (Player pl in players) { if (pl.level != lvl || !pl.HasCpeExt(CpeExt.HackControl)) { continue; } pl.Send(Hacks.MakeHackControl(pl)); } }
void SendMapMotd() { byte[] packet = Packet.Motd(this, level.GetMotd(this)); if (OnSendMOTD != null) { OnSendMOTD(this, packet); } Send(packet); if (!HasCpeExt(CpeExt.HackControl)) { return; } Send(Hacks.MakeHackControl(this)); 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); 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)); }