diff --git a/evennia/settings_default.py b/evennia/settings_default.py index 1b68f698ad..1a613d403d 100644 --- a/evennia/settings_default.py +++ b/evennia/settings_default.py @@ -268,8 +268,8 @@ CMDSET_PATHS = ["commands"] # Typeclasses and other paths ###################################################################### -# Server-side session class used. #TODO -SERVER_SESSION_CLASS = "server.serversession.ServerSession" +# Server-side session class used. +SERVER_SESSION_CLASS = "evennia.server.serversession.ServerSession" # Base paths for typeclassed object classes. These paths must be # defined relative evennia's root directory. They will be searched in diff --git a/game_template/server/conf/portal_services_plugin.py b/game_template/server/conf/portal_services_plugin.py index 3eb12e477f..b536c5675c 100644 --- a/game_template/server/conf/portal_services_plugin.py +++ b/game_template/server/conf/portal_services_plugin.py @@ -5,11 +5,12 @@ This plugin module can define user-created services for the Portal to start. This module must handle all imports and setups required to start -twisted services (see examples in src/server/server.py). It must also -contain a function start_plugin_services(application). Evennia will -call this function with the main Portal application (so your services -can be added to it). The function should not return anything. Plugin -services are started last in the Portal startup process. +twisted services (see examples in evennia.server.portal.portal). It +must also contain a function start_plugin_services(application). +Evennia will call this function with the main Portal application (so +your services can be added to it). The function should not return +anything. Plugin services are started last in the Portal startup +process. """ diff --git a/game_template/server/conf/server_services_plugin.py b/game_template/server/conf/server_services_plugin.py index ae9e5d7082..e3d41fe3a5 100644 --- a/game_template/server/conf/server_services_plugin.py +++ b/game_template/server/conf/server_services_plugin.py @@ -2,14 +2,15 @@ Server plugin services -This plugin module can define user-created services for the Server to start. +This plugin module can define user-created services for the Server to +start. -This module must handle all imports and setups required to start a twisted -service (see examples in src/server/server.py). It must also contain a -function start_plugin_services(application). Evennia will call this function -with the main Server application (so your services can be added to it). The -function should not return anything. Plugin services are started last in -the Server startup process. +This module must handle all imports and setups required to start a +twisted service (see examples in evennia.server.server). It must also +contain a function start_plugin_services(application). Evennia will +call this function with the main Server application (so your services +can be added to it). The function should not return anything. Plugin +services are started last in the Server startup process. """ diff --git a/game_template/server/conf/serversession.py b/game_template/server/conf/serversession.py new file mode 100644 index 0000000000..050ff3e966 --- /dev/null +++ b/game_template/server/conf/serversession.py @@ -0,0 +1,35 @@ +""" +ServerSession + +The serversession is the Server-side in-memory representation of a +user connecting to the game. Evennia manages one Session per +connection to the game. So a user logged into the game with multiple +clients (if Evennia is configured to allow that) will have multiple +sessions tied to one Player object. All communication between Evennia +and the real-world user goes through the Session(s) associated with that user. + +It should be noted that modifying the Session object is not usually +necessary except for the most custom and exotic designs - and even +then it might be enough to just add custom session-level commands to +the SessionCmdSet instead. + +This module is not normally called. To tell Evennia to use the class +in this module instead of the default one, add the following to your +settings file: + + SERVER_SESSION_CLASS = "server.conf.serversession.ServerSession" + +""" + +from evennia.server.serversession import ServerSession as BaseServerSession + +class ServerSession(BaseServerSession): + """ + This class represents a player's session and is a template for + individual protocols to communicate with Evennia. + + Each player gets one or more sessions assigned to them whenever they connect + to the game server. All communication between game and player goes + through their session(s). + """ + pass