Client API

MP_ChatClient component reference

Attached to the PlayerController, the MP_ChatClient handles all outgoing RPCs and processes incoming data deltas for the UI.

UI Event Dispatchers (Delegates)

OnMessageReceived (Event)

Fires when a single new message arrives.

Returns:

  • RoomID (String)
  • NewMsg (FMP_ChatMessage)

OnRoomBatchMessageReceived (Event)

Fires for initial room loads/pagination.

Returns:

  • RoomID (String)
  • NewMsg (Array of FMP_ChatMessage)

OnMessageEdited (Event)

Fires when an existing message is modified.

Returns:

  • RoomID (String)
  • MessageID (String)
  • EditedMsg (String)

OnMessageDeleted (Event)

Fires when a message is removed.

Returns:

  • RoomID (String)
  • MessageID (String)

Server RPCs & Client Utilities

JoinOrCreateChatRoom (Function)

Quick access; joins if exists, creates if it doesn't.

Parameters:

  • RoomDesc (Room Configuration Struct)
  • InviteCode (Optional password string)

SendMessage (Function)

Broadcasts a new message.

Parameters:

  • RoomID (String) - Name of the room
  • MessageText (String) - Text body

GetChatRoom (Function)

Returns the local AMP_ChatRoom object reference.

Parameters:

  • RoomID (String) - Name of the room

Returns:

  • Local AMP_ChatRoom Object Reference