public static void Init() { if (instance == null) { instance = new BvServer(); } instance.messageHandler = new SecureMsgHandler(instance.NetworkMessageHandler); MyAPIGateway.Multiplayer.RegisterSecureMessageHandler(serverHandlerID, instance.messageHandler); }
protected override void AfterLoadData() { BvApiMaster.Init(); BvServer.Init(); }
/// <summary> /// Release resources /// </summary> public override void Close() { MyAPIGateway.Multiplayer.UnregisterSecureMessageHandler(serverHandlerID, messageHandler); instance = null; }
/// <summary> /// Detaches the head. /// </summary> public void DetachHead() { //subtype.Detach(); -- Bug: This isn't being synchronized with the DS, yet Attach() is. BvServer.SendEntityActionToServer(ServerBlockActions.MyMechanicalConnection | ServerBlockActions.DetachHead, subtype.EntityId); }
/// <summary> /// Attempts to attach a nearby head. /// </summary> public void AttachHead() { //subtype.Attach(); BvServer.SendEntityActionToServer(ServerBlockActions.MyMechanicalConnection | ServerBlockActions.AttachHead, subtype.EntityId); }