mirror of
https://github.com/evennia/evennia.git
synced 2026-03-27 10:16:32 +01:00
Some more fixes to the commands.
This commit is contained in:
parent
db8af97ab2
commit
1f676eda60
3 changed files with 18 additions and 4 deletions
|
|
@ -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):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue