コード例 #1
0
        public static RevealResponse FromBytes(byte[] bytes)
        {
            VRage.ByteStream stream = new VRage.ByteStream(bytes, bytes.Length);

            RevealResponse response = new RevealResponse();
            response.EntityId = stream.getLong();

            return response;
        }
コード例 #2
0
        private void ReceiveRevealRequest(byte[] body, ulong senderId)
        {
            Log.Trace("Receiving Reveal Request", "ReceiveRevealRequest");

            RevealRequest request = RevealRequest.FromBytes(body);
            bool success = false;

            if (Session.Server.CanReveal(request.EntityId)) {
                success = Session.Server.QueueReveal(request.EntityId);
                Log.Trace("Successfully revealed", "ReceiveRevealRequest");
            }

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

            Log.Trace("Sending response success ? " + response.Success, "ReceiveRevealRequest");

            response.SendToPlayer(senderId);
        }