Restructured the way typeclasses are loaded. This makes it possible to run at_init() hooks at initiation also for objects without any custom cases for character/players. at_init() hooks are called only when an object is initiated. This means that a room's at_init() hook is only called when someone looks or enters it or a script operates on it, for example, rest of the time these objects are dormant, most efficiently.
This commit is contained in:
parent
0a1bcd36c2
commit
23cd9e31b1
14 changed files with 142 additions and 109 deletions
|
|
@ -48,16 +48,9 @@ class ServerSession(Session):
|
|||
the session as it was.
|
||||
"""
|
||||
if not self.logged_in:
|
||||
return
|
||||
|
||||
player = self.get_player()
|
||||
return
|
||||
character = self.get_character()
|
||||
if player:
|
||||
#print "sync: at_init() - player"
|
||||
player.at_init()
|
||||
if character:
|
||||
#print "sync: at_init() - character"
|
||||
character.at_init()
|
||||
# start (persistent) scripts on this object
|
||||
ScriptDB.objects.validate(obj=character)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue