Voting Check

Use our API to check if a player voted or not. Currently this API is just built to use with Silkroad Online servers. It will be updated soon..


What is Voting Check?

Voting Check is a way to get your players rewarded for advertising your server. Usually the voting sites are not owned by the private server owners. So they are not able to check whether the voting-procedure has completed successfully or not. Most of them simply add virtual currencies to the player's account just for voting here.

How does it work?

Currently we provide a vote-pingback and a PHP API that you may use on your webserver. This API is build for Silkroad Servers but it can easily be used on any other kind of server with some little edits.

What is Vote-Pingback?

Vote Pingback is an information we send to any kind of web service that is listening to it and entered with us.

Do I have to use your API to get this service?

Of course not. We provided this API to make it easier for server owners to get everything working without much effort. I you want to integrate any different service listener, feel free.

How do I know the user provides his votingUserID?

Either you send your users a link to your voting-site with "?votingUserID=123" (without quotes) added behind your link so your link looks like this:
https://www.toplist50.com/games/mmorpg/freegame/yourgame/?votingUserID=123
Or you embed an iframe in your webpage with exact that format above.

This is what we do on a successful voting:

PHP Code
#...
//open connection
$ch = curl_init();

$finalURL  = $yourCallbackURL . "?action=vote&user=" . $theUserYouProvided . "&time=" . time();

//set the url, number of POST vars, etc..
curl_setopt($ch, CURLOPT_URL, $finalURL);
#...

//execute request
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$contents = curl_exec($ch);


//close connection
curl_close($ch);
#...

So your webservice should do something like this:

PHP Code
function yourFunction()
{
    # Allow only our servers and
        # local ones (for testing purposes)
        $IPwhiteList = array(
            "127.0.0.1", "::1",
            gethostbyname("toplist50.com")
        );

        $echo = "undefined";
        if (isset($_REQUEST["action"])) {
            switch (trim($_REQUEST["action"])) {
                case "vote":
                    # yea it`s a voting callback
                    if (in_array($_SERVER["REMOTE_ADDR"], $IPwhiteList)) {
                        # break on invalid calls
                        if (!isset($_REQUEST["user"]) || !isset($_REQUEST["time"]))
                            throw new NotFoundHttpException();
                        # ok, request allowed & valid
                        $userID = intval($_REQUEST["user"]);
                        $time = intval($_REQUEST["time"]);

                        // that`s it, user voted and you can give him a reward
                        $echo = "UPDATE users SET reward = reward + 1 WHERE userid = $userID";
                        die('OK');
                    }
                    break;
                default:
                    $echo = "unknown action";
            }
        }

        die('KO');
}

⁡
Present your server everywhere, not just on list pages. Visible on mobile as well. Including a small description like this...
?Premium Advertisement Get yours

⁡
?Premium Advertisement Get yours
⁡
? Premium Advertisement Get yours