# DataModel

DataModel : `ServiceProvider`

## Overview

As the top-level hierarchical element structuring the entire game, it encompasses various core services.

Essential game elements like Workspace and Lighting are children of the DataModel, accessible globally via game, which is a global object

## Properties

### JobId

`string`

This property returns a unique identifier that distinguishes the currently running game server instance.

Even servers sharing the same PlaceId have different JobId values per instance, so it can be used to identify a specific server session or for logging and analytics purposes.

#### Code Samples

### PlaceId

`string`

This property returns the ID of the Place currently running on the server.

The PlaceId identifies a published world, and all server instances launched from the same place share the same value.

#### Code Samples

### Workspace

`Workspace`

This property provides access to the Workspace service, which manages the game's 3D world space and physical environment. Most 3D objects placed in the world, such as parts, models, and characters, are contained under this Workspace.

#### Code Samples

## Methods

### DisableJoin

Prevents new players from joining the game session.

This API can only be called on the server.

#### Parameters

#### Return

| `void` |   |
| ------ | - |

#### Code Samples

```lua
-- Block server entry
game:DisableJoin() -- Server state: false
```

### EnableJoin

Allows players to join a game session. Calling this method enables players to connect to the server and participate.

This API can only be called on the server.

#### Parameters

#### Return

| `void` |   |
| ------ | - |

#### Code Samples

```lua
-- Allow server entry
game:EnableJoin() -- Server state: true
```

### IsJoinEnabled

Checks whether the current game session allows players to join. Returns true if joining is allowed, otherwise false.

#### Parameters

#### Return

| `boolean` | Specifies whether joining is allowed for the current session. |
| --------- | ------------------------------------------------------------- |

#### Code Samples

```lua
-- During test execution, toggle the allow player join state and output logs

-- Check initial server state
print("Initial join enabled state : ", game:IsJoinEnabled())

-- Block server entry
game:DisableJoin()
print("Join Disabled. Current State : ", game:IsJoinEnabled())

task.wait(5)

-- Allow server entry
game:EnableJoin()
print("Join Enabled. Current State : ", game:IsJoinEnabled())
```

## Events


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.overdare.com/development/api-reference/classes/datamodel.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
