Send an OOB message to the client once a player logs in.

This commit is contained in:
Simon Vermeersch 2016-12-28 19:30:49 +01:00 committed by Griatch
parent 9d714a9c55
commit a0cd61df27
2 changed files with 9 additions and 0 deletions

View file

@ -725,6 +725,10 @@ class DefaultPlayer(with_metaclass(TypeclassBase, PlayerDB)):
if session and protocol_flags:
session.update_flags(**protocol_flags)
# inform the client that we logged in through an OOB message
if session:
session.msg(logged_in={})
self._send_to_connect_channel("|G%s connected|n" % self.key)
if _MULTISESSION_MODE == 0:
# in this mode we should have only one character available. We

View file

@ -220,6 +220,10 @@ function onPrompt(args, kwargs) {
doWindowResize();
}
// Called when the user logged in
function onLoggedIn() {
}
// Silences events we don't do anything with.
function onSilence(cmdname, args, kwargs) {}
@ -337,6 +341,7 @@ $(document).ready(function() {
Evennia.emitter.on("prompt", onPrompt);
Evennia.emitter.on("default", onDefault);
Evennia.emitter.on("connection_close", onConnectionClose);
Evennia.emitter.on("logged_in", onLoggedIn);
// silence currently unused events
Evennia.emitter.on("connection_open", onSilence);
Evennia.emitter.on("connection_error", onSilence);