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:
Griatch 2011-10-01 22:00:22 +02:00
parent 0a1bcd36c2
commit 23cd9e31b1
14 changed files with 142 additions and 109 deletions

View file

@ -123,7 +123,7 @@ class CommandTest(TestCase):
self.room1 = create.create_object(settings.BASE_ROOM_TYPECLASS, key="room1")
self.room2 = create.create_object(settings.BASE_ROOM_TYPECLASS, key="room2")
# create a faux player/character for testing.
self.char1 = create.create_player("TestChar", "testplayer@test.com", "testpassword", location=self.room1)
self.char1 = create.create_player("TestChar", "testplayer@test.com", "testpassword", character_location=self.room1)
self.char1.player.user.is_superuser = True
self.char1.lock_storage = ""
self.char1.locks = LockHandler(self.char1)
@ -132,7 +132,7 @@ class CommandTest(TestCase):
sess.connectionMade()
sess.session_login(self.char1.player)
# create second player
self.char2 = create.create_player("TestChar2", "testplayer2@test.com", "testpassword2", location=self.room1)
self.char2 = create.create_player("TestChar2", "testplayer2@test.com", "testpassword2", character_location=self.room1)
self.char2.player.user.is_superuser = False
self.char2.lock_storage = ""
self.char2.locks = LockHandler(self.char2)

View file

@ -161,9 +161,9 @@ class CmdCreate(MuxCommand):
new_character = create.create_player(playername, email, password,
permissions=permissions,
location=default_home,
typeclass=typeclass,
home=default_home)
character_typeclass=typeclass,
character_location=default_home,
character_home=default_home)
new_player = new_character.player
# character safety features