Hello Lapo and Friends
I need to say something about chat rooms.
Yesterday we have implemented a clan chat room and all works properly.
We can chat without any problem.
We have decided to create a chat room when a clan is created, if all users leave the game, the room is destroyed.
At the login of a member we saw if the clan_room is existing and move the user in that room, or if is not existing recreate the room.
Now i want to know how to save the message of the chat, and reload it when we restart play the game.
How can i do this?
There is something to do client-side or server-side?
Or there is a setting on smartfox server? Or i need to save my message on a table in the db??
Thanks to all for the help
Persisting message in chat room
Re: Persisting message in chat room
We don't provide tools for managing the chat history so you can choose whatever way you prefer for your application.
If you plan to store the messages from server side in a database you can use the SFSEvent.PUBLIC_MESSAGE to catch all chat messages that are sent and received.
cheers
If you plan to store the messages from server side in a database you can use the SFSEvent.PUBLIC_MESSAGE to catch all chat messages that are sent and received.
cheers
Re: Persisting message in chat room
Ok lapo thanks
yesterday i have implemented the chat_table.
On clan registration i create a table named clan_chat_table
on chatting with the members ,all members send with an handler a message and i register this on the table.
On login when i recreate the room, i read this table, and then return the first 100 message written in the table.
We have decided at the finish of the app, that one day at week we can do manutention of the database
Thanks for your help
yesterday i have implemented the chat_table.
On clan registration i create a table named clan_chat_table
on chatting with the members ,all members send with an handler a message and i register this on the table.
On login when i recreate the room, i read this table, and then return the first 100 message written in the table.
We have decided at the finish of the app, that one day at week we can do manutention of the database
Thanks for your help
Who is online
Users browsing this forum: Baidu [Spider] and 94 guests