コード例 #1
0
        // Sends an error stream message to a recipient
        public static void sendError(byte[] recipient, byte[] sender, byte[] data, RemoteEndpoint endpoint = null)
        {
            StreamMessage message = new StreamMessage();

            message.type           = StreamMessageCode.error;
            message.recipient      = recipient;
            message.sender         = sender;
            message.data           = data;
            message.encryptionType = StreamMessageEncryptionCode.none;

            if (endpoint != null)
            {
                endpoint.sendData(ProtocolMessageCode.s2data, message.getBytes());
            }
            else
            {
                NetworkServer.forwardMessage(recipient, ProtocolMessageCode.s2data, message.getBytes());
            }
        }
コード例 #2
0
ファイル: StreamProcessor.cs プロジェクト: requin38/Taams-S2
        // Sends an error stream message to a recipient
        // TODO: add additional data for error details
        public static void sendError(byte[] recipient)
        {
            StreamMessage message = new StreamMessage();

            message.type        = StreamMessageCode.error;
            message.recipient   = recipient;
            message.transaction = new byte[1];
            message.sigdata     = new byte[1];
            message.data        = new byte[1];

            NetworkServer.forwardMessage(recipient, ProtocolMessageCode.s2data, message.getBytes());
        }