- Thu Jan 10, 2013 3:15 pm
#137073
If a public realm hasn't been touched at all in 60 days it will automatically be wiped back to its original form.
EDIT: Changed from 90 days to 60 days.
This means REALMS which are 50x50, not chunks. Chunks would be simpler to code, but chunks aren't realms and neither do chunks fit evenly within realms.
The Code (I have little experience with this, so don't consider my words absolute)
I imagine a database 40,000 rows long (1 row per realm) could be used. At implementation, the server assigns 0 to all rows corresponding to a private realm. It assigns the system time to all realms which are public. When a realm is bought and changed to private, 0 is assigned. When a realm is reverted to public, the system time is assigned. When a player places or removes a block in a public realm, the system time is assigned.
Periodically, the server goes through the database and checks if a 0 is assigned. If so, does nothing. If not, then it subtracts the assigned number (time of last block placed or removed) from the current system time. If this number is greater than 60 days, it runs the realm reset script (which may involve loading the included chunks into memory if they are not already).
Again, this is my shallow understanding of how something like this would work internally.
EDIT: Changed from 90 days to 60 days.
This means REALMS which are 50x50, not chunks. Chunks would be simpler to code, but chunks aren't realms and neither do chunks fit evenly within realms.
The Code (I have little experience with this, so don't consider my words absolute)
I imagine a database 40,000 rows long (1 row per realm) could be used. At implementation, the server assigns 0 to all rows corresponding to a private realm. It assigns the system time to all realms which are public. When a realm is bought and changed to private, 0 is assigned. When a realm is reverted to public, the system time is assigned. When a player places or removes a block in a public realm, the system time is assigned.
Periodically, the server goes through the database and checks if a 0 is assigned. If so, does nothing. If not, then it subtracts the assigned number (time of last block placed or removed) from the current system time. If this number is greater than 60 days, it runs the realm reset script (which may involve loading the included chunks into memory if they are not already).
Again, this is my shallow understanding of how something like this would work internally.
Last edited by eah on Thu Jan 10, 2013 3:38 pm, edited 1 time in total.
