Jump to content


Member Since 06 May 2003
Offline Last Active Sep 22 2016 08:19 PM

Posts I've Made

In Topic: Planned Downtime: Saturday Sept 17th, 12-4am PDT (7-11am UTC)

16 September 2016 - 07:57 PM

:intoxicated:  :thumb-up:  :ph34r:

In Topic: Is it considered bad practice to pass SQL script?

08 September 2016 - 04:36 AM

This series of articles about DI was written by Fabien Potencier, who is the originator of the Symfony frameworks(s). I highly recommend reading through it prior to making a thread on the subject here.

In Topic: Uptime history simplest possible script

31 August 2016 - 10:47 PM

Well intelligent code is a problem since the users that post their server to the listing will have to do something in their side ( in case its curl responding ) which is a little bad idea because more often people are not willing to do anything except giving the best ever description about their game server.

You don't seem to have followed the idea here. The servers being pinged don't need to do anything. Your server is the one that would be attempting to connect to theirs and recording the response.

In Topic: Why Warning "Cannot modify header information" Is NOT Fired ?

31 August 2016 - 09:26 PM

Also it is good practice not to end php scripts with an end tag:


// some code

Remove all those "?>" tags. When you include scripts a spurious newline or extra bit of whitespace after the tag can trigger output, and be hard to track down.

In Topic: Uptime history simplest possible script

31 August 2016 - 09:21 PM

First I don't agree with your assessment. The A2_INFO portion of the protocol is what I would suggest you use. Making a socket connection (or not) tells you nothing about what is running on that socket.

By having intelligent code that actually queries the cogs server, you determine that the server is functioning, what you expect it to be, and in good health. I found this in no time: https://github.com/x...HP-Source-Query

Most of the problem is solved.

Your system needs at least 2 tables:

id int unsigned (primary key) auto_increment
name: varchar
IP: varchar
Port: int

id int unsigned (primary key) auto_increment
server_id: int unsigned (foreign key containing server.id}
status: char[1] (O for Ok, D for Down)
createdAt: timestamp

You will query SELECT * from server and iterate through every row in your master script.

Your detail script which is run by the master script will insert a row in server_status

Timestamp can be omitted from the query, and it will be filled in with the current server timestamp value.

When creating the graphs, you simply need to do some sql to get the range of rows in server_status needed to create the graph for the period you desire. The information in http://www.gizmola.c...different..html should help you figure out how you can do directly in mysql. For these types of purposes timestamps are compatible with datetime columns.