Fixes mono builds. (#16)

This commit is contained in:
Kamron Batman 2019-03-03 15:49:10 -08:00 committed by GitHub
parent 90ffe0ea3c
commit 1c8f044476
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 9 additions and 30 deletions

View file

@ -22,10 +22,7 @@ namespace Server.RemoteAdmin
public static void Configure()
{
PacketHandlers.Register(0xF1, 0, false, OnReceive);
#if !MONO
Core.MultiConsoleOut.Add(new EventTextWriter(OnConsoleChar, OnConsoleLine, OnConsoleString));
#endif
Timer.DelayCall(TimeSpan.FromMinutes(2.5), TimeSpan.FromMinutes(2.5), CleanUp);
}
@ -279,4 +276,4 @@ namespace Server.RemoteAdmin
m_OnLine?.Invoke(line);
}
}
}
}

View file

@ -51,7 +51,6 @@ namespace Server
{
public unsafe void Read(IntPtr ptr, void* buffer, int length)
{
//UnsafeNativeMethods._lread( ptr, buffer, length );
uint lpNumberOfBytesRead = 0;
UnsafeNativeMethods.ReadFile(ptr, buffer, (uint)length, ref lpNumberOfBytesRead, null);
}

View file

@ -48,10 +48,11 @@ namespace Server
{
FileOptions options = FileOptions.SequentialScan;
if (Concurrency > 0) options |= FileOptions.Asynchronous;
if (Concurrency > 0)
options |= FileOptions.Asynchronous;
#if MONO
return new FileStream( path, mode, access, share, bufferSize, options );
return new FileStream( path, mode, access, share, BufferSize, options );
#else
if (Unbuffered)
options |= NoBuffering;
@ -109,4 +110,4 @@ namespace Server
}
#endif
}
}
}

View file

@ -79,10 +79,8 @@ namespace Server
)
);
#if !MONO
PerformanceCounterCategory.Create(PerformanceCategoryName, PerformanceCategoryDesc,
PerformanceCounterCategoryType.SingleInstance, counters);
#endif
}
numberOfWorldSaves = new PerformanceCounter(PerformanceCategoryName, "Save - Count", false);
@ -137,4 +135,4 @@ namespace Server
writtenBytesPerSecond.IncrementBy(numberOfBytes);
}
}
}
}

View file

@ -388,11 +388,7 @@ namespace Server
fixed (StaticTile* pTiles = staTiles)
{
#if !MONO
NativeReader.Read(DataStream.SafeFileHandle.DangerousGetHandle(), pTiles, length);
#else
NativeReader.Read( m_Statics.Handle, pTiles, length );
#endif
if (m_Lists == null)
{
m_Lists = new TileList[8][];
@ -463,11 +459,7 @@ namespace Server
fixed (LandTile* pTiles = tiles)
{
#if !MONO
NativeReader.Read(MapStream.SafeFileHandle.DangerousGetHandle(), pTiles, 192);
#else
NativeReader.Read( m_Map.Handle, pTiles, 192 );
#endif
}
return tiles;
@ -718,9 +710,9 @@ namespace Server
if (y == null)
return -1;
return x.m_Offset.CompareTo(y.m_Offset);
}
}
}
}
}

View file

@ -95,11 +95,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);
@ -163,11 +159,7 @@ 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)
@ -199,4 +191,4 @@ namespace Server
}
}
}
}
}