static void RunProgramRequest(ref RunProgramMsg msg, MyNetworkClient sender) { MyEntity entity; MyEntities.TryGetEntityById(msg.EntityId, out entity); if (entity is MyProgrammableBlock) { (entity as MyProgrammableBlock).Run(StringCompressor.DecompressString(msg.Argument)); } }
static void UpdateProgramSuccess(ref UpdateProgramMsg msg, MyNetworkClient sender) { MyEntity entity; MyEntities.TryGetEntityById(msg.EntityId, out entity); if (entity is MyProgrammableBlock) { (entity as MyProgrammableBlock).UpdateProgram(StringCompressor.DecompressString(msg.Program), StringCompressor.DecompressString(msg.Storage)); } }