// Path: HexBoxServer/src/com/hexabeast/hexboxserver/NBlockModification.java
// public class NBlockModification {
// 	public int x;
// 	public int y;
// 	
// 	public int id;
// 	
// 	
// 	public boolean layer;
// }
// 
// Path: HexBoxServer/src/com/hexabeast/hexboxserver/NCompressedLayer.java
// public class NCompressedLayer 
// {
// 	public boolean isMain;
// 	public String layer;
// 	
// 	public NCompressedLayer()
// 	{
// 	}
// }
// 
// Path: HexBoxServer/src/com/hexabeast/hexboxserver/VirtualMap.java
// public class VirtualMap {
// 	public VirtualMap()
// 	{
// 	}
// 	
// 	public synchronized void setBlock(NBlockModification conf)
// 	{
// 		
// 	}
// 		
// 	public void setChanged(int x, int y, int layer)
// 	{
// 		
// 	}
// 	
// 	public synchronized void sendCompressedMap(boolean isMain, Connection c)
// 	{
// 		
// 	}
// 	
// 	public void sendLayer(boolean isMain, Connection c) throws IOException
// 	{
// 		
// 	}
// 	
// 	public void loadMap(byte[][] layer, FileHandle[][] mapFile) throws IOException
// 	{	
// 		
// 	}
// 	
// 	public void saveMap()
// 	{
// 			
// 	}
// 	
// 	public void SaveLayers(int m, boolean saveAll) throws IOException
// 	{
// 		
// 	}
// }


import com.hexabeast.hexboxserver.NBlockModification;
import com.hexabeast.hexboxserver.NCompressedLayer;
import com.hexabeast.hexboxserver.VirtualMap;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.zip.DeflaterOutputStream;
import java.util.zip.InflaterInputStream;
import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.utils.Base64Coder;
import com.badlogic.gdx.utils.StreamUtils;
import com.esotericsoftware.kryonet.Connection;
	public synchronized void sendCompressedMap(boolean isMain, Connection c)
	{
		try {
			sendLayer(isMain,c);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	@Override
	public void sendLayer(boolean isMain, Connection c) throws IOException
	{
		MapLayer m = Map.instance.mainLayer;
		if(!isMain)m = Map.instance.backLayer;
		ByteArrayOutputStream baos2 = new ByteArrayOutputStream();
        DeflaterOutputStream dos;

		baos2 = new ByteArrayOutputStream();
		
        dos = new DeflaterOutputStream(baos2);
		
        for(int k = 0; k<Map.instance.width; k++)
		{
        	for(int l = 0; l<Map.instance.height; l++)
			{
				dos.write(m.getBloc(k, l).Id & 0x000000FF);
			}
		}
		if(dos != null) {
            dos.finish();
        }
// Path: HexBoxServer/src/com/hexabeast/hexboxserver/NBlockModification.java
// public class NBlockModification {
// 	public int x;
// 	public int y;
// 	
// 	public int id;
// 	
// 	
// 	public boolean layer;
// }
// 
// Path: HexBoxServer/src/com/hexabeast/hexboxserver/NCompressedLayer.java
// public class NCompressedLayer 
// {
// 	public boolean isMain;
// 	public String layer;
// 	
// 	public NCompressedLayer()
// 	{
// 	}
// }
// 
// Path: HexBoxServer/src/com/hexabeast/hexboxserver/VirtualMap.java
// public class VirtualMap {
// 	public VirtualMap()
// 	{
// 	}
// 	
// 	public synchronized void setBlock(NBlockModification conf)
// 	{
// 		
// 	}
// 		
// 	public void setChanged(int x, int y, int layer)
// 	{
// 		
// 	}
// 	
// 	public synchronized void sendCompressedMap(boolean isMain, Connection c)
// 	{
// 		
// 	}
// 	
// 	public void sendLayer(boolean isMain, Connection c) throws IOException
// 	{
// 		
// 	}
// 	
// 	public void loadMap(byte[][] layer, FileHandle[][] mapFile) throws IOException
// 	{	
// 		
// 	}
// 	
// 	public void saveMap()
// 	{
// 			
// 	}
// 	
// 	public void SaveLayers(int m, boolean saveAll) throws IOException
// 	{
// 		
// 	}
// }


// Path: core/src/com/hexabeast/sandbox/IntegratedServerMap.java
import com.hexabeast.hexboxserver.NBlockModification;
import com.hexabeast.hexboxserver.NCompressedLayer;
import com.hexabeast.hexboxserver.VirtualMap;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.zip.DeflaterOutputStream;
import java.util.zip.InflaterInputStream;
import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.utils.Base64Coder;
import com.badlogic.gdx.utils.StreamUtils;
import com.esotericsoftware.kryonet.Connection;

	public synchronized void sendCompressedMap(boolean isMain, Connection c)
	{
		try {
			sendLayer(isMain,c);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	@Override
	public void sendLayer(boolean isMain, Connection c) throws IOException
	{
		MapLayer m = Map.instance.mainLayer;
		if(!isMain)m = Map.instance.backLayer;
		ByteArrayOutputStream baos2 = new ByteArrayOutputStream();
        DeflaterOutputStream dos;

		baos2 = new ByteArrayOutputStream();
		
        dos = new DeflaterOutputStream(baos2);
		
        for(int k = 0; k<Map.instance.width; k++)
		{
        	for(int l = 0; l<Map.instance.height; l++)
			{
				dos.write(m.getBloc(k, l).Id & 0x000000FF);
			}
		}
		if(dos != null) {
            dos.finish();
        }
		NCompressedLayer l = new NCompressedLayer();