Support a new server
What differs between servers and where it goes in the module. How to check that it works.
What differs
Each server ships its own client. The base, OTClientV8, is the same. These parts often differ:
- The bot. Which bot it is, and how it names routes, labels and supplies.
- Server features, such as tasks, blessings, death redemption and autoloot.
- Where the client keeps its files, and which modules it already has.
The module reads the basics itself. These are name, level, experience, position, capacity, stamina and skulls in view. It also reads exp per hour from the skills panel. It takes screenshots of the game view too. Everything else comes from an adapter.
Write an adapter
An adapter is a Lua table. You register it with Voidwatch.register. It runs only on the servers that it matches. Each of its fields fills one field of the status.
Voidwatch.register({
id = 'myserver-tasks', version = '1',
match = { hosts = { 'myserver.com' } },
fields = {
tasks = function() return { { name = 'dragon', have = 120, want = 300 } } end,
},
actions = {
claim_task = function(args) return true, 'claimed' end,
},
init = function(vw) end,
terminate = function() end,
})
matchtakeshostsandworlds.hostsholds the login addresses. Withoutmatch, the adapter runs on every server.initconnects the game events.terminatedisconnects them.- An adapter that fails 10 times in a row turns itself off. The module keeps running.
The bot has its own adapter, voidwatch/bot/voidwatch_bot.lua. It runs inside the bot and calls Voidwatch.attachBot every 10 seconds. It sends the fields of the bot, such as route, cavebot and targeting. When no call arrives for 30 seconds, the module drops these fields.
A field that no adapter answers stays out of the payload. The website then hides it.
Check it
- Pair a client on the server.
- Open the Live page. Check that level, position and capacity show.
- Check that your adapter fields also show, for example route, supplies and tasks.
- Open the character on the Live page. Check that the screenshot refreshes every few seconds.
- Send a test alert from the Alerts page. Check that it arrives.
A server shows as active on the server list when it passes these checks. Players must also use it. After our own tests, we mark it as verified.
Share your adapter on our Discord. Other players on the server can then use it.