DragonPrime - LoGD Resource Community

Core Code Development Discussions => Core Development Discussion => Topic started by: Catscradler on February 22, 2006, 05:24:18 PM



Title: AJAX based chat
Post by: Catscradler on February 22, 2006, 05:24:18 PM
Okay all you hotshot DP coders, wanna make something REALLY good?  What's the most requested feature in the game?

1.  Decent marriage system - we have that (http://dragonprime.net/index.php?topic=3753.0))
2.  A PvP system that's fair - some good options but nothing great quite yet.
3.  A chat system where you don't have to click Refresh all the time - we can do that.

Wait, what?  Yes.  Yes we can.

As many of you know, AJAX (http://en.wikipedia.org/wiki/AJAX) is a combination of existing web technologies that (among other things) allow the user to reload parts of the page without freezing the rest of their browser while waiting for the request to go through.  The process is usually pretty speedy as well.  I've thought for a while that such a system would make the in-game chat system work better, but didn't want to propose it without any backup or suggestions as to how to go about it.

Luckily I just ran across a link to the Most Simple Ajax Chat Ever (http://www.linuxuser.at/index.php?title=Most_Simple_Ajax_Chat_Ever), which runs in about 20 lines of Javascript and about 40 lines of PHP.  A system like this should be, well, not easy, but not on the level of recreating the game, to integrate into the existing commentary code, with the old system to fall back on for browsers that don't support Javascript.

I'm merely proposing it because, well, I don't have the time to do it myself, but I figured some of you folks would probably like to give this a try for future code releases.


Title: Re: AJAX based chat
Post by: orochi on April 14, 2006, 05:57:17 PM
im sure its not too much of a problem ::) isent the installation file using ajax?


Title: Re: AJAX based chat
Post by: Torne on April 14, 2006, 05:58:06 PM
No, the installer is a plain old html page with forms.


Title: Re: AJAX based chat
Post by: CortalUX on April 15, 2006, 03:21:30 PM
The magicmirror module I released does this; dunno where it is though. I'm sure that wouldn't be too hard to get working as it's already working in an LotGD popup.


Title: Re: AJAX based chat
Post by: Talisman on April 15, 2006, 05:09:16 PM
http://dragonprime.net/index.php?module=Downloads;sa=dlview;id=360


Title: Re: AJAX based chat
Post by: orochi on April 16, 2006, 09:47:17 AM
i use the magic mirror system, and really like it ^_^ it would be cool if the main chat wasa similar


Title: Re: AJAX based chat
Post by: CortalUX on April 16, 2006, 03:16:31 PM
depends how big your userbase was; unless old ajax chat messages weren't deleted


Title: Re: AJAX based chat
Post by: Oberon-FI- on April 21, 2006, 12:03:33 PM
sorry if I resume this old post.
I have developed a chat system for village and all area with AJAX so to replace the commentary with a live chat.
I have tried magicmirror system too, but i have always the same following bug:

when i send a message, the "div" (where the message is attached) doesnt refresh correctly.
I cannot see the message: to see it, i have to reorganize or move the browser window O_o.

Am i only with this problem?  :(

~Oberon~
http://www.fantasyitalia.it/LotGD/


Title: Re: AJAX based chat
Post by: edmund on September 13, 2006, 02:33:40 AM
I have developed a fully AJAX version of the commentary system that works like a charm, I'm in final testing with my users on HL and will release it as a module in a week or two, it does require a slight change to the commentary lib in that I had to add 2 modulehooks to make it work right, but the AJAX chat works perfectly, and it degrades well for people who have javascript problems and can be turned on and off at will by users if they prefer to use the old way.


Title: Re: AJAX based chat
Post by: Nightborn on September 13, 2006, 02:40:59 AM
great! =)


what about the timeout? how did you do that?


Title: Re: AJAX based chat
Post by: edmund on September 19, 2006, 02:35:27 PM
the ajax request itself does not update the person's login timer, so if they just sit on the chat area, they will time out as normal, one of the bugs I am working on is to make it so that the posting of a comment will update the person's login timer while displaying will not, this way posting a comment will keep you loggedin, but just watching the chat scroll by will not,

Also I have a javascript timer as well, after a few minutes of inactivity, if the person does not post a comment or browse to another page the live updating will stop and give people a link to turn it back on.

Another thing I'm working on is for moderators, wherre they can delete comments live from within the chat area.

If you would like to see for yourself how the live chat system works, I have it installed in it's alpha glory on HogwartsLive.com

Also, I have sent my alpha version to the owner of a couple other sites.


Title: Re: AJAX based chat
Post by: XChrisX on September 20, 2006, 01:49:14 AM
the ajax request itself does not update the person's login timer, so if they just sit on the chat area, they will time out as normal.

this way posting a comment will keep you loggedin, but just watching the chat scroll by will not,

This is very dissatisfying. The AJAX version should have no difference to the normal standard chat as it is now. It should only be faster...


Title: Re: AJAX based chat
Post by: Torne on September 20, 2006, 04:15:28 AM
Does the client poll for new text from the server, or is it real server-push?


Title: Re: AJAX based chat
Post by: Maeher on September 20, 2006, 05:34:13 AM
the ajax request itself does not update the person's login timer, so if they just sit on the chat area, they will time out as normal.

this way posting a comment will keep you loggedin, but just watching the chat scroll by will not,

This is very dissatisfying. The AJAX version should have no difference to the normal standard chat as it is now. It should only be faster...

Where exactly do you see the difference?


Title: Re: AJAX based chat
Post by: XChrisX on September 20, 2006, 05:44:48 AM
If you click on "Refresh" now, you will not time-out.

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


Title: Re: AJAX based chat
Post by: Maeher 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.


Title: Re: AJAX based chat
Post by: XChrisX 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.


Title: Re: AJAX based chat
Post by: Maeher 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.


Title: Re: AJAX based chat
Post by: Elessa 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.


Title: Re: AJAX based chat
Post by: SaucyWench 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  ;D

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.


Title: Re: AJAX based chat
Post by: Torne 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).


Title: Re: AJAX based chat
Post by: XChrisX 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... ;)


Title: Re: AJAX based chat
Post by: Elessa 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... ;)

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


Title: Re: AJAX based chat
Post by: edmund 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.


Title: Re: AJAX based chat
Post by: XChrisX 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... :P )

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... ;)


Title: Re: AJAX based chat
Post by: edmund 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.


Title: Re: AJAX based chat
Post by: edmund 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... :P )

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... ;)

Well there are some bugs still, I'm working on them as fast as I can though.


Title: Re: AJAX based chat
Post by: SaucyWench 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... ;)
Yeah, my 220 users testing it are just chicken feed compared to the big showoffy sites  :P

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?


Title: Re: AJAX based chat
Post by: edmund 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... ;)
Yeah, my 220 users testing it are just chicken feed compared to the big showoffy sites  :P

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.


Title: Re: AJAX based chat
Post by: SaucyWench on September 21, 2006, 12:12:22 AM
Ah, that explains why I couldn't set it =D Thanks!


Title: Re: AJAX based chat
Post by: Torne on September 21, 2006, 02:45:20 AM
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.
Keeping HTTP connections open is not that expensive on modern web servers (unless you still use a preforking apache), and having a minimal php script running that knows only how to fetch commentary from the db and nothing else shouldn't take up that much memory.

