Raised This Month: $32 Target: $400
 8% 

php script to get status and players on server


Post New Thread Reply   
 
Thread Tools Display Modes
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-26-2013 , 18:10   Re: php script to get status and players on server
Reply With Quote #11

Quote:
Originally Posted by seriousspot View Post
easy to understand? noob friendly? owell you forgot these
"Easy to understand" is totally subjective and depends on how much of the coding and functions that you know.

"noob friendly" . . . that's the point of making it more abstract, so the "noob" doesn't need to know the intricate details that are usually more complex.

There is a reason why people make APIs.

If you are unable to understand the underlying code of an API then it is most likely best to use the API as is.

Disclaimer: It seems I need one of these on my posts in this thread. This as my opinion.
__________________

Last edited by fysiks; 06-26-2013 at 18:11.
fysiks is online now
seriousspot
BANNED
Join Date: Mar 2013
Location: Lithuania / Norway
Old 06-26-2013 , 19:25   Re: php script to get status and players on server
Reply With Quote #12

Quote:
Originally Posted by fysiks View Post
"Easy to understand" is totally subjective and depends on how much of the coding and functions that you know.

"noob friendly" . . . that's the point of making it more abstract, so the "noob" doesn't need to know the intricate details that are usually more complex.

There is a reason why people make APIs.

If you are unable to understand the underlying code of an API then it is most likely best to use the API as is.

Disclaimer: It seems I need one of these on my posts in this thread. This as my opinion.
Some of people have no programming skills i mean ability to learn how it works fast, they think diffrent its hard to explain. Ofcourse its dumb example of my worldview that in other opinion doesen't fit to reality, but one of these people i am. Most of code even "some" api's is not fully explained i just see code that i can't understand what main functions does, spending alot of time to figure out part by part of it to recognize. Its only my opinion, but most of open source code should be explained how it works.

by the way take a look at this: https://forums.alliedmods.net/showpo...4&postcount=12

Making statistics by its worldview doesen't mean its right, there should be a vote instead as suggestion.

____________________________________

Also we went to offtopic, if you feeling that disscusion is not useless and want continue it feel free to pm me
seriousspot is offline
quark
Veteran Member
Join Date: Oct 2011
Location: Your mind.
Old 06-27-2013 , 01:57   Re: php script to get status and players on server
Reply With Quote #13

You should shut up with this boring speech and help that guy. Spamming his thread.
__________________

Check out My Plugins:
qServerInfo ; ASKTAG
quark is offline
4ever16
Veteran Member
Join Date: Apr 2015
Old 05-23-2017 , 04:06   Re: php script to get status and players on server
Reply With Quote #14

Quote:
Originally Posted by lqlqlq View Post
i find this for server status check:
Code:
<?php
$ip = "127.0.0.1"; // Server IP
$port = "27015"; // Port
 
$output = @fsockopen("udp://$ip", $port, $errno, $errstr, 0.25);
@socket_set_timeout($output, 1);
@socket_set_blocking($output, 1);
 
@fwrite($output, "\xFF\xFF\xFF\xFF\x55\x54\x53\x6F\x75\x72\x63\x65\x20\x45\x6E\x67\x69\x6E\x65\x20\x51\x75\x65\x72\x79\x00");
 
$buffer = @fread($output, 4096);

if (!$buffer) {
    echo "offline";
} else {
    echo "online";
}

?>
it works perfect.
Please, add a option to check server current players and max players.
Can someone make a version where online players are printed?
Just the number of online players nothing more!
4ever16 is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:28.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode