RuneHub Launched! We are officially out of beta! 🚀 Learn more
Whether you're a beginner or a seasoned developer, our documentation covers all aspects of callback integration, ensuring you have the knowledge needed to succeed.
Ready to test your callback? Test nowIncentive Voting is your golden ticket to climbing the ranks in the RSPS list. By turning votes into valuable rewards for your players, you not only encourage player participation but also significantly enhance your server's visibility and popularity. Let's dive into the essence of Incentive Voting and how it can transform your server's standing and player engagement.
Here is a high-level overview on how to implement Incentive Voting on your server. If you're still unsure of how to proceed, check out our examples below.
Imagine sending your players on a mission - a simple click on a unique voting URL that rockets your server up the ranks. Upon their successful vote, we swing into action, promptly notifying you. The next move? It’s your call. Decide on the rewards and watch as player motivation skyrockets!
Begin by providing us with a Callback URL, a secret doorway to your website through which we'll send you a signal GET request once a vote is cast. This URL is your gateway to processing votes. When setting up your Callback URL, ensure it's secure and accessible.
Directing your players to the voting page might seem simple, yet precision is key. A proper URL format, as shown below, is crucial for success:
https://rune-hub.com/vote/your-server
Remember, the "your-server" part is for you to customize. Set this up on your servers' dashboard!
You can append any data you want to this url using URL parameters. For example, you can add the players's username, IP, or any other data you want to track. When we receive this data, we will include it in the callback request so you know who voted! The only format we request you follow, is when using player data, to use the "player" parameter.
To get you started, here's a quick example:
https://rune-hub.com/vote/UNIQUEIDENTIFIER?player=USERNAME&ip=100.100.100.100
Use this framework to tailor your system's response, be it logging the votes in a database or crafting a custom reward mechanism.
Have you completed the setup for the callback and the entire incentive voting system? Utilize our Callback Tester to verify the functionality of your setup.
Go to Callback TesterTo help you get started, we've prepared a few examples to guide you through the process of setting up Incentive Voting. Choose the example that best suits your server's tech stack and start boosting your rank today!
Please note that these are only examples to get you going quickly. In a real service, you would want to do some form of authenticating, logging, and error handling. These are all just bare minimum examples!
Using Java is a great option considering most RSPS servers are written in Java. Javalin is a lightweight web framework that makes it easy to create RESTful APIs quickly. If you already have a web framework in use such as Spring Boot, you can use that and easily adapt the code to your needs.
// VoteApp.java
import io.javalin.Javalin;
import io.javalin.http.Handler;
public class VoteApp {
public static void main(String[] args) {
Javalin app = Javalin.create(config -> {
config.defaultContentType = "text/plain";
}).start(7000);
app.get("/vote", handleVoteRequest);
}
private static Handler handleVoteRequest = ctx -> {
// Get query parameters
String player = ctx.queryParam("player");
String ip = ctx.queryParam("ip");
// Logging query parameters
ctx.queryParamMap().forEach((key, values) -> {
System.out.println(key + ": " + values.get(0));
});
// Placeholder for database operations
String sql = "INSERT INTO votes (player, ip) VALUES (?, ?)";
// Example: Use JDBC to execute this SQL statement with prepared statements
// For now, just send a response back indicating success
ctx.result("Success");
};
}
RuneHub is written in Nuxt 3 and is a great full-stack framework for Vue.js. It's easy to get started and has a lot of built-in features that make it easy to create a modern web application. Below is an example of how you can set up a callback endpoint in Nuxt 3.
// /server/api/calback.ts
export default defineEventHandler(async (event) => {
//get the query params from the event
const query = getQuery(event)
console.log("Received Callback:")
//Logs all params sent with the vote link
for (const key in query) {
console.log(key+": "+query[key])
}
//get your data from the query
const player = query.player
const ip = query.ip
//get any additional params you may have sent with your vote link
//do something with the data
const sql = 'INSERT INTO votes (player, ip) VALUES (?, ?)'
//execute the query, storing it in your own db, etc.
return new Response("Received Callback")
})
If you're using Node.js, Express is a popular choice for creating web servers. It's easy to quickly setup and deploy a server using Express. Below is an example of how you can set up a callback endpoint in Express.
// app.js
const express = require('express');
const app = express();
// Route handling GET requests to "/vote"
app.get('/vote', (req, res) => {
// Get the query params from the request
const query = req.query;
console.log("Received Callback:");
// Logs all params sent with the vote link
for (const key in query) {
console.log(key+": "+query[key])
}
// Get your data from the query
const player = query.player;
const ip = query.ip;
// Do something with the data
const sql = 'INSERT INTO votes (player, ip) VALUES (?, ?)';
// Example: Execute the query, storing it in your own db, etc.
res.send("Success");
});
const port = 3000;
app.listen(port, () => {
console.log("Server running on port " + port);
});
Kotlin is another popular language for RSPS servers and if you are already using the language for your server, Ktor is a great choice for creating web servers. Below is an example of how you can set up a callback endpoint in Ktor.
// app.kt
import io.ktor.server.engine.*
import io.ktor.server.netty.*
import io.ktor.server.application.*
import io.ktor.server.response.*
import io.ktor.server.request.*
import io.ktor.server.routing.*
fun main() {
embeddedServer(Netty, port = 8080) {
routing {
get("/vote") {
// Retrieve query parameters
val player = call.request.queryParameters["player"]
val ip = call.request.queryParameters["ip"]
// Logging each query parameter
call.request.queryParameters.forEach { key, values ->
println("$key: " + values.first())
}
// Placeholder for database operations
val sql = "INSERT INTO votes (player, ip) VALUES (?, ?)"
// You would typically use a database client to execute this
// Respond to the client
call.respondText("Success")
}
}
}.start(wait = true)
}
PHP is a long-standing choice for web development and Laravel is a popular framework for creating web applications. Below is an example of how you can set up a callback endpoint in Laravel.
// routes/web.php
use IlluminateSupportFacadesRoute;
Route::get('/vote', function () {
$query = request()->query();
// Log each query parameter
foreach ($query as $key => $value) {
logger()->info("$key: $value");
}
// Retrieve specific parameters
$player = request()->query('player', 'default_player');
$ip = request()->query('ip', 'default_ip');
// Placeholder for database operations
// You would typically use Eloquent or the DB facade to insert data
// DB::table('votes')->insert(['player' => $player, 'ip' => $ip]);
return "Success";
});
Being that RuneHub is a new type of voting platform, we have a few unique systems in place to ensure that votes are counted accurately and that servers are rewarded fairly. Below we explain how votes are counted, how sponsored servers work, and other various systems around our platform.
Rather than counting votes for a month straight, just to reset them and have all of the servers rush to get votes again, we have a system in place that counts votes over a month-long period. This means that votes are counted over a rolling 30-day period, and gives a more consistent view of how servers are doing.
Each review that is given, counts as five (5) votes towards the server's total vote count. This is to encourage players to leave reviews and give feedback on the servers they play on. These reviews are then used to calculate the server's overall rating. The votes attributed from reviews are counted towards the server's total vote count, and do not fall off after 30 days, since each user can only leave one review per server.
Sponsored servers are can appear in a few different locations around the site. These servers are given a boost in visibility and experience a higher click-through rate than non-sponsored servers. Sponsored servers are a great way to get your server in front of more players and grow your community.
Each sponsored section works a little differently, but we sell more slots than are displayed so that players do not see the same servers every time they visit the site. This ensures that all sponsored servers get a fair chance at being seen by players.
Premium servers offers all servers to get more exposure at a low cost. Premium servers are shown in their normal positions on the top list, but they are highlighted and distinguished from other servers. They are also able to display a 468x60 animated banner on the top list page to grab players attention.
The premium user role is a way for players to support the site and get some extra perks in return. Premium users names are highlighted in comments, reviews, and in all other places where their username is displayed. They also get a rank in the discord server. There are more perks to come and we always appreciate suggestions!
Ascend the RSPS list rankings, attracting new players and growing your community.
Tip: Rewarding votes not only encourages participation but also fosters a sense of community and loyalty among your players.
Add your Server for Free