string HandleVoxelChunkReq(string request, string path, string param,
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
{
// Try to parse the texture ID from the request URL
NameValueCollection query = HttpUtility.ParseQueryString(httpRequest.Url.Query);
int X, Y,Z=0;
if (!int.TryParse(query.GetOne("x"), out X) ||
!int.TryParse(query.GetOne("y"), out Y))
{
httpResponse.StatusCode = 404;
httpResponse.Send();
return null;
}
if (X < 0 ||
X > m_scene.Voxels.Width / VoxelChannel.CHUNK_SIZE_X ||
Y < 0 ||
Y > m_scene.Voxels.Length / VoxelChannel.CHUNK_SIZE_Y ||
Z < 0 ||
Z > m_scene.Voxels.Height / VoxelChannel.CHUNK_SIZE_Z)
{
httpResponse.StatusCode = 404;
httpResponse.Send();
return null;
}
SendChunk(httpRequest, httpResponse, X, Y);
httpResponse.Send();
return null;
}
public void RegionLoaded(Scene scene)