serverLog hook and added a way to notify clients in custom interface

This commit is contained in:
Evil Factory
2021-09-03 12:15:29 -03:00
parent 2ddedf16b3
commit ce0da8581a
3 changed files with 24 additions and 2 deletions
@@ -5,6 +5,19 @@ namespace Barotrauma.Items.Components
{
partial class CustomInterface : ItemComponent, IClientSerializable, IServerSerializable
{
public void UpdateClients()
{
//notify all clients of the new state
GameMain.Server.CreateEntityEvent(item, new object[]
{
NetEntityEvent.Type.ComponentState,
item.GetComponentIndex(this)
});
item.CreateServerEvent(this);
}
public void ServerRead(ClientNetObject type, IReadMessage msg, Client c)
{
bool[] elementStates = new bool[customInterfaceElementList.Count];