From 6ae112342140c2a7bfc9205ca432f064004ae79d Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 1 Oct 2011 22:36:55 +0200 Subject: [PATCH] Fixed hook method descriptions. --- src/objects/objects.py | 11 +++++------ src/players/player.py | 13 +++++++------ src/scripts/scripts.py | 6 +++--- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/objects/objects.py b/src/objects/objects.py index 2c5264b7c8..160b379454 100644 --- a/src/objects/objects.py +++ b/src/objects/objects.py @@ -77,12 +77,11 @@ class Object(TypeClass): 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. + This is always called whenever this object is initiated -- + that is, whenever it its typeclass is cached from memory. This + happens on-demand first time the object is used or activated + in some way after being created but also after each server + restart or reload. """ pass diff --git a/src/players/player.py b/src/players/player.py index c3ea34cf32..0d8da1d474 100644 --- a/src/players/player.py +++ b/src/players/player.py @@ -53,12 +53,13 @@ class Player(TypeClass): 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. + This is always called whenever this object is initiated -- + that is, whenever it its typeclass is cached from memory. This + happens on-demand first time the object is used or activated + in some way after being created but also after each server + restart or reload. In the case of player objects, this usually + happens the moment the player logs in or reconnects after a + reload. """ pass diff --git a/src/scripts/scripts.py b/src/scripts/scripts.py index 2ff9f1b8e4..cdb97add97 100644 --- a/src/scripts/scripts.py +++ b/src/scripts/scripts.py @@ -221,9 +221,6 @@ class ScriptClass(TypeClass): return True # hooks - def at_init(self): - "called every typeclass initiation (reloads/restarts). not much use for scripts." - pass def at_script_creation(self): "placeholder" pass @@ -239,6 +236,9 @@ class ScriptClass(TypeClass): def at_repeat(self): "placeholder" pass + def at_init(self): + "called when typeclass re-caches. Usually not used for scripts." + pass #