Author Topic: 2 Questions: ChatConnector , Check if the Server Crashed  (Read 1748 times)

0 Members and 1 Guest are viewing this topic.

Offline captain1342

  • Full Member
  • ***
  • Posts: 104
  • Karma: 6
  • Quality is our standard
    • Aperture Development - Quality is our standard
2 Questions: ChatConnector , Check if the Server Crashed
« on: March 15, 2017, 07:48:30 AM »
So i have a new project I am working on and maybe you know how I should start.

First: I would need for the addon an Build-In chat system which is does not require a server connection and now just the questuion is, What should I use as Chat server?
I thought about some possibilities but what would you prefer?
My Ideas:
Quote
IRC
Discord
It must be aviable clientside ( the script will just run client side )

Second: Is there an easy way to detect a Server crash from the client?

I thought about something complicated using timer's and the net lib but I think there is a simpler way I just don't know yet.

Thanks for reading,

~MG
 PS: Suggestions are welcomed ;)
Aperture Development
Quality is our standard

Website - GitHub  - Forum  - Steam  - Discord

Offline iViscosity

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 803
  • Karma: 58
Re: 2 Questions: ChatConnector , Check if the Server Crashed
« Reply #1 on: March 15, 2017, 08:37:52 AM »
I'm confused about what you're asking in your first question... I know something like Discord Chat Relay exists (costs $3.50, though), if that's sort of what you're asking.

As for your second question, there is another thing: Server Crash Menu & Auto Reconnection, however that costs $3.99. If you don't want to pay (I don't blame you) there is likely a free version of some of those somewhere, but if you'd like to make it yourself (at least for the crashing, not sure about the Discord/IRC), you could add a Think hook (or a timer that ticks every couple seconds) that checks everyone's ping and sees if all of them are the same. Pings constantly fluctuate even on a minor scale (1-2 ms) so if you check every person in a "for" loop for their Player:Ping() and they are all the same, the server most likely crashed. It's best to add another Think hook to check for a crash recovery (or a false-alarm) by storing the ping everyone had when the server crashed (in the first hook) then comparing in the second. If they're different then, it will continue as normal.
I'm iViscosity. I like gaming and programming. Need some help? Shoot me PM.