Skip to content

Commit

Permalink
Update server list ping closes #177
Browse files Browse the repository at this point in the history
  • Loading branch information
ementalo committed Nov 8, 2012
1 parent 917f37c commit 0947dfb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Chraft/Net/Client.Recv.cs
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ public static void HandlePacketServerListPing(Client client, ServerListPingPacke
{
// Received a ServerListPing, so send back Disconnect with the Reason string containing data (server description, number of users, number of slots), delimited by a §
var clientCount = client.Server.GetAuthenticatedClients().Count();
client.Kick(String.Format("{0}§{1}§{2}", client.Server, clientCount, ChraftConfig.MaxPlayers));
client.Kick(String.Format("§1\0{0}\0{1}\0{2}\0{3}\0{4}", ProtocolVersion, MinecraftServerVersion, ChraftConfig.MOTD, clientCount, ChraftConfig.MaxPlayers));
}

public static void HandlePacketDisconnect(Client client, DisconnectPacket packet)
Expand Down
3 changes: 2 additions & 1 deletion Chraft/Net/Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ namespace Chraft.Net
{
public partial class Client : IClient
{
internal const int ProtocolVersion = 29;
internal const int ProtocolVersion = 47;
internal const string MinecraftServerVersion = "1.4.2";
private readonly Socket _socket;
public volatile bool Running = true;
internal PacketHandler PacketHandler { get; private set; }
Expand Down

0 comments on commit 0947dfb

Please sign in to comment.