From 1ed9e396a8fbb54627c68ad7406760ebda194c5e Mon Sep 17 00:00:00 2001 From: mark Date: Mon, 13 Dec 2010 03:26:46 +0000 Subject: [PATCH] mono (at least 2.6.7+) appears to finally support SafeFileHandle --- Server/TileMatrix.cs | 9 +-------- Server/TileMatrixPatch.cs | 9 +-------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/Server/TileMatrix.cs b/Server/TileMatrix.cs index 76a70e936..eff3abba8 100644 --- a/Server/TileMatrix.cs +++ b/Server/TileMatrix.cs @@ -399,11 +399,8 @@ namespace Server fixed ( StaticTile *pTiles = staTiles ) { -#if !MONO NativeReader.Read( m_Statics.SafeFileHandle.DangerousGetHandle(), pTiles, length ); -#else - NativeReader.Read( m_Statics.Handle, pTiles, length ); -#endif + if ( m_Lists == null ) { m_Lists = new TileList[8][]; @@ -472,11 +469,7 @@ namespace Server fixed ( LandTile *pTiles = tiles ) { -#if !MONO NativeReader.Read( m_Map.SafeFileHandle.DangerousGetHandle(), pTiles, 192 ); -#else - NativeReader.Read( m_Map.Handle, pTiles, 192 ); -#endif } return tiles; diff --git a/Server/TileMatrixPatch.cs b/Server/TileMatrixPatch.cs index 7f4e3e050..8b9ae159e 100644 --- a/Server/TileMatrixPatch.cs +++ b/Server/TileMatrixPatch.cs @@ -99,11 +99,7 @@ namespace Server fixed ( LandTile *pTiles = tiles ) { -#if !MONO NativeReader.Read( fsData.SafeFileHandle.DangerousGetHandle(), pTiles, 192 ); -#else - NativeReader.Read( fsData.Handle, pTiles, 192 ); -#endif } matrix.SetLandBlock( x, y, tiles ); @@ -168,11 +164,8 @@ namespace Server fixed ( StaticTile *pTiles = staTiles ) { -#if !MONO NativeReader.Read( fsData.SafeFileHandle.DangerousGetHandle(), pTiles, length ); -#else - NativeReader.Read( fsData.Handle, pTiles, length ); -#endif + StaticTile *pCur = pTiles, pEnd = pTiles + tileCount; while ( pCur < pEnd )