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.
Table of Contents
Basic Integration
Advanced Features
1. Simple Voting Links
The easiest way to get started. Create direct links to your game's voting page that players can click.
Basic Voting Link
Use this simple link format:
https://mmo100.top/game/YOUR-GAME-SLUG
Replace YOUR-GAME-SLUG with your game's URL slug (found in your dashboard).
With Traffic Tracking
Add traffic tracking to count "In" clicks from your website:
https://mmo100.top/in?u=YOUR-GAME-SLUG&a=in
This link will count as an "In" click and redirect to your game page.
HTML Example
<!-- Basic voting link -->
<a href="https://mmo100.top/game/your-game-slug" target="_blank">
Vote for Our Server
</a>
<!-- With traffic tracking -->
<a href="https://mmo100.top/in?u=your-game-slug&a=in" target="_blank">
Vote for Our Server
</a>
<!-- Styled button -->
<a href="https://mmo100.top/in?u=your-game-slug&a=in"
target="_blank"
class="vote-button">
🗳️ Vote Now
</a>
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
- Get your API key from Dashboard → Your Game → Button Codes
- Create a postback script on your server
- 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
- Go to Dashboard → Your Game → Incentive Rewards
- Copy your API key and pingback URL
- 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
/api/postback/vote
Record a vote with full API authentication
/api/postback/traffic
Track traffic (in/out clicks)
/api/postback/stats
Get game statistics
Incentive Endpoints
/api/incentive/vote
Record vote with rewards
/api/incentive/rewards/{game}
Get available rewards for a game
/api/incentive/player/{game}
Get player voting history
Pingback Endpoints
/api/pingback
GTop100 compatible pingback (JSON/POST)
/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