コード例 #1
0
        public virtual void SendRunProgramRequest(string argument)
        {
            var msg = new RunProgramMsg();

            msg.EntityId = m_programmableBlock.EntityId;
            msg.Argument = StringCompressor.CompressString(argument ?? string.Empty);
            Sync.Layer.SendMessageToServer(ref msg, MyTransportMessageEnum.Request);
        }
コード例 #2
0
        public virtual void SendUpdateProgramRequest(string program, string storage)
        {
            var msg = new UpdateProgramMsg();

            msg.EntityId = m_programmableBlock.EntityId;
            msg.Program  = StringCompressor.CompressString(program);
            msg.Storage  = StringCompressor.CompressString(storage);
            Sync.Layer.SendMessageToServer(ref msg, MyTransportMessageEnum.Request);
        }
コード例 #3
0
        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));
            }
        }
コード例 #4
0
        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));
            }
        }