• Studio

  • Bots

  • Web API

  • Designer Resources

  • Host Resources

  • API

    Services

    Edit

    Chat

    The Chat service provides functionality for creating and managing chat channels to dictate how players communicate with each other, as well as how receiving messages work in the game.

    Properties

    allChannels

    ChannelInfo[]

    ServerOnly

    All chat channels that exist in the game.

    allJoinedChannels

    ChannelInfo[]

    All chat channels that the player has joined.

    An event that is fired when a client receives a text message. If this event has no connected listeners, the text message will display normally.

    If you connect to this event to do custom messaging logic, use the DisplayTextMessage method to send the final results.

    Class.ChannelInfo, Class.Player (the sender), and string are passed as the parameters.

    An event that is fired when a client receives a whisper. If this event has no connected listeners, the whisper will display normally.

    If your game does not allow whispering at certain times or only with certain people, this event should be connected to and use the DisplayTextMessage method only when whispering is allowed.

    Class.ChannelInfo, Class.Player (the sender), and string are passed as the parameters.

    An event that is fired by the server to all clients in the same channel as the player that joined. Class.ChannelInfo and Class.Player are passed as the parameters.

    An event that is fired by the server to all clients in the same channel as the player that left. Class.ChannelInfo and Class.Player are passed as the parameters.

    An event that is fired by the server to all clients when a channel is destroyed. Class.ChannelInfo is passed as the parameter.

    Methods

    ServerOnly

    Creates a new channel. If the channel already exists, it will return the existing channel.

    Parameters

    channelName

    string

    allowText

    boolean

    allowVoice

    boolean

    ServerOnly

    Destroys the given channel, removing all players from it.

    Parameters

    Returns

    void

    ServerOnly

    Adds the given player to the given channel.

    Parameters

    player
    Player

    Returns

    void

    ServerOnly

    Removes the given player from the given channel.

    Parameters

    player
    Player

    Returns

    void

    Sets the default channel for the player. This will be the default channel text messages are sent to.

    Parameters

    channelInfo
    ChannelInfo

    Returns

    boolean

    Displays the given text message to the channel's chat log with a speech bubble over the given player's head.

    Parameters

    from
    Player
    message

    string

    Returns

    void

    PocketWorlds Icon

    © 2024 Pocket Worlds. All rights reserved.