# Authoritative tournament

**URL:** https://forum.heroiclabs.com/t/authoritative-tournament/1043
**Category:** Local Setup
**Tags:** server-framework
**Created:** [October 13, 2020, 3:48pm UTC](https://forum.heroiclabs.com/t/authoritative-tournament/1043 "2020-10-13T15:48:43Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![xiaoNiuNew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/xiaoniunew/32/330_2.png) [@xiaoNiuNew](https://forum.heroiclabs.com/u/xiaoNiuNew)
#### Post date: [October 13, 2020, 3:48pm UTC](https://forum.heroiclabs.com/t/authoritative-tournament/1043/1 "2020-10-13T15:48:43Z")

</div>

Hi , I new to Nakama and my english is poor. But thank you for developing a so good server for everyone !

when I use buildin tournament , I find that do not have a authoritative option like leaderboard, so how can I prevent client to wirte record?

And I find a problem with tournament\_records\_haystack runtime function of Lua, it do not return a “rank” value, the same funtion in Go runtime work OK.

My Nakama version is 2.13.0

Thanks!

---

<div class="post-metadata">

### Author: ![novabyte](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/novabyte/32/1324_2.png) [@novabyte](https://forum.heroiclabs.com/u/novabyte)
#### Post date: [October 14, 2020, 1:40pm UTC](https://forum.heroiclabs.com/t/authoritative-tournament/1043/2 "2020-10-14T13:40:11Z")

</div>

Hi @xiaoNiuNew welcome 👋

> when I use buildin tournament , I find that do not have a authoritative option like leaderboard, so how can I prevent client to wirte record?

That’s a good question. The reason that there’s no flag to pass in to tournaments to create them and mark them authoritative is that they’re already marked authoritative inside the game server when they’re created.

> And I find a problem with tournament\_records\_haystack runtime function of Lua, it do not return a “rank” value, the same funtion in Go runtime work OK.

Sounds like you found a small bug. Please can you open an issue on the repo and we’ll resolve it as part of the next server release. Also be sure to include the Lua code you used to test as a reference example to help us reproduce the issue faster.

Finally thanks for the kind words about the game server! 🙏

---

<div class="post-metadata">

### Author: ![xiaoNiuNew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/xiaoniunew/32/330_2.png) [@xiaoNiuNew](https://forum.heroiclabs.com/u/xiaoNiuNew)
#### Post date: [October 14, 2020, 3:33pm UTC](https://forum.heroiclabs.com/t/authoritative-tournament/1043/3 "2020-10-14T15:33:10Z")

</div>

> [@novabyte](#):
>
> they’re already marked authoritative inside the game server when they’re created.

But there is a write record funtion of client in Doc here  
[https://heroiclabs.com/docs/gameplay-tournaments/#write-tournament-record](https://heroiclabs.com/docs/gameplay-tournaments/#write-tournament-record)  
Althonght I did not test this clinet funtion 😅 , is it deprecated ?

> [@novabyte](#):
>
> Please can you open an issue on the repo and we’ll resolve it as part of the next server release

OK, I have open a issue

---

<div class="post-metadata">

### Author: ![novabyte](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/novabyte/32/1324_2.png) [@novabyte](https://forum.heroiclabs.com/u/novabyte)
#### Post date: [October 15, 2020, 8:14am UTC](https://forum.heroiclabs.com/t/authoritative-tournament/1043/4 "2020-10-15T08:14:41Z")

</div>

> Althonght I did not test this clinet funtion 😅 , is it deprecated ?

No. When I mentioned that tournaments are already authoritatively controlled I meant it in the natural language sense of the word “authoritative”. A user must request to join a tournament and may only join if the tournament is not already full. This means it is controlled authoritatively by logic on the server.

If you’d like to perform velocity checks on scores submitted by users to a tournament or want to prevent the use of the client API to submit scores for tournaments you can simply attach a before hook to the API: [https://heroiclabs.com/docs/runtime-code-basics/#before-hook](https://heroiclabs.com/docs/runtime-code-basics/#before-hook)
