Skip to content

Pre-fetch object_meta to avoid simultaneous access on first search - #125

Merged
savage13 merged 2 commits into
masterfrom
getObjectMetaData
Oct 31, 2026
Merged

savage13 merged 2 commits into
masterfrom
getObjectMetaData

Conversation

@savage13

@savage13 savage13 commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

On the first search after loading the map, object_meta.json was requested simultaneously as the check for the existing data was insufficient to avoid repeated network requests.


This change is Reviewable

Comment thread src/services/MsgMgr.ts Outdated
this.names = d;
}));
await Promise.all(fileLoadPromises);
// Pre-fetch object_meta.json (the first search causes simultaneous access)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't we just add object_meta.json to fileList?

and actually do you know why AreaData/ClimateData/ObjectMeta are even in this file? doesn't seem related to messages at all

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding those to the fileList (/public/game_files/text/list.json) is probably best, but list.json lives outside of the repo. They could be hard-coded in like names.json.

Then, we would need to modify getObjectMetaData() and friends to request the files content with getFile(). This is fine with me.

I think those are all changes I made. I think that it they closer in content than MapMgr, which is more database rather than "static" or data from a file.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I am all set with the PR. Would be glad to merge this.

@savage13
savage13 merged commit 53a8e90 into master Oct 31, 2026
2 checks passed
@savage13
savage13 deleted the getObjectMetaData branch October 31, 2026 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants