Ejemplo n.º 1
0
    def sendChatString(self, message):
        """
        message is a string.

        Send chat message update
        """
        assert self.notify.debugStateCall(self)
        chatFlags = CFSpeech | CFTimeout

        if base.cr.wantSwitchboardHacks:
            from otp.switchboard import badwordpy
            badwordpy.init("", "")
            message = badwordpy.scrub(message)

        if isThought(message):
            # If it's intended to be a thought message, send it as
            # one.  This means we don't include a timeout.
            message = removeThoughtPrefix(message)
            chatFlags = CFThought

        #messenger.send("chatUpdate", [message, chatFlags])
        #base.chatAssistant.sendAvatarOpenTypedChat(message)

        messenger.send(NormalChatEvent)
        self.announceChat()
Ejemplo n.º 2
0
 def sendChatString(self, message):
     chatFlags = CFSpeech | CFTimeout
     if base.cr.wantSwitchboardHacks:
         from otp.switchboard import badwordpy
         badwordpy.init('', '')
         message = badwordpy.scrub(message)
     if isThought(message):
         message = removeThoughtPrefix(message)
         chatFlags = CFThought
     messenger.send(NormalChatEvent)
     self.announceChat()
Ejemplo n.º 3
0
from otp.otpbase import OTPLocalizer
from otp.speedchat import SCDecoders
from direct.showbase import PythonUtil
from otp.avatar import DistributedAvatar
import time
from otp.avatar import Avatar, PlayerBase
from otp.chat import TalkAssistant
from otp.otpbase import OTPGlobals
from otp.avatar.Avatar import teleportNotify
from otp.distributed.TelemetryLimited import TelemetryLimited

#hack, init for client-side outgoing chat filter
if base.config.GetBool('want-chatfilter-hacks',0):
    from otp.switchboard import badwordpy
    import os
    badwordpy.init(os.environ.get('OTP')+'\\src\\switchboard\\','')


class DistributedPlayer(DistributedAvatar.DistributedAvatar,
                        PlayerBase.PlayerBase):
    """Distributed Player class:"""

    # This is the length of time that should elapse before we allow
    # another failed-teleport message to be displayed from the same
    # avatar.
    TeleportFailureTimeout = 60.0

    # Create a default chat garbler (can be overridden by child class)
    chatGarbler = ChatGarbler.ChatGarbler()

    def __init__(self, cr):
Ejemplo n.º 4
0
from otp.avatar.Avatar import teleportNotify
from otp.chat import ChatGarbler
from otp.chat import TalkAssistant
from otp.distributed.TelemetryLimited import TelemetryLimited
from otp.otpbase import OTPGlobals
from otp.otpbase import OTPLocalizer
from otp.speedchat import SCDecoders
from toontown.chat.ChatGlobals import *
from toontown.chat.WhisperPopup import WhisperPopup
from toontown.modpanel.ModPanel import ModPanel


if base.config.GetBool('want-chatfilter-hacks', 0):
    from otp.switchboard import badwordpy
    import os
    badwordpy.init(os.environ.get('OTP') + '\\src\\switchboard\\', '')

class DistributedPlayer(DistributedAvatar.DistributedAvatar, PlayerBase.PlayerBase, TelemetryLimited):
    TeleportFailureTimeout = 60.0
    chatGarbler = ChatGarbler.ChatGarbler()

    def __init__(self, cr):
        try:
            self.DistributedPlayer_initialized
        except:
            self.DistributedPlayer_initialized = 1
            DistributedAvatar.DistributedAvatar.__init__(self, cr)
            PlayerBase.PlayerBase.__init__(self)
            TelemetryLimited.__init__(self)
            self.__teleportAvailable = 0
            self.inventory = None
from otp.speedchat import SCDecoders
from direct.showbase import PythonUtil
from otp.avatar import DistributedAvatar
import time
from otp.avatar import Avatar, PlayerBase
from otp.chat import TalkAssistant
from otp.otpbase import OTPGlobals
from otp.avatar.Avatar import teleportNotify
from otp.distributed.TelemetryLimited import TelemetryLimited
from otp.ai.MagicWordGlobal import *

if config.GetBool("want-chatfilter-hacks", 0):
    from otp.switchboard import badwordpy
    import os

    badwordpy.init(os.environ.get("OTP") + "\\src\\switchboard\\", "")


class DistributedPlayer(DistributedAvatar.DistributedAvatar, PlayerBase.PlayerBase, TelemetryLimited):
    TeleportFailureTimeout = 60.0
    chatGarbler = ChatGarbler.ChatGarbler()

    def __init__(self, cr):
        try:
            self.DistributedPlayer_initialized
        except:
            self.DistributedPlayer_initialized = 1
            DistributedAvatar.DistributedAvatar.__init__(self, cr)
            PlayerBase.PlayerBase.__init__(self)
            TelemetryLimited.__init__(self)
            self.__teleportAvailable = 0