Jump to content
  • 0
Almond Snicker

How to wipe 'mapreg' - Global Permanent Variables

Question

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?

image.thumb.png.efb090049e86d5b5b0f1cd60e62e264a.png

 

image.png.23cd3ece4de907e84e2575a0c6f6a75d.png

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 1

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.

  • Upvote 1
  • Love 1
Link to comment
Share on other sites

  • 0

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.