A number of server-push AJAX systems I've seen actually use a dedicated server for the push component which is not even a full httpd - a trivial socket server attached directly to a db backend is sufficient. :)



Title: Re: AJAX based chat
Post by: edmund on September 21, 2006, 03:58:26 PM
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.
Keeping HTTP connections open is not that expensive on modern web servers (unless you still use a preforking apache), and having a minimal php script running that knows only how to fetch commentary from the db and nothing else shouldn't take up that much memory.

A number of server-push AJAX systems I've seen actually use a dedicated server for the push component which is not even a full httpd - a trivial socket server attached directly to a db backend is sufficient. :)



Yes, and how many LoGD admins you think will be able to do that, I have considering seting up a dedicated server for push component on HL, but we have our own server, we can do that.

Still if you have a hundred people connected to a push method, then that's a hundred sockets, and therefore a hundred threads you have open simultaneously. fetching opens and closes those threads cleanly.


Title: Re: AJAX based chat
Post by: kickme on September 21, 2006, 09:03:58 PM
Not sure if you know this all ready, but some special characters don't work.


Title: Re: AJAX based chat
Post by: edmund on September 21, 2006, 09:52:02 PM
Not sure if you know this all ready, but some special characters don't work.

Noticed that actually, was going to look into doing str-replaces in the original source to try to resolve those, but I'm not sure what I can do for it that will make those special characters transfer well, there's so many of them.


Title: Re: AJAX based chat
Post by: XChrisX on September 21, 2006, 10:15:55 PM
Maybe you can do something by using "htmlentities()" ? The entity scheme is stored in the database as a setting since v1.1.0 :)


Title: Re: AJAX based chat
Post by: Torne on September 22, 2006, 03:38:11 AM
Still if you have a hundred people connected to a push method, then that's a hundred sockets, and therefore a hundred threads you have open simultaneously. fetching opens and closes those threads cleanly.
A hundred threads is hardly a lot - any threaded apache run by a moderate sized hoster would have hundreds, maybe a thousand or two threads under normal operation. My webserver at home runs with thirty or forty and it's mostly only used by me :)

A dedicated push server app wouldn't need a thread for each socket, also; one is enough.


Title: Re: AJAX based chat
Post by: Ernesto on November 01, 2006, 12:36:38 PM
Any updates on this one my man? If nothing ready for full release, I wouldn't mind test driving it for you.


Title: Re: AJAX based chat
Post by: SaucyWench on November 01, 2006, 04:19:52 PM
I have it installed on Darton. It shows all colours in the chat area, but the preview currently only supports the 1.0.6 colours (Edmund has been very busy lately, but I daresay he will update the modified commentary file to include the 1.1.1 colour set when he has time). It is ALSO not suitable for games with either multiple cities or clans*.








*Technically speaking there is no harm for multiple city games, but there is the potential for code-brained players to formulate an exploit enabling them to see into other chat areas in the game (excluding the Grotto), which means that they could, if so inclined, read other clan halls.


Title: Re: AJAX based chat
Post by: Ernesto on November 02, 2006, 10:29:30 AM
Ok, I am so far running this module without any problems, I just had to bugfix 3 things in the code to make it work on my server (Was some absolute filepaths that were wrong).

If we (read: edmund!) can get this working real smooth, I don't see a reason why we cant implement this type of controls in numerous places of the game. Forest fights, real time player fighting etc comes to mind. I dont know the technical backdraws of course, since I am a newbie, but setting something like this into the forest fights would be really nice, instead of having to reload "the entire page" each time you wish to execute a round.

Another example where something like this could be used is for example the potion modules. As it is now, when you quaff a potion, it reloads to a new page, where it sais something like: "Ah, you drank a potion" and then you can press the "Return to whence you came" link in the navbar, but with an ajax driven {content} it would be possible to just scroll that text in the "special window" assigned for texts and events like theese.

IE, something like this:

Quote
Box area with the static description of the location
Blah blah you are standing in a nice pretty meadow, birds are singing and an old man is scratching his hairy behind.
Just behind the man you see a gigantic tree with apples in it!
Quote
If the module does not have ajax hook support, it would output its text here in this "box" just like it always has
Quote
Ajax driven "dynamic" content, like quaffing potions, combat text, NPC chat etc
You take a bite from one of the apples. That is delicious, but the man looks at you angrily and exclaims:
"Stop that you scroundler!"
Man slaps you in the face
You take 1 damage
Quote
Box footer area with static footer description, for example "Who is here:"
Who is here
============
Players: Page Samwise, Squire Longshanks, King Robert
NPC: Old man
 


Title: Re: AJAX based chat
Post by: GenmaC on November 06, 2006, 06:18:01 PM
I am highly impressed with this module :) Very good work :)


Title: Re: AJAX based chat
Post by: Malchior on November 06, 2006, 06:46:23 PM
I am highly impressed with this module :) Very good work :)

I totally agree with you. But there's one thing, it somehow changes a persons clan status color to blue. But it doesn't matter anyway.  ;D Nice job Edmund ;)


Title: Re: AJAX based chat
Post by: Ernesto on November 08, 2006, 03:12:42 PM
This module is absolutelly awesome, but it generates ALOT of PHP errors in the webservers errors.log file. (Undefined variables)

My errors.log file was at 7gb (Ieeek!) and this little bugger surelly didn't help to decrease the size =)


Title: Re: AJAX based chat
Post by: GenmaC on November 13, 2006, 08:22:53 AM
Here are a couple of the undefined variable errors I've seen and not been able to puzzle out (there was another one but it was easy to fix):

PHP Notice: "Undefined index: lastcommentid"
in /home/.ramone/mcounts/mcounts.thesevens.net/ajaxcommentary.php at 39.
PHP Notice: "Undefined offset: 25"
in /home/.ramone/mcounts/mcounts.thesevens.net/ajaxcommentary.php at 203.

I think the offset 25 error might have something to do with the color limits, as that is what mine is set to.

Also, it does not handle special characters correctly, but turns them into their ASCII code equivalent.

And lastly, the coolest thing in the world would be if I could turn this off for certain areas (like the MOTD).

ps best module ever


