Exemple #1
0
        public string CrassusResponse(
            Guid destinationUUID,
            Guid sourceUUID,
            string[] channels
            )
        {
            string dataBlock = JsonConvert.SerializeObject(channels);

            Protocol0Header header = new Protocol0Header(
                0,
                Guid.NewGuid()
                );
            Protocol0Body body = new Protocol0Body(
                sourceUUID,
                destinationUUID,
                dataBlock
                );

            return(Serialize(new Protocol[] { header, body }));
        }
Exemple #2
0
        /// <summary>
        /// Create a fully encoded and serialized CrassusCommand packet
        /// </summary>
        /// <param name="destinationUUID">What the target for the packet is</param>
        /// <param name="sourceUUID">What the source for the packet is</param>
        /// <param name="arguments">An array of arguments</param>
        /// <returns>JSON Encoded packet as string</returns>
        public string CrassusCommand(
            Guid destinationUUID,
            Guid sourceUUID,
            string[] arguments
            )
        {
            string dataBlock = JsonConvert.SerializeObject(arguments);

            Protocol0Header header = new Protocol0Header(
                0,
                Guid.NewGuid()
                );
            Protocol0Body body = new Protocol0Body(
                destinationUUID,
                sourceUUID,
                dataBlock
                );

            return(Serialize(new Protocol[] { header, body }));
        }