package net.mc_pandacraft.java.plugin.pandacraftutils.network_api;

import java.io.PrintStream;

public class Response {
	public boolean good = true;
	public String data = "";
	
	
	public Response(boolean good, String data) {
		this.good = good;
		this.data = data;
	}

	public Response() {
	}
	
	
	public void sendPacket(PrintStream out) {
		
		if (data == null) data = "";
		
		out.print((good?"OK":"ERROR")+"\n");
		out.print(data.getBytes().length+"\n");
		out.print(data);
		out.flush();
	}
}
