Almond Snicker Posted June 13 Share Posted June 13 Hi guys, I tried truncating my mapreg and values are still not removed, this is check when you @set "$variable" in game. I tried checking the sql mapreg database also and it's empty, however there are values when checked in game. how do you delete this or wipe? Quote Link to comment Share on other sites More sharing options...
1 Tokei Posted June 14 Share Posted June 14 Long story short, you need to restart your server. As for why... that is due to how SQL data is used on the map-server. When the map-server starts, it reads all the variables in the mapreg table and loads them into memory. This way, when you want to access the variable in-game (when you use @set $variable), the value is easily accessible without having to look it up with your SQL server. This is done for various other features, like your character inventory, quests, achievements, player stats, etc. In either case, when you edit or delete the entry in SQL while it is still being loaded in memory, it will not have any impact in-game because that is not where the data is being read from. Doing so can actually cause issues as well if you're not careful. So you need to close your server, truncate the table, and then restart your server. 1 1 Quote Link to comment Share on other sites More sharing options...
0 Start_ Posted June 13 Share Posted June 13 (edited) Make sure there are no new variable got re-registered again on OnInit / OnPCLoginEvent. Edited June 13 by Start_ Quote Link to comment Share on other sites More sharing options...
0 Almond Snicker Posted June 13 Author Share Posted June 13 Yes this specific variable is not triggered by oninit and onpcloginevent aswell. On 6/14/2022 at 8:59 AM, Tokei said: Long story short, you need to restart your server. As for why... that is due to how SQL data is used on the map-server. When the map-server starts, it reads all the variables in the mapreg table and loads them into memory. This way, when you want to access the variable in-game (when you use @set $variable), the value is easily accessible without having to look it up with your SQL server. This is done for various other features, like your character inventory, quests, achievements, player stats, etc. In either case, when you edit or delete the entry in SQL while it is still being loaded in memory, it will not have any impact in-game because that is not where the data is being read from. Doing so can actually cause issues as well if you're not careful. So you need to close your server, truncate the table, and then restart your server. Thank you for the perfect explanation, appreciate it @Tokei Quote Link to comment Share on other sites More sharing options...
Hi guys, I tried truncating my mapreg and values are still not removed, this is check when you @set "$variable" in game.
I tried checking the sql mapreg database also and it's empty, however there are values when checked in game. how do you delete this or wipe?
Link to comment
Share on other sites