Voting Integration Guide

Boost your server with our voting system

Voting Integration Guide

This comprehensive guide will show you how to integrate voting with your game server using our platform. Choose from simple voting links, advanced postback systems, or incentive-based voting to maximize player engagement.

Quick Start

New to voting integration? Start with Simple Voting Links for the easiest setup, then upgrade to Postback Systems for advanced features like rewards and player tracking.

2. Button Codes & Widgets

Create professional voting buttons and widgets that display real-time statistics.

Access Button Generator

Go to your dashboard → Select your game → Button Codes

Note: You need to be logged in and own the game to access button codes.

Button Types

Rank Button

Shows your current ranking

Rank
#1

Stats Button

Shows rating and votes

Rating
4.5/5
150 votes

Custom Button

Customizable design

MMO100
Top

Generated Code Example

<!-- HTML iframe code -->
<iframe src="https://mmo100.top/button/your-game-slug?type=rank&size=medium&style=default" 
        width="96" height="48" frameborder="0" scrolling="no"></iframe>

<!-- JavaScript code -->
<script>
document.write('<iframe src="https://mmo100.top/button/your-game-slug?type=rank&size=medium&style=default" 
        width="96" height="48" frameborder="0" scrolling="no"></iframe>');
</script>

3. Traffic Tracking

Track "In" and "Out" clicks to measure traffic flow between your server and our platform.

In Traffic (To Our Site)

Counts when players click from your website to ours:

https://mmo100.top/in?u=YOUR-GAME-SLUG&a=in

Use this URL for voting links on your website. It will count as an "In" click.

Out Traffic (To Your Site)

Counts when players click from our site to yours:

https://mmo100.top/out?u=YOUR-GAME-SLUG&a=out

This is automatically handled by our "Visit Website" button.

JavaScript Tracking

For advanced tracking, use our JavaScript functions:

<!-- Track outbound clicks -->
<a href="https://yourserver.com" 
   onclick="trackOutClick(GAME_ID, 'https://yourserver.com')">
    Visit Our Website
</a>

<!-- Track inbound clicks (automatic on game pages) -->
<script>
// This is automatically called when someone visits your game page
trackInClick(GAME_ID);
</script>

4. Postback System

Advanced system that sends vote confirmations back to your server in real-time.

Setup Requirements

  1. Get your API key from Dashboard → Your Game → Button Codes
  2. Create a postback script on your server
  3. Configure your postback URL in our system

Simple Postback (Recommended)

Easiest method using username parameter:

https://mmo100.top/game/YOUR-GAME-SLUG?vote=1&pingUsername=PLAYER_NAME

When a player votes, we'll send a postback to your configured URL with the player's name.

PHP Postback Handler

<?php
// Simple postback handler (postback.php)
$playerName = $_POST['pingUsername'] ?? $_GET['pingUsername'] ?? 'Unknown';
$voteValue = $_POST['vote'] ?? $_GET['vote'] ?? 0;

if ($voteValue == 1 && !empty($playerName)) {
    // Give reward to player
    givePlayerReward($playerName, 1000); // 1000 gold
    echo "Vote recorded for " . $playerName;
} else {
    echo "Invalid vote data";
}

function givePlayerReward($playerName, $amount) {
    // Your reward system here
    // Example: Add gold to player account
}
?>

Advanced Postback (API)

For more control, use our API endpoints:

<?php
// Advanced postback using our API
$apiKey = 'your-api-key';
$apiSecret = 'your-api-secret';
$postbackUrl = 'https://mmo100.top/api/postback/vote';

$voteData = [
    'game_id' => 123,
    'api_key' => $apiKey,
    'user_id' => $playerId,
    'ip_address' => $_SERVER['REMOTE_ADDR'],
    'vote_value' => 1,
    'timestamp' => time()
];

// Create signature
ksort($voteData);
$queryString = http_build_query($voteData);
$signature = hash_hmac('sha256', $queryString, $apiSecret);
$voteData['signature'] = $signature;

// Send to our API
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $postbackUrl);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($voteData));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);

