Poodletooth-iLand/otp/chat/ChatAgent.py

21 lines
675 B
Python
Raw Normal View History

2015-03-03 16:10:12 -06:00
from direct.distributed.DistributedObjectGlobal import DistributedObjectGlobal
from pandac.PandaModules import *
from otp.otpbase import OTPGlobals
class ChatAgent(DistributedObjectGlobal):
def __init__(self, cr):
DistributedObjectGlobal.__init__(self, cr)
def delete(self):
self.ignoreAll()
self.cr.chatManager = None
DistributedObjectGlobal.delete(self)
return
def adminChat(self, aboutId, message):
self.notify.warning('Admin Chat(%s): %s' % (aboutId, message))
messenger.send('adminChat', [aboutId, message])
def sendChatMessage(self, message):
self.sendUpdate('chatMessage', [message])