# API

The **BOII Development Server Core (BDSC)** exposes a clean, structured API designed to give you controlled access to essential systems - without enforcing how your server should work.

It focuses on **player handling**, **server registry**, and **utility helpers**, giving you full control over your gameplay logic through modular extensions.

***

## What It Covers

The API is split into three main areas:

#### **1. Registry**

Manage the core player lifecycle.

* Create and register player objects
* Retrieve players by source
* Maintain the live player registry

#### **2. Player API**

Interact with a player object via its public-facing interface.

* Add data or methods dynamically
* Sync data to clients when needed
* Trigger save/destroy lifecycle events

#### **3. Utility Functions**

Access core helpers for logging, and translations.

***

## Design Philosophy

BDSC is built for developers who want flexibility without the baggage.

* Clean, minimal API
* Lifecycle and data sync built-in
* Fully extensible from external resources
* No forced framework rules
* No prebuilt gameplay logic

***

## How to Use the API

BDSC exposes its full API via a single namespace import.

#### **Namespace Import**

Use `exports.bdsc:import()` to get access to all available functions and objects:

```lua
local bdsc = exports.bdsc:import()

local player = bdsc.get_player(source)
player:add_data("custom", { foo = "bar" }, true)
```

> All player objects support the full public API, including `add_data`, `run_method`, and `save`.

***

<table data-view="cards"><thead><tr><th></th><th data-hidden data-card-cover data-type="files"></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td>Player Registry</td><td><a href="https://3046942752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHfd391cB6wDC8S3yHcie%2Fuploads%2FVEW51mwL4OCqWml6YhZA%2Fplug_registry_gitbook.png?alt=media&#x26;token=295e0a40-12a8-4f75-8331-c289d0f2f8a1">plug_registry_gitbook.png</a></td><td><a href="api/registry">registry</a></td></tr><tr><td>Player Object</td><td><a href="https://3046942752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHfd391cB6wDC8S3yHcie%2Fuploads%2FMuBcZcCLxlbKmcMzqAgK%2Fplug_player_gitbook.png?alt=media&#x26;token=ec283e08-88fd-4c64-b413-083c599efa12">plug_player_gitbook.png</a></td><td><a href="api/player-object">player-object</a></td></tr><tr><td>Utility Functions</td><td><a href="https://3046942752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHfd391cB6wDC8S3yHcie%2Fuploads%2FngdOKRwktWbrSjVpLNdL%2Fplug_utlity_gitbook.png?alt=media&#x26;token=67ea4575-4d8d-46fd-b2bb-97a4d1c644a8">plug_utlity_gitbook.png</a></td><td><a href="api/utility">utility</a></td></tr></tbody></table>
