can you send PrivateMessage by name?

Post here your questions about the Objective-C API for SFS2X

Moderators: Lapo, Bax

Post Reply
intomo
Posts: 51
Joined: 22 Nov 2010, 21:21
Location: Los Angeles

can you send PrivateMessage by name?

Post by intomo »

I see how to send by ID, is there a way of sending by name of the recipient?

Code: Select all

    func sendPrivateMessage(recipientID: Int, message: String) {
        smartFox.send(PrivateMessageRequest.request(withMessage:message, recipientId: recipientID) as? IRequest)
    }
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: can you send PrivateMessage by name?

Post by Lapo »

Hi,
no, it's by id, which you can obtain from the SFSUser object.
If you have the name you should also have the ID, since both these properties come from the SFSUser object.

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
intomo
Posts: 51
Joined: 22 Nov 2010, 21:21
Location: Los Angeles

Re: can you send PrivateMessage by name?

Post by intomo »

Can you assign an ID during connection/log in as long as it is unique? Or are they always assigned by the server? I'm assuming they are always integers as well? Thanks.
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: can you send PrivateMessage by name?

Post by Lapo »

Yes, they're auto-assigned.
Can you explain what are you trying to achieve?

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
Post Reply