Title: Re: AJAX based chat
Post by: Ernesto on November 13, 2006, 09:26:03 AM
I am thinking that one should toss in a html_entity_decode() (PHP Manual (http://se2.php.net/manual/en/function.html-entity-decode.php)) somewhere in there? (Or some other equivialent function)

Code:
function ajaxpostcomment () {
s = $("commentary").value;
postcontents = "lastid="+lastcommentid+"&mode=addcomment&insertcommentary="+window.escape(s)+"&section='.urlencode($args['section']).'&talkline='.urlencode($args['talkline']).'&schema='.urlencode($args['schema']).'"
var request = new Ajax.Request(
"ajaxcommentary.php",
{
method: "post",
postBody: postcontents,
onSuccess: ajaxpostsuccess,
onFailure: ajaxpostfail
});
return false;
}


Title: Re: AJAX based chat
Post by: Ernesto on November 13, 2006, 09:29:14 AM
On the urlencode subject, there is a post menioning problems with urlencode and JavaScript escape functions, which can render content impossible to deencode using the php deencode functions.

A workaround is suggested to be  (http://www.webtoolkit.info/javascript-url-decode-encode.htmlthis[/url)


Title: Re: AJAX based chat
Post by: zachattack on December 23, 2006, 10:48:49 PM
ok I've tried everything with this module, and obviously I'm doing something wrong, am I installing it wrong or something, but I've tried and tried and tried and every time I get nothing, I and Setsuke here have tried this module, and I'm baffled why I can't get it working, I've tried all kinds of versions of IE and Mozzila and still nothing.


Title: Re: AJAX based chat
Post by: Ernesto on December 28, 2006, 02:27:49 AM
There are some bugs with absolute file paths in it, list me the files and the folder structure in the ZIP file and I can give you my working fixed files


Title: Re: AJAX based chat
Post by: SaucyWench on December 28, 2006, 05:31:37 PM
DISABLE COLLAPSIBLE CONTENT SECTIONS (core file).

It's not the chat module's fault. It's JavaScript - it doesn't like to share.

I'd say to disable the collapse module anyway, even if you don't run the chat module. It allows players to hide stuff they should be reading. If you are like me and like to shove important messages into the village area so they players them (instead of blocking motd messages), then your messages still hide if collapse is allowed.


Title: Re: AJAX based chat
Post by: zachattack on December 28, 2006, 05:38:33 PM
I'm a bit confused so is that the only problem? If it is than their we go lol, of course.  ;D  I wish someone had put a readme in there.


Title: Re: AJAX based chat
Post by: SaucyWench on December 28, 2006, 06:17:25 PM
How should I know? You provided almost nothing in the way of information on your error. Perhaps you should try my suggestion to see if it solves the problem. My crystal ball is outta whack.


Title: Re: AJAX based chat
Post by: zachattack on December 28, 2006, 06:32:34 PM
Ok I'm using version 1.0.6
 I've got all the modules, in the right places, I believe so, the js, is where is suppose to be edited the commentary exactly.
I have an extra copy of the file right here.


Title: Re: AJAX based chat
Post by: edmund on January 02, 2007, 05:42:10 PM
There was a reason I personally never released this module, actually several reasons, the version that I put up early for download was early release compared to what I've been working on, and yes, I was waiting to release till I knew what modifications I was going to have to further make to make sure it is compatible with 1.1.1


Title: Re: AJAX based chat
Post by: deatheater on May 16, 2007, 05:19:16 PM
Just wondering if this has been updated for 1.1.1?


Title: Re: AJAX based chat
Post by: SaucyWench on May 17, 2007, 12:13:11 AM
There haven't been any major changes to the commentary in 1.1.1 that I know of (I will be corrected if there have I am sure) so it should "work" ok. Some of the colour codes were adjusted though so the preview might not show one or two of the colours - although they will work once you press enter.

Remember that the module was not 100% bug free and contains exploits for code-y-players to be able to see into other towns/clans, so make sure your game isn't going to be affected if they can do it.


Title: Re: AJAX based chat
Post by: Nightborn on May 17, 2007, 02:06:14 AM
commentary changes I made:

introduced /game

introduced a count of chars in the preview

(now I am not sure, it's about a year ago if it was me or already in 1.1.0)
added [DEL] beside the posts in the chats to delete them directly

you have to consider them, I patched around in the commentary at quite some locations.


Title: Re: AJAX based chat
Post by: SaucyWench on May 17, 2007, 03:00:19 AM
Ah yes my bad. I had completely forgotten that to install the ajax chat you have to replace the core file for commentary.php .

Simplest thing would be to compare commentary.php from 1.0.6 to the commentary.php released with the ajax chat - you will see the differences - and put those changes into the 1.1.1 version of commentary.php .

Without them you will "undo" all Nightborn's changes as the AJAX chat will not work unless you use the supplied version of commentary.

(The [DEL] buttons weren't in 1.1.0, Nightborn, because I remember seeing them when I did the 1.1.1 upgrade on a test server.)


Title: Re: AJAX based chat
Post by: Stryfe on May 23, 2007, 02:30:41 PM
Im trying to install this on my server, only i dont understand where the Javascript folder/modules go. can someone help if possible?


Title: Re: AJAX based chat
Post by: SaucyWench on May 23, 2007, 03:02:52 PM
All files are uploaded with file structure intact.

Please ensure you have all the required knowledge to install and run legend of the green dragon. You have been told before.

We do not provide assistance on learning the minimum requirements apart from pointing you on where to find the information. All the required information is detailed in

1. Bright red link on DragonPrime
2. "Installing the game" tutorial here
3. DragonPedia


Title: Re: AJAX based chat
Post by: Stryfe on May 23, 2007, 03:57:32 PM
right i figured out how to do it. Thanks anyway


Title: Re: AJAX based chat
Post by: Diego6666 on June 02, 2007, 08:43:02 PM
I LOVE this module! thank you!  ;D


Title: Re: AJAX based chat
Post by: Heaps2 on July 02, 2007, 09:04:45 PM
Ok, here's my problem. I upload all the files, folder, ect. place them in the correct spot, and still, I get nothing. When I post, it deletes from the speak box like it's about to post, but after waiting like 10 minutes, it still didn't show up. It even showed me the link to Re-activate it! I've had other people take a look at it (Stryfe and Deatheater, (both of them have it on their sites and working)), and they say I have them in the correct places. Could someone please help me?


Title: Re: AJAX based chat
Post by: Boofo on July 14, 2007, 03:08:25 AM
Does anyone have this working on 1.1.1 and maybe the set if files needed for it?


Title: Re: AJAX based chat
Post by: Stryfe on August 12, 2007, 05:50:54 PM
i've been using Ajax on the 1.1.0 version however i only upgraded the game to 1.1.1 today and Ajax stopped working, anyone know how this can be fixed? it would be much appreciated.
Regards
Stryfe


Title: Re: AJAX based chat
Post by: rolland on August 12, 2007, 06:08:47 PM
Does anyone have this working on 1.1.1 and maybe the set if files needed for it?

DeathEater on Hobbit Quest (http://hobbitquest.com) does.


Title: Re: AJAX based chat
Post by: sixf00t4 on August 31, 2007, 11:37:17 PM
what site does edmund run?  I'm curious to see his core edits.


Title: Re: AJAX based chat
Post by: Nightborn on September 01, 2007, 01:06:10 AM
=) why not petition and ask for them?


Title: Re: AJAX based chat
Post by: Oridin on September 01, 2007, 05:57:34 AM
he's on Hogwarts Live I think.. not the owner but the next in charge.


Title: Re: AJAX based chat
Post by: rolland on September 01, 2007, 06:26:02 AM
He runs the coding side of things.


Title: Re: AJAX based chat
Post by: sixf00t4 on September 01, 2007, 09:01:54 AM
=) why not petition and ask for them?
  why not quit being an arse?  That's why i asked what site he ran.


Title: Re: AJAX based chat
Post by: Oridin on September 01, 2007, 09:05:51 AM
i know where the code place for HL is!

http://lotgd.ariadoss.com

That is what you are looking for yes?


Title: Re: AJAX based chat
Post by: Snarkie on September 01, 2007, 12:17:40 PM
Edmund does not run any site. His LoTGD Modules can be found at http://www.capslog.info/lotgd/

EDIT:What I meant was, Edmund doesn't own a Legend Of the Green Dragon Game


Title: Re: AJAX based chat
Post by: WitchyWoman on September 01, 2007, 03:56:44 PM
what site does edmund run?  I'm curious to see his core edits.

Oridin and Rolland are correct...Edmund runs the coding side of things on HogwartsLive. If Snarkie's link (http://www.capslog.info/lotgd/) doesn't give you the information you want, you can petition on HL and I will make sure he gets it :)


Title: Re: AJAX based chat
Post by: sixf00t4 on September 06, 2007, 09:30:22 AM
Kinda hard to petition on HL when you can't send a petition without being logged in.

How about you guys just report your core edits?  releasing files, especially when you have no idea what version they're from and they contain no comments as to what was changed in the file, doesn't really do the community any help.

I would really encourage you to be a little more thorough while making core edits, don't just think "it works for me, everyone else is on they're own."  That's really against the community aspect that we thrive on here.

If you could relay a message to edmund that we're requesting any and all core edits, that'd be swell.


Title: Re: AJAX based chat
Post by: WitchyWoman on September 06, 2007, 11:01:39 PM
I will pass the message along to both Danilo and Edmund for you :)


Title: Re: AJAX based chat
Post by: coolgames on September 07, 2007, 04:36:59 AM
can;t you contact them directly ??
why not just look one of their DP profiles and Email,Chat etc... them ??  ;)



Title: Re: AJAX based chat
Post by: Ariadoss on September 07, 2007, 06:53:31 PM
Kinda hard to petition on HL when you can't send a petition without being logged in.

How about you guys just report your core edits?  releasing files, especially when you have no idea what version they're from and they contain no comments as to what was changed in the file, doesn't really do the community any help.

I would really encourage you to be a little more thorough while making core edits, don't just think "it works for me, everyone else is on they're own."  That's really against the community aspect that we thrive on here.

If you could relay a message to edmund that we're requesting any and all core edits, that'd be swell.

A lot of my [core] edits would really be useless to anyone else. I wouldn't even remember what modules interacted with them, or if they were textual alterations or alterations to the code. I was considering using CVS so I could compare HL with an unedited copy of lotgd, but until I have time to set something like that up you'll just have to make do with my files (though I doubt anyone would find them useful). As for Edmund I believe he's tried to stay away from the core as much as possible. And the one file (I believe it's one) he modified for the AJAX chat is inside the zip archive for it.

