<commit_before>package wraithaven.conquest.server;

import java.io.PrintWriter;
import wraithaven.conquest.KickMessagePacket;
import wraithaven.conquest.Packet;
import wraith.library.Multiplayer.ClientInstance;

public class Player{
	private boolean awaitingHandshake = true;
	private final String name;
	private final ClientInstance client;
	private final PrintWriter outputStream;
	public Player(ClientInstance client, PrintWriter outputStream){
		this.client=client;
		this.outputStream=outputStream;
		name="Player";  //TODO Get actual name.
	}
	@Override public boolean equals(Object o){
		if(o instanceof Player)return o==this;
		if(o instanceof ClientInstance)return o==client;
		return false;
	}
	public void kick(String message){
		KickMessagePacket packet = new KickMessagePacket();
		packet.setMessage(message);
		sendPacket(packet);
		ServerLauncher.server.kickClient(client);
	}
	public void sendPacket(Packet packet){ outputStream.println(packet.compress()); }
	public String getName(){ return name; }
	public boolean awaitingHandshake(){ return awaitingHandshake; }
	public void shakeHand(){ awaitingHandshake=false; }
}<commit_msg>Player now sends "proper" packet format.<commit_after>package wraithaven.conquest.server;

import java.io.PrintWriter;
import wraithaven.conquest.KickMessagePacket;
import wraithaven.conquest.Packet;
import wraith.library.Multiplayer.ClientInstance;

public class Player{
	private boolean awaitingHandshake = true;
	private final String name;
	private final ClientInstance client;
	private final PrintWriter outputStream;
	public Player(ClientInstance client, PrintWriter outputStream){
		this.client=client;
		this.outputStream=outputStream;
		name="Player";  //TODO Get actual name.
	}
	@Override public boolean equals(Object o){
		if(o instanceof Player)return o==this;
		if(o instanceof ClientInstance)return o==client;
		return false;
	}
	public void kick(String message){
		KickMessagePacket packet = new KickMessagePacket();
		packet.setMessage(message);
		sendPacket(packet);
		ServerLauncher.server.kickClient(client);
	}
	public void sendPacket(Packet packet){ outputStream.println(packet.getPacketType().getHexId()+packet.compress()); }
	public String getName(){ return name; }
	public boolean awaitingHandshake(){ return awaitingHandshake; }
	public void shakeHand(){ awaitingHandshake=false; }
}
{'fraction_non_alphanumeric': 0.0951167728237792, 'fraction_numerical': 0.0, 'mean_word_length': 6.479365079365079, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5559115', 'n_tokens_mistral': 692, 'n_tokens_neox': 649, 'n_words': 177}