public void SendShowOnScreenChangeRequest(byte show) { ChangeShowOnScreenMsg msg = new ChangeShowOnScreenMsg(); msg.EntityId = m_block.EntityId; msg.Show = show; Sync.Layer.SendMessageToServer(ref msg, MyTransportMessageEnum.Request); }
static void OnShowOnScreenSucess(ref ChangeShowOnScreenMsg msg, MyNetworkClient sender) { MyEntity entity = null; MyEntities.TryGetEntityById(msg.EntityId, out entity); MyTextPanel block = entity as MyTextPanel; if (block != null) { block.ShowTextFlag = (ShowTextOnScreenFlag)msg.Show; } }
static void OnShowOnScreenRequest(ref ChangeShowOnScreenMsg msg, MyNetworkClient sender) { MyEntity entity = null; MyEntities.TryGetEntityById(msg.EntityId, out entity); MyTextPanel block = entity as MyTextPanel; if (block != null) { block.ShowTextFlag = (ShowTextOnScreenFlag)msg.Show; Sync.Layer.SendMessageToAll(ref msg, MyTransportMessageEnum.Success); } }