ZH
English Български Русский Español Português Türkçe Tiếng Việt 中文 한국어 ไทย Filipino Azərbaycan

服主专区

添加你的服务器,把投票链接放到你的网站上,自动奖励你的玩家。只需三步:

选择你的游戏——本页会显示需要设置的具体内容。

1. 投票链接

把这个链接放到你的网站上(SERVER_ID 在“我的服务器”中):

https://mmotop100.com/vote/SERVER_ID?u=PLAYER_NAME

u = 你的玩家的账号名(字母、数字、_ . @ -,最多 64 位)。它会在 postback 中返回给你,让你知道该奖励谁。

2. 玩家如何获得奖励

Postback - 我们通知你的网站玩家已投票

每计入一票后,我们都会请求你的 postback 地址(POST,表单字段):

字段含义
server_id你的服务器编号
vote_id投票编号 - 唯一;每个 vote_id 只奖励一次
user你的投票链接中的 u
ip投票者的 IP 地址
country投票者的国家(两个字母,可能为空)
time时间(unix 秒,UTC)
test1 = 来自你面板的测试,不要发放奖励
sig签名:用你的 postback 密钥对 "vote_id|server_id|user|ip|time" 做 HMAC-SHA256

你的网站读取 GET 参数?把占位符放进地址,我们会发送已填好的 GET 请求:{user} {ip} {vote_id} {server_id} {time} {country} {test} {sig}

https://your-site.com/vote_reward.php?name={user}&ip={ip}&id={vote_id}&t={time}&sig={sig}

返回任意 2xx 状态即可。如果你的网站没有响应,我们会在 1 分钟、5 分钟、30 分钟、2 小时和 6 小时后重试。每次尝试都会记录在你的 postback 日志中。

PHP 示例

<?php
// vote_reward.php - called by MMOTop100 when a player voted
$secret = 'YOUR_POSTBACK_SECRET';            // My servers -> your server -> Keys
$in   = $_POST ?: $_GET;
$user = (string)($in['user'] ?? '');
$ip   = (string)($in['ip'] ?? '');
$vote = (string)($in['vote_id'] ?? '');
$sid  = (string)($in['server_id'] ?? '');
$time = (int)($in['time'] ?? 0);
$sig  = (string)($in['sig'] ?? '');

$want = hash_hmac('sha256', "$vote|$sid|$user|$ip|$time", $secret);
if (!hash_equals($want, $sig) || abs(time() - $time) > 86400) { http_response_code(403); exit('bad signature'); }
if (($in['test'] ?? '0') === '1') { exit('OK test'); }

// pay ONCE per vote_id (the same vote can arrive again if your answer got lost):
// INSERT INTO vote_log (vote_id, ...) with vote_id UNIQUE - if it already exists, do nothing.
// then give the reward to $user
echo 'OK';

3. Claim API——每票奖励只领取一次

供游戏服务器插件和机器人使用:对一张票的第一次调用返回 claimed:true 并标记为已领取——之后的调用都会显示已领取。用玩家的 IP 和/或名字查询。

GET https://mmotop100.com/api/claim?server=SERVER_ID&key=API_KEY&ip=1.2.3.4&user=PLAYER_NAME
{"claimed":true,"vote_id":123,"at":1762900000}          = give the reward now (each vote only once)
{"claimed":false,"voted":true,"next":1762943200}        = already taken - can vote again at "next"
{"claimed":false,"voted":false}                         = no vote in the last 12 hours

或者向我们查询(API)

如果你的网站无法接收请求,可以查询某个 IP 或玩家在最近 12 小时内是否投过票:

GET https://mmotop100.com/api/voted?server=SERVER_ID&key=API_KEY&ip=1.2.3.4
GET https://mmotop100.com/api/voted?server=SERVER_ID&key=API_KEY&user=PLAYER_NAME

{"voted":true,"at":1762900000,"next":1762943200}   or   {"voted":false}

4. 规则