private static void WriteUserLeaveGroupMessage(ref MessagePackWriter writer, UserLeaveGroupMessage message) { writer.WriteArrayHeader(3); writer.Write(ServiceProtocolConstants.UserLeaveGroupMessageType); writer.Write(message.UserId); writer.Write(message.GroupName); }
private static UserLeaveGroupMessage CreateUserLeaveGroupMessage(ref MessagePackReader reader, int arrayLength) { var userId = ReadString(ref reader, "userId"); var groupName = ReadString(ref reader, "groupName"); var result = new UserLeaveGroupMessage(userId, groupName); if (arrayLength >= 4) { result.ReadExtensionMembers(ref reader); } return(result); }