$result = json_decode($response, true);
if ($result['success']) {
    echo "Vote recorded successfully!";
}
?>

5. Incentive Voting

Reward players for voting with in-game items, currency, or experience points.

Setup Incentive System

  1. Go to Dashboard → Your Game → Incentive Rewards
  2. Copy your API key and pingback URL
  3. Implement the reward system on your server

PHP Integration Code

<?php
// ArenaTop100 Compatible Incentive Voting
$apiKey = 'your-api-key';
$apiSecret = 'your-api-secret';
$pingbackUrl = 'https://mmo100.top/api/incentive/vote';

// Get player name from your system
$playerName = $_POST['player_name'] ?? $_GET['player_name'] ?? 'Unknown';
$playerIP = $_SERVER['REMOTE_ADDR'] ?? '127.0.0.1';

// Prepare vote data
$voteData = [
    'game_id' => 123,
    'api_key' => $apiKey,
    'player_name' => $playerName,
    'player_ip' => $playerIP,
    'vote_value' => 1,
    'reward_type' => 'currency', // item, currency, experience, points
    'reward_amount' => 1000, // Amount to give
    'reward_item' => 'Gold', // Item name (optional)
    'timestamp' => time()
];

// Create signature
ksort($voteData);
$queryString = http_build_query($voteData);
$signature = hash_hmac('sha256', $queryString, $apiSecret);
$voteData['signature'] = $signature;

// Send to MMO100
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $pingbackUrl);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($voteData));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Content-Type: application/x-www-form-urlencoded'
]);

$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode === 200) {
    $result = json_decode($response, true);
    if ($result['success'] && $result['reward_status'] === 'approved') {
        // Give reward to player
        givePlayerReward($playerName, $result['reward']);
        echo "Vote recorded! Reward given.";
    } else {
        echo "Vote failed: " . $result['message'];
    }
} else {
    echo "Error: HTTP " . $httpCode;
}

function givePlayerReward($playerName, $reward) {
    // Implement your reward system here
    // Example: Add currency to player account
    // Example: Give item to player inventory
    // Example: Add experience points
}
?>

Reward Types

Currency Rewards

'reward_type' => 'currency'
'reward_amount' => 1000
'reward_item' => 'Gold'

Item Rewards

'reward_type' => 'item'
'reward_amount' => 1
'reward_item' => 'Legendary Sword'

Experience Rewards

'reward_type' => 'experience'
'reward_amount' => 5000
'reward_item' => 'XP'

Points Rewards

'reward_type' => 'points'
'reward_amount' => 100
'reward_item' => 'Vote Points'

6. API Reference

Complete reference for all available API endpoints and parameters.

Postback Endpoints

POST /api/postback/vote

Record a vote with full API authentication

POST /api/postback/traffic

Track traffic (in/out clicks)

GET /api/postback/stats

Get game statistics

Incentive Endpoints

POST /api/incentive/vote

Record vote with rewards

GET /api/incentive/rewards/{game}

Get available rewards for a game

GET /api/incentive/player/{game}

Get player voting history

Pingback Endpoints

POST /api/pingback

GTop100 compatible pingback (JSON/POST)

GET /api/pingback/config/{game}

Get pingback configuration

Troubleshooting

Common Issues

  • API Key Invalid: Check your API key in the dashboard
  • Signature Mismatch: Ensure parameters are sorted alphabetically
  • Duplicate Votes: Check IP and time restrictions
  • Postback Not Working: Verify your postback URL is accessible

Testing Tips

  • Use different IP addresses to test voting
  • Check server logs for postback responses
  • Test with different player names
  • Verify API endpoints with curl or Postman

Need Help?

Contact Support

Having trouble with integration? We're here to help!

Contact Us

Dashboard Access

Manage your games and get API keys from your dashboard.

Go to Dashboard