Developer

1 min readUpdated 2 weeks ago

Overview

Other resources read board data through two server exports. Who can see and edit each board is set in the config.

Server Exports

lua
1local boards = exports['ml_board']:GetActiveBoards()
2local count = exports['ml_board']:GetPlayerBoardCount(identifier)
  • GetActiveBoards(): Returns a table of all active dynamic (player-placed) boards
  • GetPlayerBoardCount(identifier): Returns the number of boards owned by a player

Permissions

Board access is set per location in shared/config_locations.lua:

  • jobView: Jobs that can read the board (nil = everyone)
  • jobWrite: Jobs that can post notes
  • jobClear: Jobs that can clear all notes
  • allowedVariants: Restrict which note types are available (by id)

Each board also carries a permissions table with one rule per action, so pinning, moving, deleting, clearing, wiring, drawing and stamping are gated separately. Static boards take it in shared/config_locations.lua, player-placed boards take it on their entry in Config.BoardTypes. Values are 'all', 'own', 'none' or a job list, and the admin permission bypasses all of them.

shared/config_locations.lua
1permissions = {
2    place         = 'all',
3    move          = 'own',
4    delete        = 'own',
5    clear         = { 'police' },
6    connect       = 'all',
7    erase_connect = 'own',
8    draw          = 'none',
9    erase_draw    = 'own',
10    stamp         = 'all',
11},