Store world save variables at characters db#2825
Store world save variables at characters db#2825schell244 wants to merge 1 commit intovmangos:developmentfrom
Conversation
|
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. |
|
or another permutation of these words? |
|
maybe world_persistent_variables? |
|
Oh yes, you're right, there are querys on |
|
I don't think it makes sense to change only |
|
Did not experience any issues with that change, but I agree that it makes sense to move the other tables as well, together with the variables. Will add some more changes when I have time. |
9e01003 to
bdf1813
Compare
bdf1813 to
a2e44cd
Compare
We are focusing on non-admin-command induced changes to the DB. The current war effort stage is stored in But (what you probably mean,) @schell244 Here are some sql snippets you can try to verify your changes. USE world; -- whatever your db name is
-- Creates `root_readonly` user with pw `root` which only has read access to all tables
CREATE USER 'root_readonly'@'%' IDENTIFIED BY 'root';
GRANT SELECT ON *.* TO 'root_readonly'@'%';
FLUSH PRIVILEGES;
-- Grad write permissions to game_event
GRANT INSERT, UPDATE, DELETE ON game_event TO 'root_readonly'@'%';
FLUSH PRIVILEGES;
-- Revoke write permission to game_event
REVOKE INSERT, UPDATE, DELETE ON game_event FROM 'root_readonly'@'%';
FLUSH PRIVILEGES; |
🍰 Pullrequest
Store world persistent variables in characters db.
This enables applying a fresh world db without losing any saved variables.
Refactored storage from a linear vector to an unordered_map for O(1) lookup, replaced the DELETE+INSERT transaction with a single REPLACE INTO, and removed the unused _InsertVariable and LoadVariable functions.
How2Test
world_persistent_variablesin the characters dbTodo / Checklist