oldschool-toontown/otp/uberdog/SpeedchatRelay.py

27 lines
1.1 KiB
Python
Raw Normal View History

2019-11-02 17:27:54 -05:00
from direct.distributed.DistributedObjectGlobal import DistributedObjectGlobal
from direct.directnotify.DirectNotifyGlobal import directNotify
from otp.otpbase import OTPGlobals
from otp.uberdog import SpeedchatRelayGlobals
class SpeedchatRelay(DistributedObjectGlobal):
def __init__(self, cr):
DistributedObjectGlobal.__init__(self, cr)
def sendSpeedchat(self, receiverId, messageIndex):
self.sendSpeedchatToRelay(receiverId, SpeedchatRelayGlobals.NORMAL, [messageIndex])
def sendSpeedchatCustom(self, receiverId, messageIndex):
self.sendSpeedchatToRelay(receiverId, SpeedchatRelayGlobals.CUSTOM, [messageIndex])
def sendSpeedchatEmote(self, receiverId, messageIndex):
self.sendSpeedchatToRelay(receiverId, SpeedchatRelayGlobals.EMOTE, [messageIndex])
def sendSpeedchatToRelay(self, receiverId, speedchatType, parameters):
self.sendUpdate('forwardSpeedchat', [receiverId,
speedchatType,
parameters,
base.cr.accountDetailRecord.playerAccountId,
base.cr.accountDetailRecord.playerName + ' RHFM',
0])