His code can be found here:
http://www.capslog.info/lotgd/
Mine here (I haven't edited anything in ages):
http://lotgd.ariadoss.com/ - click on core_files

We have petitions from non-logged in users disabled, because we were getting a lot of spam, but you can contact help[at]hogwartslive[dot]com or if you want to get to me directly headmaster[at]hogwartslive[dot]com

Also, I know Nick/Edmund has helped people in the past get the AJAX chat setup when they contacted him. I'll make sure to ask him if there's anything missing though. :)


Title: Re: AJAX based chat
Post by: edmund on September 08, 2007, 01:50:21 PM
Kinda hard to petition on HL when you can't send a petition without being logged in.

How about you guys just report your core edits?  releasing files, especially when you have no idea what version they're from and they contain no comments as to what was changed in the file, doesn't really do the community any help.

I would really encourage you to be a little more thorough while making core edits, don't just think "it works for me, everyone else is on they're own."  That's really against the community aspect that we thrive on here.

If you could relay a message to edmund that we're requesting any and all core edits, that'd be swell.

I have said before that the AJAX chat was from 1.0.6, though I know people who have had no problem making it work on 1.1.0 and 1.1.1, I also said it was far from done and tht whenever I get around to finishing a copy that would work on just about every version I'd release an actual package.  I've been working on this more lately, trying to increase the speed and reduce the queries.

The only files from the core changed are in the zip, no other files were changed, and I've made no other core changes for any other modules, at least not in this version, I have been working on a massive modification of the game that changes a lot of core files, to work with a slightly different game play flow, but it is nowhere near ready for release even in an alpha form, and I'm under no obligation under the license to release that code at all, though I'm planning on it.

You know I'm a bit sick of the implication that i don't do my fair share in the community, I release my code and modules, I help people as much as I can, to be told that I'm acting "against the community aspect that we thrive on here" is a bit disappointing.

You know that the CCL that LOTGD is under doesn't require that I release any of my changes back to anyone, it only requires that if I DO distribute changes, that I have to make those changes available on the same license.

It requires
1) That I give credit back to the owners of the license
2) That I only use it for noncommercial purposes
3) That if I release my changes, I have to release it under the same or compatible license to the by-nc-sa 2.0 license

That said, I have always been happy to release the modules that I have made when I feel that they are not too hackish.

For example I have a new module I want to release for handling raffles in a legal way, at the moment however it doesn't have an admin frontend for adding and editing the actual raffles, all the user-frontend is done, but the admin frontend isn't even close, so I'm not going to release it yet.  I will gladly release it when that critical component is in place.


Title: Re: AJAX based chat
Post by: Talisman on September 08, 2007, 02:00:12 PM
While I don't wish to enter into any debate about who's doing what or not here, I should point out that you need to read the license information provided by Eric Stevens on the "about.php?op=license" page:

Quote
"The new license restricts public performance of the work unless the source code of the modified work is made available on demand."

"In plain English, this means that if you put this game on a web server and allow people 'outside of a normal circle of family and its social acquaintances' to play there, then you are publically performing this work and MUST either a) make any and ALL changes which you make to the game available on request (note this doesn't have to be available via the online source display link, but they must be able to ask you for the code AND receive a complete copy), b) make arrangements privately with the authors wherein they grant you a special license, or c) remove the code entirely from the machine."

It is within this section where terms of using the LoGD game code DO require you to make any changes to the core game code available upon request, and any modules which depend upon those changes in order to function.

OR, you must make arrangements with Eric Stevens and JT Traub to permit you to withhold those changes.

In the meantime, let's get this thread back ontopic - AJAX Chat.


