|
||||||||||
Title: Experimental chat room - call for testers Post by leo on Feb 15th, 2008, 2:59am Since the troubles we've been having on the different chat systems of the Gameroom, I've been working on and off to make a new chat system, which is coming close to usable, and Omar told me I could call for testers in the forum. If you wish to test it, please read on: Try the functionalities on as many browsers and platforms as you can. If you want to make hard stress tests, please wait until Monday when I am more available to restore the server in case of a crash. ;) It works entirely in Javascript (using Ajax techniques), and the sound works on whichever media plugin is the default on your browser. Internet Explorer will issue an ActiveX warning the first time a sound is about to be played, so you have to allow it. It should theoretically work also on old versions of Firefox and Internet Explorer, but I need more testing to ensure it. On IE6 especially, I still have to know how the http request system will work with the corresponding ActiveX object. The test version doesn't check for the uniqueness of login names, this is intentional until the chat runs on the Gameroom user authentication system. There are a few known problems which I don't know how to solve yet: - When the sound alerts are on, Firefox will bring the chat window to the foreground when any other Firefox window has the focus, which is very annoying. - Automatic logout when closing the chat window doesn't work in Firefox. Neither onunload or onbeforeunload events seem to be able to run the code to inform the server that the user is logging out. This works on my local server though. ??? If you see the system is down, please alert me by PM on this forum. Here it is, located on a temporary web site during the development: http://lestrucsaleo.net/arimaa/chatroomtest/ Thanks for testing, suggesting improvements and bug fixes. If the system gets adopted for the Gameroom I think it would be good to make it a collaborative development. |
||||||||||
Title: Re: Experimental chat room - call for testers Post by Janzert on Feb 15th, 2008, 5:02am Looks like it will develop into a great system. I tried it with Firefox 2.0.0.12 on windows XP. When I tried it just now, there was about a 10-15 second delay before what I typed showed up and then it seemed to repeat the last couple things I said multiple times over. [Edit: hmm and after I logged out and back in it seems that each line really is showing up only once, apparently just repeating locally] Great start and hopefully it won't be too hard to make it stable for everyone. Janzert Addition 2: Not sure if it's actually significant but at random intervals I'm seeing the following error in the firebug console. [Exception... "Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIXMLHttpRequest.status]" nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)" location: "JS frame :: http://lestrucsaleo.net/arimaa/chatroomtest/htr.js :: anonymous :: line 37" data: no] http://lestrucsaleo.net/arimaa/chatroomtest/htr.js Line 37 They seem to be after a post request fails. |
||||||||||
Title: Re: Experimental chat room - call for testers Post by leo on Feb 15th, 2008, 5:54am Thanks, Janzert! Yes, the repetition is only client-side, it doesn't appear in the archive, and I'll have to figure out why it happens at all... although I suspect it has to do with requests that pile up during blocking times. I think I'll revert to having the checking function recall itself instead of using a repetition timer. It might be related with the exception error you're getting. I keep firebug open too to see if i get the same thing. I just got an 8-fold repetition once while test-chatting with 99of9. |
||||||||||
Title: Re: Experimental chat room - call for testers Post by The_Jeh on Feb 15th, 2008, 10:14am It looks great. Is there any way to increase the checks rate to less than one second? It is most impressive. |
||||||||||
Title: Re: Experimental chat room - call for testers Post by leo on Feb 15th, 2008, 10:57am Thanks, The Jeh. The polling rate is intentionally limited to 1s (and defaults to 2s) in order not to saturate the server with constant HTTP requests. There exist techniques of "reverse Ajax" though, which allow for instant notification when an update is available, much better for a chat client, but they require a bit unusual software on the server side. It would be good to discuss this topic, and see if the Arimaa server could have such technology installed. Streaming Ajax: http://en.wikipedia.org/wiki/Comet_(programming) (http://en.wikipedia.org/wiki/Comet_(programming)) EDIT: Maybe the game client already works this way, at least the Flash version? (I think Flash can handle persistent sockets and those nifty things without the heavy weight of HTTP) |
||||||||||
Title: Re: Experimental chat room - call for testers Post by The_Jeh on Feb 15th, 2008, 1:37pm If it's going to complicate things, don't bother. 1s is definitely good enough. I'm sure you don't want to get into things that will potentially cause difficulties later on. The only thing I can think of would be to put a frame around the color that you are currently using. And I don't know whether you want to bar a user from using a taken color or not. These are just icing on the cake, though. I think it is currently good enough to be used. |
||||||||||
Title: Re: Experimental chat room - call for testers Post by leo on Feb 16th, 2008, 12:42am Yes, marking the currently selected color is in the plans, as well as generating links on recognized URLs, and transforming the traditional IRC command "/me", and there's still much room for improvement. Most of the work is done client side in the Javascript files which are included in the chat and archive pages. I will updload a zipped package of all js and php files tonight (European time) so that anyone who'd like to experiment with changes and improvements can. I will be internet-less all of today so I hope nothing will crash meanwhile. :) I will miss a lot of Round 6 games :( |
||||||||||
Title: Re: Experimental chat room - call for testers Post by leo on Feb 21st, 2008, 10:48am I didn't have time to dive into the code and comment it, and I won't be able to do so until next week, sorry :-[ Anyway the js scripts are readily browsable meanwhile, and even if they are not commented they are relatively simple. |
||||||||||
Title: Re: Experimental chat room - call for testers Post by leo on Mar 6th, 2008, 10:44am Time passes way too fast... Only now have I uploaded a very slightly improved version of the chatroom. Omar will link to it from the Gameroom but it's still experimental. Client side message repetition should not happen again (found a simple solution to the problem) The backslash on arimaa piece symbols was replaced by a colon - I first tried a forward slash à la IRC but they did a mess with image file paths in the formatting algorithm. Animated emoticons are still there - sorry Froody - but they will be replaced by static ones as soon as I can produce free time out of the fabric of space Well, there is still much much work to do on this chatroom, but this time it's easier for everybody to help, because I uploaded the source code with some (insufficient) comments: http://lestrucsaleo.net/arimaa/chatroomtest/dev/ If you feel like testing it before it has a link in the Gameroom, you can do this from the same address as before: http://lestrucsaleo.net/arimaa/chatroomtest Thanks! Don't forget to report bugs before the whole plant explodes |
||||||||||
Title: Re: Experimental chat room - call for testers Post by clauchau on Mar 6th, 2008, 11:58am Wow, excellent chat appli! Excellent emoticons for the pieces! The colon is a real good choice, very natural considering standard emoticons. I'll see if I can suggest pictures for board squares :a1, :a2, ..., :h8 The source code is so short and the running is so smooth, congrats Leo. |
||||||||||
Title: Re: Experimental chat room - call for testers Post by leo on Mar 8th, 2008, 12:25am Thanks Claude :) By board square pictures do you mean square tiles or the square coordinate notation you suggested some time ago? I read there have been problems in the chat room but I haven't seen them happen live. Could someone who experienced them tell me how it looked like? This chat room doesn't kick people out, but there is a 90 seconds (was 30s on thursday) timeout system to handle people leaving without hitting the log out button. As soon as the client app checks for updates the user is logged in again automatically. The client checks for updates every second (every 10s in stand by mode), and these requests serve also the purpose of a ping system. Logging out by using the log out button sends an explicit log out command to the server, so the user is instantly removed from the user list, no timeout is needed then. In the previous weeks the logout command was automatically sent when the window was closed, but this didn't work on firefox/xp, so I removed it. The temporary server is a shared server with limited capabilities, and this might be a cause for the problems met. |
||||||||||
Title: Re: Experimental chat room - call for testers Post by Janzert on Mar 8th, 2008, 9:24am One thing that might help is if the chat client could check to see if the last update request had finished before sending another one off. Watching in firebug I sometimes see 15+ requests waiting to complete and it seems to be after periods like this that the chat server stops responding comepletely for a while. Also it might make sense to make the update rate dynamic. Something like once a second immediately after receiving or sending a message but then gradually slowing down to 5 or 10 seconds if no change has been received in the last 30 minutes. Janzert |
||||||||||
Title: Re: Experimental chat room - call for testers Post by Janzert on Mar 8th, 2008, 11:00am I grabbed the source and thought I would try and solve something simple first. So I started with why people timing out instead of explicitly logging out didn't produce a chat message. But now I see that the code is there to do just that but it's been explicitly disabled. Not sure why it was disabled, but maybe now with the longer timeout it could be tried again? Janzert |
||||||||||
Title: Re: Experimental chat room - call for testers Post by Arimanator on Mar 8th, 2008, 2:39pm Well, Leo I tried your experimental chat room, but it doesn't work any better than the others for me; I get to a screen with what seems to be an input field, but if I try to write something in it and press enter, I don't get any response at all, same thing if I hit anything resembling a button with my mouse pointer. It's completely inert. |
||||||||||
Title: Re: Experimental chat room - call for testers Post by leo on Mar 9th, 2008, 1:16am on 03/08/08 at 09:24:51, Janzert wrote:
This can be the cause of the problem, since my server is minimal and its response times vary with the load of all the domains share-hosted on it. I decided to go for a simplistic repetition request system first in order to avoid having to deal with lost requests and implement a time out feature to the browser's http request system. But this might be urgently needed now. What is the simplest way to have the simple structure of Javascript to manage all this asynchronous stuff? Launch a one-time delay timer when a request is sent, and have it cancel the request if it wasn't answered? on 03/08/08 at 09:24:51, Janzert wrote:
Yes, another big thing in the todo list, or the server will collapse under the requests. From our conversation in the chat room yesterday, I gathered you were already testing changes to have dynamic polling period? How are the tests going? on 03/08/08 at 11:00:15, Janzert wrote:
Actually the reason I suppressed timeout messages from the chat log (only client side) is that they happen late and fall in the middle of the conversations, or, if there has been no user for a while, they fall in just before someone logs in (because the server only reacts to requests, it doesn't run on its own to check who's there and not). I found it more ennoying than informative. Dunno... on 03/08/08 at 14:39:40, Arimanator wrote:
Maybe your version of IE detects an error in the script and stops executing it, which prevents it from building the page with the options and fetching data from the server. If you have a yellow triangle with a shriek mark in the status bar, could you click on it and tell us what message(s) it reports? Also, which sub-version of IE6 do you have? Someone tested the chatroom OK with IE6, but maybe not your exact same version. |
||||||||||
Title: Re: Experimental chat room - call for testers Post by woh on Mar 9th, 2008, 6:36am on 03/09/08 at 01:16:32, leo wrote:
Hi Leo I am having the same troubles with the chat room as Araminator. I am using IE6 on XP. The exact version of IE6 is 6.0.2900.2180.xpsp_sp2_rtm.040803-2158. There is indeed a yellow triangle in the statusbar with the following info: Line: 5 Character: 2 Error: 'XMLHttpRequest' not defined Code 0 woh |
||||||||||
Title: Re: Experimental chat room - call for testers Post by Janzert on Mar 9th, 2008, 8:13am on 03/09/08 at 01:16:32, leo wrote:
The only thing is that it provides a good record to see that a player did leave at the beginning of a game and before the spectators started talking about the game. I had reenabled them here but could disable it again if you want. Janzert [Edit: ps. Leo I left a pm last night wondering how you would like changes sent back to you] |
||||||||||
Title: Re: Experimental chat room - call for testers Post by leo on Mar 9th, 2008, 9:26am on 03/09/08 at 06:36:55, woh wrote:
Thanks Woh, I'm baffled by this error message because the script is designed to detect if this object (used to send requests to the server) is not defined (which is always the case on IE6) and then define it using IE6 specific way of dealing with the task. If someone knows about Microsoft ActiveX system, could you have a look at the htr.js script and see if I did something wrong in redefining XMLHttpRequest? on 03/09/08 at 08:13:50, Janzert wrote:
OK, let's have timeout information displayed. We'll see later if we can shrink the timeout delay back to a smaller value to make the information more useful. on 03/09/08 at 08:13:50, Janzert wrote:
I just enabled email notification on PMs, I hadn't realized the functionality was turned off, sorry :-[ I answered your PM, and I think we should discuss your changes in this thread, you seem to have done a lot of work in very little time! |
||||||||||
Title: Re: Experimental chat room - call for testers Post by Arimanator on Mar 9th, 2008, 10:36am on 03/09/08 at 01:16:32, leo wrote:
I did that and it says: Line: 5 Character: 2 Error: 'XMLHttpRequest' not defined Code 0 |
||||||||||
Title: Re: Experimental chat room - call for testers Post by Janzert on Mar 9th, 2008, 12:29pm Here's what I've done so far: Stop making multiple update requests at once (with a timeout in case a request gets lost) Slow down update requests over time when there is no activity in the chat room (after 30 minutes of the chat being idle it will be making a request every 10 seconds) Add IM (:) and IRC (/me) style emotes (simply styling the text in italics for now but that should be easily changeable in the css if desired) Change the way sounds are played so firefox won't bring the window to the foreground (this method is suppose to work with all the major browsers but does seem to require wav sound files, I've converted the mp3s. It probably needs more testing with other browser to be sure it really works everywhere) Change the check for XMLHttpRequest so it hopefully works with IE6 now. Untested as I don't have IE6 though. Add the beginnings of linkifying urls (Currently only urls starting with http:// or https:// will be recognized) I think that's everything so far. Janzert |
||||||||||
Title: Re: Experimental chat room - call for testers Post by clauchau on Mar 10th, 2008, 9:53am I don't usually use IE but I checked it and right now I get the same script error as others with my IE 6.0.2900.2180.xpsp_sp2_gdr.070227-2254 (while it works with Firefox on the same machine). I've fiddled with htr.js and I can tell you the error occurs right on testing if (! XMLHttpRequest). IE doesn't like that way to test whether the function is undefined or not. That variable is not zero, a null pointer or whatever you expect it should be in javascript. It is undefined and cannot be tested that way. There is another error coming up when I remove the test and force the script to define XMLHttpRequest. It says an ActiveX component cannot create any object. It occurs on new ActiveXObject (versions[i]) |
||||||||||
Title: Re: Experimental chat room - call for testers Post by leo on Mar 10th, 2008, 1:09pm I just uploaded Janzert's new files to the experimental chat room and it seems to work fine. :) IE6 users please test it. Note: I had to hit refresh for firefox to use the new scripts, don't know why. It should be checking for file updates. :-/ If you don't see the new features, please try refreshing. on 03/09/08 at 10:36:35, Arimanator wrote:
Thanks! Same error as Woh and others. We're investigating the suspects (see below). on 03/09/08 at 12:29:38, Janzert wrote:
Great! A thousand thanks to you, Janzert! Your code is now up and running on the server. The development page now contains also the zip of your changes. on 03/10/08 at 09:53:07, clauchau wrote:
Yes, this is because xmlhttprequest is a native js object on firefox but not ie6 - it is on ie7 though, which simplifies programming because we had to deal with a bunch of various activex versions of the equivalent object before. on 03/10/08 at 09:53:07, clauchau wrote:
I've seen a lot of example of the shriek operator used to test for the existence of an object or a method, but maybe microsoft's js is different. Thanks for pointing it out. Hopefully Janzert's code update will fix this problem. on 03/10/08 at 09:53:07, clauchau wrote:
Thanks again for testing, I'll try to dig deeper into this when I get more time. Any suggestion of code change? (ps: have you seen my question about board emoticons on the previous page?) |
||||||||||
Title: Re: Experimental chat room - call for testers Post by woh on Mar 10th, 2008, 4:25pm on 03/10/08 at 13:09:28, leo wrote:
I am afraid there is still a problem. I am getting the following message: Line 12 Character 4 Error: could not create object Code 0 I hope this helps. |
||||||||||
Title: Re: Experimental chat room - call for testers Post by Arimanator on Mar 10th, 2008, 6:03pm on 03/10/08 at 16:25:47, woh wrote:
I concur; it takes a while longer to get there though. |
||||||||||
Title: Re: Experimental chat room - call for testers Post by omar on Mar 10th, 2008, 10:28pm Leo, try replacing this line in htr.js var htr = new XMLHttpRequest(); with var htr = getHttpObject() Where the getHttpObject function is defined as: function getHttpObject(){ if (window.XMLHttpRequest){ return new XMLHttpRequest(); } else if(window.ActiveXObject){ return new ActiveXObject("Microsoft.XMLHTTP"); } else{ alert('Status: Cound not create XmlHttpRequest Object. Consider upgrading your browser.'); } } |
||||||||||
Title: Re: Experimental chat room - call for testers Post by leo on Mar 11th, 2008, 2:09pm Thanks for testing, Woh and Arimanator. Arimanator, I think it takes longer because the browser has to cache the 3 sound files at startup with the new system, but it should start faster on the next access. Thanks Omar, I've reverted to simpler coding as you suggest. I initially wanted to test for all possible activex versions to be sure to get the right one but I evidently screwed something up. I also removed all sentry checks for the existence of the xmlhttprequest object in the chat.js script. So, IE6 users, there is one more test to do - hopefully the last one. If it still doesn't work, try hitting refresh in case the browser uses old cached versions of the scripts. And if it still doesn't work, I heard of a powerful new system of chat that uses advanced technologies called paper, ink and couriers, but I have no idea how this works. :P EDIT: Note to the developers: the weird NaN displays that come sometimes - rarely enough fortunately - are not due to the message formatting algorithm mistakingly interpreting a date where there is none, because the dates are separate data in the chat log items. They might be due to wrong splitting of the raw chat log data, possibly for data corruption but I have no idea at this point where this can sneak in. |
||||||||||
Title: Re: Experimental chat room - call for testers Post by woh on Mar 11th, 2008, 4:39pm on 03/11/08 at 14:09:49, leo wrote:
Leo The chat room now works for me. Thanks woh |
||||||||||
Title: Re: Experimental chat room - call for testers Post by leo on Mar 12th, 2008, 5:53am on 03/11/08 at 16:39:42, woh wrote:
Great!!! I had a look at the archive and saw you logged in yesterday shortly after I left. Arimanator could log in too. Status news: Bandwidth load so far is about 20MB transfer per day, about 100MB in the last 5 days (10% of the bandwidth I'm allowed per month on this server!). This transfer load is mostly due to the unavoidable HTTP headers sent with each request to check if there are new messages on the chat server, and the answers -with their own headers too- telling that no, there is no new message. The actual chat data transfer itself probably amounts to much less than 1% of the total. Which means the internet is a resource waster :) At least with this simple Ajax system. Some future improvements to work on: See if Janzert's code changes significantly reduce the bandwidth usage in the next days, and if they don't then tweak the automatic gradual throttle down to be more drastic. Make the various tool bars and option bars into css popup bars? Have a calendar to pick a day from the archive instead of the current form. Add a common game board to move pieces around and point things with a hand. But for the time being I'm going to use my free time to play Arimaa instead of coding ;) Thanks a bunch to everybody who took of their time and effort and patience to finally have the chatroom working. Especially you, Janzert! |
||||||||||
Title: Re: Experimental chat room - call for testers Post by Arimanator on Mar 12th, 2008, 6:15am I think Leo that I’ll never be able to thank you enough for all the time you dedicated to this task and the great job that you've done in the end. Kudos! :) |
||||||||||
Title: Re: Experimental chat room - call for testers Post by omar on Mar 13th, 2008, 1:46am Leo, The chat room looks awesome. You've done an amazing job with it. Thanks. And thanks to everyone else who helped out. Would you like me to move it over to the arimaa.com server now, so that it doesn't push you to your bandwidth limit? |
||||||||||
Title: Re: Experimental chat room - call for testers Post by leo on Mar 15th, 2008, 4:56pm Thanks Omar, I sent you an email. The chat room will behave much more smoothly on your server. Preparing the transfer onto the arimaa.com server I couldn't resist making last minute changes (always a bad idea but well... if only because the "last minute" lasted all the evening -- LOL) Please hit refresh on the chatroom page to be sure to have the latest scripts. * User preferences are now saved into cookies and preserved across sessions. The side effect of the cookies is that they are automatically sent along with each check for updates and inflate the bandwidth even more, argh. I don't know how to prevent that. * The random problem we have been having with incomplete messages might now be fixed. I extended the interprocess lock to the whole duration of the server side script. This will probably slow things down a bit but hopefully solve all weird bugs. * Enabled back auto-logout when closing the window even if it doesn't always work. I just saw IE displayed the sound embeds as funny dots and tried to hide them into a hidden html div but FF couldn't play the sounds anymore... This is probably similar to why you couln't tweak their visibility directly, Janzert. I'll post more news when necessary. Stress tests and reports welcome before the transfer to arimaa.com. |
||||||||||
Title: Re: Experimental chat room - call for testers Post by Fritzlein on Mar 17th, 2008, 7:32pm The chat seems to be having some issues. I'm not doing anything right now and I keep getting timed out and logged back in: 07:28:57 omar timed out 07:28:57 Cottage_Cheese timed out 07:28:57 Fritzlein timed out 07:28:57 Cottage_Cheese is coming in 07:28:57 Fritzlein is coming in 07:28:57 omar timed out 07:28:57 Cottage_Cheese timed out 07:28:57 Fritzlein timed out 07:28:57 Cottage_Cheese is coming in 07:28:57 Fritzlein is coming in 07:29:13 omar is coming in 07:28:57 omar timed out 07:28:57 Cottage_Cheese timed out 07:28:57 Fritzlein timed out 07:28:57 Cottage_Cheese is coming in 07:28:57 Fritzlein is coming in 07:29:13 omar is coming in 07:30:54 Cottage_Cheese timed out 07:30:54 Fritzlein timed out 07:30:54 omar timed out 07:30:54 Cottage_Cheese is coming in 07:30:56 Fritzlein is coming in Any thoughts what might be up? |
||||||||||
Title: Re: Experimental chat room - call for testers Post by aaaa on Mar 18th, 2008, 12:03am I'd rather have a flash client. Now I don't get any sound because I'm missing a plug-in. I'm using Firefox. |
||||||||||
Title: Re: Experimental chat room - call for testers Post by leo on Mar 18th, 2008, 3:57am A quick reply but I will get back about it later when I have more time: Lost messages are due to the requests being canceled after too much time have passed. Client app should be modified so that posting requests can't be cancelled as checking requests are. The weird timeouts are trickier to figure out, I never watched them happen live and I'm scratching my head about them, although I suspect my crappy shared server of being poorly responsive, to put it mildly. I'll add the updated source code files to the dev page today for anyone wanting to have a look at them, but last week's source are still mostly valid to analyse the functioning. @Aaaa, yes, a Flash client would probably work much better, although it would require a plugin too -- the Flash plugin. |
||||||||||
Title: Re: Experimental chat room - call for testers Post by leo on Mar 19th, 2008, 1:26am Anyone up for converting the javascript/css/html of the chatroom to actionscript/flash? Some versions of flash (was it on some linux/firefox combinations?) didn't run correctly, any idea why? As a last resort, how about using something like dojo (http://dojotoolkit.org/) to help fighting back browser inconsistencies and ajax memory leaks? |
||||||||||
Title: Re: Experimental chat room - call for testers Post by omar on Mar 20th, 2008, 1:41am I have written a actionscript/flash version of a simple chat room, and though it seemed to be working for me on linux/FF it was not working for some other folks. I don't remember exactly why right now. But if we have any flash developers that want to take a crack at it, I can send you the source. |
||||||||||
Arimaa Forum » Powered by YaBB 1 Gold - SP 1.3.1! YaBB © 2000-2003. All Rights Reserved. |