Hi,
In my game it's possible remove a user from the clan, when a user is removed, need notify in the client chat of all users that are that room, which of these ways is the best?
1) At the end of the request to expel a member of the clan, I make another request to download the notifications;
(It's bad, because it only works for those who make the request, and not for all other online users)
2) At the end of the request, I download all the updated chat;
(It's bad, because it only works for those who make the request, and not for all other online users)
3) Generates the client notification, and sends this message to all members of the clan online, and the server updates the chat in the db;
4) From the server I enter the notification in the db, the server select the room, and send this notification to the whole room.
If there are better ways to update both databases and chats for online users, do not hesitate to comment them, thanks for your attention.
Game chat and database update
Re: Game chat and database update
Hi,
I would choose number 4
Cheers
Code: Select all
In my game it's possible remove a user from the clan, when a user is removed, need notify in the client chat of all users that are that room, which of these ways is the best?
I would choose number 4
Cheers
Re: Game chat and database update
Can you send me an example to do this?
Re: Game chat and database update
To do what exactly? How to send a message to all user in a Room?
The extension send() method takes a list of Users, so you can pass Room.getUserList() directly in there.
Cheers
The extension send() method takes a list of Users, so you can pass Room.getUserList() directly in there.
Cheers
Re: Game chat and database update
I have to take the room of the user who made the request, and then send all the users in the room a message.
How do I get the user's room?
How do I send a server-side message to all users in the room?
How do I get the user's room?
How do I send a server-side message to all users in the room?
Re: Game chat and database update
I'd recommend to make the server side docs your best friend
All these questions are answered there: http://docs2x.smartfoxserver.com/api-do ... oc/server/
user.getLastJoinedRoom();
As I explained in my previous response: the extension send() method takes a list of Users, so you can pass Room.getUserList() directly in there.
All these questions are answered there: http://docs2x.smartfoxserver.com/api-do ... oc/server/
How do I get the user's room?
user.getLastJoinedRoom();
How do I send a server-side message to all users in the room?
As I explained in my previous response: the extension send() method takes a list of Users, so you can pass Room.getUserList() directly in there.
Re: Game chat and database update
Why can't I pass Room.getUserList () in send () ?
Re: Game chat and database update
TwineApps wrote:Why can't I pass Room.getUserList () in send () ?
You can do that. The send method takes a List<User> as the 3rd parameter and Room.getUserList() gives you a List<User>
cheers
Who is online
Users browsing this forum: No registered users and 58 guests