Jump to content

REDIS: Clear Traders, Trader Items, Veichles and Buildings


Dwarfer

Recommended Posts

This post is old and you are probably better using the following

 

 

-----------------------------------------------------

 

Hi Guys,

 

Not sure where this belongs on the forum so just put it here. If one of the mods wants to move to better place please do.

 

So I was trying to find a easy way to clear out my Trader items and I could not find a way other than using something like redis desktop manager then selecting each AI_ITEMS and deleting it.. 

 

The best way I have found to-do it so far is using the redis-cli tool and the window port of Linux xargs. Links bellow.

 

Redis-cli: https://github.com/ServiceStack/redis-windows/blob/master/downloads/redis64-2.8.12.zip

FindUtils: http://gnuwin32.sourceforge.net/packages/findutils.htm

 

I am not going to tell you how to install these however once you have them working and your paths specified you can do something like this.  You would need to change YOUR_PORT, YOUR_PASSWORD and NAS123 to whatever you have specified on your own servers.  Basicllay if you run the line without the xargs it would just display all the key lines. with the "|  xargs" you basically send that result to the DEL command and hay presto they all go :-)

 

** DOING THIS MAY BREAK YOUR DB SO MAKE SURE YOU HAVE A BACKUP **

 

Clear Veichles

C:\Temp>redis-cli.exe -p YOUR_PORT -a YOUR_PASSWORD keys Vehicle:NAS123:* | xargs redis-cli.exe -p YOUR_PORT -a YOUR_PASSWORD DEL
 
Clear AI Traders
C:\Temp>redis-cli.exe -p YOUR_PORT -a YOUR_PASSWORD keys AI:NAS123:* | xargs redis-cli.exe -p YOUR_PORT -a YOUR_PASSWORD DEL
 
Clear AI Trader Items
C:\Temp>redis-cli.exe -p YOUR_PORT -a YOUR_PASSWORD keys AI_ITEMS:NAS123:* | xargs redis-cli.exe -p YOUR_PORT -a YOUR_PASSWORD DEL
 
Clear Buildings
C:\Temp>redis-cli.exe -p YOUR_PORT -a YOUR_PASSWORD keys Building:NAS123:* | xargs redis-cli.exe -p YOUR_PORT -a YOUR_PASSWORD DEL
Link to comment
Share on other sites

  • 4 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Discord

×
×
  • Create New...