Trunk: Merged griatch-branch. This implements a new reload mechanism - splitting Evennia into two processes: Server and Portal with different tasks. Also cleans and fixes several bugs in script systems as well as introduces i18n (courtesy of raydeejay).

This commit is contained in:
Griatch 2011-09-03 10:22:19 +00:00
parent 14dae44a46
commit f13e8cdf7c
50 changed files with 3175 additions and 2565 deletions

View file

@ -113,6 +113,14 @@ class PlayerManager(TypedObjectManager):
"""
return User.objects.filter(email__iexact=uemail)
@returns_typeclass
@returns_player
def get_player_from_uid(self, uid):
"""
Returns a player object based on User id.
"""
return User.objects.get(id=uid)
@returns_typeclass
def get_player_from_name(self, uname):
"Get player object based on name"

View file

@ -51,6 +51,17 @@ class Player(TypeClass):
pass
def at_init(self):
"""
This is always called whenever this
object initiated -- both when the object
is first created as well as after each restart.
It is also called after each server reload, so
if something should survive a warm-reboot (rebooting
the server without the players logging out), put it here.
"""
pass
# Note that the hooks below also exist
# in the character object's typeclass. You
# can often ignore these and rely on the
@ -101,3 +112,18 @@ class Player(TypeClass):
itself as a sender in the msg() call.
"""
pass
def at_server_reload(self):
"""
This hook is called whenever the server is shutting down for restart/reboot.
If you want to, for example, save non-persistent properties across a restart,
this is the place to do it.
"""
pass
def at_server_shutdown(self):
"""
This hook is called whenever the server is shutting down fully (i.e. not for
a restart).
"""
pass