public static void CreateFracturedBlock(MyObjectBuilder_FracturedBlock fracturedBlock, long grid, Vector3I position) { var msg = new CreateFractureBlockMsg(); msg.FracturedBlock = fracturedBlock; msg.Grid = grid; msg.Position = position; MySession.Static.SyncLayer.SendMessageToAll(ref msg); }
static void OnCreateFracturedBlockMessage(ref CreateFractureBlockMsg msg, MyNetworkClient sender) { MyCubeGrid grid; if (MyEntities.TryGetEntityById(msg.Grid, out grid)) { grid.EnableGenerators(false, true); grid.CreateFracturedBlock(msg.FracturedBlock, msg.Position); grid.EnableGenerators(true, true); } }
static void OnCreateFracturedBlockMessage(ref CreateFractureBlockMsg msg, MyNetworkClient sender) { Debug.Assert(!Sync.IsServer); MyCubeGrid grid; if (MyEntities.TryGetEntityById(msg.Grid, out grid)) { grid.EnableGenerators(false, true); grid.CreateFracturedBlock(msg.FracturedBlock, msg.Position); grid.EnableGenerators(true, true); } }
public static void CreateFracturedBlock(MyObjectBuilder_FracturedBlock fracturedBlock, long grid, Vector3I position) { Debug.Assert(Sync.IsServer); var msg = new CreateFractureBlockMsg(); msg.FracturedBlock = fracturedBlock; msg.Grid = grid; msg.Position = position; MySession.Static.SyncLayer.SendMessageToAll(ref msg); }