Checked at_init() due to reported issues of it not getting called. Couldn't find any problems, rather it was called too many times, so removed an unecessary call.
This commit is contained in:
parent
de9c2ec437
commit
f1d743f14c
3 changed files with 6 additions and 6 deletions
|
|
@ -86,6 +86,7 @@ class Object(TypeClass):
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
def basetype_posthook_setup(self):
|
def basetype_posthook_setup(self):
|
||||||
"""
|
"""
|
||||||
Called once, after basetype_setup and at_object_creation. This should generally not be overloaded unless
|
Called once, after basetype_setup and at_object_creation. This should generally not be overloaded unless
|
||||||
|
|
|
||||||
|
|
@ -268,13 +268,12 @@ class AMPProtocol(amp.AMP):
|
||||||
#print "serveradmin (server side):", sessid, operation, data
|
#print "serveradmin (server side):", sessid, operation, data
|
||||||
|
|
||||||
if operation == 'PCONN': #portal_session_connect
|
if operation == 'PCONN': #portal_session_connect
|
||||||
# create a new, session and sync it
|
# create a new session and sync it
|
||||||
sess = ServerSession()
|
sess = ServerSession()
|
||||||
sess.sessionhandler = self.factory.server.sessions
|
sess.sessionhandler = self.factory.server.sessions
|
||||||
sess.load_sync_data(data)
|
sess.load_sync_data(data)
|
||||||
if sess.logged_in and sess.uid:
|
if sess.logged_in and sess.uid:
|
||||||
# this can happen in the case of auto-authenticating protocols like SSH
|
# this can happen in the case of auto-authenticating protocols like SSH
|
||||||
|
|
||||||
sess.player = PlayerDB.objects.get_player_from_uid(sess.uid)
|
sess.player = PlayerDB.objects.get_player_from_uid(sess.uid)
|
||||||
sess.at_sync() # this runs initialization without acr
|
sess.at_sync() # this runs initialization without acr
|
||||||
|
|
||||||
|
|
@ -296,7 +295,6 @@ class AMPProtocol(amp.AMP):
|
||||||
sess.load_sync_data(sessdict)
|
sess.load_sync_data(sessdict)
|
||||||
if sess.uid:
|
if sess.uid:
|
||||||
sess.player = PlayerDB.objects.get_player_from_uid(sess.uid)
|
sess.player = PlayerDB.objects.get_player_from_uid(sess.uid)
|
||||||
sess.at_sync()
|
|
||||||
sesslist.append(sess)
|
sesslist.append(sess)
|
||||||
# replace sessions on server
|
# replace sessions on server
|
||||||
server_sessionhandler.portal_session_sync(sesslist)
|
server_sessionhandler.portal_session_sync(sesslist)
|
||||||
|
|
|
||||||
|
|
@ -53,8 +53,10 @@ class ServerSession(Session):
|
||||||
player = self.get_player()
|
player = self.get_player()
|
||||||
character = self.get_character()
|
character = self.get_character()
|
||||||
if player:
|
if player:
|
||||||
|
#print "sync: at_init() - player"
|
||||||
player.at_init()
|
player.at_init()
|
||||||
if character:
|
if character:
|
||||||
|
#print "sync: at_init() - character"
|
||||||
character.at_init()
|
character.at_init()
|
||||||
# start (persistent) scripts on this object
|
# start (persistent) scripts on this object
|
||||||
ScriptDB.objects.validate(obj=character)
|
ScriptDB.objects.validate(obj=character)
|
||||||
|
|
@ -82,6 +84,7 @@ class ServerSession(Session):
|
||||||
self.user.save()
|
self.user.save()
|
||||||
|
|
||||||
# player init
|
# player init
|
||||||
|
#print "at_init() - player"
|
||||||
player.at_init()
|
player.at_init()
|
||||||
|
|
||||||
# Check if this is the first time the *player* logs in
|
# Check if this is the first time the *player* logs in
|
||||||
|
|
@ -91,6 +94,7 @@ class ServerSession(Session):
|
||||||
player.at_pre_login()
|
player.at_pre_login()
|
||||||
|
|
||||||
character = player.character
|
character = player.character
|
||||||
|
#print "at_init() - character"
|
||||||
character.at_init()
|
character.at_init()
|
||||||
if character:
|
if character:
|
||||||
# this player has a character. Check if it's the
|
# this player has a character. Check if it's the
|
||||||
|
|
@ -101,9 +105,6 @@ class ServerSession(Session):
|
||||||
# run character login hook
|
# run character login hook
|
||||||
character.at_pre_login()
|
character.at_pre_login()
|
||||||
|
|
||||||
# this is always called first
|
|
||||||
player.at_init()
|
|
||||||
|
|
||||||
self.log(_('Logged in: %(self)s') % {'self': self})
|
self.log(_('Logged in: %(self)s') % {'self': self})
|
||||||
|
|
||||||
# start (persistent) scripts on this object
|
# start (persistent) scripts on this object
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue