Added comprehensive encoding handling to support both player-level encoding choices as well as global multiple encodings through the settings file.

This commit is contained in:
Griatch 2010-10-03 19:11:43 +00:00
parent 7904916dba
commit 745df8356f
5 changed files with 69 additions and 34 deletions

View file

@ -253,19 +253,15 @@ class PlayerDB(TypedObject):
def msg(self, message, from_obj=None, markup=True):
"""
This duplicates the same-named method on the Character.
It forwards messages to the character or uses
the session messaging directly.
This is the main route for sending data to the user.
"""
if from_obj:
try:
from_obj.at_msg_send(message, self)
except Exception:
pass
if self.character:
self.character.msg(message, from_obj)
else:
if from_obj:
try:
from_obj.at_msg_send(message, self)
except Exception:
pass
if self.at_msg_receive(message, from_obj):
if self.character.at_msg_receive(message, from_obj):
for session in object.__getattribute__(self, 'sessions'):
session.msg(message, markup)