Live chat - Now ready for alpha testing

Started by Qube, November 11, 2017, 18:50:26

Previous topic - Next topic

Qube

Quote from: Derron on November 14, 2017, 09:31:06
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.

Mac Studio M1 Max ( 10 core CPU - 24 core GPU ), 32GB LPDDR5, 512GB SSD,
Beelink SER7 Mini Gaming PC, Ryzen 7 7840HS 8-Core 16-Thread 5.1GHz Processor, 32G DDR5 RAM 1T PCIe 4.0 SSD
MSI MEG 342C 34" QD-OLED Monitor

Until the next time.

Derron

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

Qube

QuoteCurrently 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.
Mac Studio M1 Max ( 10 core CPU - 24 core GPU ), 32GB LPDDR5, 512GB SSD,
Beelink SER7 Mini Gaming PC, Ryzen 7 7840HS 8-Core 16-Thread 5.1GHz Processor, 32G DDR5 RAM 1T PCIe 4.0 SSD
MSI MEG 342C 34" QD-OLED Monitor

Until the next time.

Derron

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

Qube

QuoteSorry 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.
Mac Studio M1 Max ( 10 core CPU - 24 core GPU ), 32GB LPDDR5, 512GB SSD,
Beelink SER7 Mini Gaming PC, Ryzen 7 7840HS 8-Core 16-Thread 5.1GHz Processor, 32G DDR5 RAM 1T PCIe 4.0 SSD
MSI MEG 342C 34" QD-OLED Monitor

Until the next time.

Qube

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.
Mac Studio M1 Max ( 10 core CPU - 24 core GPU ), 32GB LPDDR5, 512GB SSD,
Beelink SER7 Mini Gaming PC, Ryzen 7 7840HS 8-Core 16-Thread 5.1GHz Processor, 32G DDR5 RAM 1T PCIe 4.0 SSD
MSI MEG 342C 34" QD-OLED Monitor

Until the next time.

Derron

There is no announcement for users leaving the chat.


bye
Ron

Qube

T
Quote from: Derron on November 15, 2017, 09:13:33
There is no announcement for users leaving the chat.
That will be done today :)
Mac Studio M1 Max ( 10 core CPU - 24 core GPU ), 32GB LPDDR5, 512GB SSD,
Beelink SER7 Mini Gaming PC, Ryzen 7 7840HS 8-Core 16-Thread 5.1GHz Processor, 32G DDR5 RAM 1T PCIe 4.0 SSD
MSI MEG 342C 34" QD-OLED Monitor

Until the next time.

Qube

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
Mac Studio M1 Max ( 10 core CPU - 24 core GPU ), 32GB LPDDR5, 512GB SSD,
Beelink SER7 Mini Gaming PC, Ryzen 7 7840HS 8-Core 16-Thread 5.1GHz Processor, 32G DDR5 RAM 1T PCIe 4.0 SSD
MSI MEG 342C 34" QD-OLED Monitor

Until the next time.

Derron

Dunno if you updated something now:








bye
Ron

Goodlookinguy

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

Derron

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

Qube

#42
QuoteI 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 :)

QuotePS: 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.
Mac Studio M1 Max ( 10 core CPU - 24 core GPU ), 32GB LPDDR5, 512GB SSD,
Beelink SER7 Mini Gaming PC, Ryzen 7 7840HS 8-Core 16-Thread 5.1GHz Processor, 32G DDR5 RAM 1T PCIe 4.0 SSD
MSI MEG 342C 34" QD-OLED Monitor

Until the next time.

Qube

Just for you Derron, the chat now shows the last 10 messages when you enter ;D
Mac Studio M1 Max ( 10 core CPU - 24 core GPU ), 32GB LPDDR5, 512GB SSD,
Beelink SER7 Mini Gaming PC, Ryzen 7 7840HS 8-Core 16-Thread 5.1GHz Processor, 32G DDR5 RAM 1T PCIe 4.0 SSD
MSI MEG 342C 34" QD-OLED Monitor

Until the next time.

Derron

bla enters
bla leaves the building
blub enters
...


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


bye
Ron