mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-13 01:26:50 -04:00
Cache WoM env and terrain identifiers.
This commit is contained in:
parent
1a61c78ed6
commit
60f0086680
@ -316,7 +316,9 @@ namespace ClassicalSharp {
|
|||||||
// different world, the environment settings from the last world are not loaded in the
|
// different world, the environment settings from the last world are not loaded in the
|
||||||
// new world if the async 'get request' didn't complete before the new world was loaded.
|
// new world if the async 'get request' didn't complete before the new world was loaded.
|
||||||
womCounter++;
|
womCounter++;
|
||||||
Window.AsyncDownloader.DownloadPage( url, true, "womenv_" + womCounter );
|
womEnvIdentifier = "womenv_" + womCounter;
|
||||||
|
womTerrainIdentifier = "womterrain_" + womCounter;
|
||||||
|
Window.AsyncDownloader.DownloadPage( url, true, womEnvIdentifier );
|
||||||
sendWomId = true;
|
sendWomId = true;
|
||||||
}
|
}
|
||||||
receivedFirstPosition = false;
|
receivedFirstPosition = false;
|
||||||
|
@ -7,9 +7,10 @@ namespace ClassicalSharp {
|
|||||||
|
|
||||||
public partial class NetworkProcessor {
|
public partial class NetworkProcessor {
|
||||||
|
|
||||||
|
string womEnvIdentifier = "womenv_0", womTerrainIdentifier = "womterrain_0";
|
||||||
void CheckForWomEnvironment() {
|
void CheckForWomEnvironment() {
|
||||||
string page;
|
string page;
|
||||||
Window.AsyncDownloader.TryGetPage( "womenv_" + womCounter, out page );
|
Window.AsyncDownloader.TryGetPage( womEnvIdentifier, out page );
|
||||||
if( page != null ) {
|
if( page != null ) {
|
||||||
ParseWomConfig( page );
|
ParseWomConfig( page );
|
||||||
}
|
}
|
||||||
@ -18,7 +19,7 @@ namespace ClassicalSharp {
|
|||||||
|
|
||||||
void CheckWomBitmaps() {
|
void CheckWomBitmaps() {
|
||||||
Bitmap terrainBmp;
|
Bitmap terrainBmp;
|
||||||
Window.AsyncDownloader.TryGetImage( "womterrain_" + womCounter, out terrainBmp );
|
Window.AsyncDownloader.TryGetImage( womTerrainIdentifier, out terrainBmp );
|
||||||
if( terrainBmp != null ) {
|
if( terrainBmp != null ) {
|
||||||
Window.ChangeTerrainAtlas( terrainBmp );
|
Window.ChangeTerrainAtlas( terrainBmp );
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user