> For the complete documentation index, see [llms.txt](https://akequ.gitbook.io/scp-classified-site-plugin-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://akequ.gitbook.io/scp-classified-site-plugin-api/docs/plugin-classes-game-classes-limitations.md).

# 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());
}
```
