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) { buffer.WriteVarInt(PacketID); buffer.WriteString(Arguments[0].ToString()); buffer.WriteString(Arguments[1].ToString()); buffer.FlushData(); }
public void Write(ClientWrapper state, MSGBuffer buffer, object[] Arguments) { buffer.WriteVarInt(PacketID); buffer.WriteLong(Globals.WorldAge); buffer.WriteLong(Globals.TimeOfDay); buffer.FlushData(); }
public void Write(ClientWrapper state, MSGBuffer buffer, object[] Arguments) { int id = new Random().Next(0, 100); buffer.WriteVarInt(PacketID); buffer.WriteVarInt(id); buffer.FlushData(); }
public void Write(ClientWrapper state, MSGBuffer buffer, object[] Arguments) { Vector3 D = Globals.WorldGen.GetSpawnPoint(); long Data = (((long)D.X & 0x3FFFFFF) << 38) | (((long)D.Y & 0xFFF) << 26) | ((long)D.Z & 0x3FFFFFF); buffer.WriteVarInt(PacketID); buffer.WriteLong(Data); buffer.FlushData(); }
public void Write(ClientWrapper state, MSGBuffer buffer, object[] Arguments) { buffer.WriteVarInt(0x08); buffer.WriteDouble(Globals.WorldGen.GetSpawnPoint().X); buffer.WriteDouble(Globals.WorldGen.GetSpawnPoint().Y); buffer.WriteDouble(Globals.WorldGen.GetSpawnPoint().Z); buffer.WriteFloat(0f); buffer.WriteFloat(0f); buffer.WriteByte(111); 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(); }
public void Write(ClientWrapper state, MSGBuffer buffer, object[] Arguments) { buffer.WriteVarInt(PacketID); buffer.Write((byte[])Arguments[0]); buffer.FlushData(); }