Package sfs3.client.requests
Class PublicMessageRequest
java.lang.Object
sfs3.client.requests.BaseRequest
sfs3.client.requests.GenericMessageRequest
sfs3.client.requests.PublicMessageRequest
- All Implemented Interfaces:
sfs3.client.requests.IClientRequest
public class PublicMessageRequest
extends sfs3.client.requests.GenericMessageRequest
Sends a public chat message.
A public message is dispatched to all the users in the specified Room, including the message sender (this allows showing messages in the correct order in the application interface); the corresponding event is the publicMessage event. It is also possible to send an optional object together with the message: it can contain custom parameters useful to transmit, for example, additional informations related to the message, like the text font or color, or other formatting details.
In case the target Room is not specified, the message is sent in the last Room joined by the sender.
NOTE: the publicMessage event is dispatched if the Room is configured to allow public messaging only (see the RoomSettings.permissions parameter).
- See Also:
-
Field Summary
Fields inherited from class sfs3.client.requests.GenericMessageRequest
KEY_MESSAGE, KEY_MESSAGE_TYPE, KEY_RECIPIENT, KEY_RECIPIENT_MODE, KEY_ROOM_ID, KEY_SENDER_DATA, KEY_USER_ID, KEY_XTRA_PARAMS, log, message, params, recipient, room, sendMode, type, userFields inherited from class sfs3.client.requests.BaseRequest
AddBuddy, AdminMessage, AutoJoin, BanUser, BanUsersFromRoom, BlockBuddy, CallExtension, ChangeRoomCapacity, ChangeRoomName, ChangeRoomPassword, ClusterInviteUsers, ClusterJoinOrCreate, CreateRoom, CreateSFSGame, FindRooms, FindUsers, GameServerConnectionRequired, GenericMessage, GetRoomList, GoOnline, Handshake, InitBuddyList, InvitationReply, InviteUser, JoinRoom, JoinRoomInvite, KEY_ERROR_CODE, KEY_ERROR_PARAMS, KickUser, LeaveRoom, Login, Logout, ManualDisconnection, ModeratorMessage, ObjectMessage, PingPong, PlayerToSpectator, PrivateMessage, PublicMessage, QuickJoinGame, QuickJoinOrCreateRoom, RemoveBuddy, SetBuddyVariables, SetRoomVariables, SetUserPosition, SetUserVariables, sfso, SpectatorToPlayer, SubscribeRoomGroup, targetController, UdpInit, UnsubscribeRoomGroup -
Constructor Summary
ConstructorsConstructorDescriptionPublicMessageRequest(String message) PublicMessageRequest(String message, ISFSObject params) PublicMessageRequest(String message, ISFSObject params, Room targetRoom) Creates a new PublicMessageRequest instance. -
Method Summary
Methods inherited from class sfs3.client.requests.GenericMessageRequest
execute, validateMethods inherited from class sfs3.client.requests.BaseRequest
getId, getRequest, getTargetController, getTransportType, setId, setTargetController, setTransportType
-
Constructor Details
-
PublicMessageRequest
Creates a new PublicMessageRequest instance. The instance must be passed to the SmartFox.send() method for the request to be performed.- Parameters:
message- The message to be sent to all the users in the target Room.params- An instance of SFSObject containing additional custom parameters to be sent to the message recipients (for example the color of the text, etc).targetRoom- The Room object corresponding to the Room where the message should be dispatched; ifnull, the last Room joined by the user is used.- See Also:
-
PublicMessageRequest
- See Also:
-
PublicMessageRequest
- See Also:
-