Title: Re: AJAX based chat
Post by: deatheater on September 10, 2007, 02:36:47 PM
The current module that is available for download from (http://www.capslog.info/lotgd/) is version 1.11 of this software.  It is buggy, does not work on 1.1.1.

The version that is being used on Hogwarts Live is 1.13.

I have tried contacting Edmund to have him release this, but to no avail.

I have been able to debug some of 1.11 & was able to make it successfully work on 1.1.1. I am stuck with the following problem though. Everytime the timeout occurs, I get the "FAQ Muted" warning.

Any help?

DE


Title: Re: AJAX based chat
Post by: rolland on September 10, 2007, 02:49:29 PM
Can you attach the code?


Title: Re: AJAX based chat
Post by: deatheater on September 10, 2007, 08:31:17 PM
Can you attach the code?

The code to what?


Title: Re: AJAX based chat
Post by: rolland on September 11, 2007, 08:30:39 AM
Can you attach the code?

The code to what?

The code you have working on 1.1.1, its hard for people to fix bugs in code they cant see.


Title: Re: AJAX based chat
Post by: Ariadoss on September 11, 2007, 02:42:33 PM
While I don't wish to enter into any debate about who's doing what or not here, I should point out that you need to read the license information provided by Eric Stevens on the "about.php?op=license" page:

Quote
"The new license restricts public performance of the work unless the source code of the modified work is made available on demand."

"In plain English, this means that if you put this game on a web server and allow people 'outside of a normal circle of family and its social acquaintances' to play there, then you are publically performing this work and MUST either a) make any and ALL changes which you make to the game available on request (note this doesn't have to be available via the online source display link, but they must be able to ask you for the code AND receive a complete copy), b) make arrangements privately with the authors wherein they grant you a special license, or c) remove the code entirely from the machine."

It is within this section where terms of using the LoGD game code DO require you to make any changes to the core game code available upon request, and any modules which depend upon those changes in order to function.

OR, you must make arrangements with Eric Stevens and JT Traub to permit you to withhold those changes.

In the meantime, let's get this thread back ontopic - AJAX Chat.

Just to clear something up:
Talisman, I think you misunderstood him, Edmund is modifying the core in a private copy of the game that only he currently has access to - it's not on a live site, so I'm pretty sure he's not obligated to release that code under the license.

To everyone else:
The AJAX chat was originally written for a site that's running 1.0.6, you shouldn't expect it to be compatible with any other version. If someone modifies it to work for a version they're running perhaps they should post the changes in this forum?


Title: Re: AJAX based chat
Post by: Elessa on September 11, 2007, 02:49:51 PM
To everyone else:
The AJAX chat was originally written for a site that's running 1.0.6, you shouldn't expect it to be compatible with any other version. If someone modifies it to work for a version they're running perhaps they should post the changes in this forum?


makes sense to me.  i suspect others have upgraded it to work with newer releases of the core.



Title: Re: AJAX based chat
Post by: Talisman on September 11, 2007, 04:26:52 PM
Just to clear something up:
Talisman, I think you misunderstood him, Edmund is modifying the core in a private copy of the game that only he currently has access to - it's not on a live site, so I'm pretty sure he's not obligated to release that code under the license.

No misunderstanding - he never indicated it was a private site, however your comment is correct - modifications on a private server can be withheld.

Quote
To everyone else:
The AJAX chat was originally written for a site that's running 1.0.6, you shouldn't expect it to be compatible with any other version. If someone modifies it to work for a version they're running perhaps they should post the changes in this forum?

Nobody expects it to work, which is why they're discussing how to get it working.  That's part of the purpose of this forum, so this sort of discussion should be expected, whether the original author chooses to participate or not.


Title: Re: AJAX based chat
Post by: deatheater on September 13, 2007, 12:18:44 AM
The code you have working on 1.1.1, its hard for people to fix bugs in code they cant see.

I didn't update the actual code, but rather just overwrite the commentary.php file in the lib directory.


Title: Re: AJAX based chat
Post by: deatheater on September 21, 2007, 07:17:33 PM
I'm just bumping this thread to see if anybody would know how to fix this..

DE


Title: Re: AJAX based chat
Post by: edmund on September 22, 2007, 11:45:51 AM
you cannot simply overwrite the lib/commentary.php in 1.1.1 with a version that was written for 1.0.6, the other code is different, you'll have to merge changes.  At some point I'll write a version specifically for 1.1.1, but as I don't have a 1.1.1 based game, there is little incentive for me to actually go through that trouble, at the moment I'm more concerned about making the chat more efficient.


Title: Re: AJAX based chat
Post by: Nightborn on September 23, 2007, 01:59:54 AM
 :) you did actually read the changelog and find those changes for your game useless? Sad indeed.

Maybe I can present you some more :D


Title: Re: AJAX based chat
Post by: Oridin on November 08, 2007, 03:52:13 PM
I suppose this is the official thread for ajax commentary. I was told to post in the module's thread stating that this module does not work with the 1.1.1+R.C. release of the LoGD core code.


Title: Re: AJAX based chat
Post by: Elessa on November 08, 2007, 03:56:54 PM
I suppose this is the official thread for ajax commentary. I was told to post in the module's thread stating that this module does not work with the 1.1.1+R.C. release of the LoGD core code.

realise that there isn't a version written for v 1.1.1.  edmund, the author, hasn't created one.

if someone has tinkered with the module to make it work with the beta, they should indicate how it was done. perhaps they can figure out what is different between the beta and the RC.


Title: Re: AJAX based chat
Post by: Oridin on November 08, 2007, 07:25:34 PM
Problem has been solved. Forgot to replace the /lib commentary php file.


Title: Re: AJAX based chat
Post by: chernobyl_ on October 21, 2008, 01:23:31 PM
Hello everyone,

I'm bringing up this old thread to let you know that I have patched edmund's AJAX-based commentary to make it compatible with version 1.1.1 of the game. The patched core files are based on 1.1.1, so you can safely replace the original files with them.

Other fixes and updates:
- the Bio links now work with the game's forced navigation system (no need for the "evil" patch in bio.php)
- Unicode support (hopefully)
- the refresh interval can be configured in the module settings

It hasn't been tested thoroughly, so use at your own risk; let me know if you find any bugs.
I hope this will help and encourage the development team to add support for such a feature in the LOGD 1.2.0 core :)

Download link: http://bossakov.eu/uploads/logd/ajaxcommentary.zip


Title: Re: AJAX based chat
Post by: CavemanJoe on November 17, 2008, 08:14:33 AM
Bug reports:

Some of my players are reporting problems using `0 and `& colour codes.  Apparently the text breaks off and stops at the point where they type the colour code.  Example:

Example `0Message
Renders as:
Example `0

Also, you've got a typo - "Live updated stoped due to inactivity"

In all other respects, thanks for a great module! :)



