# DataModel

DataModel : `ServiceProvider`

## Overview

게임 전체 구조를 구성하는 계층 구조의 최상위 요소로, 여러 핵심 서비스를 포함하고 있습니다.

Workspace, Lighting 과 같은 필수 게임 요소들은 DataModel의 자식 요소이며, 전역 객체인 game을 통해 어디서든 접근할 수 있습니다.

## Properties

### JobId

`string`

현재 실행 중인 게임 서버 인스턴스를 구분하는 고유 식별자를 반환하는 속성입니다.

같은 PlaceId를 사용하는 서버라도 인스턴스마다 서로 다른 JobId 값을 가지므로, 특정 서버 세션을 식별하거나 로그·분석 용도로 활용할 수 있습니다.

#### Code Samples

### PlaceId

`string`

현재 서버에서 실행 중인 플레이스(Place)의 ID를 반환하는 속성입니다.

PlaceId는 게시된 월드를 식별하는 값으로, 동일한 플레이스에서 시작된 모든 서버 인스턴스가 같은 값을 공유합니다.

#### Code Samples

### Workspace

`Workspace`

게임 월드의 3D 공간과 물리 환경을 담당하는 Workspace 서비스에 접근하는 속성입니다. 월드에 배치된 파트, 모델, 캐릭터 등 대부분의 3D 오브젝트는 이 Workspace 아래에 포함됩니다.

#### Code Samples

## Methods

### DisableJoin

게임 세션에 새로운 플레이어가 참여하지 못하도록 차단합니다.

이 API는 서버에서만 호출할 수 있습니다.

#### Parameters

#### Return

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

#### Code Samples

```lua
-- 서버 진입 막기
game:DisableJoin() -- 서버 상태 : false
```

### EnableJoin

게임 세션에 플레이어의 참가를 허용합니다. 이 메서드를 호출하면 플레이어가 서버에 접속하여 참여할 수 있게 됩니다.

이 API는 서버에서만 호출할 수 있습니다.

#### Parameters

#### Return

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

#### Code Samples

```lua
-- 서버 진입 허용
game:EnableJoin() -- 서버 상태 : true
```

### IsJoinEnabled

현재 게임 세션이 플레이어의 참여를 허용하는지 확인합니다. 참여가 가능하면 true, 그렇지 않으면 false를 반환합니다.

#### Parameters

#### Return

| `boolean` | 현재 세션의 참여 허용 여부입니다. |
| --------- | ------------------- |

#### Code Samples

```lua
-- 테스트 실행 시점에 플레이어 난입 허용 상태를 토글하면서 로그 출력

-- 최초 서버 상태 확인
print("Initial join enabled state : ", game:IsJoinEnabled())

-- 서버 진입 막기
game:DisableJoin()
print("Join Disabled. Current State : ", game:IsJoinEnabled())

task.wait(5)

-- 서버 진입 허용
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/korean/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.
