votick Posted August 13, 2012 Share Posted August 13, 2012 (edited) I would like to display the total number of players online accross the total number of game servers running. So far I can display the total number of players online but I can't seem to get back the total number of servers running. E.g. I want to have on my site "## players are online across ## servers. " Is anyone able to help? EDIT: I've done it now works a treat Edited August 14, 2012 by votick Link to comment Share on other sites More sharing options...
exextatic Posted August 25, 2012 Share Posted August 25, 2012 Do you mind telling us what you did to do that? Link to comment Share on other sites More sharing options...
FiendServers Posted April 15, 2013 Share Posted April 15, 2013 Any update? As this would be a neat integration. Also if someone could PM me as how the live stats database grabber actually works that would be amazing! Link to comment Share on other sites More sharing options...
Jaggl Posted April 17, 2013 Share Posted April 17, 2013 yeah would be cool... iam also interested int this Link to comment Share on other sites More sharing options...
brad.vilayer Posted April 17, 2013 Share Posted April 17, 2013 We have it over at vilayer.com Pm me for details or add me on Skype brad.gyton Link to comment Share on other sites More sharing options...
DamienWebb Posted May 18, 2013 Share Posted May 18, 2013 I added you over a week ago Brad but you never responded to the request.... I'd love to get this working. Link to comment Share on other sites More sharing options...
brad.vilayer Posted May 18, 2013 Share Posted May 18, 2013 whats your skype? Link to comment Share on other sites More sharing options...
DamienWebb Posted May 19, 2013 Share Posted May 19, 2013 webb.damien .... thanks alot man really appreciate it =) Link to comment Share on other sites More sharing options...
windrof123 Posted May 20, 2013 Share Posted May 20, 2013 can anyone help me with the same thing ? Link to comment Share on other sites More sharing options...
Jaggl Posted May 27, 2013 Share Posted May 27, 2013 here too would be cool Link to comment Share on other sites More sharing options...
Raizio Posted May 27, 2013 Share Posted May 27, 2013 Why not post it on the forums instead of the endless pm/skype requests? Unless of course you are asking a small fee, in that case I have said nothing Link to comment Share on other sites More sharing options...
Jaggl Posted May 30, 2013 Share Posted May 30, 2013 would be very very nice if you can post the code here.... do you use WHMCS? Link to comment Share on other sites More sharing options...
Duvy Posted June 1, 2013 Share Posted June 1, 2013 SQL Query: SELECT SUM(players) FROM tc_game_service_live_stats Link to comment Share on other sites More sharing options...
Jaggl Posted June 4, 2013 Share Posted June 4, 2013 the problem is that iam to stupid to insert this into our whmcs website Link to comment Share on other sites More sharing options...
Rads Posted June 19, 2013 Share Posted June 19, 2013 You need to create a database connection to the tcadmin database, execute the query on the connections, print the results on the web page. You need to know how to code in php to do this. Link to comment Share on other sites More sharing options...
Jaggl Posted June 20, 2013 Share Posted June 20, 2013 yeah lol and thats the problem... i dont know how to do this :=) Link to comment Share on other sites More sharing options...
Weaklinks Posted June 20, 2013 Share Posted June 20, 2013 Hi , TCAdmin provides some help create a file index.html or what ever name you want it to be and play around with this code. <b>Get a List of Configured Games and Voice Servers<br> </b><font size="2">Required info:<br> - Standard information</font><form action="http://127.0.0.1:8880/billingapi.aspx" method=post> <table border="1" id="table1" style="border-collapse: collapse" bordercolordark="#000000" bordercolorlight="#C0C0C0"> <tr> <td colspan="2" align="center"><b>Standard Information</b></td> <td> </td> <td><font size="2">This information is always required</font></td> </tr> <tr> <td>Admin:</td> <td> <input value="admin" name="tcadmin_username"></td> <td> </td> <td><font size="2">The admin account for the control panel</font></td> </tr> <tr> <td>Password:</td> <td> <input value="password" name="tcadmin_password"></td> <td> </td> <td><font size="2">The admin password</font></td> </tr> <tr> <td>Function:</td> <td> <select size="1" name="function"> <option value="GetSupportedGames" selected>Get Supported Game Servers </option> <option value="GetSupportedVoiceServers">Get Supported Voice Servers </option> </select></td> <td> </td> <td><font size="2">The command that TCAdmin will execute</font></td> </tr> <tr> <td>Response Type:</td> <td><select size="1" name="response_type"> <option value="xml" selected>XML</option> <option value="text">Text</option> </select></td> <td> </td> <td><font size="2">The type of response that will be sent by TCAdmin.</font></td> </tr> <tr> <td colspan="2"> </td> <td> </td> <td> </td> </tr> <tr> <td colspan="4" align="center"> <input type="submit" value="Submit"></td> </tr> </table> </form> Link to comment Share on other sites More sharing options...
votick Posted July 25, 2013 Author Share Posted July 25, 2013 (edited) I came back to look for this script. Checked my archives and I've found it PM me if you would like it. Can view an example on my site of the above code: http://killingceiling.co.uk E.g: Currently there are 57 players on our network playing across 15 online servers. Edited July 25, 2013 by votick Link to comment Share on other sites More sharing options...
Dennis Posted July 25, 2013 Share Posted July 25, 2013 I've sent you a PM. Link to comment Share on other sites More sharing options...
votick Posted July 25, 2013 Author Share Posted July 25, 2013 Ahh seems I can't view PM's :/ Your administrator has disabled private messaging. Link to comment Share on other sites More sharing options...
Dennis Posted July 25, 2013 Share Posted July 25, 2013 Well, the PM is actually an email Link to comment Share on other sites More sharing options...
ringo Posted July 28, 2013 Share Posted July 28, 2013 Here is an edited version from long ago to display total player online out of how many slots and how many servers are online. Database Query File include.php: <?php ini_set('precision', 5); $link = mysql_connect('LOCALHOST', 'DATABASE_USER', 'DATABASE PASSWORD'); if (!$link) { die('Not connected : ' . mysql_error()); } $db_selected = mysql_select_db('DATABASE_NAME', $link); if (!$db_selected) { die ('Can\'t Find DB : ' . mysql_error()); } //Query Stuff $active = mysql_query("SELECT SUM(online) FROM tc_game_service_live_stats"); $act = mysql_result($active, 0); $totalslots = mysql_query("SELECT SUM(slots) FROM tc_game_services"); $tsc = mysql_result($totalslots, 0); $totalplayers = mysql_query("select sum(players) from tc_game_service_live_stats"); $po = mysql_result($totalplayers, 0); ?> Don't forget to include the above file where ever your going to display the info. <?php include 'include.php'; ?> Display Queried Info:<p>Players Online: <?php echo $po; ?>/<?php echo $tsc; ?></p> <p>Servers Online: <?php echo $act; ?></p> There is so much more info that can be queried, per server or as a whole. Link to comment Share on other sites More sharing options...
ringo Posted July 29, 2013 Share Posted July 29, 2013 Here is a more detailed table of most of the items that can be queried. <?php $con=mysqli_connect('HOST', 'DB_USER', 'DB_PASS', 'tcadmin'); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $result = mysqli_query($con,"SELECT * from tc_game_service_live_stats") or die(mysqli_error($con)); echo "<table border='1' style='background-color:gray';> <tr> <th>Colored Name</th> <th>Name</th> <th>Memory Used</th> <th>CPU Usage (%)</th> <th>Service ID</th> <th>Process ID</th> <th>Current Map</th> <th>Online?</th> <th>Players Online</th> <th>Game Type</th> <th>Game (Mod)</th> <th>Queried Last</th> </tr>"; while($row = mysqli_fetch_array($result)) { $test = $row['memory'] /1024 /1024; $format = number_format($test,0); echo "<tr>"; echo "<td>" . $row['html_name'] . "</td>"; echo "<td>" . $row['name'] . "</td>"; echo "<td>" . $format . " MB</td>"; echo "<td>" . $row['cpu'] . "</td>"; echo "<td>" . $row['service_id'] . "</td>"; echo "<td>" . $row['pid'] . "</td>"; echo "<td>" . $row['map'] . "</td>"; echo "<td>"; if ($row['online'] == '1') {echo "Online";} else echo "Offline"; echo "</td>"; echo "<td>" . $row['players'] . "/" . $row['max_players'] . "</td>"; echo "<td>" . $row['game_type'] . "</td>"; echo "<td>" . $row['game'] . "</td>"; echo "<td>" . $row['query_time'] . "</td>"; echo "</tr>"; } echo "</table>"; mysqli_close($con); ?> Link to comment Share on other sites More sharing options...
Jaggl Posted July 29, 2013 Share Posted July 29, 2013 someone using WHMCS and is using this script`? Link to comment Share on other sites More sharing options...
Jaggl Posted July 29, 2013 Share Posted July 29, 2013 finally got mine working :=) http://www.Hosters.at Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now