Title: Re: AJAX based chat
Post by: chernobyl_ on November 18, 2008, 10:28:05 AM
Thanks.
You can get an updated version at the same download link.

  • brackets in clan names are now colored to reflect the clan rank
  • fixed support for `& color code
  • fixed typo ("live updates stopped due to inactivity")


Title: Re: AJAX based chat
Post by: CavemanJoe on November 18, 2008, 09:16:44 PM
Woo!

Just noticed that using the /game switch doesn't seem to be supported yet.  Any chance of sticking that in too?

EDIT: To elaborate:

Using /game in commentary will enter the text into the commentary system - it can be seen after you nav away and then back to the commentary area.  However, when the chat updates, /game commentary cannot be seen.


Title: Re: AJAX based chat
Post by: ChrisDS on December 30, 2008, 12:55:49 PM
Hey guys I tried installing this and got an error...

Fatal error: require_once() [function.require]: Failed opening required 'lib/forms.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/ndspower/public_html/logd/lib/commentary.php on line 637

does this mean anything to anyone. This happens when I copy over my lib/commentaty.php
I am running 1.1.0
I would really like to try this out. Thanks.


Title: Re: AJAX based chat
Post by: chernobyl_ on December 31, 2008, 07:17:17 AM
Sorry, this will only work with LotGD 1.1.1. If for some reason you can't upgrade your game, somewhere up this thread you can find an older version of the AJAX chat which is made for 1.1.0. Good luck!


Title: Re: AJAX based chat
Post by: dzNick on August 11, 2009, 03:08:40 AM
Sorry to bump this topic, but I was wondering, is this AJAX comentary module compatable with the stable version 1.1.2?


Title: Re: AJAX based chat
Post by: Edward on August 11, 2009, 04:41:53 AM
Sorry to bump this topic, but I was wondering, is this AJAX comentary module compatable with the stable version 1.1.2?


That is a good question; I guess the only answer at the moment would be to try it out, compare the files of 1.1.0, and the current version. I have a sinking suspicion that it wont work though, :-/...


Title: Re: AJAX based chat
Post by: jerry on August 11, 2009, 05:17:18 AM
Sorry to bump this topic, but I was wondering, is this AJAX comentary module compatable with the stable version 1.1.2?


That is a good question; I guess the only answer at the moment would be to try it out, compare the files of 1.1.0, and the current version. I have a sinking suspicion that it wont work though, :-/...

no it will not :p
I've tried it.


Title: Re: AJAX based chat
Post by: dzNick on August 11, 2009, 12:28:56 PM
Sorry to bump this topic, but I was wondering, is this AJAX comentary module compatable with the stable version 1.1.2?


That is a good question; I guess the only answer at the moment would be to try it out, compare the files of 1.1.0, and the current version. I have a sinking suspicion that it wont work though, :-/...

no it will not :p
I've tried it.
Ah. Thanks guys. =p


Title: Re: AJAX based chat
Post by: JollyGG on August 12, 2009, 12:28:45 AM
hmm, I won't upgrade my sites until then, then :P

Tho I DO have a question...why can't AJAX Commentary work with more than 3 cities?


Title: Re: AJAX based chat
Post by: Uchiha Dave on November 13, 2009, 09:02:26 AM
Isnt there an instruction on where to put the files


Title: Re: AJAX based chat
Post by: jerry on November 13, 2009, 04:24:07 PM
Isnt there an instruction on where to put the files

It's not compatible with 1.1.1


Title: What Version Is AJAX Commentary?
Post by: Brendan on February 17, 2010, 03:29:30 PM
Can someone tell me what version Ajax chat is for? people say 1.1.1, then i read a topic saying it isnt compatible with it..

I have it on my 1.1.1 but it doesnt work, i dont get any errors, but i have it turned on and i still have to refresh to see new posts or when i post it refreshes.


Title: Re: What Version Is AJAX Commentary?
Post by: JollyGG on February 17, 2010, 04:08:41 PM
My copy of Ajax chat works with 1.1.1


Title: Re: What Version Is AJAX Commentary?
Post by: Brendan on February 17, 2010, 04:15:59 PM
Could you tell me how to install it properly please, i have tried placing the folders everywhere.

I have.

Code:
maindir/modules/ajaxcommentary.php
maindir/modules/modules/lib/json.php
maindir/modules/modules/moderate.php
maindir/modules/modules/ajaxcommentary.php
maindir/modules/js/json
maindir/module/js/prototype
and i have overritten the commentary with the /lib/commentary.php


Title: Re: AJAX based chat
Post by: Brendan on February 17, 2010, 05:39:07 PM
This thread does not tell you how to install it, and where all the mods go.

Or if your bumping it to tell me it isnt compatible with 1.1.1 it is.

I have seen it on 1.1.1 sites, without and changes done to it.

Im sure Jolly hasnt changed anything in it either, or he would of said.


Title: Re: AJAX based chat
Post by: Elessa on February 17, 2010, 05:44:55 PM
this is the discussion thread for the module, which has been and is buggy.     this is a module that hasn't been publicly released as a functioning module.

someone has an attachment in here that supposedly works with 1.1.1.

there are people who say it doesn't and never has. it would be nice if someone could figure out how. 

if you have seen it working on a site, ask that admin for a copy of their module.


Title: Re: AJAX based chat
Post by: Brendan on February 17, 2010, 05:55:30 PM
I have a copy of it, i have it installed i just dont know where the files go in the directory for it to work.


Title: Re: AJAX based chat
Post by: Elessa on February 17, 2010, 06:20:17 PM
I have a copy of it, i have it installed i just dont know where the files go in the directory for it to work.

have you replaced the commentary.php version with 1.0.6? that is the only "fix" i have seen, that kind of allows the module to work. 

also, i have just spent close to an hour combing all threads where the topic for the module is discussed. interestingly not a single one provides any information on actual installation.  was there anything special with this or does it follow the standard module installation guidelines (http://wiki.dragonprime.net/index.php?title=Many_Modules#How_to_Install_Modules)?  has anyone created a readme.txt for this module that will share?


Title: Re: AJAX based chat
Post by: Brendan on February 17, 2010, 07:07:44 PM
I replaced my commentary.php with the commentary.php that comes with the ajax module, if that is the 1.0.6 one.


Title: Re: AJAX based chat
Post by: CavemanJoe on February 18, 2010, 08:15:21 AM
I had this working on the Island briefly.

In its present form this module is half module, half core edits - and whenever you try to do something new with commentary (like my commentary icons, /special comments etc), it'll bork real nice and you'll spend ages trying to get it working with your new commentary goodness.

Also the extra server load this tends to generate is significant.  If you're running a popular game, you'll be scrabbling to reduce resource consumption.

My advice right now is not to try installing this module as it is - it needs either turning into a self-contained module or baking into the core.  I may take this up at a later date.


Title: Re: AJAX based chat
Post by: Silient on October 13, 2010, 11:20:20 AM



Hello everyone,

I'm bringing up this old thread to let you know that I have patched edmund's AJAX-based commentary to make it compatible with version 1.1.1 of the game. The patched core files are based on 1.1.1, so you can safely replace the original files with them.

Other fixes and updates:
- the Bio links now work with the game's forced navigation system (no need for the "evil" patch in bio.php)
- Unicode support (hopefully)
- the refresh interval can be configured in the module settings

It hasn't been tested thoroughly, so use at your own risk; let me know if you find any bugs.
I hope this will help and encourage the development team to add support for such a feature in the LOGD 1.2.0 core :)

Download link: http://bossakov.eu/uploads/logd/ajaxcommentary.zip


So...Yes. It works with 1.1.1 the question a lot of people have is, after we download, where do the files go?
I have a theory that I will test after I post this, i'll let you know how it works.

edit: I managed to ind where everything goes, Lib in libs, modules in modules, libs (inside modules in the file) in the modules lib. etc etc. I couldn't find where the .JS files wen though...But I didn't break anything and the module installed so...yeah. I'm 99.9% percent sure if I place those where they go it will start working.


Title: Re: AJAX based chat
Post by: robbace on October 13, 2010, 12:56:28 PM
WOW I was just thinking last night if we could use ajax for this very thing! You guys are amazing. I'm running 1.1.2 and it works good thus far. Color too.

As far as where the files go it was pretty self explanatory.  The files in the zip are laid out like the root folder in the game.  Be sure to rename the old files that it will overwrite encase you don't dig it.

Robbace


Title: Re: AJAX based chat
Post by: Silient on October 13, 2010, 01:13:59 PM
WOW I was just thinking last night if we could use ajax for this very thing! You guys are amazing. I'm running 1.1.2 and it works good thus far. Color too.

As far as where the files go it was pretty self explanatory.  The files in the zip are laid out like the root folder in the game.  Be sure to rename the old files that it will overwrite encase you don't dig it.

Robbace

Mind telling us exactly where the Javescript (.JS) files go? I haven't been able to find them?


Title: Re: AJAX based chat
Post by: Stephen Kise on October 13, 2010, 01:20:40 PM
For those who are running on a localized, port forwarded system for Ubuntu 10.04 Lucid Linux.. (Lampp).. You will need some more stuff to modify.. Each file that you put in the htdocs will need to be given the permissions correctly..

Right click and go to 'Properties'..
Go to the 'Permissions' tab..
Make the owner as your user name.. Not root.. Then Read and Write..
Make the group and others with your username, not the root, and give the access 'Read Only'

Hope that helps anyone who has the same config as me.


Title: Re: AJAX based chat
Post by: Stephen Kise on October 13, 2010, 01:21:59 PM
WOW I was just thinking last night if we could use ajax for this very thing! You guys are amazing. I'm running 1.1.2 and it works good thus far. Color too.

As far as where the files go it was pretty self explanatory.  The files in the zip are laid out like the root folder in the game.  Be sure to rename the old files that it will overwrite encase you don't dig it.

Robbace

Mind telling us exactly where the Javescript (.JS) files go? I haven't been able to find them?
Drop everything in the root.... .js files will go in the newly made js folder in the root.. EXCEPT for the JSON.js in the modules/lib folder


Title: Re: AJAX based chat
Post by: robbace on October 13, 2010, 01:34:32 PM
For those who are running on a localized, port forwarded system for Ubuntu 10.04 Lucid Linux.. (Lampp).. You will need some more stuff to modify.. Each file that you put in the htdocs will need to be given the permissions correctly..

Right click and go to 'Properties'..
Go to the 'Permissions' tab..
Make the owner as your user name.. Not root.. Then Read and Write..
Make the group and others with your username, not the root, and give the access 'Read Only'

Hope that helps anyone who has the same config as me.


I'm running Debian 5 with LXDE  I notice when the commentary refreshes and with only myself online Apache puts a 6% load on my CPU. Granted its a weak CPU... it's a VIA C7-D 1.5ghz chip.  It was one of those Everex Green Linux PC's for $199.  

Something to consider once I get more players.  Maybe start a Core i7 server fund :)

Robbace


Title: Re: AJAX based chat
Post by: Silient on October 13, 2010, 02:16:25 PM
WOW I was just thinking last night if we could use ajax for this very thing! You guys are amazing. I'm running 1.1.2 and it works good thus far. Color too.

As far as where the files go it was pretty self explanatory.  The files in the zip are laid out like the root folder in the game.  Be sure to rename the old files that it will overwrite encase you don't dig it.

Robbace

Mind telling us exactly where the Javescript (.JS) files go? I haven't been able to find them?
Drop everything in the root.... .js files will go in the newly made js folder in the root.. EXCEPT for the JSON.js in the modules/lib folder

Thank you. I did that with the two JS files and it worked.


Title: Re: AJAX based chat
Post by: robbace on October 13, 2010, 03:18:57 PM
Noticed it doesn't work on the Isle of Wen. Bummer. I like to float around there sometimes and be on hand to help answer Newbies questions.


Title: Re: AJAX based chat
Post by: Aeolus on October 08, 2012, 08:38:47 PM
Woo!

Just noticed that using the /game switch doesn't seem to be supported yet.  Any chance of sticking that in too?

EDIT: To elaborate:

Using /game in commentary will enter the text into the commentary system - it can be seen after you nav away and then back to the commentary area.  However, when the chat updates, /game commentary cannot be seen.

Apologies for raising an old topic.. But has anyone been able to fix this? I've taken a look here and there, but haven't been able to find anywhere to put it. o.o


Title: Re: AJAX based chat
Post by: Nder' on October 09, 2012, 01:07:18 PM
I have a copy of it, i have it installed i just dont know where the files go in the directory for it to work.

have you replaced the commentary.php version with 1.0.6? that is the only "fix" i have seen, that kind of allows the module to work. 

also, i have just spent close to an hour combing all threads where the topic for the module is discussed. interestingly not a single one provides any information on actual installation.  was there anything special with this or does it follow the standard module installation guidelines (http://wiki.dragonprime.net/index.php?title=Many_Modules#How_to_Install_Modules)?  has anyone created a readme.txt for this module that will share?

Has anyone made a readme on how to install it?


Title: Re: AJAX based chat
Post by: Aeolus on October 09, 2012, 01:48:35 PM
I have a copy of it, i have it installed i just dont know where the files go in the directory for it to work.

have you replaced the commentary.php version with 1.0.6? that is the only "fix" i have seen, that kind of allows the module to work. 

also, i have just spent close to an hour combing all threads where the topic for the module is discussed. interestingly not a single one provides any information on actual installation.  was there anything special with this or does it follow the standard module installation guidelines (http://wiki.dragonprime.net/index.php?title=Many_Modules#How_to_Install_Modules)?  has anyone created a readme.txt for this module that will share?

Has anyone made a readme on how to install it?

It's just extract the .zip/.rar file, and upload everything straight to the root file, the structure of the files kept.


Title: Re: AJAX based chat
Post by: Nder' on January 01, 2013, 07:03:06 PM
Is there any way to allow AJAX commentary for some villages but not others? I ask this as most of the NPC's (if not all) don't seem to like Live Chat.


Title: Re: AJAX based chat
Post by: Aeolus on January 09, 2013, 09:46:24 AM
Is there any way to allow AJAX commentary for some villages but not others? I ask this as most of the NPC's (if not all) don't seem to like Live Chat.

Not exactly sure myself, but take a look at how the user pref works between switching between using AJAX and not using it, then incorporate it as a setting.


Title: Re: AJAX based chat
Post by: Aeolus on March 22, 2013, 02:15:33 PM
Woo!

Just noticed that using the /game switch doesn't seem to be supported yet.  Any chance of sticking that in too?

EDIT: To elaborate:

Using /game in commentary will enter the text into the commentary system - it can be seen after you nav away and then back to the commentary area.  However, when the chat updates, /game commentary cannot be seen.

There is a quick and simply solution to this - two edits required to ./ajaxcommentary.php.

Replace:
Code:
db_prefix("commentary") . " INNER JOIN " .
With:
Code:
db_prefix("commentary") . " LEFT JOIN " .

Replace:
Code:
db_prefix("accounts") . ".locked=0 ORDER BY commentid DESC LIMIT $limit";
With:
Code:
"( ".db_prefix("accounts") . ".locked=0 OR ".db_prefix("accounts") .".locked is null ) ORDER BY commentid DESC LIMIT $limit";

And voila! It works! (Except it only works when there's a normal post present.. A chat consisting of only Gamemaster posts doesn't work.)


Title: Re: AJAX based chat
Post by: Aeolus on November 06, 2013, 04:51:53 PM
Bug reports:

Some of my players are reporting problems using `0 and `& colour codes.  Apparently the text breaks off and stops at the point where they type the colour code.

For those still having this issue with this version (http://dragonprime.net/index.php?topic=3865.msg83322#msg83322), in modules/ajaxcommentary.php, simply replace +s+ with +encodeURIComponent(s)+ on line 120.


Title: Re: AJAX based chat
Post by: megaspeek on December 23, 2013, 09:00:55 AM
Hey, I installed everything to the root folder and activated the module but the chat doesn't seem to be working. I tested it and I still have to refresh the page to view updates even though the module is active and the files are set in the root folder.


Title: Re: AJAX based chat
Post by: Aeolus on December 23, 2013, 10:17:34 AM
Not all of the files, right? You need to keep the directory structure as well (i.e. files in the modules folder (in the AJAX download) go into your sites modules folder, same with lib, etc).

Have you tried turning it off (uninstalling) and turning it back on (installing) again?


Title: Re: AJAX based chat
Post by: president731 on May 22, 2014, 01:02:25 PM
I am having the same issue where I still have to refresh in order to see posts. I have tried uninstalling it and reinstalling it. Everything seems to be in the right place. I am running 1.1.2. Any help would be appreciated. :)


Title: Re: AJAX based chat
Post by: Aeolus on May 22, 2014, 03:10:23 PM
I am having the same issue where I still have to refresh in order to see posts. I have tried uninstalling it and reinstalling it. Everything seems to be in the right place. I am running 1.1.2. Any help would be appreciated. :)

Try clicking Reinstall several times. Works for me for certain things. xD Else, make sure that you have the Live Chat enabled in your prefs.


Title: Re: AJAX based chat
Post by: president731 on May 22, 2014, 03:21:00 PM
Settings are set to yes...I suppose I'll just keep trying then.


Title: Re: AJAX based chat
Post by: president731 on May 22, 2014, 04:02:11 PM
Finally got it working. :)


Title: Re: AJAX based chat
Post by: Aeolus on May 22, 2014, 04:07:33 PM
Finally got it working. :)

Awesome! Make sure that you take notes of the edits posted most recently in this thread to get a well-functioning live chat.


Title: Re: AJAX based chat
Post by: Megan|SaraBeth on January 25, 2015, 03:20:42 PM
Apparently my site causes Javascript errors with this module. I have a screen shot of the errors on the following link. I dont know the first thing about Javascript or how to fix it.  Help would be greatly appreciated. Thanks.

https://dl.dropboxusercontent.com/u/64659251/errors.png


Title: Re: AJAX based chat
Post by: Aeolus on January 25, 2015, 04:09:04 PM
Firstly, it's not Java. Javascript. And the fix is basically given to you on the screenshot - file, error, page number, code to comment out.


Title: Re: AJAX based chat
Post by: Megan|SaraBeth on February 17, 2015, 11:50:45 AM
Is there a way you can tell me how you found those errors or give me another copy of that screen shot since you took it off your dropbox?


Title: Re: AJAX based chat
Post by: Aeolus on February 17, 2015, 01:53:46 PM
Is there a way you can tell me how you found those errors or give me another copy of that screen shot since you took it off your dropbox?

Yeah, the browser's console.


Title: Re: AJAX based chat
Post by: Megan|SaraBeth on March 19, 2015, 10:55:55 AM
Where in the console did you find it? I tried different things and I couldnt find it.


Title: Re: AJAX based chat
Post by: Aeolus on March 19, 2015, 05:17:35 PM
Where in the console did you find it? I tried different things and I couldnt find it.

Literally as soon as you open up the console, there it is. ???


Title: Re: AJAX based chat
Post by: DarknessFalls on March 20, 2015, 07:30:30 AM
Where in the console did you find it? I tried different things and I couldnt find it.


I hope this helps.

How to open the Javascript console in supported browsers:
Chrome/Windows: CTRL+SHIFT+J
Chrome/Mac: CMD+ALT+J
Firefox/Windows: CTRL+SHIFT+I
Firefox/Mac: CMD+ALT+K
Internet Explorer: F12 to open Developer Tools, then click the Console tab or button
Safari: CMD+ALT+C after enabling Develop menu (Go to Preferences > Advanced, enable Show Develop menu in menu bar)
Opera:  CTRL + SHIFT + I


Title: Re: AJAX based chat
Post by: Megan|SaraBeth on March 22, 2015, 03:47:52 PM
Thank you DarknessFalls. Thats what I was getting at. I had no idea how to open the console. I never use it.


Title: Re: AJAX based chat
Post by: DarknessFalls on March 23, 2015, 08:00:36 AM
Not a problem.


Title: Re: AJAX based chat
Post by: Stephen.Kise on October 19, 2016, 03:12:47 PM
Alright, I am not finding an attachment for this module at all. This really should have been added to the downloads section, even if it did require minor core edits. I personally haven't used this module, or have access to the source of the module, to outline possible fixes for the issue I have found. The main issue is that with this chat system, players can view and post to any commentary section they want. Could someone please attach the download, in hopes of providing a patch?


Title: Re: AJAX based chat
Post by: Megan|SaraBeth on October 19, 2016, 06:41:44 PM
As I'd really love to get this patch and have people not post where they aren't supposed to, I'm going to be nice and post the files here for the fix to be implemented. My files are custom edited and these aren't. I'd love to know what the fix is and where it goes. Thanks.


Title: Re: AJAX based chat
Post by: Aeolus on October 19, 2016, 07:43:14 PM
I'd love to know what the fix is and where it goes. Thanks.

Sigh.


Title: Re: AJAX based chat
Post by: Stephen.Kise on October 19, 2016, 08:50:51 PM
As I'd really love to get this patch and have people not post where they aren't supposed to, I'm going to be nice and post the files here for the fix to be implemented. My files are custom edited and these aren't. I'd love to know what the fix is and where it goes. Thanks.

The 'do it for me, because I am here' mentality is almost ascending into a community-wide meme. This mentality needs to change into 'how is this possible?' if you wish to learn. The solution is too complex, it looks like you have to uninstall it.


Title: Re: AJAX based chat
Post by: Megan|SaraBeth on October 19, 2016, 09:11:41 PM
Wow. There really should be an easier way. Like maybe with just making a module that blocks comments from the grotto if you arent staff. I tried to look at it to fix it and I dont understand much about commentary and I tried learning some of the code but when most everything is in the form of an acronym it makes it hard to understand. But I do try at times on my own. Like I did with my MoTDs and then it got to a point where I couldnt figure out my 2 issues no matter what I looked at and everything. So I do try.


Title: Re: AJAX based chat
Post by: Stephen.Kise on October 19, 2016, 09:13:41 PM
Wow. There really should be an easier way. Like maybe with just making a module that blocks comments from the grotto if you arent staff. I tried to look at it to fix it and I dont understand much about commentary and I tried learning some of the code but when most everything is in the form of an acronym it makes it hard to understand. But I do try at times on my own. Like I did with my MoTDs and then it got to a point where I couldnt figure out my 2 issues no matter what I looked at and everything. So I do try.

Well uninstalling is very easy to do. I will provide feedback when I am home.

Carrying the section through session like I did in jquerycommentary should be the quickest answer.


Title: Re: AJAX based chat
Post by: Megan|SaraBeth on October 19, 2016, 09:17:43 PM
I know but unless there is a better live chat to use that is publically available then maybe a module should be used in place of a HUGE fix. Some people like live chat very much.


Title: Re: AJAX based chat
Post by: pharis on September 28, 2017, 03:07:16 PM
Hey, i was just wondering if anyone came up with a solution without tampering with the core code ?
Is this still a thing ?


Title: Re: AJAX based chat
Post by: Aeolus on September 28, 2017, 08:24:10 PM
Hey, i was just wondering if anyone came up with a solution without tampering with the core code ?
Is this still a thing ?

Yes, it's still a thing. No, you cannot use this module without making core alterations, as the hooks required to make it modularized do not exist. (Although, you as such wouldn't directly be making alterations, you'd simply be uploading different versions of existing core files.)


Title: Re: AJAX based chat
Post by: Stephen.Kise on September 29, 2017, 07:20:06 AM
Hey, i was just wondering if anyone came up with a solution without tampering with the core code ?
Is this still a thing ?

Yes, there is a solution without editing the core code - but it is not through this module, since it relies on core editing. All you would need to do is to make an API hook, for your javascript to obtain a JSON of all recent commentary, and display it through your javascript.


Title: Re: AJAX based chat
Post by: pharis on September 30, 2017, 10:08:17 AM
that is a neat idea. :-)

© 2017 DragonPrime - LoGD Resource Community
Email Talisman: talisman -at- gmail.com
&oeXs)2U7=V BmܲV.U e=;p\}eG )Jj} C5EH7ˤH=j } mo|*Ŋw{drV_@IV>/- TFQJ׀̀Ve}l1,V O iNYx͘$e$;
Forums: Powered by SMF 1.1.21 | SMF © 2006-2007, Simple Machines