deleting pos lines in sqlite map db
deleting pos lines in sqlite map db
Hi,
will there be any problems if i delete some well selected pos lines from sqlite db?
What i need to know is, will deleted lines (entries) be regenerated from seed if not found?
So i could write an SQL Query to delete all sectors which i dont want to preserve.
like delete all pos where pos(x,y,z) is not in myRange.
e.g. delete all except posXYZtoPos(0,0,0 to 100,100,100)
will there be any problems if i delete some well selected pos lines from sqlite db?
What i need to know is, will deleted lines (entries) be regenerated from seed if not found?
So i could write an SQL Query to delete all sectors which i dont want to preserve.
like delete all pos where pos(x,y,z) is not in myRange.
e.g. delete all except posXYZtoPos(0,0,0 to 100,100,100)
-
- Member
- Posts: 4276
- Joined: Sun Sep 09, 2012 17:31
- GitHub: Sokomine
- IRC: Sokomine
- In-game: Sokomine
Re: deleting pos lines in sqlite map db
That ought to work well. The only thing you might have to take into consideration is that mapgen generates several mapblocks (16x16x16 blocks) in one go as one chunk (usually 5x5x5 mapblocks, so 80x80x80 blocks). I don't know what will happen if you delete only part of a chunk.mike wrote: What i need to know is, will deleted lines (entries) be regenerated from seed if not found?
So i could write an SQL Query to delete all sectors which i dont want to preserve.
You'll have to transform the pos index into coordinates first, but yes, it ought to work then.mike wrote: e.g. delete all except posXYZtoPos(0,0,0 to 100,100,100)
A list of my mods can be found here.
Re: deleting pos lines in sqlite map db
If this is that easy wouldnt it be a function for worldedit or an script?
-
- Member
- Posts: 4276
- Joined: Sun Sep 09, 2012 17:31
- GitHub: Sokomine
- IRC: Sokomine
- In-game: Sokomine
Re: deleting pos lines in sqlite map db
This is nothing WorldEdit can do, as WorldEdit runs while the server is running. This kind of work is better done while the world is not loaded. The necessary commands depend on the database backend. sqlite3 is easier to handle in that regard than leveldb.mike wrote: If this is that easy wouldnt it be a function for worldedit or an script?
A list of my mods can be found here.
-
- Moderator
- Posts: 4094
- Joined: Wed Aug 24, 2011 09:44
- GitHub: sfan5
- IRC: sfan5
- Location: Germany
Re: deleting pos lines in sqlite map db
If you delete a MapBlock from the database it will get regenerated when you visit the area again.
Re: deleting pos lines in sqlite map db
so i dont have to care if i have to delete a set or just random picks?
Re: deleting pos lines in sqlite map db
is there any code for generating the coords except the one from db spec page?
-
- Moderator
- Posts: 4094
- Joined: Wed Aug 24, 2011 09:44
- GitHub: sfan5
- IRC: sfan5
- Location: Germany
Re: deleting pos lines in sqlite map db
Here's a small python program that does what you want: http://sprunge.us/KOhi
X, Y and Z are MapBlock coords. not node coords.
Example:
You want to delete the 16x16x16 cube the node (-123, 456, 25) belongs to:
-123 / 16 = -7
456 / 16 = 28
25 / 16 = 1
-> ./pos2dbpos.py -7 28 1
Then delete that entry in the database.
X, Y and Z are MapBlock coords. not node coords.
Example:
You want to delete the 16x16x16 cube the node (-123, 456, 25) belongs to:
-123 / 16 = -7
456 / 16 = 28
25 / 16 = 1
-> ./pos2dbpos.py -7 28 1
Then delete that entry in the database.
-
- Member
- Posts: 1482
- Joined: Fri Apr 19, 2013 16:19
- GitHub: twoelk
- IRC: twoelk
- In-game: twoelk
- Location: northern Germany
Re: deleting pos lines in sqlite map db
Not code but some playing with spreadsheets.
Beware might contain mistakes. Use with care.
Is extracted from some other project of mine therefore might have vital parts missing.
Beware might contain mistakes. Use with care.
Is extracted from some other project of mine therefore might have vital parts missing.
- Attachments
-
- Calculating_MapInteger.zip
- (17.72 KiB) Downloaded 64 times
Re: deleting pos lines in sqlite map db
That looks good.
So if i calculate like this for one node, then maximum 16 nodes in all directions will be deleted?
Next i have to think how to write a script which deletes all except "active" played map.
I cant delete e.g. block 123456 until inf. I hate unnormalized databases ;-)
So if i calculate like this for one node, then maximum 16 nodes in all directions will be deleted?
Next i have to think how to write a script which deletes all except "active" played map.
I cant delete e.g. block 123456 until inf. I hate unnormalized databases ;-)
Who is online
Users browsing this forum: rudzik8 and 13 guests