Пример #1
0
        public static ConcealResponse FromBytes(byte[] bytes)
        {
            VRage.ByteStream stream = new VRage.ByteStream(bytes, bytes.Length);

            ConcealResponse response = new ConcealResponse();
            response.LoadFromByteStream(stream);
            response.EntityId = stream.getLong();
            response.Success = stream.getBoolean();

            Log.Info("Deserialized Conceal Response " + response.EntityId + " ? " + response.Success, "ToBytes");

            return response;
        }
        public static ConcealResponse FromBytes(byte[] bytes)
        {
            VRage.ByteStream stream = new VRage.ByteStream(bytes, bytes.Length);

            ConcealResponse response = new ConcealResponse();

            response.LoadFromByteStream(stream);
            response.EntityId = stream.getLong();
            response.Success  = stream.getBoolean();

            Log.Info("Deserialized Conceal Response " + response.EntityId + " ? " + response.Success, "ToBytes");

            return(response);
        }
        private void ReceiveConcealRequest(byte[] body, ulong senderId)
        {
            Log.Trace("Receiving Conceal Request", "ReceiveConcealRequest");

            ConcealRequest request = ConcealRequest.FromBytes(body);
            bool success = Session.Manager.QueueConceal(request.EntityId);

            ConcealResponse response = new ConcealResponse() {
                EntityId = request.EntityId,
                Success = success
            };

            response.SendToPlayer(senderId);
        }