Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store world save variables at characters db #2825

Open
wants to merge 3 commits into
base: development
Choose a base branch
from

Conversation

schell244
Copy link
Contributor

@schell244 schell244 commented Nov 8, 2024

🍰 Pullrequest

Store world save variables at characters db, as they are related to player actions and make world database read only.
This will allow to apply a fresh world db without wiping any saved states.
Also removed LoadVariable function, as it was unused.
(Changes have been tested on raspywow server)

How2Test

  • Apply changes from this PR
  • Start server and check save states are now stored at world_persistent_variables at characters db
  • Do changes to world states (for example start Stranglethorn Vale Fishing and hand in 40 tasy fish)
  • Apply fresh world db, reboot server -> event is still completed for this week

Todo / Checklist

  • None

@0blu 0blu added CPP A issue / PR which references CPP code SQL A issue / PR which references SQL code labels Nov 8, 2024
@ratkosrb
Copy link
Contributor

ratkosrb commented Nov 8, 2024

World states is already a term that exists, and it's something that's sent to client. We should not have confusing naming like this, because it implies that those are the same world states blizzard sends if you name the table like this, and that is not what it contains. Variables is our own custom indexes and values, not using blizzard's ids for stuff.

@0blu
Copy link
Collaborator

0blu commented Nov 8, 2024

variables is too generic, especially in a database like characters.
Maybe something like this:

  • persistent_world_data
  • persistent_state
  • world_persistence
  • world_progress
  • game_state
  • realm_state

or another permutation of these words?

@schell244
Copy link
Contributor Author

maybe world_persistent_variables?

@schell244 schell244 changed the title Store world save states at characters db Store world save variables at characters db Nov 8, 2024
@shudza
Copy link
Contributor

shudza commented Nov 8, 2024

... and make world database read only.

game_events is written to as well, or am I wrong?

@schell244
Copy link
Contributor Author

... and make world database read only.

game_events is written to as well, or am I wrong?

Oh yes, you're right, there are querys on game_event_creature and game_event_creature_data. Would probably make sense to move those tables to charcter db as well at some point.

@shudza
Copy link
Contributor

shudza commented Nov 8, 2024

I don't think it makes sense to change only variables then. For example, variables stores stuff like resources for war effort, but the stage it self is stored in game_events. So if the point was to make world db ephemeral/read-only, this would probably cause issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CPP A issue / PR which references CPP code SQL A issue / PR which references SQL code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants