From 8a9abcc8e4ccf279a76ac3989b554195b2765ebd Mon Sep 17 00:00:00 2001 From: austin Date: Wed, 2 Apr 2025 13:51:57 -0400 Subject: [PATCH] lore message resend --- docs/src/progress/renderertodo.md | 1 + .../engine/loadingthreads/ClientLoading.java | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/docs/src/progress/renderertodo.md b/docs/src/progress/renderertodo.md index eb491a4d..1b744e2d 100644 --- a/docs/src/progress/renderertodo.md +++ b/docs/src/progress/renderertodo.md @@ -1414,6 +1414,7 @@ Two EXCELLENT rock textures Fix rock2 texture biome floor elements controlling noise generator's voxel selection Plains (rock) biome +Lore message resend from client on failure diff --git a/src/main/java/electrosphere/engine/loadingthreads/ClientLoading.java b/src/main/java/electrosphere/engine/loadingthreads/ClientLoading.java index 157d8bb0..dea0a608 100644 --- a/src/main/java/electrosphere/engine/loadingthreads/ClientLoading.java +++ b/src/main/java/electrosphere/engine/loadingthreads/ClientLoading.java @@ -29,6 +29,8 @@ import electrosphere.entity.EntityUtils; import electrosphere.logger.LoggerInterface; import electrosphere.net.NetUtils; 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.ActorTextureMask; @@ -46,6 +48,11 @@ public class ClientLoading { */ 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 @@ -72,10 +79,18 @@ public class ClientLoading { } //while we don't know what races are playable, wait WindowUtils.updateLoadingWindow("Waiting on lore"); + int framesWaited = 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 { TimeUnit.MILLISECONDS.sleep(5); } catch (InterruptedException ex) {} + framesWaited++; } //once we have them, bring up the character creation interface //init character creation window