# Plugin Classes/Game Classes Limitations

{% hint style="success" %}
Expect crashes, a lot of errors and etc. This is fine :)
{% endhint %}

### Calling methods from base class

{% hint style="danger" %}
IMPORTANT!\
Do not call methods from base classes (example: Item, PlayerClass and etc).\
Like base.Init() and etc.\
THIS WILL CRASH SERVER/CLIENT WITHOUT ANY MESSAGE
{% endhint %}

### System/Unity Classes limitations

Game use IL2CPP builds, so Classes/Methods/Constructors and etc. that game dont use will not be available in plugins.

{% hint style="warning" %}
If plugin use something, that not available in game, then it will not be loaded and server will not start. You will see error in console, like "Method not implemented" and other like errors.
{% endhint %}

If you need something, that not available in game, you can contact Game Developer on [our Discord](https://discord.gg/rJMD9DhQ23) server or create ticket(better) to ask about implementing this.

### Server/Client Communications

Item, Player Classes, Rooms and etc use three functions to communicate between connections:

* SendToClient
* SendToServer
* SendToEveryone

Calling functions must be **public**, otherwise they will not be called.\
They can accept most of base value types, like **int, float, string** and etc, also Unity **Vector3** and **Quaternion**.&#x20;

{% hint style="danger" %}
Currently send **byte, sbyte, bool** not supported, we investigating this issue, maybe some another value types too.
{% endhint %}

**SendToServer** also pass **Mirror.NetworkConnectionToClient** as last parameter to function, but this is optionally and not require to be in server function.

### Obtaining Player Classes, Items, Room Events

Plugin classes use proxies, so when trying to get class, check its type, otherwise you will get error of incorrect type.\
Example:

```csharp
if(player.playerClass.GetType() == typeof(PlayerClassProxy))
{
    PlayerClassProxy proxy = player.playerClass as PlayerClassProxy;
    Debug.Log(proxy.GetName());
}
else
{
    Debug.Log(player.playerClass.GetName());
}

if(player.items[5].GetType() == typeof(ItemProxy))
{
    ItemProxy proxy = player.items[5] as ItemProxy;
    Debug.Log(proxy.GetName());
}
else
{
    Debug.Log(player.items[5].GetName());
}
```


---

# 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://akequ.gitbook.io/scp-classified-site-plugin-api/docs/plugin-classes-game-classes-limitations.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.
