Esempio n. 1
0
 private static void WriteUserJoinGroupMessage(ref MessagePackWriter writer, UserJoinGroupMessage message)
 {
     writer.WriteArrayHeader(3);
     writer.Write(ServiceProtocolConstants.UserJoinGroupMessageType);
     writer.Write(message.UserId);
     writer.Write(message.GroupName);
 }
        private static UserJoinGroupMessage CreateUserJoinGroupMessage(ref MessagePackReader reader, int arrayLength)
        {
            var userId    = ReadString(ref reader, "userId");
            var groupName = ReadString(ref reader, "groupName");

            var result = new UserJoinGroupMessage(userId, groupName);

            if (arrayLength >= 4)
            {
                result.ReadExtensionMembers(ref reader);
            }
            return(result);
        }