Hi, Have a look at this demo I wrote for both original framework and ApePubSub: https://github.com/lcharette/JSF-vs.-APS---Move-demo <https://github.com/lcharette/JSF-vs.-APS---Move-demo> (It’s the demo from the website : http://ape-project.org/demos/move/ <http://ape-project.org/demos/move/>). The readme explains the difference between the default javascript framework and Pablo’s ApePubSub.
And honestly, go for ApePubSub. Much more simpler to use and learn. Pablo’s demos on the project Github page are well documented and the wiki is very useful. - Louis P.S.: I created a chat system for a phpBB board very similar to what you want. Indeed, don’t store each message in the database, unless you REALLY want to have a log. Not only it's slow and will cause you headaches, but the size of the log will grow FAST. Several Mo (if not Go) of log will be stored in only a couple of days if the chat is really popular. Been there, done that lol. If you really need to create a log, store to ram and then send messages to the database in some sort of batch. As for the friend system, my best advise it to do it using normal AJAX and whatever server side code you’re using (php, etc.) then notify APE that the friend list changed by giving it the new friend list. APE could handle it, but writing it and maintaining your friend list logic in PHP or whatever is usually simpler. > Le 2015-07-08 à 09:39, Al <[email protected]> a écrit : > > Thanks for that. > > To which framework do you refer ? > This: > https://github.com/ptejada/ApePubSub > or this: > https://github.com/ptejada/APE-Client-JavaScript > > ? > > On Wednesday, July 8, 2015 at 3:28:11 PM UTC+2, Nicolas wrote: > My best advice is to look at the demo sources. > > Also, you should check out Pablo Tejada's framework for simplifying APE on > the client side. > > On the server side, you should register your own commands like this: > > Ape.registerCmd("ACK_RECEIPT", true, function(params, info){ > Ape.log("ACK_RCPT - r_ID :"+params.raw_id + ", pag_cntr > :"+params.page_counter +", u_id :"+info.user.user_id); > > }); > > Also, you will use Mysql support. Be aware that unlike PHP, calls to Mysql > are asynchronous, which means that the reply is non-blocking. This raises > issues when you want to give immediate answers to a command (you can't). It > also complicates things as far as variables management is concerned because > variable values may have changed between the moment you call Mysql and the > moment the reply comes. This is similar to issues you have to deal when you > make a loop of calls to setTimeout in Javascript. > > Then if you know how to program Javascript cleanly you should make great > things. > > Hope this helps. > > PS: I have learned too late that objects are better than arrays for APE. If > you store things, store (and send) them as objects. They will take less > memory but most importantly they will avoid issues with the 0 in arrays (if > you send an array via APE, the indexes always start at 0 which messes up your > array). > > > > > > > > > On Wednesday, July 8, 2015 at 2:56:18 PM UTC+2, Al wrote: > This guys got the same complains as me: > > https://lastzero.net/2010/09/ape-ajax-push-engine/ > <https://lastzero.net/2010/09/ape-ajax-push-engine/> > > And that was in 2010. > I've seen many good projects before that nobody uses because lack of > documentation. Pity :( > > On Wednesday, July 8, 2015 at 2:43:39 PM UTC+2, Al wrote: > Nice, but how do I get going on this with no documentation and zero examples > to find. Care to share some source code? > > On Wednesday, July 8, 2015 at 2:06:59 PM UTC+2, Nicolas wrote: > Yes all this is possible (and more). > > I have done most of what you need on my board gaming platform. Check out > www.happymeeple.com/en/ <http://www.happymeeple.com/en/> and you will see > main chat (=inn), one-on-one chats and friends list. I also added likes (as > well as reward, ban, delete buttons for admin). > > Hope this helps. > > > > On Wednesday, July 8, 2015 at 1:48:34 PM UTC+2, Al wrote: > Hello, > > I was looking at APE as a possible solution for multi channel chatting > solution. > I read through the documentation and I must say it is very poor :( > Nowhere I could find any walk-through regarding the implementation of > server-side logic. Yes there are some API documentation but this is not much > of an information if you never did anything with APE before. > > > What I'm looking to achieve is something like this: > > Multi channel chat where a user can join a channel and chat with everyone > else. > The user must be registered and logged in. > On joining the channel the user will get a subset of latest messages (from DB > I guess) with the possibility to request even older ones. > Possibility for private messaging with options like block/ignore other user, > add-as-friend, de-friend (again, all goes to DB). > > When a user is online he also joins automatically another channel, his > "friends-hub" where he get notified when friends are active on other channels. > > > Can all this be achieved with APE? > > > I will appreciate if someone could share some code to get me started. > > Thanks! > > -- > -- > You received this message because you are subscribed to the Google > Groups "APE Project" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/ape-project?hl=en > <http://groups.google.com/group/ape-project?hl=en> > --- > APE Project (Ajax Push Engine) > Official website : http://www.ape-project.org/ <http://www.ape-project.org/> > Git Hub : http://github.com/APE-Project/ <http://github.com/APE-Project/> > > --- > You received this message because you are subscribed to the Google Groups > "APE Project" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] > <mailto:[email protected]>. > For more options, visit https://groups.google.com/d/optout > <https://groups.google.com/d/optout>. -- -- You received this message because you are subscribed to the Google Groups "APE Project" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/ape-project?hl=en --- APE Project (Ajax Push Engine) Official website : http://www.ape-project.org/ Git Hub : http://github.com/APE-Project/ --- You received this message because you are subscribed to the Google Groups "APE Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
