OpenSim.Region.CoreModules.World.Voxels.VoxelModule.HandleSetMatTableReq C# (CSharp) Method

HandleSetMatTableReq() private method

private HandleSetMatTableReq ( string request, string path, string param, OpenSim.Framework.Servers.HttpServer.OSHttpRequest req, OpenSim.Framework.Servers.HttpServer.OSHttpResponse res ) : string
request string
path string
param string
req OpenSim.Framework.Servers.HttpServer.OSHttpRequest
res OpenSim.Framework.Servers.HttpServer.OSHttpResponse
return string
		string HandleSetMatTableReq(string request, string path, string param,
                                      OSHttpRequest req, OSHttpResponse res)
		{
			OSDMap input = (OSDMap)OSDParser.DeserializeLLSDXml(request);
			VoxMaterial mat = new VoxMaterial();
			mat.Name		= input["name"].AsString();
			mat.Deposit		= (DepositType)input["deposit"].AsInteger();
			mat.Density		= (float)input["density"].AsReal();
			mat.Flags		= (MatFlags)input["flags"].AsBinary()[0];
			mat.Texture		= input["texture"].AsUUID();
			mat.Type		= (MaterialType)input["type"].AsBinary()[0];
			if(input["id"].AsBinary()[0]==0x00) // 0x00=AIR_VOXEL, so we cannot set it.
				(m_scene.Voxels as VoxelChannel).AddMaterial(mat);
			else
			{
				byte id = input["id"].AsBinary()[0];
				(m_scene.Voxels as VoxelChannel).mMaterials[id]=mat;
			}
			return "OK";
		}