November 21, 2017, 03:52:46 PM

Author Topic: Live chat - Now ready for alpha testing  (Read 556 times)

Offline Qube

  • Administrator
  • Sr. Member
  • *****
  • Posts: 451
Re: Live chat - Now ready for alpha testing
« Reply #30 on: November 14, 2017, 06:58:20 PM »
Is there a reason for the "^p" rather than using urlencode() and urldecode() which are intended for these things? Maybe your form-encryption is doing some odd stuff?
Why are you requesting a new chat key each second? Isn't that a bit nasty regarding server load/requests-count? These "I am alive and still the same" could be done way less often - and/or before user interaction happens (so check on sending a new line rather than periodically).
I don't use "^p"? - I use urlencode() / urldecode() amongst other things.

There is a very good reason for the key generation. It's also not every second but every three seconds as it checks for new messages and also the users in chat. As javascript calls PHP files they need to be executed securely so users can not call / abuse the those PHP files separately. I can't check for new messages way less often or else having a conversation is going to be really slow.

Until the next time...

Online Derron

  • Full Member
  • ***
  • Posts: 200
Re: Live chat - Now ready for alpha testing
« Reply #31 on: November 14, 2017, 07:16:35 PM »
https://socket.io/get-started/chat/ (and others)


Basic idea is to use WebSockets to allow communication between Server->Client. So instead of your current "client polls server for changes" it becomes a "server informs clients of changes".




Currently you request things on a 3 second interval, yes -  but you request them multiple times (at least with my Chrome):





bye
Ron

Offline Qube

  • Administrator
  • Sr. Member
  • *****
  • Posts: 451
Re: Live chat - Now ready for alpha testing
« Reply #32 on: November 14, 2017, 08:30:47 PM »
Quote
Currently you request things on a 3 second interval, yes -  but you request them multiple times (at least with my Chrome)
That is correct. Calling for a key uses minimal resources so I'm fine with that.

If the chat ever gets like 50+ users in regularly ( highly doubtful ) then it will be recoded to a more efficient system.
Until the next time...

Online Derron

  • Full Member
  • ***
  • Posts: 200
Re: Live chat - Now ready for alpha testing
« Reply #33 on: November 14, 2017, 08:44:05 PM »
Sorry if I did not made it clear enough: you do request the key multiple times per "request cycle". So 2 times at 0s, 2 times at 3s, 2 times at 6s...
I understand, that you request the key again each 3 seconds - but assumed 1 request/3 seconds would be enough.




bye
Ron

Offline Qube

  • Administrator
  • Sr. Member
  • *****
  • Posts: 451
Re: Live chat - Now ready for alpha testing
« Reply #34 on: November 14, 2017, 08:50:36 PM »
Quote
Sorry if I did not made it clear enough: you do request the key multiple times per "request cycle". So 2 times at 0s, 2 times at 3s, 2 times at 6s...
I understand, that you request the key again each 3 seconds - but assumed 1 request/3 seconds would be enough.
Oh I see what you are referring to.. On the version being uploaded tonight it doesn't go mad with key requests. Most of those calls should of been removed days ago, I just forgot about them.
Until the next time...

Offline Qube

  • Administrator
  • Sr. Member
  • *****
  • Posts: 451
Re: Live chat - Now ready for alpha testing
« Reply #35 on: November 15, 2017, 05:01:16 AM »
New version uploaded.

1.. You *should* no longer be logged out at random times.
2.. The chat sounds can now be turned on / off via the new shiny checkbox.
3.. Under the hood - Far less external calls are made to scripts. Thanks to Derron for pointing out there were excessive calls. There were some I knew about about but others I'd forgotten about during the initial coding of the chat room which should of been removed from day one.

There are still a couple of bugs to fix and a new face lift coming but it's progressing.
Until the next time...

Online Derron

  • Full Member
  • ***
  • Posts: 200
Re: Live chat - Now ready for alpha testing
« Reply #36 on: November 15, 2017, 09:13:33 AM »
There is no announcement for users leaving the chat.


bye
Ron

Offline Qube

  • Administrator
  • Sr. Member
  • *****
  • Posts: 451
Re: Live chat - Now ready for alpha testing
« Reply #37 on: November 15, 2017, 01:07:17 PM »
T
There is no announcement for users leaving the chat.
That will be done today :)
Until the next time...

Offline Qube

  • Administrator
  • Sr. Member
  • *****
  • Posts: 451
Re: Live chat - Now ready for alpha testing
« Reply #38 on: November 15, 2017, 07:39:52 PM »
New version uploaded...

1.. Room announcements for members joining and leaving
2.. You should no longer be randomly kicked out after X minutes of being idle
3.. The + sign now works again ( silly javascript )
4.. If you are idle for more then 7 minutes your username goes grey and the time idle is shown next to your username
5.. If you are idle for about an hour you are booted out
Until the next time...

Online Derron

  • Full Member
  • ***
  • Posts: 200
Re: Live chat - Now ready for alpha testing
« Reply #39 on: November 15, 2017, 09:07:19 PM »
Dunno if you updated something now:








bye
Ron

Online Goodlookinguy

  • Full Member
  • ***
  • Posts: 102
    • How to be Unprofessional: A Blitz Research Ltd Story
Re: Live chat - Now ready for alpha testing
« Reply #40 on: November 15, 2017, 09:40:14 PM »
I was about to post that Derron and I have been kicked and reentered several times. Definitely seems to be some issues when people are actively chatting or something.
I'm insane and not in a funny or good way! nrgs.org

Online Derron

  • Full Member
  • ***
  • Posts: 200
Re: Live chat - Now ready for alpha testing
« Reply #41 on: November 15, 2017, 09:41:18 PM »
I chatted with Dabz a while and did not encounter that - so probably this is Qube doing things on the server.

We'll let him do that. Good night ;-)



PS: Closing a chat window does not remove you from the list so soon, doing a /quit is immediately removing the user.


bye
Ron

Offline Qube

  • Administrator
  • Sr. Member
  • *****
  • Posts: 451
Re: Live chat - Now ready for alpha testing
« Reply #42 on: November 15, 2017, 11:37:41 PM »
Quote
I chatted with Dabz a while and did not encounter that - so probably this is Qube doing things on the server.
Yeah, it was me changing code around causing the problems :)

Quote
PS: Closing a chat window does not remove you from the list so soon, doing a /quit is immediately removing the user.
Still need to add an on close event.
Until the next time...

Offline Qube

  • Administrator
  • Sr. Member
  • *****
  • Posts: 451
Re: Live chat - Now ready for alpha testing
« Reply #43 on: November 16, 2017, 03:00:31 AM »
Just for you Derron, the chat now shows the last 10 messages when you enter ;D
Until the next time...

Online Derron

  • Full Member
  • ***
  • Posts: 200
Re: Live chat - Now ready for alpha testing
« Reply #44 on: November 16, 2017, 08:32:59 AM »
bla enters
bla leaves the building
blub enters
...


That's not the kind of messages _most_ people are interested in :-)


bye
Ron