lore message resend
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit

This commit is contained in:
austin 2025-04-02 13:51:57 -04:00
parent 21c73c6672
commit 8a9abcc8e4
2 changed files with 16 additions and 0 deletions

View File

@ -1414,6 +1414,7 @@ Two EXCELLENT rock textures
Fix rock2 texture Fix rock2 texture
biome floor elements controlling noise generator's voxel selection biome floor elements controlling noise generator's voxel selection
Plains (rock) biome Plains (rock) biome
Lore message resend from client on failure

View File

@ -29,6 +29,8 @@ import electrosphere.entity.EntityUtils;
import electrosphere.logger.LoggerInterface; import electrosphere.logger.LoggerInterface;
import electrosphere.net.NetUtils; import electrosphere.net.NetUtils;
import electrosphere.net.client.ClientNetworking; import electrosphere.net.client.ClientNetworking;
import electrosphere.net.parser.net.message.CharacterMessage;
import electrosphere.net.parser.net.message.LoreMessage;
import electrosphere.renderer.actor.Actor; import electrosphere.renderer.actor.Actor;
import electrosphere.renderer.actor.ActorTextureMask; import electrosphere.renderer.actor.ActorTextureMask;
@ -46,6 +48,11 @@ public class ClientLoading {
*/ */
static final int DRAW_CELL_EXPECTED_MINIMUM_FRAMES_TO_INIT = 10; static final int DRAW_CELL_EXPECTED_MINIMUM_FRAMES_TO_INIT = 10;
/**
* Number of frames to wait before re-sending query for lore
*/
static final int LORE_RESEND_FRAMES = 1000;
/** /**
* Loads the race data from the server * Loads the race data from the server
@ -72,10 +79,18 @@ public class ClientLoading {
} }
//while we don't know what races are playable, wait //while we don't know what races are playable, wait
WindowUtils.updateLoadingWindow("Waiting on lore"); WindowUtils.updateLoadingWindow("Waiting on lore");
int framesWaited = 0;
while(Globals.gameConfigCurrent.getCreatureTypeLoader().getPlayableRaces().size() == 0){ while(Globals.gameConfigCurrent.getCreatureTypeLoader().getPlayableRaces().size() == 0){
if(framesWaited % LORE_RESEND_FRAMES == (LORE_RESEND_FRAMES - 1)){
//request playable races
Globals.clientConnection.queueOutgoingMessage(LoreMessage.constructRequestRacesMessage());
//request characters available to this player
Globals.clientConnection.queueOutgoingMessage(CharacterMessage.constructRequestCharacterListMessage());
}
try { try {
TimeUnit.MILLISECONDS.sleep(5); TimeUnit.MILLISECONDS.sleep(5);
} catch (InterruptedException ex) {} } catch (InterruptedException ex) {}
framesWaited++;
} }
//once we have them, bring up the character creation interface //once we have them, bring up the character creation interface
//init character creation window //init character creation window