Warning: preg_replace_callback(): Requires argument 2, '$func['entity_fix']('\2')', to be a valid callback in /nfs/c01/h06/mnt/10927/domains/dragonprime.net/html/Sources/Load.php(225) : runtime-created function on line 3
AJAX based chat
DragonPrime - LoGD Resource Community
Welcome Guest
  • Good morning, Guest.
    Please log in, or register.
  • September 20, 2019, 02:52:57 AM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: 1 [2] 3 4 ... 11   Go Down
  Print  
Author Topic: AJAX based chat  (Read 69266 times)
0 Members and 1 Guest are viewing this topic.
Maeher
Codemeister
****
Offline Offline

Posts: 362


There's nothing to see here...


View Profile
« Reply #15 on: September 20, 2006, 05:50:54 AM »

Yes, but only if you do not say anything.
If you would stay logged in only by watching the chat nobody would ever time out in the village and that would not make sense.
Logged

There is no signature...
XChrisX
Global Moderator
Mod God
*****
Offline Offline

Posts: 4647

Be aware of the squirrel!


View Profile WWW
« Reply #16 on: September 20, 2006, 06:01:55 AM »

"Only watching" and "hitting refresh" are two different things...

If I hit the refresh button NOW I will not time out. Full stop. This is the status quo.

Any change to the chat engine should replicate this.

AJAX does not mean it has to auto-reload comments. It simply needs to reload the commentaries, not the whole page. That's what an AJAX chat *should* do.

It should not change the behaviour of the chat - just improve the performance.
Logged

Running for more than three years now:
Maeher
Codemeister
****
Offline Offline

Posts: 362


There's nothing to see here...


View Profile
« Reply #17 on: September 20, 2006, 06:35:27 AM »

OK, that means, that you and the author have two different point of views how the chat should be like.
As i understand the author's intentions, he wanted to create a chat, that is autoupdated.

It's exactly the difference, Torne just asked. You want a client driven chat where the client can poll for new text. edmund wants a server driven chat where the server pushes the new texts.
Logged

There is no signature...
Elessa
Faerie
Mod God
*****
Offline Offline

Posts: 3598


short, sweet and to the point


View Profile
« Reply #18 on: September 20, 2006, 09:30:51 AM »

i am curious, but hath any of ye actually gone to hogwarts live to see the AJAX chat in use?  i know saucywench hast spent some time there playing with it and was rather impressed.

if ye haven't i suggest ye do, as i believe that the game dost indeed timeout regardless of the chat based on the conversation that was had between saucy and edmund last night in the channel.
Logged

Uuma ma ten rashwe, ta tuluva a lle

Play the latest beta version here on LoGD DragonPrime - Axebridge
SaucyWench
Mod God
*****
Offline Offline

Posts: 2238


I'm a good girl.


View Profile WWW
« Reply #19 on: September 20, 2006, 01:39:45 PM »

I don't quite know how, but I think you've misunderstood it, XChrisX. I have a copy of the zip and I'm going to install it on Darton to help Edmund beta test it. The scrolling chat replaces the lines of commentary and in the same way sits *above* the normal "add" box and refresh buttons. Either saying something or hitting that refresh button will update your laston value and keep you logged in.

Right now, if you sit still in the village of any normal server, and do nothing but stare at the chat, you will time out after 15 minutes. It is exactly the same with the ajax chat installed. If you sit there, after 15 minutes the JavaScript will activate and put a little linky inside the chat saying that you've timed out, and the chat will stop scrolling. If you click it, you get the login page. You can, of course, click any other nav link on the page and get exactly the same result  Grin

Right now the chat is only suitable for servers with collapsible content disabled. I don't know the exact whys, but I suspect the JavaScripts don't dance, because JS is renowned for not being sharing and caring. Edmund has specifically blocked anyone from adapting the code to view the Grotto, but if I understood him right it has a mini-exploit in that someone with code background would be able to view any commentary area within the game if they made the html up. So for now it's probably not ready for beta release. It's not an issue for me on Darton or the GemDust tourneys because I have no clans.
Logged

SaucyWench
Owner of GemDust.com and Darton City proudly hosted by LunarPages
Torne
SVN Users
Codemeister
*
Offline Offline

Posts: 259


Code ninja


View Profile
« Reply #20 on: September 20, 2006, 03:36:47 PM »

It's exactly the difference, Torne just asked. You want a client driven chat where the client can poll for new text. edmund wants a server driven chat where the server pushes the new texts.
That's not what I actually meant. I was asking about a JS implementation detail - whether the client periodically makes a request to the server automatically based on a JS timer in order to get new text, or a fully server-push model where the server delivers multipart content over a persistent connection. Basically, when someone types something do other people see it 'instantly' (minus latency of connection) or when their client next checks for new commentary (which may be frequent enough that it *seems* instant, but can be a tremendous bandwidth expenditure).
Logged
XChrisX
Global Moderator
Mod God
*****
Offline Offline

Posts: 4647

Be aware of the squirrel!


View Profile WWW
« Reply #21 on: September 20, 2006, 10:26:11 PM »

I understood he was planning to make it like an IRC chat, where you can sit idly by and see the text scrolling. (So it auto-updates itself - which would be different from now).

What I wonder: Has anyone from the core development team received a copy of this ZIP file? And if no: Why?!

Basically I'm asking this, because it might be worth introducing this to the core code... But the time frame for submitting changes is getting smaller and smaller and smaller with every second... Wink
« Last Edit: September 20, 2006, 10:31:17 PM by XChrisX » Logged

