void HandleLevelInit() { if (gzipStream != null) { return; } game.Map.Reset(); prevScreen = game.activeScreen; if (prevScreen is LoadingMapScreen) { prevScreen = null; } prevCursorVisible = game.CursorVisible; game.SetNewScreen(new LoadingMapScreen(game, ServerName, ServerMotd), false); if (ServerMotd.Contains("cfg=")) { ReadWomConfigurationAsync(); } receivedFirstPosition = false; gzipHeader = new GZipHeaderReader(); // Workaround because built in mono stream assumes that the end of stream // has been reached the first time a read call returns 0. (MS.NET doesn't) #if __MonoCS__ gzipStream = new DeflateStream(gzippedMap, true); #else gzipStream = new DeflateStream(gzippedMap, CompressionMode.Decompress); if (OpenTK.Configuration.RunningOnMono) { throw new InvalidOperationException("You must compile ClassicalSharp with __MonoCS__ defined " + "to run on Mono, due to a limitation in Mono."); } #endif mapSizeIndex = 0; mapIndex = 0; receiveStart = DateTime.UtcNow; }
void HandleLevelInit() { game.Map.Reset(); game.SetNewScreen( new LoadingMapScreen( game, ServerName, ServerMotd ) ); if( ServerMotd.Contains( "cfg=" ) ) { ReadWomConfigurationAsync(); } receivedFirstPosition = false; gzipHeader = new GZipHeaderReader(); // Workaround because built in mono stream assumes that the end of stream // has been reached the first time a read call returns 0. (MS.NET doesn't) #if __MonoCS__ gzipStream = new DeflateStream( gzippedMap, true ); #else gzipStream = new DeflateStream( gzippedMap, CompressionMode.Decompress ); if( OpenTK.Configuration.RunningOnMono ) { throw new InvalidOperationException( "You must compile ClassicalSharp with __MonoCS__ defined " + "to run on Mono, due to a limitation in Mono." ); } #endif mapSizeIndex = 0; mapIndex = 0; receiveStart = DateTime.UtcNow; }