Server Analytics & Cross-Chat (Mod + Bot Supported)

Paid Server Analytics & Cross-Chat (Mod + Bot Supported) 0.0.25

This resource is paid, and requires to be purchased

Changes & Updates

  • Added /bag command this lets you view inventory data.
  • Plugin now tracks player inventories to database at sa_stock, sa_holdings, sa_stock_moves this better lets you as a server owner see what the player has in their inventory.
  • Added new admin command ServerAnalytics.bag <eos>
  • Bunch of new Configuration options for inventory tracking.
  • Discord webhook alerts on certain items.
JSON:
 // How many days of chat lines to keep in the <prefix>_chat table.
    // 0 keeps them forever. Chat is the biggest table on a busy server, so
    // 30 is a sensible floor and 90 is plenty for a moderation trail.
    "ChatDays": 30,

    // How many days of item move rows to keep in the <prefix>_stock_moves table.
    // This is the "who took the metal" trail. 0 means forever, but on a busy server
    // it grows fast, so 45 days is a sensible starting point.
    "InventoryMovesDays": 45,

    // How many days a quiet bag or box page stays in the books before I tidy it away.
    // A page is quiet when I have not counted it since then, which usually means the
    // player stopped playing or the box was torn down. 0 keeps every page forever.
    "InventoryIdleDays": 10
  },

  // Inventory: what people are carrying and what is sitting in their boxes.
  //
  // How it works, in plain words. I do not hook every single item pickup, because a
  // forge running flat out would drown the server in events. Instead I keep a page for
  // every bag and box I know about, and I look at a few of those pages every second.
  // When a page has not changed since the last look I write nothing at all. When it has
  // changed I write only the lines that moved. A bag somebody is actively sorting gets
  // looked at almost every second. A bag nobody has touched gets looked at once a sweep.
  //
  // A box or a mount only gets a page once a player opens it. I never go hunting for
  // every chest on the map, so a server with fifty thousand structures costs me nothing
  // until somebody actually opens one. The page then sticks around for
  // ContainerHoldMinutes after the last time anyone touched it.
  //
  // The starting numbers here are picked for a hundred players online at once. If your
  // server is smaller you can drop SweepSeconds and get near instant updates.
  "Inventory": {
    // Count what players are carrying, worn gear included.
    // This is the main one. Turn it off and I only watch boxes and mounts.
    "Players": true,

    // Count boxes, forges, fabricators, crop plots and anything else a player opens.
    // Turn it off if you only care about what people carry on them.
    "Containers": true,

    // Count what a player loads onto a dino. Same rule as boxes, I only see a mount
    // once somebody opens its inventory. Set false to skip dinos entirely.
    "Mounts": true,

    // Include the gear a player is wearing and holding in their count.
    // False counts only loose items in the bag.
    "IncludeEquipped": true,

    // Count blueprints as their own number on each item line, so you can tell
    // "300 metal" from "300 metal plus 2 blueprints for it".
    "TrackBlueprints": true,

    // Save the full contents to the <prefix>_stock table so you can ask "what does
    // this player have right now". Set false and I only write the move trail, which
    // is much lighter on the database but cannot answer that question.
    "SaveContents": true,

    // How long a full pass over every page should take, in seconds.
    // This is the dial that matters most. 30 means every bag and box I know about gets
    // looked at least once every 30 seconds. 5 gives you near live numbers and costs
    // about six times as much work. Anything a player is actively using is looked at
    // far more often than this no matter what you put here, so 30 still feels quick.
    "SweepSeconds": 30,

    // The hard ceiling on how many pages I read in one second, whatever SweepSeconds
    // works out to. This is the safety belt that stops a sudden crowd from costing a
    // frame. 12 is comfortable. Raise it only if MaxScansPerTick shows up as the thing
    // holding you back in ServerAnalytics.Holds.
    "MaxScansPerTick": 12,

    // The most move rows I hand to the database in one second. Extra moves wait their
    // turn rather than piling into the write queue. Raise it if you run MySQL on the
    // same box and it never breaks a sweat.
    "MaxRowsPerTick": 200,

    // How long I hold a change before writing it down, in seconds. Chopping a tree
    // sends wood into a bag in dozens of small bites. With 8 seconds those become one
    // tidy row saying the whole amount. A smaller number writes sooner and writes more.
    "MoveWindowSeconds": 8,

    // The smallest move worth a row. 1 records everything. Set it to 20 and a player
    // eating one berry is ignored while somebody hauling metal is not.
    "MinMoveQuantity": 1,

    // Use the game's own "this inventory changed" marker to skip pages that cannot
    // have moved. This is nearly free and saves most of the work, so leave it true.
    // If your numbers ever look stuck, set it false and tell NordBots support.
    "UseFrameHint": true,

    // No matter what that marker says, I count a page from scratch at least this often.
    // This is the belt and braces for the setting above. 300 is five minutes.
    "ForceRescanSeconds": 300,

    // How many extra looks a page earns after it changes. A bag that just changed is
    // very likely about to change again, so it jumps the queue for this many looks.
    // This is what makes a player sorting a chest feel live. 0 turns it off.
    "HotLooks": 8,

    // The most items I read out of one bag or box in a single look. A vault stuffed
    // past this is counted up to the cap and no further, which keeps one hoarder from
    // costing everybody a frame. 600 covers any normal container.
    "MaxItemsPerHold": 600,

    // The most box and mount pages I keep at once. When it is full, new boxes are
    // turned away until an old page ages out, and ServerAnalytics.Holds tells you how
    // many I turned away. Raise it on a big busy server, lower it on a small box.
    "MaxContainers": 400,

    // How long a box or mount page lives after the last time anyone touched it.
    // 30 minutes keeps a raid or a build session together without holding pages for
    // chests nobody has opened since this morning.
    "ContainerHoldMinutes": 30,

    // My own speed limit for one second of counting, in millionths of a second.
    // 3000 is three thousandths of a second. If a sweep goes over this I quietly halve
    // how many pages I read next second and creep back up when there is room again, so
    // a busy moment costs you a slower count and never a stutter.
    "SweepBudgetMicros": 3000,

    // How many lines /bag shows a player by default. They can ask for more by typing
    // a number after the command, up to 25.
    "BagLinesShown": 8,

    // Items I should not count at all, matched anywhere in the item name and not fussy
    // about capitals. Good for cutting the noise from things nobody cares about.
    // Example: ["Berry", "Feces", "Thatch"]
    "IgnoreItems": [],

    // When this list has anything in it, I count only items that match one of these.
    // Everything else is skipped. Great for a server that only wants the valuable
    // things watched. Example: ["Element", "Tek", "Metal Ingot", "C4"]
    "OnlyItems": [],

    // Items worth a Discord alert when a big pile of them moves. Same matching as
    // above. Alerts go to your alert webhook. Example: ["Element", "C4", "Tek "]
    "AlertItems": [],

    // How much of a watched item has to move before I speak up. 0 turns the alerts
    // off no matter what AlertItems says. 100 means "tell me when a hundred element
    // moves at once", which is the kind of thing worth knowing about.
    "AlertQuantity": 0
  },
    
  "Commands": {
    // The chat command a player types to see their own record.
    // Rename it if another plugin already uses /mystats. Set "" to turn it off.
    "MyStats": "/mystats",

    // The chat command for the tribe page. Set "" to turn it off.
    "TribeStats": "/tribestats",

    // The leaderboard command. A player can add a board name after it:
    // /top time, /top kills, or /top tames. Plain /top shows time. Set "" to turn it off.
    "Top": "/top",

    // The chat command a player types to see what they are carrying. It only answers
    // when Track then Inventory is on. A player can add a number for more lines,
    // like /bag 20. Set "" to turn it off.
    "Bag": "/bag"
  },

Code:
  "bag_off": "Bag counting is off on this server, so I have nothing to show you.",
  "bag_wait": "I have not counted your bag yet. Give me a moment and ask again.",
  "bag_head": "Here is what you are carrying. {}.",
  "bag_empty": "Your bag is empty as far as I can see.",
Back
Top