Running for more than three years now:
Elessa
Faerie
Mod God
*****
Offline Offline

Posts: 3598


short, sweet and to the point


View Profile
« Reply #22 on: September 20, 2006, 10:32:41 PM »



What I wonder: Has anyone from the core development team received a copy of this ZIP file? And if no: Why?!

Basically I'm asking this, because it might be worth introducing this to the core code... But the time frame for submitting changes is getting smaller and smaller and smaller with every second... Wink

hast anyone from the core development team thought to ask edmund for a copy of the zip?  mayhaps one of ye should...  Wink
Logged

Uuma ma ten rashwe, ta tuluva a lle

Play the latest beta version here on LoGD DragonPrime - Axebridge
edmund
Member
Militia
**
Offline Offline

Posts: 23



View Profile
« Reply #23 on: September 20, 2006, 10:34:41 PM »

If you click on "Refresh" now, you will not time-out.

According to his description I would time-out after some minutes.

And the standard refresh button will still have the same effect, all I'm saying is that the AUTOMATIC refresh will not keep you logged in, otherwise someone will sit there on the page and never get logged out.  If you click refresh, or click the reactivation when the ajax automaticalyl times out, it will keep you logged in.
Logged
XChrisX
Global Moderator
Mod God
*****
Offline Offline

Posts: 4647

Be aware of the squirrel!


View Profile WWW
« Reply #24 on: September 20, 2006, 10:39:38 PM »

Aaaa... I did not realize there was a refresh button AND an automatic refresh... (I though they were excluding each other... Tongue )

Okay, that clarifies some things...

Elessa was so kind to send the link to me where I just downloaded the ZIP file. I will take a look at the code. Maybe I can test it this weekend and then put it to our live server to do some hardcore-testing... Wink
Logged

Running for more than three years now:
edmund
Member
Militia
**
Offline Offline

Posts: 23



View Profile
« Reply #25 on: September 20, 2006, 10:43:09 PM »

It's exactly the difference, Torne just asked. You want a client driven chat where the client can poll for new text. edmund wants a server driven chat where the server pushes the new texts.
That's not what I actually meant. I was asking about a JS implementation detail - whether the client periodically makes a request to the server automatically based on a JS timer in order to get new text, or a fully server-push model where the server delivers multipart content over a persistent connection. Basically, when someone types something do other people see it 'instantly' (minus latency of connection) or when their client next checks for new commentary (which may be frequent enough that it *seems* instant, but can be a tremendous bandwidth expenditure).

The current version is not a server-push, as that would result in something that would hold threads open far too long, and would ause memory problems.

On high traffic sites, many people are hitting the refresh link every 3 or 4 seconds anyway, so it's a significant bandwidth decrease to only fetch the commentary area, instead of the whole page, imho, also a significant SQL query decrease, as when rendering village.php there can litterally be hundreds of SQL queries run depending on the modules you have active.
Logged
edmund
Member
Militia
**
Offline Offline

Posts: 23



View Profile
« Reply #26 on: September 20, 2006, 11:14:53 PM »

Aaaa... I did not realize there was a refresh button AND an automatic refresh... (I though they were excluding each other... Tongue )

Okay, that clarifies some things...

Elessa was so kind to send the link to me where I just downloaded the ZIP file. I will take a look at the code. Maybe I can test it this weekend and then put it to our live server to do some hardcore-testing... Wink

Well there are some bugs still, I'm working on them as fast as I can though.
Logged
SaucyWench
Mod God
*****
Offline Offline

Posts: 2238


I'm a good girl.


View Profile WWW
« Reply #27 on: September 20, 2006, 11:35:56 PM »

Maybe I can test it this weekend and then put it to our live server to do some hardcore-testing... Wink
Yeah, my 220 users testing it are just chicken feed compared to the big showoffy sites  Tongue

I have it installed now on www.dartoncity.com for anyone who would like to see it. Edmund, you mentioned something about an admin setting for the refresh rate. I couldn't see it, was it something I had to edit in the code?
Logged

SaucyWench
Owner of GemDust.com and Darton City proudly hosted by LunarPages
edmund
Member
Militia
**
Offline Offline

Posts: 23



View Profile
« Reply #28 on: September 20, 2006, 11:42:29 PM »

Maybe I can test it this weekend and then put it to our live server to do some hardcore-testing... Wink
Yeah, my 220 users testing it are just chicken feed compared to the big showoffy sites  Tongue

I have it installed now on www.dartoncity.com for anyone who would like to see it. Edmund, you mentioned something about an admin setting for the refresh rate. I couldn't see it, was it something I had to edit in the code?

Actually it's a user setting, the user has their own control over the refresh rate, you can set the default in the code, I currently have it for 7 seconds, but I think the final version I'll up it back to 3 seconds, I had it at 3 seconds initially, but HL became really sluggish, I then found out the HL problem was something completely unrelated, but oh well.
Logged
SaucyWench
Mod God
*****
Offline Offline

Posts: 2238


I'm a good girl.


View Profile WWW
« Reply #29 on: September 21, 2006, 12:12:22 AM »

Ah, that explains why I couldn't set it =D Thanks!
Logged

SaucyWench
Owner of GemDust.com and Darton City proudly hosted by LunarPages
Pages: 1 [2] 3 4 ... 11   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Play LoGD on Dragonprime

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
62 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search