public void Write(ClientWrapper state, MSGBuffer buffer, object[] Arguments) { buffer.WriteVarInt(PacketID); buffer.WriteString(Arguments[0].ToString()); buffer.WriteString(Arguments[1].ToString()); buffer.FlushData(); }
private void HandleStatusRequest(ClientWrapper state, MSGBuffer buffer) { buffer.WriteVarInt(PacketID); Serverping serverlistping = new Serverping() { Version = new ServerpingVersion() { Name = Globals.ProtocolName, Protocol = Globals.ProtocolVersion }, Players = new ServerpingPlayers() { Max = Globals.MaxPlayers, Online = Globals.PlayersOnline, }, Description = new ServerpingDescription() { Motd = Globals.Config.Motd }, Favicon = (Globals.Favicon == null) ? "" : Globals.Favicon }; buffer.WriteString(JsonConvert.SerializeObject(serverlistping)); buffer.FlushData(); }
public void Write(ClientWrapper state, MSGBuffer buffer, object[] Arguments) { if (state.PlayMode) { buffer.WriteVarInt(PacketID); } else { buffer.WriteVarInt(0x00); } buffer.WriteString(JsonConvert.SerializeObject((ChatMessage)Arguments[0])); buffer.FlushData(); }
public void Write(ClientWrapper state, MSGBuffer buffer, object[] Arguments) { buffer.WriteVarInt(PacketID); buffer.WriteInt(state.Player.UniqueServerID); buffer.WriteByte((byte)state.Player.Gamemode); buffer.WriteInt(state.Player.Dimension); buffer.WriteByte((byte)Globals.Difficulty); buffer.WriteByte((byte)Globals.MaxPlayers); buffer.WriteString(Globals.LVLType); buffer.WriteBool(false); Globals.Logger.Log(Utils.LogType.Error, Globals.LVLType); buffer.FlushData(); }