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

Para sa server owners

Idagdag ang server mo, ilagay ang vote link sa site mo at awtomatikong i-reward ang players mo. Tatlong hakbang:

Piliin ang laro mo - ipapakita ng pahina kung ano mismo ang ise-set up.

1. Ang vote link

Ilagay ang link na ito sa site mo (nasa Mga server ko ang SERVER_ID):

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

u = account name ng player mo (letra, numero, _ . @ -, hanggang 64). Babalik ito sa iyo sa postback, para alam mo kung sino ang ire-reward.

2. Paano nakukuha ng players ang reward

Postback - sinasabihan namin ang site mo na nag-vote ang player

Pagkatapos ng bawat nabilang na boto, tatawagin namin ang postback address mo (POST, form fields):

FieldIbig sabihin
server_idnumero ng server mo
vote_idnumero ng boto - unique; i-reward ang bawat vote_id nang ISANG BESES lang
userang u mula sa vote link mo
ipIP address ng bumoto
countrybansa ng bumoto (dalawang letra, puwedeng blangko)
timekailan (unix seconds, UTC)
test1 = test mula sa panel mo, huwag i-reward
sigsignature: HMAC-SHA256 ng "vote_id|server_id|user|ip|time" gamit ang postback secret mo

GET parameters ba ang binabasa ng site mo? Maglagay ng placeholders sa address at magpapadala kami ng GET na may laman na: {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}

Sumagot ng kahit anong 2xx status. Kung hindi sumagot ang site mo, susubukan ulit namin pagkatapos ng 1 min, 5 min, 30 min, 2 h at 6 h. Nasa postback log mo ang bawat subok.

Halimbawa sa 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 - reward ng boto, isang beses

Para sa game-server plugins at bots: ang unang tawag para sa boto ay nagbabalik ng claimed:true at minamarkahang nakuha - sinasabi ng mga susunod na nakuha na. Magtanong gamit ang IP at/o pangalan ng player.

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

O tanungin kami (API)

Kung hindi kayang tumanggap ng calls ang site mo, itanong kung nag-vote ang isang IP o player sa huling 12 oras:

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. Rules