mirror of
https://github.com/evennia/evennia.git
synced 2026-03-31 21:17:17 +02:00
Fixed a malformed call to portal_disconnect that stopped auto-disconnection from working. Also removed sessiohandler.portal_disconnect since it has no function anymore, as well as changed two AMP command chars around for better debugging (they were matching the tab- and line breaks chars before). Resolves #900.
This commit is contained in:
parent
8d672a8e9d
commit
8655f880f2
2 changed files with 7 additions and 20 deletions
|
|
@ -38,6 +38,7 @@ class DummySession(object):
|
|||
DUMMYSESSION = DummySession()
|
||||
|
||||
# communication bits
|
||||
# (chr(9) and chr(10) are \t and \n, so skipping them)
|
||||
|
||||
PCONN = chr(1) # portal session connect
|
||||
PDISCONN = chr(2) # portal session disconnect
|
||||
|
|
@ -47,8 +48,8 @@ SDISCONN = chr(5) # server session disconnect
|
|||
SDISCONNALL = chr(6) # server session disconnect all
|
||||
SSHUTD = chr(7) # server shutdown
|
||||
SSYNC = chr(8) # server session sync
|
||||
SCONN = chr(9) # server creating new connection (for irc/imc2 bots etc)
|
||||
PCONNSYNC = chr(10) # portal post-syncing a session
|
||||
SCONN = chr(11) # server creating new connection (for irc/imc2 bots etc)
|
||||
PCONNSYNC = chr(12) # portal post-syncing a session
|
||||
AMP_MAXLEN = amp.MAX_VALUE_LENGTH # max allowed data length in AMP protocol (cannot be changed)
|
||||
|
||||
BATCH_RATE = 250 # max commands/sec before switching to batch-sending
|
||||
|
|
@ -429,7 +430,7 @@ class AMPProtocol(amp.AMP):
|
|||
|
||||
Args:
|
||||
sessid (int): Unique Session id.
|
||||
msg (str): Message to send over the wire.
|
||||
text (str): Message to send over the wire.
|
||||
kwargs (any, optional): Optional data.
|
||||
|
||||
Returns:
|
||||
|
|
@ -493,7 +494,7 @@ class AMPProtocol(amp.AMP):
|
|||
elif operation == PDISCONN: # portal_session_disconnect
|
||||
# session closed from portal side
|
||||
session = server_sessionhandler[sessid]
|
||||
self.factory.server.sessions.portal_disconnect(session)
|
||||
self.factory.server.sessions.disconnect(session)
|
||||
|
||||
elif operation == PSYNC: # portal_session_sync
|
||||
# force a resync of sessions when portal reconnects to
|
||||
|
|
|
|||
|
|
@ -46,8 +46,8 @@ SDISCONN = chr(5) # server session disconnect
|
|||
SDISCONNALL = chr(6) # server session disconnect all
|
||||
SSHUTD = chr(7) # server shutdown
|
||||
SSYNC = chr(8) # server session sync
|
||||
SCONN = chr(9) # server portal connection (for bots)
|
||||
PCONNSYNC = chr(10) # portal post-syncing session
|
||||
SCONN = chr(11) # server portal connection (for bots)
|
||||
PCONNSYNC = chr(12) # portal post-syncing session
|
||||
|
||||
# i18n
|
||||
from django.utils.translation import ugettext as _
|
||||
|
|
@ -193,20 +193,6 @@ class ServerSessionHandler(SessionHandler):
|
|||
# protocol_flags etc)
|
||||
session.load_sync_data(portalsessiondata)
|
||||
|
||||
def portal_disconnect(self, sessid):
|
||||
"""
|
||||
Called by Portal when portal reports a closing of a session
|
||||
from the portal side.
|
||||
|
||||
Args:
|
||||
sessid (int): Session id.
|
||||
|
||||
"""
|
||||
session = self.get(sessid, None)
|
||||
if not session:
|
||||
return
|
||||
self.disconnect(session)
|
||||
|
||||
def portal_sessions_sync(self, portalsessionsdata):
|
||||
"""
|
||||
Syncing all session ids of the portal with the ones of the
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue