Some bug fixes in the IMC system.

This commit is contained in:
Griatch 2011-04-19 21:40:53 +00:00
parent b856cb8faf
commit c70d59045a
3 changed files with 22 additions and 18 deletions

View file

@ -6,6 +6,12 @@ from src.objects.models import ObjectDB
from src.comms.imc2lib import imc2_ansi
def handle_whois_reply(packet):
"""
When the player sends an imcwhois <playername> request, the outgoing
packet contains the id of the one asking. This handler catches the
(possible) reply from the server, parses the id back to the
original asker and tells them the result.
"""
try:
pobject = ObjectDB.objects.get(id=packet.target)
response_text = imc2_ansi.parse_ansi(packet.optional_data.get('text', 'Unknown'))