You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 2, 2019. It is now read-only.
As a player I want the items in my inventory to be there after I quit and return to the game so I don't lose my stuff.
The game currently makes you drop all the items in your inventory on the floor before you leave the game, because the GameMap that represents your inventory is cascade-deleted from the database when your Actor is deleted. Instead, it would be great to be able to keep your inventory around and reattach it when you come back to the game.
The text was updated successfully, but these errors were encountered:
One way would be to reexamine the idea of deleting the Actor and instead just flag it as inactive. That way we could leave all the associated database entries alone and simply remove the flag when the player connects again. A downside to this strategy is that we would have to be very careful that all the code in the game filters Actors based on that flag. If we missed one we could accidentally affect a player that's supposed to be logged out.
A way to mitigate the need for all the filtering might be to create a special GameMap specifically for logged out players, and move the Actor onto that map. You'd need to store their original location somewhere so you could move them back there when they reconnect.
Another idea would be to flag the inventory itself and store the ID on the PlayerActorTemplate so it could be reattached to the new Actor when it is created. Inactive GameMaps are much less likely to be accidentally touched than inactive Actors so this seems less risky to me, but more complicated.
When you leave the game we now just set your GameMap to null, effectively sending you to "the void". When you reconnect we bring you back to (0, 0) on the default map. That lets us keep your inventory and your Actor in the database without deleting anything, so your inventory is preserved and there's no complicated process to "reconnect" it. We shouldn't have any more problems with broken foreign key constraints preventing cleanup and people now get to keep their stuff. Win win!
* Closes#91
* Fixes#92
As a player I want the items in my inventory to be there after I quit and return to the game so I don't lose my stuff.
The game currently makes you drop all the items in your inventory on the floor before you leave the game, because the
GameMap
that represents your inventory is cascade-deleted from the database when yourActor
is deleted. Instead, it would be great to be able to keep your inventory around and reattach it when you come back to the game.The text was updated successfully, but these errors were encountered: