Some more fixes to the commands.

This commit is contained in:
Griatch 2013-02-16 21:26:59 +01:00
parent db8af97ab2
commit 1f676eda60
3 changed files with 18 additions and 4 deletions

View file

@ -395,9 +395,15 @@ class CmdQuit(MuxCommand):
def func(self):
"hook function"
for session in self.caller.sessions:
session.msg("{RQuitting{n. Hope to see you soon again.")
session.session_disconnect()
if hasattr(self.caller, "player"):
player = self.caller.player
else:
player = self.caller
player.msg("{RQuitting{n. Hope to see you soon again.", sessid=self.sessid)
player.disconnect_session_from_player(self.sessid)
#for session in self.caller.sessions:
# session.session_disconnect()
class CmdWho(MuxCommand):
"""

View file

@ -423,6 +423,15 @@ class PlayerDB(TypedObject):
# a non-character session; this goes to player directly
_GA(self, "execute_cmd")(ingoing_string, sessid=sessid)
def disconnect_session_from_player(self, sessid):
"""
Access method for disconnecting a given session from the player.
"""
global _SESSIONS
if not _SESSIONS:
from src.server.sessionhandler import SESSIONS as _SESSIONS
_SESSIONS.disconnect(sessid=sessid)
def connect_session_to_character(self, sessid, character, force=False):
"""
Connect the given session to a character through this player.

View file

@ -57,7 +57,6 @@ class ServerSession(Session):
self.cmdset.update(init_mode=True)
return
def session_login(self, player):
"""
Startup mechanisms that need to run at login. This is called