Entity Pool Refreshing

On this page we will explain the concept of entity pool refreshing.

This feature is obsolete and will be removed in the future.

The entity pool refreshing is a really important part of Onsharp, especially when you mix C# and LUA on the server-side. If you create an entity, e.g. a vehicle, in a LUA script, Onsharp won't know, that this entity exists. To let Onsharp know, if a new entity is created, the entity pools get refreshed every time you try to acccess the list containing all entities.

If you know, you just use Onsharp and not LUA on the server-side, you can disable the refreshing process. To do that, Onsharp offers a method, which turns off the process completely.

public override void OnStart()
{
    Runtime.DisableEntityPoolRefreshing();
}

Please make absolutly sure, you don't use any LUA code or you won't access the entity lists at all. Otherwise C# won't be synchronized anymore when other LUA packages create entities.

Last updated