public static void SendAfterGridBuilt(long builderId, long gridId) { var msg = new AfterGridCreatedMsg(); msg.BuilderEntityId = builderId; msg.GridEntityId = gridId; MySession.Static.SyncLayer.SendMessageToAll(ref msg); }
public static void SendAfterGridBuilt(long builderId, long gridId) { Debug.Fail("Use replication instead of this!"); var msg = new AfterGridCreatedMsg(); msg.BuilderEntityId = builderId; msg.GridEntityId = gridId; MySession.Static.SyncLayer.SendMessageToAll(ref msg); }
static void OnMessageAfterGridCreated(ref AfterGridCreatedMsg msg, MyNetworkClient sender) { MyEntity builder; MyEntity gridEntity; MyCubeGrid grid; MyEntities.TryGetEntityById(msg.BuilderEntityId, out builder); MyEntities.TryGetEntityById(msg.GridEntityId, out gridEntity); grid = gridEntity as MyCubeGrid; Debug.Assert(grid != null, "Could not find the grid entity!"); if (grid == null) { return; } MyCubeBuilder.AfterGridBuild(builder, grid); }
static void OnMessageAfterGridCreated(ref AfterGridCreatedMsg msg, MyNetworkClient sender) { Debug.Fail("Use replication instead of this!"); MyEntity builder; MyEntity gridEntity; MyCubeGrid grid; MyEntities.TryGetEntityById(msg.BuilderEntityId, out builder); MyEntities.TryGetEntityById(msg.GridEntityId, out gridEntity); grid = gridEntity as MyCubeGrid; Debug.Assert(grid != null, "Could not find the grid entity!"); if (grid == null) { return; } MyCubeBuilder.AfterGridBuild(builder, grid); }