Implemented working MCCP (data compression) and MSSP (mud-listing crawler support). Moved all user-level customization modules from gamesrc/world to gamesrc/conf to reduce clutter.

This commit is contained in:
Griatch 2011-11-20 11:52:01 +01:00
parent a4f8019c4a
commit fb78758356
15 changed files with 465 additions and 48 deletions

View file

@ -89,6 +89,7 @@ class ServerSessionHandler(SessionHandler):
"""
self.sessions = {}
self.server = None
self.server_data = {"servername":settings.SERVERNAME}
def portal_connect(self, sessid, session):
"""
@ -333,6 +334,16 @@ class PortalSessionHandler(SessionHandler):
self.portal = None
self.sessions = {}
self.latest_sessid = 0
self.uptime = time.time()
self.connection_time = 0
def at_server_connection(self):
"""
Called when the Portal establishes connection with the
Server. At this point, the AMP connection is already
established.
"""
self.connection_time = time.time()
def connect(self, session):
"""
@ -373,6 +384,14 @@ class PortalSessionHandler(SessionHandler):
session.disconnect(reason)
del session
def count_loggedin(self, include_unloggedin=False):
"""
Count loggedin connections, alternatively count all connections.
"""
return len(self.get_sessions(include_unloggedin=include_unloggedin))
def session_from_suid(self, suid):
"""
Given a session id, retrieve the session (this is primarily