diff --git a/IINA+.xcodeproj/project.pbxproj b/IINA+.xcodeproj/project.pbxproj index a3a9efd9..931ed599 100644 --- a/IINA+.xcodeproj/project.pbxproj +++ b/IINA+.xcodeproj/project.pbxproj @@ -32,6 +32,8 @@ 012738C12C731EEB0031E643 /* TaskExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 012738C02C731EEB0031E643 /* TaskExtension.swift */; }; 0132B2E32123D05E001EB7DC /* BilibiliCardProgressView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0132B2E22123D05E001EB7DC /* BilibiliCardProgressView.swift */; }; 0132B2E52123D68D001EB7DC /* BilibiliCardImageBoxView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0132B2E42123D68D001EB7DC /* BilibiliCardImageBoxView.swift */; }; + 013598962CEC8EC400B3EFC0 /* Bangumi.swift in Sources */ = {isa = PBXBuildFile; fileRef = 013598952CEC8EC400B3EFC0 /* Bangumi.swift */; }; + 013598982CEC95AE00B3EFC0 /* BilbiliShare.swift in Sources */ = {isa = PBXBuildFile; fileRef = 013598972CEC95AE00B3EFC0 /* BilbiliShare.swift */; }; 013850FA214EA2AA003817CE /* huya.js in Resources */ = {isa = PBXBuildFile; fileRef = 013850F9214EA2AA003817CE /* huya.js */; }; 01398985210F27A600B7042F /* PreferencesWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01398984210F27A600B7042F /* PreferencesWindowController.swift */; }; 01398987210F58E500B7042F /* MainWindowTableRowView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01398986210F58E500B7042F /* MainWindowTableRowView.swift */; }; @@ -118,8 +120,11 @@ 01C0809A27BC079200E87A8C /* Sparkle in Frameworks */ = {isa = PBXBuildFile; productRef = 01C0809927BC079200E87A8C /* Sparkle */; }; 01C0809D27BC0BC400E87A8C /* SocketRocket in Frameworks */ = {isa = PBXBuildFile; productRef = 01C0809C27BC0BC400E87A8C /* SocketRocket */; }; 01C248B52A623EC000C92639 /* IINAApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01C248B42A623EC000C92639 /* IINAApp.swift */; }; + 01C248CA2CE480670074A76F /* TokenBucket.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01C248C92CE480670074A76F /* TokenBucket.swift */; }; + 01C248CD2CE480F30074A76F /* DequeModule in Frameworks */ = {isa = PBXBuildFile; productRef = 01C248CC2CE480F30074A76F /* DequeModule */; }; 01C338B528E47B3F004CC0B8 /* MBGA.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01C338B428E47B3F004CC0B8 /* MBGA.swift */; }; 01C373592429F2C2006778D1 /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = 01C373582429F2C2006778D1 /* README.md */; }; + 01D482BB2CAF978C00F636EE /* CharacterSetExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01D482BA2CAF978C00F636EE /* CharacterSetExtension.swift */; }; 01D8282A2AC3E1D6003A73BA /* mpegts.js in Copy Web Files */ = {isa = PBXBuildFile; fileRef = 01D828282AC3E1A6003A73BA /* mpegts.js */; }; 01D8762927D459C5001140DD /* crypto-js.js in Resources */ = {isa = PBXBuildFile; fileRef = 01D8762827D459C5001140DD /* crypto-js.js */; }; 01DCD2F9259710D800D286C8 /* BilibiliDMMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01DCD2F8259710D800D286C8 /* BilibiliDMMessage.swift */; }; @@ -130,7 +135,6 @@ 01EDCCA82A791EE0001DC138 /* test.htm in Copy Web Files */ = {isa = PBXBuildFile; fileRef = 01EDCCA62A791EB5001DC138 /* test.htm */; }; 01F46CA12102EF4600FE9DAD /* GereralViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01F46CA02102EF4600FE9DAD /* GereralViewController.swift */; }; 01F5151A2109F002007C7153 /* LiveStatusTableCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01F515192109F002007C7153 /* LiveStatusTableCellView.swift */; }; - 01F829CA2C5FA783004E4893 /* Semaphore in Frameworks */ = {isa = PBXBuildFile; productRef = 01F829C92C5FA783004E4893 /* Semaphore */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -206,6 +210,8 @@ 012738C02C731EEB0031E643 /* TaskExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TaskExtension.swift; sourceTree = ""; }; 0132B2E22123D05E001EB7DC /* BilibiliCardProgressView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BilibiliCardProgressView.swift; sourceTree = ""; }; 0132B2E42123D68D001EB7DC /* BilibiliCardImageBoxView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BilibiliCardImageBoxView.swift; sourceTree = ""; }; + 013598952CEC8EC400B3EFC0 /* Bangumi.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Bangumi.swift; sourceTree = ""; }; + 013598972CEC95AE00B3EFC0 /* BilbiliShare.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BilbiliShare.swift; sourceTree = ""; }; 013850F9214EA2AA003817CE /* huya.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = huya.js; sourceTree = ""; }; 01398984210F27A600B7042F /* PreferencesWindowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PreferencesWindowController.swift; sourceTree = ""; }; 01398986210F58E500B7042F /* MainWindowTableRowView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainWindowTableRowView.swift; sourceTree = ""; }; @@ -285,8 +291,10 @@ 01C0807927BB5CFF00E87A8C /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Preferences.strings"; sourceTree = ""; }; 01C248B42A623EC000C92639 /* IINAApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IINAApp.swift; sourceTree = ""; }; 01C248B62A62418E00C92639 /* iina-plugin-danmaku.iinaplgz */ = {isa = PBXFileReference; lastKnownFileType = file; path = "iina-plugin-danmaku.iinaplgz"; sourceTree = ""; }; + 01C248C92CE480670074A76F /* TokenBucket.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TokenBucket.swift; sourceTree = ""; }; 01C338B428E47B3F004CC0B8 /* MBGA.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MBGA.swift; sourceTree = ""; }; 01C373582429F2C2006778D1 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = SOURCE_ROOT; }; + 01D482BA2CAF978C00F636EE /* CharacterSetExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CharacterSetExtension.swift; sourceTree = ""; }; 01D828282AC3E1A6003A73BA /* mpegts.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = mpegts.js; path = "IINA+/WebFiles/node_modules/mpegts.js/dist/mpegts.js"; sourceTree = SOURCE_ROOT; }; 01D8762827D459C5001140DD /* crypto-js.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = "crypto-js.js"; path = "IINA+/WebFiles/node_modules/crypto-js/crypto-js.js"; sourceTree = SOURCE_ROOT; }; 01DCD2F8259710D800D286C8 /* BilibiliDMMessage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BilibiliDMMessage.swift; sourceTree = ""; }; @@ -311,10 +319,10 @@ 01C0809D27BC0BC400E87A8C /* SocketRocket in Frameworks */, 01C0808827BC049500E87A8C /* CryptoSwift in Frameworks */, 01C0809427BC06EC00E87A8C /* SwiftProtobuf in Frameworks */, + 01C248CD2CE480F30074A76F /* DequeModule in Frameworks */, 013F9B4B2C2C0A060024020C /* Swifter in Frameworks */, 01C0807C27BC00EA00E87A8C /* Alamofire in Frameworks */, 01C0809727BC074000E87A8C /* SDWebImage in Frameworks */, - 01F829CA2C5FA783004E4893 /* Semaphore in Frameworks */, 01C0808527BC03E300E87A8C /* SwiftSoup in Frameworks */, 01C0808B27BC04C500E87A8C /* Marshal in Frameworks */, ); @@ -403,6 +411,7 @@ 012601722119BA6D00C9C639 /* Utils */ = { isa = PBXGroup; children = ( + 01C248C92CE480670074A76F /* TokenBucket.swift */, 01BAD2AD2B13960600A64D55 /* Extensions */, 018F4F5F280D89BB0045B67C /* VideoDecoder */, 01B090A6281CFF1B00E305B7 /* Danmaku */, @@ -493,6 +502,8 @@ 01A183DA2B789728006FA874 /* HuyaUrl.swift */, 018F4F6B2817FFF30045B67C /* BiliLive.swift */, 01683DDA2118905D0016A886 /* Bilibili.swift */, + 013598972CEC95AE00B3EFC0 /* BilbiliShare.swift */, + 013598952CEC8EC400B3EFC0 /* Bangumi.swift */, 018739ED2852135200156F3F /* QQLive.swift */, 01C338B428E47B3F004CC0B8 /* MBGA.swift */, 010BEA6B2C4FE2C60061E1DC /* BilibiliDash.swift */, @@ -596,6 +607,7 @@ isa = PBXGroup; children = ( 01942A3527C49D850092FA5A /* WKWebViewExtension.swift */, + 01D482BA2CAF978C00F636EE /* CharacterSetExtension.swift */, 01010124211DBC27002F0F7F /* StringExtension.swift */, 0184D7112B2025FF00C7901A /* DateExtension.swift */, 012738C02C731EEB0031E643 /* TaskExtension.swift */, @@ -659,7 +671,7 @@ 01C0809927BC079200E87A8C /* Sparkle */, 01C0809C27BC0BC400E87A8C /* SocketRocket */, 013F9B4A2C2C0A060024020C /* Swifter */, - 01F829C92C5FA783004E4893 /* Semaphore */, + 01C248CC2CE480F30074A76F /* DequeModule */, ); productName = "iina+"; productReference = 01AEC8A720EDFD01001406E8 /* IINA+.app */; @@ -715,7 +727,7 @@ 01C0809B27BC0BC400E87A8C /* XCRemoteSwiftPackageReference "SocketRocket" */, 010CE8C72A911010002FA130 /* XCRemoteSwiftPackageReference "SwiftBrotli" */, 013F9B492C2C0A060024020C /* XCRemoteSwiftPackageReference "swifter" */, - 01F829C82C5FA783004E4893 /* XCRemoteSwiftPackageReference "Semaphore" */, + 01C248CB2CE480F30074A76F /* XCRemoteSwiftPackageReference "swift-collections" */, ); productRefGroup = 01AEC8A820EDFD01001406E8 /* Products */; projectDirPath = ""; @@ -803,6 +815,7 @@ 01AEC8C920F1081C001406E8 /* Identifiers.swift in Sources */, 01010125211DBC27002F0F7F /* StringExtension.swift in Sources */, 013A05EF2BC8052900AD63DD /* MainWindowTableView.swift in Sources */, + 013598982CEC95AE00B3EFC0 /* BilbiliShare.swift in Sources */, 010BEA6C2C4FE2C60061E1DC /* BilibiliDash.swift in Sources */, 0182F5DF295FDAB600DB8BDD /* DouYinPushFrame.pb.swift in Sources */, 0196CB6421214B4200BCD29E /* AdvancedViewController.swift in Sources */, @@ -813,6 +826,7 @@ 0182F5DD295F108D00DB8BDD /* DouYinResponse.pb.swift in Sources */, 01260178211ABD3B00C9C639 /* VideoViewsFormatter.swift in Sources */, 016A71F32A91C50F007B4CA3 /* BiliLiveDMv2.pb.swift in Sources */, + 01C248CA2CE480670074A76F /* TokenBucket.swift in Sources */, 014B447E210069FF00E7AA6A /* BookmarkExtension.swift in Sources */, 01B881372C4128EA00E44B97 /* BilibiliDynamicManger.swift in Sources */, 01479CD5210AFACB0046AAAD /* AddBookmarkViewController.swift in Sources */, @@ -823,6 +837,7 @@ 01F46CA12102EF4600FE9DAD /* GereralViewController.swift in Sources */, 015C19DC218B0D4F003B2F3A /* VideoGetStructs.swift in Sources */, 013CE8DE2184459E000271FB /* Danmaku.swift in Sources */, + 013598962CEC8EC400B3EFC0 /* Bangumi.swift in Sources */, 0101012B211DCE1C002F0F7F /* SidebarTableCellView.swift in Sources */, 0184D7122B2025FF00C7901A /* DateExtension.swift in Sources */, 011E4D3321E99CA400997633 /* Log.swift in Sources */, @@ -854,6 +869,7 @@ 01AEC8AB20EDFD01001406E8 /* AppDelegate.swift in Sources */, 0102924627ACF8AC00CB74B5 /* ControllersVisualEffectView.swift in Sources */, 0106179D2AF34EFF005C7877 /* JSPlayerURL.swift in Sources */, + 01D482BB2CAF978C00F636EE /* CharacterSetExtension.swift in Sources */, 01010137211EFA75002F0F7F /* SuggestionsTableView.swift in Sources */, 016D772427B0CD4300358E2F /* WaitTimer.swift in Sources */, 01E6A09C211AD62800C6EF98 /* VideoDurationFormatter.swift in Sources */, @@ -971,6 +987,7 @@ SDKROOT = macosx; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_STRICT_CONCURRENCY = complete; }; name = Debug; }; @@ -1029,6 +1046,7 @@ SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; + SWIFT_STRICT_CONCURRENCY = complete; }; name = Release; }; @@ -1049,14 +1067,14 @@ "$(inherited)", "@executable_path/../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 10.15; + MACOSX_DEPLOYMENT_TARGET = 11.5; MARKETING_VERSION = 0.8.4; PRODUCT_BUNDLE_IDENTIFIER = "com.xjbeta.iina-plus"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "IINA+/iina+-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; + SWIFT_VERSION = 6.0; }; name = Debug; }; @@ -1076,14 +1094,14 @@ "$(inherited)", "@executable_path/../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 10.15; + MACOSX_DEPLOYMENT_TARGET = 11.5; MARKETING_VERSION = 0.8.4; PRODUCT_BUNDLE_IDENTIFIER = "com.xjbeta.iina-plus"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "IINA+/iina+-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-O"; - SWIFT_VERSION = 5.0; + SWIFT_VERSION = 6.0; }; name = Release; }; @@ -1199,12 +1217,12 @@ kind = branch; }; }; - 01F829C82C5FA783004E4893 /* XCRemoteSwiftPackageReference "Semaphore" */ = { + 01C248CB2CE480F30074A76F /* XCRemoteSwiftPackageReference "swift-collections" */ = { isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/groue/Semaphore"; + repositoryURL = "https://github.com/apple/swift-collections.git"; requirement = { kind = upToNextMajorVersion; - minimumVersion = 0.1.0; + minimumVersion = 1.1.4; }; }; /* End XCRemoteSwiftPackageReference section */ @@ -1260,10 +1278,10 @@ package = 01C0809B27BC0BC400E87A8C /* XCRemoteSwiftPackageReference "SocketRocket" */; productName = SocketRocket; }; - 01F829C92C5FA783004E4893 /* Semaphore */ = { + 01C248CC2CE480F30074A76F /* DequeModule */ = { isa = XCSwiftPackageProductDependency; - package = 01F829C82C5FA783004E4893 /* XCRemoteSwiftPackageReference "Semaphore" */; - productName = Semaphore; + package = 01C248CB2CE480F30074A76F /* XCRemoteSwiftPackageReference "swift-collections" */; + productName = DequeModule; }; /* End XCSwiftPackageProductDependency section */ diff --git a/IINA+.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/IINA+.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 3b6eb0ab..16575ab4 100644 --- a/IINA+.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/IINA+.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,13 +1,13 @@ { - "originHash" : "002db082d67dd04ceef35a0e7fc98dc59d5b2928b472f339c49f8bce81f0f426", + "originHash" : "e25d26158a9202447104dd429e63878698e1f4c65378618a6d336f857726dcad", "pins" : [ { "identity" : "alamofire", "kind" : "remoteSourceControl", "location" : "https://github.com/Alamofire/Alamofire", "state" : { - "revision" : "f455c2975872ccd2d9c81594c658af65716e9b9a", - "version" : "5.9.1" + "revision" : "e16d3481f5ed35f0472cb93350085853d754913f", + "version" : "5.10.1" } }, { @@ -42,17 +42,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/SDWebImage/SDWebImage", "state" : { - "revision" : "8a1be70a625683bc04d6903e2935bf23f3c6d609", - "version" : "5.19.7" - } - }, - { - "identity" : "semaphore", - "kind" : "remoteSourceControl", - "location" : "https://github.com/groue/Semaphore", - "state" : { - "revision" : "2543679282aa6f6c8ecf2138acd613ed20790bc2", - "version" : "0.1.0" + "revision" : "10d06f6a33bafae8c164fbfd1f03391f6d4692b3", + "version" : "5.20.0" } }, { @@ -61,7 +52,7 @@ "location" : "https://github.com/xjbeta/SocketRocket/", "state" : { "branch" : "dev", - "revision" : "c81e0ea3776ad369211259b9078c8bf5204c240f" + "revision" : "9c2ecc3179c602a7f5143a0b03c0c98530470212" } }, { @@ -73,13 +64,22 @@ "version" : "2.6.4" } }, + { + "identity" : "swift-collections", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-collections.git", + "state" : { + "revision" : "671108c96644956dddcd89dd59c203dcdb36cec7", + "version" : "1.1.4" + } + }, { "identity" : "swift-protobuf", "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-protobuf.git", "state" : { - "revision" : "edb6ed4919f7756157fe02f2552b7e3850a538e5", - "version" : "1.28.1" + "revision" : "ebc7251dd5b37f627c93698e4374084d98409633", + "version" : "1.28.2" } }, { @@ -105,8 +105,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/scinfu/SwiftSoup", "state" : { - "revision" : "3c2c7e1e72b8abd96eafbae80323c5c1e5317437", - "version" : "2.7.5" + "revision" : "0837db354faf9c9deb710dc597046edaadf5360f", + "version" : "2.7.6" } } ], diff --git a/IINA+/AppDelegate.swift b/IINA+/AppDelegate.swift index 5aad87c9..fbad6206 100644 --- a/IINA+/AppDelegate.swift +++ b/IINA+/AppDelegate.swift @@ -10,7 +10,7 @@ import Cocoa import SDWebImage import Sparkle -@NSApplicationMain +@main class AppDelegate: NSObject, NSApplicationDelegate { let updaterController = SPUStandardUpdaterController(startingUpdater: true, updaterDelegate: nil, userDriverDelegate: nil) @@ -74,6 +74,7 @@ class AppDelegate: NSObject, NSApplicationDelegate { return true } + @MainActor func showUpdateAlert() { guard !Preferences.shared.updateInfo070 else { return } Preferences.shared.updateInfo070 = true diff --git a/IINA+/Core Data/Bookmark.swift b/IINA+/Core Data/Bookmark.swift index 1dd5174b..0952902a 100644 --- a/IINA+/Core Data/Bookmark.swift +++ b/IINA+/Core Data/Bookmark.swift @@ -21,57 +21,8 @@ public class Bookmark: NSManagedObject { @objc dynamic var image: NSImage? - private var inited = false - private var updating = false - - func updateState(_ force: Bool = false) { - if site == .unsupported { - self.state = LiveState.none.raw - self.save() - return - } - - let limitSec: CGFloat = [.bangumi, .bilibili, .unsupported].contains(site) ? 300 : 20 - - if inited { - if updating { - return - } - - if let s = updateDate?.secondsSinceNow, - s < limitSec { - return - } - } - - inited = true - - /* - if let d = updateDate?.timeIntervalSince1970, - (Date().timeIntervalSince1970 - d) > 1800 { - state = LiveState.none.raw - } - */ - updating = true - - Task { - do { - let info = try await Processes.shared.videoDecoder.liveInfo(url) - await setInfo(info) - } catch let error { - await setInfoError(error) - } - - await MainActor.run { - updateDate = Date() - updating = false - save() - } - } - } - - @MainActor - private func setInfo(_ info: LiveInfo) { + @MainActor + func setInfo(_ info: LiveInfo) async { liveTitle = info.title liveName = info.name @@ -80,7 +31,7 @@ public class Bookmark: NSManagedObject { cover = isLiveSite ? info.avatar : info.cover cover?.coverUrlFormatter(site: isLiveSite ? site : .biliLive) - updateImage() + await updateImage() if info.site == .bangumi { liveName = "Bangumi" @@ -94,27 +45,31 @@ public class Bookmark: NSManagedObject { state = LiveState.none.raw } } - - @MainActor - private func setInfoError(_ error: any Error) { + + @MainActor + func setInfoError(_ error: any Error) { let s = "Get live status error: \(error) \n - \(url)" Log(s) - self.liveTitle = url - self.state = LiveState.none.raw + liveTitle = url + state = LiveState.none.raw } - private func updateImage() { + @MainActor + private func updateImage() async { image = nil - if let c = cover { + guard let c = cover else { return } + let img = await withCheckedContinuation { continuation in SDWebImageManager.shared.loadImage( with: .init(string: c), progress: nil) { image, _, _, _, _, url in - self.image = image + continuation.resume(returning: image?.sd_imageData()) } } + guard let img else { return } + image = NSImage(data: img) } func save() { - try? (NSApp.delegate as? AppDelegate)?.persistentContainer.viewContext.save() +// try? (NSApp.delegate as? AppDelegate)?.persistentContainer.viewContext.save() } } diff --git a/IINA+/Core Data/DataManager.swift b/IINA+/Core Data/DataManager.swift index 9d4a4a19..e98ed9fc 100644 --- a/IINA+/Core Data/DataManager.swift +++ b/IINA+/Core Data/DataManager.swift @@ -8,11 +8,16 @@ import Cocoa +@MainActor class DataManager: NSObject { let context = (NSApp.delegate as! AppDelegate).persistentContainer.viewContext + let sortDescriptors = [NSSortDescriptor(key: #keyPath(Bookmark.order), ascending: true)] + private let tokenBucket = TokenBucket(tokens: 1) + private var bookmarkReloadDate = [NSManagedObjectID: TimeInterval]() + func requestData() -> [Bookmark] { let request = NSFetchRequest(entityName: "Bookmark") request.sortDescriptors = sortDescriptors @@ -23,6 +28,63 @@ class DataManager: NSObject { return [] } + func reloadAllBookmark() { + Task { @MainActor in + await withTaskGroup(of: Void.self) { group in + for i in requestData() { + let id = i.objectID + group.addTask { + await self.reloadBookmark(id) + } + } + } + } + } + + func reloadBookmark(_ id: NSManagedObjectID) async { + guard let obj = try? context.existingObject(with: id) as? Bookmark else { return } + let site = SupportSites(url: obj.url) + if site == .unsupported { + obj.state = LiveState.none.raw + save() + return + } + + let refreshInterval: CGFloat = [.bangumi, .bilibili, .unsupported].contains(site) ? 300 : 20 + + let rt = await tokenBucket.withToken { + // Inited + if let ti = await bookmarkReloadDate[id] { + // Updating + if ti == -1 { + return 1 + } + + if Date(timeIntervalSince1970: ti).secondsSinceNow < refreshInterval { + return 1 + } + } + return 0 + } + + if rt == 1 { + return + } + + do { + let info = try await Processes.shared.videoDecoder.liveInfo(obj.url) + await obj.setInfo(info) + } catch let error { + obj.setInfoError(error) + } + + save() + + await tokenBucket.withToken { @MainActor in + bookmarkReloadDate[id] = Date().timeIntervalSince1970 + } + } + func addBookmark(_ str: String) { let newBookmark = Bookmark(context: context) newBookmark.url = str @@ -31,19 +93,21 @@ class DataManager: NSObject { } else { newBookmark.order = 0 } - try? context.save() - newBookmark.updateState() + save() + Task { + await reloadBookmark(newBookmark.objectID) + } } func deleteBookmark(_ index: Int) { let bookmark = requestData()[index] context.delete(bookmark) - try? context.save() + save() } func delete(_ bookmark: Bookmark) { context.delete(bookmark) - try? context.save() + save() } func moveBookmark(at oldIndex: Int, to newIndex: Int) { @@ -62,7 +126,10 @@ class DataManager: NSObject { default: break } - try? context.save() + save() } + func save() { + try? context.save() + } } diff --git a/IINA+/Preferences.swift b/IINA+/Preferences.swift index 0037a30f..5c6f12fd 100644 --- a/IINA+/Preferences.swift +++ b/IINA+/Preferences.swift @@ -8,13 +8,14 @@ import Cocoa -class Preferences: NSObject { +final class Preferences: NSObject, Sendable { static let shared = Preferences() private override init() { } - let prefs = UserDefaults.standard + nonisolated(unsafe) let prefs = UserDefaults.standard + let keys = PreferenceKeys.self var livePlayer: LivePlayer { @@ -115,7 +116,7 @@ class Preferences: NSObject { @objc dynamic var dmPort: Int { get { - if Processes.shared.iina.buildVersion > 16 { + if IINAApp.getBuildVersion() > 16 { return defaults(.dmPort) as? Int ?? 19080 } else { return 19080 @@ -224,7 +225,7 @@ class Preferences: NSObject { private extension Preferences { func defaults(_ key: PreferenceKeys) -> Any? { - return prefs.value(forKey: key.rawValue) as Any? + prefs.value(forKey: key.rawValue) as Any? } func defaultsSet(_ value: Any, forKey key: PreferenceKeys) { diff --git a/IINA+/Utils/BilibiliDynamicManger.swift b/IINA+/Utils/BilibiliDynamicManger.swift index 0b06bcdb..ddf8cc0b 100644 --- a/IINA+/Utils/BilibiliDynamicManger.swift +++ b/IINA+/Utils/BilibiliDynamicManger.swift @@ -8,7 +8,8 @@ import Cocoa -protocol BilibiliDynamicMangerDelegate { +@MainActor +protocol BilibiliDynamicMangerDelegate: Sendable { func bilibiliDynamicStatusChanged(_ isLoading: Bool) func bilibiliDynamicCardsContains(_ bvid: String) -> Bool @@ -22,96 +23,128 @@ protocol BilibiliDynamicMangerDelegate { actor BilibiliDynamicManger { - private var lock = NSLock() + private let tokenBucket = TokenBucket(tokens: 1) + + private var initDate: Date? + private var newDate: Date? + private var historyDate: Date? - private var bookmarkLoaderTimer: Date? - - let bilibili = Processes.shared.videoDecoder.bilibili - - var canLoadMore = true - - private var delegate: BilibiliDynamicMangerDelegate? + var delegate: BilibiliDynamicMangerDelegate? func setDelegate(_ newDelegate: BilibiliDynamicMangerDelegate) { delegate = newDelegate } func loadBilibiliCards(_ action: BilibiliDynamicAction = .init😅) { - Task { - await withCheckedContinuation { continuation in - lock.lock() - defer { lock.unlock() } - Task { - await loadCards(action) - continuation.resume() - } - } - } + Task { + await tokenBucket.withToken { + await loadCards(action) + } + } } - + private func loadCards(_ action: BilibiliDynamicAction = .init😅) async { - guard canLoadMore, let delegate = delegate else { return } - - if let date = bookmarkLoaderTimer, - date.secondsSinceNow < 5 { - Log("ignore load more") - return - } + + guard let delegate = delegate else { return } let uuid = UUID().uuidString - canLoadMore = false - await MainActor.run { - delegate.bilibiliDynamicStatusChanged(true) - } + await delegate.bilibiliDynamicStatusChanged(true) + defer { + Task { + await delegate.bilibiliDynamicStatusChanged(false) + } + } + var dynamicID = -1 - - let bilibiliCards = delegate.bilibiliDynamicCards() + let bilibiliCards = await delegate.bilibiliDynamicCards() switch action { case .history: + if historyDate != nil, historyDate!.secondsSinceNow < 1 { +// Log("\(uuid), ignore, \(action)") + return + } dynamicID = bilibiliCards.last?.dynamicId ?? -1 case .new: + if newDate != nil, newDate!.secondsSinceNow < 5 { +// Log("\(uuid), ignore, \(action)") + return + } dynamicID = bilibiliCards.first?.dynamicId ?? -1 - default: - break + case .init😅: + if initDate != nil, initDate!.secondsSinceNow < 15 { +// Log("\(uuid), ignore, \(action)") + return + } } - Log("\(uuid), start, \(dynamicID)") + Log("\(uuid), start, \(action), \(dynamicID)") do { + + let bilibili = await Processes.shared.videoDecoder.bilibili let uid = try await bilibili.getUid() let cards = try await bilibili.dynamicList(uid, action, dynamicID) - await MainActor.run { - switch action { - case .init😅: - delegate.bilibiliDynamicInitCards(cards) - case .history: - let appends = cards.filter { card in - !delegate.bilibiliDynamicCardsContains(card.bvid) + switch action { + case .init😅: + await delegate.bilibiliDynamicInitCards(cards) + self.initDate = Date() + case .history: + let appends = await withTaskGroup(of: BilibiliCard?.self) { group -> [BilibiliCard] in + for card in cards { + group.addTask { + if await delegate.bilibiliDynamicCardsContains(card.bvid) { + return nil + } else { + return card + } + } } - delegate.bilibiliDynamicAppendCards(appends) - case .new: - let appends = cards.filter { card in - !delegate.bilibiliDynamicCardsContains(card.bvid) + + var results = [BilibiliCard]() + for await result in group { + if let result { + results.append(result) + } } - if appends.count > 0 { - delegate.bilibiliDynamicInsertCards(appends) + return results + } + await delegate.bilibiliDynamicAppendCards(appends) + self.historyDate = Date() + case .new: + + let appends = await withTaskGroup(of: BilibiliCard?.self) { group -> [BilibiliCard] in + for card in cards { + group.addTask { + if await delegate.bilibiliDynamicCardsContains(card.bvid) { + return nil + } else { + return card + } + } + } + + var results = [BilibiliCard]() + for await result in group { + if let result { + results.append(result) + } } + return results } + if appends.count > 0 { + await delegate.bilibiliDynamicInsertCards(appends) + } + self.newDate = Date() } } catch let error { Log("Get bilibili dynamicList error: \(error)") } - canLoadMore = true - await MainActor.run { - delegate.bilibiliDynamicStatusChanged(false) - } - bookmarkLoaderTimer = Date() Log("\(uuid), finish, \(dynamicID)") } diff --git a/IINA+/Utils/Danmaku/BiliLiveDMv2.pb.swift b/IINA+/Utils/Danmaku/BiliLiveDMv2.pb.swift index 0fb6994b..5ef853a3 100644 --- a/IINA+/Utils/Danmaku/BiliLiveDMv2.pb.swift +++ b/IINA+/Utils/Danmaku/BiliLiveDMv2.pb.swift @@ -1,79 +1,17 @@ // DO NOT EDIT. // swift-format-ignore-file +// swiftlint:disable all // // Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: Bili_Live_dm_v2.proto +// Source: Live_dm_v2_2023_03_23.proto +// https://github.com/sjh8130/bili_danmaku/blob/master/tool_for_bili-live-dm/Live_dm_v2_2023_03_23.proto // // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ -// https://github.com/sjh8130/bili_danmaku -// https://github.com/sjh8130/bili_danmaku/blob/master/docs/Live_dm_v2_2023_03_23.proto - ///https://s1.hdslb.com/bfs/static/blive/blfe-live-room/static/js/app.****.js -/// dm_v2 -///[0][0] -///[0][1] mode root\\2 -///[0][2] size/fontsize root\\3 -///[0][3] color root\\4 -///[0][4] ctime root\\7 -///[0][5] dmid/rnd/danmakuRnd root\\9 -///[0][6] -///[0][7] midHash root\\5 -///[0][8] -///[0][9] type/danmakuType -///[0][10] chatBubbleType root\\12\\1 -///[0][11] chatBubbleColor root\\12\\2 -///[0][12] dm_type root\\13 -///[0][13] emoticonOptions root\\14! -///[0][14] voice root\\15 -///[0][15] emoticons/modeInfo root\\14! -///[0][16] Aggregation/danmakuAggregation root\\17 -///[0][17] chatBubbleId root\\12\\3 -///[1] text/content root\\6 -///[2][0] userInfo-> uid root\\20\\1 -///[2][1] userInfo-> username root\\20\\2 -///[2][2] userInfo-> isAdmin root\\20\\10 -///[2][3] userInfo-> isVip root\\20\\5 -///[2][4] userInfo-> isSvip root\\20\\6 -///[2][5] userInfo-> rank root\\20\\7 -///[2][6] userInfo-> verify root\\20\\8 -///[2][7] userInfo-> usernameColor root\\20\\3 -///[3][0] fansMedal-> level root\\20\\11\\1 -///[3][1] fansMedal-> label root\\20\\11\\2 -///[3][2] fansMedal-> anchorUsername root\\21\\2 -///[3][3] fansMedal-> RoomID -///[3][4] fansMedal-> medalColor root\\20\\11\\4 -///[3][5] fansMedal-> special root\\20\\11\\3 -///[3][6] fansMedal-> iconId root\\20\\11\\5 -///[3][7] fansMedal-> medalColorBorder root\\20\\11\\6 -///[3][8] fansMedal-> medalColorStart root\\20\\11\\7 -///[3][9] fansMedal-> medalColorEnd root\\20\\11\\8 -///[3][10] fansMedal-> guardLevel root\\20\\11\\9 -///[3][11] fansMedal-> isLight root\\20\\11\\10 -///[3][12] fansMedal-> anchorId root\\21\\1 -///[4][0] userLevel-> UL root\\20\\12\\1 -///[4][1] userLevel-> -///[4][2] userLevel-> *ULColor root\\20\\12\\2 -///[4][3] userLevel-> rank root\\20\\12\\3 -///[4][4] userLevel-> root\\20\\12\\4 -///[5][0] title -> old_title root\\20\\13\\2 -///[5][1] title -> title root\\20\\13\\1 -///[6] -///[7] guardLevel -///[8] -///[9] validation root\\19 -///[10] -///[11] -///[12] -///[13] -///[14] lpl -///[15] -///[16][0] Wealth -> level root\\20\\15\\1 -///[16][??] -///[16][??] -///[16][??] -///[16][??] +///https://s1.hdslb.com/bfs/static/player/main/core.****.js +/// DANMU_MSG dm_v2 import Foundation import SwiftProtobuf @@ -89,7 +27,7 @@ fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAP } ///11 -enum BilibiliDm_Community_Service_Dm_Live_BizScene: SwiftProtobuf.Enum { +enum BilibiliDm_Community_Service_Dm_Live_BizScene: SwiftProtobuf.Enum, Swift.CaseIterable { typealias RawValue = Int case none // = 0 case lottery // = 1 @@ -102,53 +40,47 @@ enum BilibiliDm_Community_Service_Dm_Live_BizScene: SwiftProtobuf.Enum { case UNRECOGNIZED(Int) init() { - self = .none + self = .none } init?(rawValue: Int) { - switch rawValue { - case 0: self = .none - case 1: self = .lottery - case 2: self = .survive - case 3: self = .voiceConn - case 4: self = .playBack - case 5: self = .vote - default: self = .UNRECOGNIZED(rawValue) - } + switch rawValue { + case 0: self = .none + case 1: self = .lottery + case 2: self = .survive + case 3: self = .voiceConn + case 4: self = .playBack + case 5: self = .vote + default: self = .UNRECOGNIZED(rawValue) + } } var rawValue: Int { - switch self { - case .none: return 0 - case .lottery: return 1 - case .survive: return 2 - case .voiceConn: return 3 - case .playBack: return 4 - case .vote: return 5 - case .UNRECOGNIZED(let i): return i - } + switch self { + case .none: return 0 + case .lottery: return 1 + case .survive: return 2 + case .voiceConn: return 3 + case .playBack: return 4 + case .vote: return 5 + case .UNRECOGNIZED(let i): return i + } } -} - -#if swift(>=4.2) - -extension BilibiliDm_Community_Service_Dm_Live_BizScene: CaseIterable { // The compiler won't synthesize support with the UNRECOGNIZED case. - static var allCases: [BilibiliDm_Community_Service_Dm_Live_BizScene] = [ - .none, - .lottery, - .survive, - .voiceConn, - .playBack, - .vote, + static let allCases: [BilibiliDm_Community_Service_Dm_Live_BizScene] = [ + .none, + .lottery, + .survive, + .voiceConn, + .playBack, + .vote, ] -} -#endif // swift(>=4.2) +} ///13 -enum BilibiliDm_Community_Service_Dm_Live_DmType: SwiftProtobuf.Enum { +enum BilibiliDm_Community_Service_Dm_Live_DmType: SwiftProtobuf.Enum, Swift.CaseIterable { typealias RawValue = Int case normal // = 0 case emoticon // = 1 @@ -156,114 +88,108 @@ enum BilibiliDm_Community_Service_Dm_Live_DmType: SwiftProtobuf.Enum { case UNRECOGNIZED(Int) init() { - self = .normal + self = .normal } init?(rawValue: Int) { - switch rawValue { - case 0: self = .normal - case 1: self = .emoticon - case 2: self = .voice - default: self = .UNRECOGNIZED(rawValue) - } + switch rawValue { + case 0: self = .normal + case 1: self = .emoticon + case 2: self = .voice + default: self = .UNRECOGNIZED(rawValue) + } } var rawValue: Int { - switch self { - case .normal: return 0 - case .emoticon: return 1 - case .voice: return 2 - case .UNRECOGNIZED(let i): return i - } + switch self { + case .normal: return 0 + case .emoticon: return 1 + case .voice: return 2 + case .UNRECOGNIZED(let i): return i + } } -} - -#if swift(>=4.2) - -extension BilibiliDm_Community_Service_Dm_Live_DmType: CaseIterable { // The compiler won't synthesize support with the UNRECOGNIZED case. - static var allCases: [BilibiliDm_Community_Service_Dm_Live_DmType] = [ - .normal, - .emoticon, - .voice, + static let allCases: [BilibiliDm_Community_Service_Dm_Live_DmType] = [ + .normal, + .emoticon, + .voice, ] -} -#endif // swift(>=4.2) +} -struct BilibiliDm_Community_Service_Dm_Live_Dm { +struct BilibiliDm_Community_Service_Dm_Live_Dm: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. /// [0][15].extra.id_str 新idstr - var dmid: String { - get {return _storage._dmid} - set {_uniqueStorage()._dmid = newValue} + var idStr: String { + get {return _storage._idStr} + set {_uniqueStorage()._idStr = newValue} } /// [0] [1] 弹幕类型 var mode: Int32 { - get {return _storage._mode} - set {_uniqueStorage()._mode = newValue} + get {return _storage._mode} + set {_uniqueStorage()._mode = newValue} } /// [0] [2] 弹幕字号 var size: Int32 { - get {return _storage._size} - set {_uniqueStorage()._size = newValue} + get {return _storage._size} + set {_uniqueStorage()._size = newValue} } /// [0] [3] 弹幕颜色 var color: UInt32 { - get {return _storage._color} - set {_uniqueStorage()._color = newValue} + get {return _storage._color} + set {_uniqueStorage()._color = newValue} } /// [0] [7] 发送者midHash var uhash: String { - get {return _storage._uhash} - set {_uniqueStorage()._uhash = newValue} + get {return _storage._uhash} + set {_uniqueStorage()._uhash = newValue} } /// [1] 弹幕正文 var text: String { - get {return _storage._text} - set {_uniqueStorage()._text = newValue} + get {return _storage._text} + set {_uniqueStorage()._text = newValue} } /// [0] [4] 发送时间TimeStamp(ms) var date: Int64 { - get {return _storage._date} - set {_uniqueStorage()._date = newValue} + get {return _storage._date} + set {_uniqueStorage()._date = newValue} } var weight: Int32 { - get {return _storage._weight} - set {_uniqueStorage()._weight = newValue} + get {return _storage._weight} + set {_uniqueStorage()._weight = newValue} } /// [0] [5] var rnd: Int64 { - get {return _storage._rnd} - set {_uniqueStorage()._rnd = newValue} + get {return _storage._rnd} + set {_uniqueStorage()._rnd = newValue} } var attr: Int64 { - get {return _storage._attr} - set {_uniqueStorage()._attr = newValue} + get {return _storage._attr} + set {_uniqueStorage()._attr = newValue} } var bizScene: BilibiliDm_Community_Service_Dm_Live_BizScene { - get {return _storage._bizScene} - set {_uniqueStorage()._bizScene = newValue} + get {return _storage._bizScene} + set {_uniqueStorage()._bizScene = newValue} } /// [0][11] chatBubble var bubble: BilibiliDm_Community_Service_Dm_Live_Bubble { - get {return _storage._bubble ?? BilibiliDm_Community_Service_Dm_Live_Bubble()} - set {_uniqueStorage()._bubble = newValue} + get {return _storage._bubble ?? BilibiliDm_Community_Service_Dm_Live_Bubble()} + set {_uniqueStorage()._bubble = newValue} } /// Returns true if `bubble` has been explicitly set. var hasBubble: Bool {return _storage._bubble != nil} @@ -272,20 +198,20 @@ struct BilibiliDm_Community_Service_Dm_Live_Dm { /// [0][12] DmType var dmType: BilibiliDm_Community_Service_Dm_Live_DmType { - get {return _storage._dmType} - set {_uniqueStorage()._dmType = newValue} + get {return _storage._dmType} + set {_uniqueStorage()._dmType = newValue} } /// map emoticons = 14; // [0][15] 表情 repeated - var emoticons: [BilibiliDm_Community_Service_Dm_Live_emots] { - get {return _storage._emoticons} - set {_uniqueStorage()._emoticons = newValue} + var emoticons: [BilibiliDm_Community_Service_Dm_Live_emots_temp] { + get {return _storage._emoticons} + set {_uniqueStorage()._emoticons = newValue} } /// [0][14] var voice: BilibiliDm_Community_Service_Dm_Live_Voice { - get {return _storage._voice ?? BilibiliDm_Community_Service_Dm_Live_Voice()} - set {_uniqueStorage()._voice = newValue} + get {return _storage._voice ?? BilibiliDm_Community_Service_Dm_Live_Voice()} + set {_uniqueStorage()._voice = newValue} } /// Returns true if `voice` has been explicitly set. var hasVoice: Bool {return _storage._voice != nil} @@ -293,14 +219,14 @@ struct BilibiliDm_Community_Service_Dm_Live_Dm { mutating func clearVoice() {_uniqueStorage()._voice = nil} var animation: String { - get {return _storage._animation} - set {_uniqueStorage()._animation = newValue} + get {return _storage._animation} + set {_uniqueStorage()._animation = newValue} } /// [0][16] 抽奖 var aggregation: BilibiliDm_Community_Service_Dm_Live_Aggregation { - get {return _storage._aggregation ?? BilibiliDm_Community_Service_Dm_Live_Aggregation()} - set {_uniqueStorage()._aggregation = newValue} + get {return _storage._aggregation ?? BilibiliDm_Community_Service_Dm_Live_Aggregation()} + set {_uniqueStorage()._aggregation = newValue} } /// Returns true if `aggregation` has been explicitly set. var hasAggregation: Bool {return _storage._aggregation != nil} @@ -309,14 +235,14 @@ struct BilibiliDm_Community_Service_Dm_Live_Dm { /// [0][15].extra var sendFromMe: Bool { - get {return _storage._sendFromMe} - set {_uniqueStorage()._sendFromMe = newValue} + get {return _storage._sendFromMe} + set {_uniqueStorage()._sendFromMe = newValue} } - /// [9] + /// [9] var check: BilibiliDm_Community_Service_Dm_Live_Check { - get {return _storage._check ?? BilibiliDm_Community_Service_Dm_Live_Check()} - set {_uniqueStorage()._check = newValue} + get {return _storage._check ?? BilibiliDm_Community_Service_Dm_Live_Check()} + set {_uniqueStorage()._check = newValue} } /// Returns true if `check` has been explicitly set. var hasCheck: Bool {return _storage._check != nil} @@ -325,8 +251,8 @@ struct BilibiliDm_Community_Service_Dm_Live_Dm { /// [2] 用户主站信息 var user: BilibiliDm_Community_Service_Dm_Live_User { - get {return _storage._user ?? BilibiliDm_Community_Service_Dm_Live_User()} - set {_uniqueStorage()._user = newValue} + get {return _storage._user ?? BilibiliDm_Community_Service_Dm_Live_User()} + set {_uniqueStorage()._user = newValue} } /// Returns true if `user` has been explicitly set. var hasUser: Bool {return _storage._user != nil} @@ -335,8 +261,8 @@ struct BilibiliDm_Community_Service_Dm_Live_Dm { /// [3] 粉丝勋章 var room: BilibiliDm_Community_Service_Dm_Live_Room { - get {return _storage._room ?? BilibiliDm_Community_Service_Dm_Live_Room()} - set {_uniqueStorage()._room = newValue} + get {return _storage._room ?? BilibiliDm_Community_Service_Dm_Live_Room()} + set {_uniqueStorage()._room = newValue} } /// Returns true if `room` has been explicitly set. var hasRoom: Bool {return _storage._room != nil} @@ -345,62 +271,66 @@ struct BilibiliDm_Community_Service_Dm_Live_Dm { /// [0][15].extra var icon: BilibiliDm_Community_Service_Dm_Live_Icon { - get {return _storage._icon ?? BilibiliDm_Community_Service_Dm_Live_Icon()} - set {_uniqueStorage()._icon = newValue} + get {return _storage._icon ?? BilibiliDm_Community_Service_Dm_Live_Icon()} + set {_uniqueStorage()._icon = newValue} } /// Returns true if `icon` has been explicitly set. var hasIcon: Bool {return _storage._icon != nil} /// Clears the value of `icon`. Subsequent reads from it will return its default value. mutating func clearIcon() {_uniqueStorage()._icon = nil} - var unknown23: Data { - get {return _storage._unknown23} - set {_uniqueStorage()._unknown23 = newValue} + var reply: BilibiliDm_Community_Service_Dm_Live_Reply { + get {return _storage._reply ?? BilibiliDm_Community_Service_Dm_Live_Reply()} + set {_uniqueStorage()._reply = newValue} } + /// Returns true if `reply` has been explicitly set. + var hasReply: Bool {return _storage._reply != nil} + /// Clears the value of `reply`. Subsequent reads from it will return its default value. + mutating func clearReply() {_uniqueStorage()._reply = nil} var unknown24: Data { - get {return _storage._unknown24} - set {_uniqueStorage()._unknown24 = newValue} + get {return _storage._unknown24} + set {_uniqueStorage()._unknown24 = newValue} } var unknown25: Data { - get {return _storage._unknown25} - set {_uniqueStorage()._unknown25 = newValue} + get {return _storage._unknown25} + set {_uniqueStorage()._unknown25 = newValue} } var unknown26: Data { - get {return _storage._unknown26} - set {_uniqueStorage()._unknown26 = newValue} + get {return _storage._unknown26} + set {_uniqueStorage()._unknown26 = newValue} } var unknown27: Data { - get {return _storage._unknown27} - set {_uniqueStorage()._unknown27 = newValue} + get {return _storage._unknown27} + set {_uniqueStorage()._unknown27 = newValue} } var unknown28: Data { - get {return _storage._unknown28} - set {_uniqueStorage()._unknown28 = newValue} + get {return _storage._unknown28} + set {_uniqueStorage()._unknown28 = newValue} } var unknown29: Data { - get {return _storage._unknown29} - set {_uniqueStorage()._unknown29 = newValue} + get {return _storage._unknown29} + set {_uniqueStorage()._unknown29 = newValue} } var unknown30: Data { - get {return _storage._unknown30} - set {_uniqueStorage()._unknown30 = newValue} + get {return _storage._unknown30} + set {_uniqueStorage()._unknown30 = newValue} } var unknown31: Data { - get {return _storage._unknown31} - set {_uniqueStorage()._unknown31 = newValue} + get {return _storage._unknown31} + set {_uniqueStorage()._unknown31 = newValue} } var unknown32: Data { - get {return _storage._unknown32} - set {_uniqueStorage()._unknown32 = newValue} + get {return _storage._unknown32} + set {_uniqueStorage()._unknown32 = newValue} } var unknownFields = SwiftProtobuf.UnknownStorage() @@ -411,7 +341,7 @@ struct BilibiliDm_Community_Service_Dm_Live_Dm { } ///19 -struct BilibiliDm_Community_Service_Dm_Live_Check { +struct BilibiliDm_Community_Service_Dm_Live_Check: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -428,7 +358,7 @@ struct BilibiliDm_Community_Service_Dm_Live_Check { } ///21 -struct BilibiliDm_Community_Service_Dm_Live_Room { +struct BilibiliDm_Community_Service_Dm_Live_Room: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -448,7 +378,7 @@ struct BilibiliDm_Community_Service_Dm_Live_Room { } ///12 -struct BilibiliDm_Community_Service_Dm_Live_Bubble { +struct BilibiliDm_Community_Service_Dm_Live_Bubble: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -468,7 +398,7 @@ struct BilibiliDm_Community_Service_Dm_Live_Bubble { } ///14-1 -struct BilibiliDm_Community_Service_Dm_Live_emots { +struct BilibiliDm_Community_Service_Dm_Live_emots_temp: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -478,8 +408,8 @@ struct BilibiliDm_Community_Service_Dm_Live_emots { /// [0][15].extra.emots var value: BilibiliDm_Community_Service_Dm_Live_Emoticon { - get {return _value ?? BilibiliDm_Community_Service_Dm_Live_Emoticon()} - set {_value = newValue} + get {return _value ?? BilibiliDm_Community_Service_Dm_Live_Emoticon()} + set {_value = newValue} } /// Returns true if `value` has been explicitly set. var hasValue: Bool {return self._value != nil} @@ -494,7 +424,7 @@ struct BilibiliDm_Community_Service_Dm_Live_emots { } ///14-2 -struct BilibiliDm_Community_Service_Dm_Live_Emoticon { +struct BilibiliDm_Community_Service_Dm_Live_Emoticon: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -526,7 +456,7 @@ struct BilibiliDm_Community_Service_Dm_Live_Emoticon { } ///15 -struct BilibiliDm_Community_Service_Dm_Live_Voice { +struct BilibiliDm_Community_Service_Dm_Live_Voice: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -552,7 +482,7 @@ struct BilibiliDm_Community_Service_Dm_Live_Voice { } ///17 -struct BilibiliDm_Community_Service_Dm_Live_Aggregation { +struct BilibiliDm_Community_Service_Dm_Live_Aggregation: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -575,75 +505,75 @@ struct BilibiliDm_Community_Service_Dm_Live_Aggregation { } ///20 -struct BilibiliDm_Community_Service_Dm_Live_User { +struct BilibiliDm_Community_Service_Dm_Live_User: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. ///bilibiliDm.community.service.dm.live.User var uid: Int64 { - get {return _storage._uid} - set {_uniqueStorage()._uid = newValue} + get {return _storage._uid} + set {_uniqueStorage()._uid = newValue} } /// [2][1] 昵称 var name: String { - get {return _storage._name} - set {_uniqueStorage()._name = newValue} + get {return _storage._name} + set {_uniqueStorage()._name = newValue} } /// [2][7] usernameColor var nameColor: String { - get {return _storage._nameColor} - set {_uniqueStorage()._nameColor = newValue} + get {return _storage._nameColor} + set {_uniqueStorage()._nameColor = newValue} } /// 用户头像URL var face: String { - get {return _storage._face} - set {_uniqueStorage()._face = newValue} + get {return _storage._face} + set {_uniqueStorage()._face = newValue} } /// [2][3] var vip: Int64 { - get {return _storage._vip} - set {_uniqueStorage()._vip = newValue} + get {return _storage._vip} + set {_uniqueStorage()._vip = newValue} } /// [2][4] var svip: Int64 { - get {return _storage._svip} - set {_uniqueStorage()._svip = newValue} + get {return _storage._svip} + set {_uniqueStorage()._svip = newValue} } /// [2][5] var rank: Int32 { - get {return _storage._rank} - set {_uniqueStorage()._rank = newValue} + get {return _storage._rank} + set {_uniqueStorage()._rank = newValue} } /// [2][6] 手机号验证 var mobileVerify: Int32 { - get {return _storage._mobileVerify} - set {_uniqueStorage()._mobileVerify = newValue} + get {return _storage._mobileVerify} + set {_uniqueStorage()._mobileVerify = newValue} } /// [14]? var lplStatus: Int64 { - get {return _storage._lplStatus} - set {_uniqueStorage()._lplStatus = newValue} + get {return _storage._lplStatus} + set {_uniqueStorage()._lplStatus = newValue} } /// [2][2] 房管 isAdmin var attr: Int64 { - get {return _storage._attr} - set {_uniqueStorage()._attr = newValue} + get {return _storage._attr} + set {_uniqueStorage()._attr = newValue} } /// [3] 粉丝勋章 var medal: BilibiliDm_Community_Service_Dm_Live_Medal { - get {return _storage._medal ?? BilibiliDm_Community_Service_Dm_Live_Medal()} - set {_uniqueStorage()._medal = newValue} + get {return _storage._medal ?? BilibiliDm_Community_Service_Dm_Live_Medal()} + set {_uniqueStorage()._medal = newValue} } /// Returns true if `medal` has been explicitly set. var hasMedal: Bool {return _storage._medal != nil} @@ -652,8 +582,8 @@ struct BilibiliDm_Community_Service_Dm_Live_User { /// [4] 用户直播区信息 var level: BilibiliDm_Community_Service_Dm_Live_UserLevel { - get {return _storage._level ?? BilibiliDm_Community_Service_Dm_Live_UserLevel()} - set {_uniqueStorage()._level = newValue} + get {return _storage._level ?? BilibiliDm_Community_Service_Dm_Live_UserLevel()} + set {_uniqueStorage()._level = newValue} } /// Returns true if `level` has been explicitly set. var hasLevel: Bool {return _storage._level != nil} @@ -662,8 +592,8 @@ struct BilibiliDm_Community_Service_Dm_Live_User { /// [5] 头衔 var title: BilibiliDm_Community_Service_Dm_Live_Title { - get {return _storage._title ?? BilibiliDm_Community_Service_Dm_Live_Title()} - set {_uniqueStorage()._title = newValue} + get {return _storage._title ?? BilibiliDm_Community_Service_Dm_Live_Title()} + set {_uniqueStorage()._title = newValue} } /// Returns true if `title` has been explicitly set. var hasTitle: Bool {return _storage._title != nil} @@ -671,8 +601,8 @@ struct BilibiliDm_Community_Service_Dm_Live_User { mutating func clearTitle() {_uniqueStorage()._title = nil} var identify: BilibiliDm_Community_Service_Dm_Live_Identify { - get {return _storage._identify ?? BilibiliDm_Community_Service_Dm_Live_Identify()} - set {_uniqueStorage()._identify = newValue} + get {return _storage._identify ?? BilibiliDm_Community_Service_Dm_Live_Identify()} + set {_uniqueStorage()._identify = newValue} } /// Returns true if `identify` has been explicitly set. var hasIdentify: Bool {return _storage._identify != nil} @@ -681,14 +611,23 @@ struct BilibiliDm_Community_Service_Dm_Live_User { /// 20230601~20230620 var wealth: BilibiliDm_Community_Service_Dm_Live_Wealth { - get {return _storage._wealth ?? BilibiliDm_Community_Service_Dm_Live_Wealth()} - set {_uniqueStorage()._wealth = newValue} + get {return _storage._wealth ?? BilibiliDm_Community_Service_Dm_Live_Wealth()} + set {_uniqueStorage()._wealth = newValue} } /// Returns true if `wealth` has been explicitly set. var hasWealth: Bool {return _storage._wealth != nil} /// Clears the value of `wealth`. Subsequent reads from it will return its default value. mutating func clearWealth() {_uniqueStorage()._wealth = nil} + var groupMedal: BilibiliDm_Community_Service_Dm_Live_GroupMedal { + get {return _storage._groupMedal ?? BilibiliDm_Community_Service_Dm_Live_GroupMedal()} + set {_uniqueStorage()._groupMedal = newValue} + } + /// Returns true if `groupMedal` has been explicitly set. + var hasGroupMedal: Bool {return _storage._groupMedal != nil} + /// Clears the value of `groupMedal`. Subsequent reads from it will return its default value. + mutating func clearGroupMedal() {_uniqueStorage()._groupMedal = nil} + var unknownFields = SwiftProtobuf.UnknownStorage() init() {} @@ -697,7 +636,7 @@ struct BilibiliDm_Community_Service_Dm_Live_User { } ///20-14 -struct BilibiliDm_Community_Service_Dm_Live_Identify { +struct BilibiliDm_Community_Service_Dm_Live_Identify: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -715,7 +654,7 @@ struct BilibiliDm_Community_Service_Dm_Live_Identify { } ///20-11 -struct BilibiliDm_Community_Service_Dm_Live_Medal { +struct BilibiliDm_Community_Service_Dm_Live_Medal: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -756,7 +695,7 @@ struct BilibiliDm_Community_Service_Dm_Live_Medal { } ///20-12 -struct BilibiliDm_Community_Service_Dm_Live_UserLevel { +struct BilibiliDm_Community_Service_Dm_Live_UserLevel: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -779,13 +718,13 @@ struct BilibiliDm_Community_Service_Dm_Live_UserLevel { } ///20-13 -struct BilibiliDm_Community_Service_Dm_Live_Title { +struct BilibiliDm_Community_Service_Dm_Live_Title: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. ///bilibiliDm.community.service.dm.live.Title - var title1: String = String() + var title: String = String() /// [5] var oldTitle: String = String() @@ -795,7 +734,7 @@ struct BilibiliDm_Community_Service_Dm_Live_Title { init() {} } -struct BilibiliDm_Community_Service_Dm_Live_Record { +struct BilibiliDm_Community_Service_Dm_Live_Record: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -811,7 +750,7 @@ struct BilibiliDm_Community_Service_Dm_Live_Record { } ///20-15 -struct BilibiliDm_Community_Service_Dm_Live_Wealth { +struct BilibiliDm_Community_Service_Dm_Live_Wealth: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -825,15 +764,15 @@ struct BilibiliDm_Community_Service_Dm_Live_Wealth { } ///22 -struct BilibiliDm_Community_Service_Dm_Live_Icon { +struct BilibiliDm_Community_Service_Dm_Live_Icon: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. /// bilibiliDm.community.service.dm.live.Icon var prefix: BilibiliDm_Community_Service_Dm_Live_Prefix { - get {return _prefix ?? BilibiliDm_Community_Service_Dm_Live_Prefix()} - set {_prefix = newValue} + get {return _prefix ?? BilibiliDm_Community_Service_Dm_Live_Prefix()} + set {_prefix = newValue} } /// Returns true if `prefix` has been explicitly set. var hasPrefix: Bool {return self._prefix != nil} @@ -847,7 +786,7 @@ struct BilibiliDm_Community_Service_Dm_Live_Icon { fileprivate var _prefix: BilibiliDm_Community_Service_Dm_Live_Prefix? = nil } -struct BilibiliDm_Community_Service_Dm_Live_Prefix { +struct BilibiliDm_Community_Service_Dm_Live_Prefix: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -862,27 +801,48 @@ struct BilibiliDm_Community_Service_Dm_Live_Prefix { init() {} } -#if swift(>=5.5) && canImport(_Concurrency) -extension BilibiliDm_Community_Service_Dm_Live_BizScene: @unchecked Sendable {} -extension BilibiliDm_Community_Service_Dm_Live_DmType: @unchecked Sendable {} -extension BilibiliDm_Community_Service_Dm_Live_Dm: @unchecked Sendable {} -extension BilibiliDm_Community_Service_Dm_Live_Check: @unchecked Sendable {} -extension BilibiliDm_Community_Service_Dm_Live_Room: @unchecked Sendable {} -extension BilibiliDm_Community_Service_Dm_Live_Bubble: @unchecked Sendable {} -extension BilibiliDm_Community_Service_Dm_Live_emots: @unchecked Sendable {} -extension BilibiliDm_Community_Service_Dm_Live_Emoticon: @unchecked Sendable {} -extension BilibiliDm_Community_Service_Dm_Live_Voice: @unchecked Sendable {} -extension BilibiliDm_Community_Service_Dm_Live_Aggregation: @unchecked Sendable {} -extension BilibiliDm_Community_Service_Dm_Live_User: @unchecked Sendable {} -extension BilibiliDm_Community_Service_Dm_Live_Identify: @unchecked Sendable {} -extension BilibiliDm_Community_Service_Dm_Live_Medal: @unchecked Sendable {} -extension BilibiliDm_Community_Service_Dm_Live_UserLevel: @unchecked Sendable {} -extension BilibiliDm_Community_Service_Dm_Live_Title: @unchecked Sendable {} -extension BilibiliDm_Community_Service_Dm_Live_Record: @unchecked Sendable {} -extension BilibiliDm_Community_Service_Dm_Live_Wealth: @unchecked Sendable {} -extension BilibiliDm_Community_Service_Dm_Live_Icon: @unchecked Sendable {} -extension BilibiliDm_Community_Service_Dm_Live_Prefix: @unchecked Sendable {} -#endif // swift(>=5.5) && canImport(_Concurrency) +///17 +struct BilibiliDm_Community_Service_Dm_Live_GroupMedal: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + ///bilibiliDm.community.service.dm.live.GroupMedal + var medalID: Int64 = 0 + + ///[17][1] + var name: String = String() + + ///[17][2] + var isLighted: Int64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +///23 +struct BilibiliDm_Community_Service_Dm_Live_Reply: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + ///[0][15].extra + var showReply: Bool = false + + ///[0][15].extra + var replyMid: Int64 = 0 + + ///[0][15].extra + var replyUname: String = String() + + ///[0][15].extra + var replyUnameColor: String = String() + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} // MARK: - Code below here is support for the SwiftProtobuf runtime. @@ -890,1219 +850,1337 @@ fileprivate let _protobuf_package = "bilibiliDm.community.service.dm.live" extension BilibiliDm_Community_Service_Dm_Live_BizScene: SwiftProtobuf._ProtoNameProviding { static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "BizSceneNone"), - 1: .same(proto: "BizSceneLottery"), - 2: .same(proto: "BizSceneSurvive"), - 3: .same(proto: "BizSceneVoiceConn"), - 4: .same(proto: "BizScenePlayBack"), - 5: .same(proto: "BizSceneVote"), + 0: .same(proto: "BizSceneNone"), + 1: .same(proto: "BizSceneLottery"), + 2: .same(proto: "BizSceneSurvive"), + 3: .same(proto: "BizSceneVoiceConn"), + 4: .same(proto: "BizScenePlayBack"), + 5: .same(proto: "BizSceneVote"), ] } extension BilibiliDm_Community_Service_Dm_Live_DmType: SwiftProtobuf._ProtoNameProviding { static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "DmTypeNormal"), - 1: .same(proto: "DmTypeEmoticon"), - 2: .same(proto: "DmTypeVoice"), + 0: .same(proto: "DmTypeNormal"), + 1: .same(proto: "DmTypeEmoticon"), + 2: .same(proto: "DmTypeVoice"), ] } extension BilibiliDm_Community_Service_Dm_Live_Dm: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".Dm" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "dmid"), - 2: .same(proto: "mode"), - 3: .same(proto: "size"), - 4: .same(proto: "color"), - 5: .same(proto: "uhash"), - 6: .same(proto: "text"), - 7: .same(proto: "date"), - 8: .same(proto: "weight"), - 9: .same(proto: "rnd"), - 10: .same(proto: "attr"), - 11: .standard(proto: "biz_scene"), - 12: .same(proto: "bubble"), - 13: .standard(proto: "dm_type"), - 14: .same(proto: "emoticons"), - 15: .same(proto: "voice"), - 16: .same(proto: "animation"), - 17: .same(proto: "aggregation"), - 18: .standard(proto: "send_from_me"), - 19: .same(proto: "check"), - 20: .same(proto: "user"), - 21: .same(proto: "room"), - 22: .same(proto: "icon"), - 23: .same(proto: "unknown23"), - 24: .same(proto: "unknown24"), - 25: .same(proto: "unknown25"), - 26: .same(proto: "unknown26"), - 27: .same(proto: "unknown27"), - 28: .same(proto: "unknown28"), - 29: .same(proto: "unknown29"), - 30: .same(proto: "unknown30"), - 31: .same(proto: "unknown31"), - 32: .same(proto: "unknown32"), + 1: .standard(proto: "id_str"), + 2: .same(proto: "mode"), + 3: .same(proto: "size"), + 4: .same(proto: "color"), + 5: .same(proto: "uhash"), + 6: .same(proto: "text"), + 7: .same(proto: "date"), + 8: .same(proto: "weight"), + 9: .same(proto: "rnd"), + 10: .same(proto: "attr"), + 11: .standard(proto: "biz_scene"), + 12: .same(proto: "bubble"), + 13: .standard(proto: "dm_type"), + 14: .same(proto: "emoticons"), + 15: .same(proto: "voice"), + 16: .same(proto: "animation"), + 17: .same(proto: "aggregation"), + 18: .standard(proto: "send_from_me"), + 19: .same(proto: "check"), + 20: .same(proto: "user"), + 21: .same(proto: "room"), + 22: .same(proto: "icon"), + 23: .same(proto: "reply"), + 24: .same(proto: "unknown24"), + 25: .same(proto: "unknown25"), + 26: .same(proto: "unknown26"), + 27: .same(proto: "unknown27"), + 28: .same(proto: "unknown28"), + 29: .same(proto: "unknown29"), + 30: .same(proto: "unknown30"), + 31: .same(proto: "unknown31"), + 32: .same(proto: "unknown32"), ] fileprivate class _StorageClass { - var _dmid: String = String() - var _mode: Int32 = 0 - var _size: Int32 = 0 - var _color: UInt32 = 0 - var _uhash: String = String() - var _text: String = String() - var _date: Int64 = 0 - var _weight: Int32 = 0 - var _rnd: Int64 = 0 - var _attr: Int64 = 0 - var _bizScene: BilibiliDm_Community_Service_Dm_Live_BizScene = .none - var _bubble: BilibiliDm_Community_Service_Dm_Live_Bubble? = nil - var _dmType: BilibiliDm_Community_Service_Dm_Live_DmType = .normal - var _emoticons: [BilibiliDm_Community_Service_Dm_Live_emots] = [] - var _voice: BilibiliDm_Community_Service_Dm_Live_Voice? = nil - var _animation: String = String() - var _aggregation: BilibiliDm_Community_Service_Dm_Live_Aggregation? = nil - var _sendFromMe: Bool = false - var _check: BilibiliDm_Community_Service_Dm_Live_Check? = nil - var _user: BilibiliDm_Community_Service_Dm_Live_User? = nil - var _room: BilibiliDm_Community_Service_Dm_Live_Room? = nil - var _icon: BilibiliDm_Community_Service_Dm_Live_Icon? = nil - var _unknown23: Data = Data() - var _unknown24: Data = Data() - var _unknown25: Data = Data() - var _unknown26: Data = Data() - var _unknown27: Data = Data() - var _unknown28: Data = Data() - var _unknown29: Data = Data() - var _unknown30: Data = Data() - var _unknown31: Data = Data() - var _unknown32: Data = Data() - - static let defaultInstance = _StorageClass() - - private init() {} - - init(copying source: _StorageClass) { - _dmid = source._dmid - _mode = source._mode - _size = source._size - _color = source._color - _uhash = source._uhash - _text = source._text - _date = source._date - _weight = source._weight - _rnd = source._rnd - _attr = source._attr - _bizScene = source._bizScene - _bubble = source._bubble - _dmType = source._dmType - _emoticons = source._emoticons - _voice = source._voice - _animation = source._animation - _aggregation = source._aggregation - _sendFromMe = source._sendFromMe - _check = source._check - _user = source._user - _room = source._room - _icon = source._icon - _unknown23 = source._unknown23 - _unknown24 = source._unknown24 - _unknown25 = source._unknown25 - _unknown26 = source._unknown26 - _unknown27 = source._unknown27 - _unknown28 = source._unknown28 - _unknown29 = source._unknown29 - _unknown30 = source._unknown30 - _unknown31 = source._unknown31 - _unknown32 = source._unknown32 - } + var _idStr: String = String() + var _mode: Int32 = 0 + var _size: Int32 = 0 + var _color: UInt32 = 0 + var _uhash: String = String() + var _text: String = String() + var _date: Int64 = 0 + var _weight: Int32 = 0 + var _rnd: Int64 = 0 + var _attr: Int64 = 0 + var _bizScene: BilibiliDm_Community_Service_Dm_Live_BizScene = .none + var _bubble: BilibiliDm_Community_Service_Dm_Live_Bubble? = nil + var _dmType: BilibiliDm_Community_Service_Dm_Live_DmType = .normal + var _emoticons: [BilibiliDm_Community_Service_Dm_Live_emots_temp] = [] + var _voice: BilibiliDm_Community_Service_Dm_Live_Voice? = nil + var _animation: String = String() + var _aggregation: BilibiliDm_Community_Service_Dm_Live_Aggregation? = nil + var _sendFromMe: Bool = false + var _check: BilibiliDm_Community_Service_Dm_Live_Check? = nil + var _user: BilibiliDm_Community_Service_Dm_Live_User? = nil + var _room: BilibiliDm_Community_Service_Dm_Live_Room? = nil + var _icon: BilibiliDm_Community_Service_Dm_Live_Icon? = nil + var _reply: BilibiliDm_Community_Service_Dm_Live_Reply? = nil + var _unknown24: Data = Data() + var _unknown25: Data = Data() + var _unknown26: Data = Data() + var _unknown27: Data = Data() + var _unknown28: Data = Data() + var _unknown29: Data = Data() + var _unknown30: Data = Data() + var _unknown31: Data = Data() + var _unknown32: Data = Data() + + #if swift(>=5.10) + // This property is used as the initial default value for new instances of the type. + // The type itself is protecting the reference to its storage via CoW semantics. + // This will force a copy to be made of this reference when the first mutation occurs; + // hence, it is safe to mark this as `nonisolated(unsafe)`. + static nonisolated(unsafe) let defaultInstance = _StorageClass() + #else + static let defaultInstance = _StorageClass() + #endif + + private init() {} + + init(copying source: _StorageClass) { + _idStr = source._idStr + _mode = source._mode + _size = source._size + _color = source._color + _uhash = source._uhash + _text = source._text + _date = source._date + _weight = source._weight + _rnd = source._rnd + _attr = source._attr + _bizScene = source._bizScene + _bubble = source._bubble + _dmType = source._dmType + _emoticons = source._emoticons + _voice = source._voice + _animation = source._animation + _aggregation = source._aggregation + _sendFromMe = source._sendFromMe + _check = source._check + _user = source._user + _room = source._room + _icon = source._icon + _reply = source._reply + _unknown24 = source._unknown24 + _unknown25 = source._unknown25 + _unknown26 = source._unknown26 + _unknown27 = source._unknown27 + _unknown28 = source._unknown28 + _unknown29 = source._unknown29 + _unknown30 = source._unknown30 + _unknown31 = source._unknown31 + _unknown32 = source._unknown32 + } } fileprivate mutating func _uniqueStorage() -> _StorageClass { - if !isKnownUniquelyReferenced(&_storage) { - _storage = _StorageClass(copying: _storage) - } - return _storage + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage } mutating func decodeMessage(decoder: inout D) throws { - _ = _uniqueStorage() - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &_storage._dmid) }() - case 2: try { try decoder.decodeSingularInt32Field(value: &_storage._mode) }() - case 3: try { try decoder.decodeSingularInt32Field(value: &_storage._size) }() - case 4: try { try decoder.decodeSingularUInt32Field(value: &_storage._color) }() - case 5: try { try decoder.decodeSingularStringField(value: &_storage._uhash) }() - case 6: try { try decoder.decodeSingularStringField(value: &_storage._text) }() - case 7: try { try decoder.decodeSingularInt64Field(value: &_storage._date) }() - case 8: try { try decoder.decodeSingularInt32Field(value: &_storage._weight) }() - case 9: try { try decoder.decodeSingularInt64Field(value: &_storage._rnd) }() - case 10: try { try decoder.decodeSingularInt64Field(value: &_storage._attr) }() - case 11: try { try decoder.decodeSingularEnumField(value: &_storage._bizScene) }() - case 12: try { try decoder.decodeSingularMessageField(value: &_storage._bubble) }() - case 13: try { try decoder.decodeSingularEnumField(value: &_storage._dmType) }() - case 14: try { try decoder.decodeRepeatedMessageField(value: &_storage._emoticons) }() - case 15: try { try decoder.decodeSingularMessageField(value: &_storage._voice) }() - case 16: try { try decoder.decodeSingularStringField(value: &_storage._animation) }() - case 17: try { try decoder.decodeSingularMessageField(value: &_storage._aggregation) }() - case 18: try { try decoder.decodeSingularBoolField(value: &_storage._sendFromMe) }() - case 19: try { try decoder.decodeSingularMessageField(value: &_storage._check) }() - case 20: try { try decoder.decodeSingularMessageField(value: &_storage._user) }() - case 21: try { try decoder.decodeSingularMessageField(value: &_storage._room) }() - case 22: try { try decoder.decodeSingularMessageField(value: &_storage._icon) }() - case 23: try { try decoder.decodeSingularBytesField(value: &_storage._unknown23) }() - case 24: try { try decoder.decodeSingularBytesField(value: &_storage._unknown24) }() - case 25: try { try decoder.decodeSingularBytesField(value: &_storage._unknown25) }() - case 26: try { try decoder.decodeSingularBytesField(value: &_storage._unknown26) }() - case 27: try { try decoder.decodeSingularBytesField(value: &_storage._unknown27) }() - case 28: try { try decoder.decodeSingularBytesField(value: &_storage._unknown28) }() - case 29: try { try decoder.decodeSingularBytesField(value: &_storage._unknown29) }() - case 30: try { try decoder.decodeSingularBytesField(value: &_storage._unknown30) }() - case 31: try { try decoder.decodeSingularBytesField(value: &_storage._unknown31) }() - case 32: try { try decoder.decodeSingularBytesField(value: &_storage._unknown32) }() - default: break - } - } - } + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &_storage._idStr) }() + case 2: try { try decoder.decodeSingularInt32Field(value: &_storage._mode) }() + case 3: try { try decoder.decodeSingularInt32Field(value: &_storage._size) }() + case 4: try { try decoder.decodeSingularUInt32Field(value: &_storage._color) }() + case 5: try { try decoder.decodeSingularStringField(value: &_storage._uhash) }() + case 6: try { try decoder.decodeSingularStringField(value: &_storage._text) }() + case 7: try { try decoder.decodeSingularInt64Field(value: &_storage._date) }() + case 8: try { try decoder.decodeSingularInt32Field(value: &_storage._weight) }() + case 9: try { try decoder.decodeSingularInt64Field(value: &_storage._rnd) }() + case 10: try { try decoder.decodeSingularInt64Field(value: &_storage._attr) }() + case 11: try { try decoder.decodeSingularEnumField(value: &_storage._bizScene) }() + case 12: try { try decoder.decodeSingularMessageField(value: &_storage._bubble) }() + case 13: try { try decoder.decodeSingularEnumField(value: &_storage._dmType) }() + case 14: try { try decoder.decodeRepeatedMessageField(value: &_storage._emoticons) }() + case 15: try { try decoder.decodeSingularMessageField(value: &_storage._voice) }() + case 16: try { try decoder.decodeSingularStringField(value: &_storage._animation) }() + case 17: try { try decoder.decodeSingularMessageField(value: &_storage._aggregation) }() + case 18: try { try decoder.decodeSingularBoolField(value: &_storage._sendFromMe) }() + case 19: try { try decoder.decodeSingularMessageField(value: &_storage._check) }() + case 20: try { try decoder.decodeSingularMessageField(value: &_storage._user) }() + case 21: try { try decoder.decodeSingularMessageField(value: &_storage._room) }() + case 22: try { try decoder.decodeSingularMessageField(value: &_storage._icon) }() + case 23: try { try decoder.decodeSingularMessageField(value: &_storage._reply) }() + case 24: try { try decoder.decodeSingularBytesField(value: &_storage._unknown24) }() + case 25: try { try decoder.decodeSingularBytesField(value: &_storage._unknown25) }() + case 26: try { try decoder.decodeSingularBytesField(value: &_storage._unknown26) }() + case 27: try { try decoder.decodeSingularBytesField(value: &_storage._unknown27) }() + case 28: try { try decoder.decodeSingularBytesField(value: &_storage._unknown28) }() + case 29: try { try decoder.decodeSingularBytesField(value: &_storage._unknown29) }() + case 30: try { try decoder.decodeSingularBytesField(value: &_storage._unknown30) }() + case 31: try { try decoder.decodeSingularBytesField(value: &_storage._unknown31) }() + case 32: try { try decoder.decodeSingularBytesField(value: &_storage._unknown32) }() + default: break + } + } + } } func traverse(visitor: inout V) throws { - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if !_storage._dmid.isEmpty { - try visitor.visitSingularStringField(value: _storage._dmid, fieldNumber: 1) - } - if _storage._mode != 0 { - try visitor.visitSingularInt32Field(value: _storage._mode, fieldNumber: 2) - } - if _storage._size != 0 { - try visitor.visitSingularInt32Field(value: _storage._size, fieldNumber: 3) - } - if _storage._color != 0 { - try visitor.visitSingularUInt32Field(value: _storage._color, fieldNumber: 4) - } - if !_storage._uhash.isEmpty { - try visitor.visitSingularStringField(value: _storage._uhash, fieldNumber: 5) - } - if !_storage._text.isEmpty { - try visitor.visitSingularStringField(value: _storage._text, fieldNumber: 6) - } - if _storage._date != 0 { - try visitor.visitSingularInt64Field(value: _storage._date, fieldNumber: 7) - } - if _storage._weight != 0 { - try visitor.visitSingularInt32Field(value: _storage._weight, fieldNumber: 8) - } - if _storage._rnd != 0 { - try visitor.visitSingularInt64Field(value: _storage._rnd, fieldNumber: 9) - } - if _storage._attr != 0 { - try visitor.visitSingularInt64Field(value: _storage._attr, fieldNumber: 10) - } - if _storage._bizScene != .none { - try visitor.visitSingularEnumField(value: _storage._bizScene, fieldNumber: 11) - } - try { if let v = _storage._bubble { - try visitor.visitSingularMessageField(value: v, fieldNumber: 12) - } }() - if _storage._dmType != .normal { - try visitor.visitSingularEnumField(value: _storage._dmType, fieldNumber: 13) - } - if !_storage._emoticons.isEmpty { - try visitor.visitRepeatedMessageField(value: _storage._emoticons, fieldNumber: 14) - } - try { if let v = _storage._voice { - try visitor.visitSingularMessageField(value: v, fieldNumber: 15) - } }() - if !_storage._animation.isEmpty { - try visitor.visitSingularStringField(value: _storage._animation, fieldNumber: 16) - } - try { if let v = _storage._aggregation { - try visitor.visitSingularMessageField(value: v, fieldNumber: 17) - } }() - if _storage._sendFromMe != false { - try visitor.visitSingularBoolField(value: _storage._sendFromMe, fieldNumber: 18) - } - try { if let v = _storage._check { - try visitor.visitSingularMessageField(value: v, fieldNumber: 19) - } }() - try { if let v = _storage._user { - try visitor.visitSingularMessageField(value: v, fieldNumber: 20) - } }() - try { if let v = _storage._room { - try visitor.visitSingularMessageField(value: v, fieldNumber: 21) - } }() - try { if let v = _storage._icon { - try visitor.visitSingularMessageField(value: v, fieldNumber: 22) - } }() - if !_storage._unknown23.isEmpty { - try visitor.visitSingularBytesField(value: _storage._unknown23, fieldNumber: 23) - } - if !_storage._unknown24.isEmpty { - try visitor.visitSingularBytesField(value: _storage._unknown24, fieldNumber: 24) - } - if !_storage._unknown25.isEmpty { - try visitor.visitSingularBytesField(value: _storage._unknown25, fieldNumber: 25) - } - if !_storage._unknown26.isEmpty { - try visitor.visitSingularBytesField(value: _storage._unknown26, fieldNumber: 26) - } - if !_storage._unknown27.isEmpty { - try visitor.visitSingularBytesField(value: _storage._unknown27, fieldNumber: 27) - } - if !_storage._unknown28.isEmpty { - try visitor.visitSingularBytesField(value: _storage._unknown28, fieldNumber: 28) - } - if !_storage._unknown29.isEmpty { - try visitor.visitSingularBytesField(value: _storage._unknown29, fieldNumber: 29) - } - if !_storage._unknown30.isEmpty { - try visitor.visitSingularBytesField(value: _storage._unknown30, fieldNumber: 30) - } - if !_storage._unknown31.isEmpty { - try visitor.visitSingularBytesField(value: _storage._unknown31, fieldNumber: 31) - } - if !_storage._unknown32.isEmpty { - try visitor.visitSingularBytesField(value: _storage._unknown32, fieldNumber: 32) - } - } - try unknownFields.traverse(visitor: &visitor) + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if !_storage._idStr.isEmpty { + try visitor.visitSingularStringField(value: _storage._idStr, fieldNumber: 1) + } + if _storage._mode != 0 { + try visitor.visitSingularInt32Field(value: _storage._mode, fieldNumber: 2) + } + if _storage._size != 0 { + try visitor.visitSingularInt32Field(value: _storage._size, fieldNumber: 3) + } + if _storage._color != 0 { + try visitor.visitSingularUInt32Field(value: _storage._color, fieldNumber: 4) + } + if !_storage._uhash.isEmpty { + try visitor.visitSingularStringField(value: _storage._uhash, fieldNumber: 5) + } + if !_storage._text.isEmpty { + try visitor.visitSingularStringField(value: _storage._text, fieldNumber: 6) + } + if _storage._date != 0 { + try visitor.visitSingularInt64Field(value: _storage._date, fieldNumber: 7) + } + if _storage._weight != 0 { + try visitor.visitSingularInt32Field(value: _storage._weight, fieldNumber: 8) + } + if _storage._rnd != 0 { + try visitor.visitSingularInt64Field(value: _storage._rnd, fieldNumber: 9) + } + if _storage._attr != 0 { + try visitor.visitSingularInt64Field(value: _storage._attr, fieldNumber: 10) + } + if _storage._bizScene != .none { + try visitor.visitSingularEnumField(value: _storage._bizScene, fieldNumber: 11) + } + try { if let v = _storage._bubble { + try visitor.visitSingularMessageField(value: v, fieldNumber: 12) + } }() + if _storage._dmType != .normal { + try visitor.visitSingularEnumField(value: _storage._dmType, fieldNumber: 13) + } + if !_storage._emoticons.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._emoticons, fieldNumber: 14) + } + try { if let v = _storage._voice { + try visitor.visitSingularMessageField(value: v, fieldNumber: 15) + } }() + if !_storage._animation.isEmpty { + try visitor.visitSingularStringField(value: _storage._animation, fieldNumber: 16) + } + try { if let v = _storage._aggregation { + try visitor.visitSingularMessageField(value: v, fieldNumber: 17) + } }() + if _storage._sendFromMe != false { + try visitor.visitSingularBoolField(value: _storage._sendFromMe, fieldNumber: 18) + } + try { if let v = _storage._check { + try visitor.visitSingularMessageField(value: v, fieldNumber: 19) + } }() + try { if let v = _storage._user { + try visitor.visitSingularMessageField(value: v, fieldNumber: 20) + } }() + try { if let v = _storage._room { + try visitor.visitSingularMessageField(value: v, fieldNumber: 21) + } }() + try { if let v = _storage._icon { + try visitor.visitSingularMessageField(value: v, fieldNumber: 22) + } }() + try { if let v = _storage._reply { + try visitor.visitSingularMessageField(value: v, fieldNumber: 23) + } }() + if !_storage._unknown24.isEmpty { + try visitor.visitSingularBytesField(value: _storage._unknown24, fieldNumber: 24) + } + if !_storage._unknown25.isEmpty { + try visitor.visitSingularBytesField(value: _storage._unknown25, fieldNumber: 25) + } + if !_storage._unknown26.isEmpty { + try visitor.visitSingularBytesField(value: _storage._unknown26, fieldNumber: 26) + } + if !_storage._unknown27.isEmpty { + try visitor.visitSingularBytesField(value: _storage._unknown27, fieldNumber: 27) + } + if !_storage._unknown28.isEmpty { + try visitor.visitSingularBytesField(value: _storage._unknown28, fieldNumber: 28) + } + if !_storage._unknown29.isEmpty { + try visitor.visitSingularBytesField(value: _storage._unknown29, fieldNumber: 29) + } + if !_storage._unknown30.isEmpty { + try visitor.visitSingularBytesField(value: _storage._unknown30, fieldNumber: 30) + } + if !_storage._unknown31.isEmpty { + try visitor.visitSingularBytesField(value: _storage._unknown31, fieldNumber: 31) + } + if !_storage._unknown32.isEmpty { + try visitor.visitSingularBytesField(value: _storage._unknown32, fieldNumber: 32) + } + } + try unknownFields.traverse(visitor: &visitor) } static func ==(lhs: BilibiliDm_Community_Service_Dm_Live_Dm, rhs: BilibiliDm_Community_Service_Dm_Live_Dm) -> Bool { - if lhs._storage !== rhs._storage { - let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in - let _storage = _args.0 - let rhs_storage = _args.1 - if _storage._dmid != rhs_storage._dmid {return false} - if _storage._mode != rhs_storage._mode {return false} - if _storage._size != rhs_storage._size {return false} - if _storage._color != rhs_storage._color {return false} - if _storage._uhash != rhs_storage._uhash {return false} - if _storage._text != rhs_storage._text {return false} - if _storage._date != rhs_storage._date {return false} - if _storage._weight != rhs_storage._weight {return false} - if _storage._rnd != rhs_storage._rnd {return false} - if _storage._attr != rhs_storage._attr {return false} - if _storage._bizScene != rhs_storage._bizScene {return false} - if _storage._bubble != rhs_storage._bubble {return false} - if _storage._dmType != rhs_storage._dmType {return false} - if _storage._emoticons != rhs_storage._emoticons {return false} - if _storage._voice != rhs_storage._voice {return false} - if _storage._animation != rhs_storage._animation {return false} - if _storage._aggregation != rhs_storage._aggregation {return false} - if _storage._sendFromMe != rhs_storage._sendFromMe {return false} - if _storage._check != rhs_storage._check {return false} - if _storage._user != rhs_storage._user {return false} - if _storage._room != rhs_storage._room {return false} - if _storage._icon != rhs_storage._icon {return false} - if _storage._unknown23 != rhs_storage._unknown23 {return false} - if _storage._unknown24 != rhs_storage._unknown24 {return false} - if _storage._unknown25 != rhs_storage._unknown25 {return false} - if _storage._unknown26 != rhs_storage._unknown26 {return false} - if _storage._unknown27 != rhs_storage._unknown27 {return false} - if _storage._unknown28 != rhs_storage._unknown28 {return false} - if _storage._unknown29 != rhs_storage._unknown29 {return false} - if _storage._unknown30 != rhs_storage._unknown30 {return false} - if _storage._unknown31 != rhs_storage._unknown31 {return false} - if _storage._unknown32 != rhs_storage._unknown32 {return false} - return true - } - if !storagesAreEqual {return false} - } - if lhs.unknownFields != rhs.unknownFields {return false} - return true + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._idStr != rhs_storage._idStr {return false} + if _storage._mode != rhs_storage._mode {return false} + if _storage._size != rhs_storage._size {return false} + if _storage._color != rhs_storage._color {return false} + if _storage._uhash != rhs_storage._uhash {return false} + if _storage._text != rhs_storage._text {return false} + if _storage._date != rhs_storage._date {return false} + if _storage._weight != rhs_storage._weight {return false} + if _storage._rnd != rhs_storage._rnd {return false} + if _storage._attr != rhs_storage._attr {return false} + if _storage._bizScene != rhs_storage._bizScene {return false} + if _storage._bubble != rhs_storage._bubble {return false} + if _storage._dmType != rhs_storage._dmType {return false} + if _storage._emoticons != rhs_storage._emoticons {return false} + if _storage._voice != rhs_storage._voice {return false} + if _storage._animation != rhs_storage._animation {return false} + if _storage._aggregation != rhs_storage._aggregation {return false} + if _storage._sendFromMe != rhs_storage._sendFromMe {return false} + if _storage._check != rhs_storage._check {return false} + if _storage._user != rhs_storage._user {return false} + if _storage._room != rhs_storage._room {return false} + if _storage._icon != rhs_storage._icon {return false} + if _storage._reply != rhs_storage._reply {return false} + if _storage._unknown24 != rhs_storage._unknown24 {return false} + if _storage._unknown25 != rhs_storage._unknown25 {return false} + if _storage._unknown26 != rhs_storage._unknown26 {return false} + if _storage._unknown27 != rhs_storage._unknown27 {return false} + if _storage._unknown28 != rhs_storage._unknown28 {return false} + if _storage._unknown29 != rhs_storage._unknown29 {return false} + if _storage._unknown30 != rhs_storage._unknown30 {return false} + if _storage._unknown31 != rhs_storage._unknown31 {return false} + if _storage._unknown32 != rhs_storage._unknown32 {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } extension BilibiliDm_Community_Service_Dm_Live_Check: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".Check" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "token"), - 2: .same(proto: "ts"), + 1: .same(proto: "token"), + 2: .same(proto: "ts"), ] mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.token) }() - case 2: try { try decoder.decodeSingularInt64Field(value: &self.ts) }() - default: break - } - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.token) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self.ts) }() + default: break + } + } } func traverse(visitor: inout V) throws { - if !self.token.isEmpty { - try visitor.visitSingularStringField(value: self.token, fieldNumber: 1) - } - if self.ts != 0 { - try visitor.visitSingularInt64Field(value: self.ts, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) + if !self.token.isEmpty { + try visitor.visitSingularStringField(value: self.token, fieldNumber: 1) + } + if self.ts != 0 { + try visitor.visitSingularInt64Field(value: self.ts, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) } static func ==(lhs: BilibiliDm_Community_Service_Dm_Live_Check, rhs: BilibiliDm_Community_Service_Dm_Live_Check) -> Bool { - if lhs.token != rhs.token {return false} - if lhs.ts != rhs.ts {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true + if lhs.token != rhs.token {return false} + if lhs.ts != rhs.ts {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } extension BilibiliDm_Community_Service_Dm_Live_Room: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".Room" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "uid"), - 2: .same(proto: "name"), - 3: .same(proto: "roomid"), + 1: .same(proto: "uid"), + 2: .same(proto: "name"), + 3: .same(proto: "roomid"), ] mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularInt64Field(value: &self.uid) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.name) }() - case 3: try { try decoder.decodeSingularUInt32Field(value: &self.roomid) }() - default: break - } - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt64Field(value: &self.uid) }() + case 2: try { try decoder.decodeSingularStringField(value: &self.name) }() + case 3: try { try decoder.decodeSingularUInt32Field(value: &self.roomid) }() + default: break + } + } } func traverse(visitor: inout V) throws { - if self.uid != 0 { - try visitor.visitSingularInt64Field(value: self.uid, fieldNumber: 1) - } - if !self.name.isEmpty { - try visitor.visitSingularStringField(value: self.name, fieldNumber: 2) - } - if self.roomid != 0 { - try visitor.visitSingularUInt32Field(value: self.roomid, fieldNumber: 3) - } - try unknownFields.traverse(visitor: &visitor) + if self.uid != 0 { + try visitor.visitSingularInt64Field(value: self.uid, fieldNumber: 1) + } + if !self.name.isEmpty { + try visitor.visitSingularStringField(value: self.name, fieldNumber: 2) + } + if self.roomid != 0 { + try visitor.visitSingularUInt32Field(value: self.roomid, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) } static func ==(lhs: BilibiliDm_Community_Service_Dm_Live_Room, rhs: BilibiliDm_Community_Service_Dm_Live_Room) -> Bool { - if lhs.uid != rhs.uid {return false} - if lhs.name != rhs.name {return false} - if lhs.roomid != rhs.roomid {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true + if lhs.uid != rhs.uid {return false} + if lhs.name != rhs.name {return false} + if lhs.roomid != rhs.roomid {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } extension BilibiliDm_Community_Service_Dm_Live_Bubble: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".Bubble" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "id"), - 2: .same(proto: "color"), - 3: .standard(proto: "id_v2"), + 1: .same(proto: "id"), + 2: .same(proto: "color"), + 3: .standard(proto: "id_v2"), ] mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularInt64Field(value: &self.id) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.color) }() - case 3: try { try decoder.decodeSingularInt64Field(value: &self.idV2) }() - default: break - } - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt64Field(value: &self.id) }() + case 2: try { try decoder.decodeSingularStringField(value: &self.color) }() + case 3: try { try decoder.decodeSingularInt64Field(value: &self.idV2) }() + default: break + } + } } func traverse(visitor: inout V) throws { - if self.id != 0 { - try visitor.visitSingularInt64Field(value: self.id, fieldNumber: 1) - } - if !self.color.isEmpty { - try visitor.visitSingularStringField(value: self.color, fieldNumber: 2) - } - if self.idV2 != 0 { - try visitor.visitSingularInt64Field(value: self.idV2, fieldNumber: 3) - } - try unknownFields.traverse(visitor: &visitor) + if self.id != 0 { + try visitor.visitSingularInt64Field(value: self.id, fieldNumber: 1) + } + if !self.color.isEmpty { + try visitor.visitSingularStringField(value: self.color, fieldNumber: 2) + } + if self.idV2 != 0 { + try visitor.visitSingularInt64Field(value: self.idV2, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) } static func ==(lhs: BilibiliDm_Community_Service_Dm_Live_Bubble, rhs: BilibiliDm_Community_Service_Dm_Live_Bubble) -> Bool { - if lhs.id != rhs.id {return false} - if lhs.color != rhs.color {return false} - if lhs.idV2 != rhs.idV2 {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true + if lhs.id != rhs.id {return false} + if lhs.color != rhs.color {return false} + if lhs.idV2 != rhs.idV2 {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } -extension BilibiliDm_Community_Service_Dm_Live_emots: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".emots" +extension BilibiliDm_Community_Service_Dm_Live_emots_temp: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".emots_temp" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "key"), - 2: .same(proto: "value"), + 1: .same(proto: "key"), + 2: .same(proto: "value"), ] mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.key) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._value) }() - default: break - } - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.key) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._value) }() + default: break + } + } } func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if !self.key.isEmpty { - try visitor.visitSingularStringField(value: self.key, fieldNumber: 1) - } - try { if let v = self._value { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: BilibiliDm_Community_Service_Dm_Live_emots, rhs: BilibiliDm_Community_Service_Dm_Live_emots) -> Bool { - if lhs.key != rhs.key {return false} - if lhs._value != rhs._value {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if !self.key.isEmpty { + try visitor.visitSingularStringField(value: self.key, fieldNumber: 1) + } + try { if let v = self._value { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: BilibiliDm_Community_Service_Dm_Live_emots_temp, rhs: BilibiliDm_Community_Service_Dm_Live_emots_temp) -> Bool { + if lhs.key != rhs.key {return false} + if lhs._value != rhs._value {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } extension BilibiliDm_Community_Service_Dm_Live_Emoticon: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".Emoticon" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "unique"), - 2: .same(proto: "url"), - 3: .standard(proto: "is_dynamic"), - 4: .standard(proto: "in_player_area"), - 5: .standard(proto: "bulge_display"), - 6: .same(proto: "height"), - 7: .same(proto: "width"), + 1: .same(proto: "unique"), + 2: .same(proto: "url"), + 3: .standard(proto: "is_dynamic"), + 4: .standard(proto: "in_player_area"), + 5: .standard(proto: "bulge_display"), + 6: .same(proto: "height"), + 7: .same(proto: "width"), ] mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.unique) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.url) }() - case 3: try { try decoder.decodeSingularBoolField(value: &self.isDynamic) }() - case 4: try { try decoder.decodeSingularInt64Field(value: &self.inPlayerArea) }() - case 5: try { try decoder.decodeSingularInt64Field(value: &self.bulgeDisplay) }() - case 6: try { try decoder.decodeSingularInt64Field(value: &self.height) }() - case 7: try { try decoder.decodeSingularInt64Field(value: &self.width) }() - default: break - } - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.unique) }() + case 2: try { try decoder.decodeSingularStringField(value: &self.url) }() + case 3: try { try decoder.decodeSingularBoolField(value: &self.isDynamic) }() + case 4: try { try decoder.decodeSingularInt64Field(value: &self.inPlayerArea) }() + case 5: try { try decoder.decodeSingularInt64Field(value: &self.bulgeDisplay) }() + case 6: try { try decoder.decodeSingularInt64Field(value: &self.height) }() + case 7: try { try decoder.decodeSingularInt64Field(value: &self.width) }() + default: break + } + } } func traverse(visitor: inout V) throws { - if !self.unique.isEmpty { - try visitor.visitSingularStringField(value: self.unique, fieldNumber: 1) - } - if !self.url.isEmpty { - try visitor.visitSingularStringField(value: self.url, fieldNumber: 2) - } - if self.isDynamic != false { - try visitor.visitSingularBoolField(value: self.isDynamic, fieldNumber: 3) - } - if self.inPlayerArea != 0 { - try visitor.visitSingularInt64Field(value: self.inPlayerArea, fieldNumber: 4) - } - if self.bulgeDisplay != 0 { - try visitor.visitSingularInt64Field(value: self.bulgeDisplay, fieldNumber: 5) - } - if self.height != 0 { - try visitor.visitSingularInt64Field(value: self.height, fieldNumber: 6) - } - if self.width != 0 { - try visitor.visitSingularInt64Field(value: self.width, fieldNumber: 7) - } - try unknownFields.traverse(visitor: &visitor) + if !self.unique.isEmpty { + try visitor.visitSingularStringField(value: self.unique, fieldNumber: 1) + } + if !self.url.isEmpty { + try visitor.visitSingularStringField(value: self.url, fieldNumber: 2) + } + if self.isDynamic != false { + try visitor.visitSingularBoolField(value: self.isDynamic, fieldNumber: 3) + } + if self.inPlayerArea != 0 { + try visitor.visitSingularInt64Field(value: self.inPlayerArea, fieldNumber: 4) + } + if self.bulgeDisplay != 0 { + try visitor.visitSingularInt64Field(value: self.bulgeDisplay, fieldNumber: 5) + } + if self.height != 0 { + try visitor.visitSingularInt64Field(value: self.height, fieldNumber: 6) + } + if self.width != 0 { + try visitor.visitSingularInt64Field(value: self.width, fieldNumber: 7) + } + try unknownFields.traverse(visitor: &visitor) } static func ==(lhs: BilibiliDm_Community_Service_Dm_Live_Emoticon, rhs: BilibiliDm_Community_Service_Dm_Live_Emoticon) -> Bool { - if lhs.unique != rhs.unique {return false} - if lhs.url != rhs.url {return false} - if lhs.isDynamic != rhs.isDynamic {return false} - if lhs.inPlayerArea != rhs.inPlayerArea {return false} - if lhs.bulgeDisplay != rhs.bulgeDisplay {return false} - if lhs.height != rhs.height {return false} - if lhs.width != rhs.width {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true + if lhs.unique != rhs.unique {return false} + if lhs.url != rhs.url {return false} + if lhs.isDynamic != rhs.isDynamic {return false} + if lhs.inPlayerArea != rhs.inPlayerArea {return false} + if lhs.bulgeDisplay != rhs.bulgeDisplay {return false} + if lhs.height != rhs.height {return false} + if lhs.width != rhs.width {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } extension BilibiliDm_Community_Service_Dm_Live_Voice: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".Voice" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "url"), - 2: .standard(proto: "file_format"), - 3: .same(proto: "text"), - 4: .standard(proto: "file_duration"), - 5: .standard(proto: "file_id"), + 1: .same(proto: "url"), + 2: .standard(proto: "file_format"), + 3: .same(proto: "text"), + 4: .standard(proto: "file_duration"), + 5: .standard(proto: "file_id"), ] mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.url) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.fileFormat) }() - case 3: try { try decoder.decodeSingularStringField(value: &self.text) }() - case 4: try { try decoder.decodeSingularInt64Field(value: &self.fileDuration) }() - case 5: try { try decoder.decodeSingularStringField(value: &self.fileID) }() - default: break - } - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.url) }() + case 2: try { try decoder.decodeSingularStringField(value: &self.fileFormat) }() + case 3: try { try decoder.decodeSingularStringField(value: &self.text) }() + case 4: try { try decoder.decodeSingularInt64Field(value: &self.fileDuration) }() + case 5: try { try decoder.decodeSingularStringField(value: &self.fileID) }() + default: break + } + } } func traverse(visitor: inout V) throws { - if !self.url.isEmpty { - try visitor.visitSingularStringField(value: self.url, fieldNumber: 1) - } - if !self.fileFormat.isEmpty { - try visitor.visitSingularStringField(value: self.fileFormat, fieldNumber: 2) - } - if !self.text.isEmpty { - try visitor.visitSingularStringField(value: self.text, fieldNumber: 3) - } - if self.fileDuration != 0 { - try visitor.visitSingularInt64Field(value: self.fileDuration, fieldNumber: 4) - } - if !self.fileID.isEmpty { - try visitor.visitSingularStringField(value: self.fileID, fieldNumber: 5) - } - try unknownFields.traverse(visitor: &visitor) + if !self.url.isEmpty { + try visitor.visitSingularStringField(value: self.url, fieldNumber: 1) + } + if !self.fileFormat.isEmpty { + try visitor.visitSingularStringField(value: self.fileFormat, fieldNumber: 2) + } + if !self.text.isEmpty { + try visitor.visitSingularStringField(value: self.text, fieldNumber: 3) + } + if self.fileDuration != 0 { + try visitor.visitSingularInt64Field(value: self.fileDuration, fieldNumber: 4) + } + if !self.fileID.isEmpty { + try visitor.visitSingularStringField(value: self.fileID, fieldNumber: 5) + } + try unknownFields.traverse(visitor: &visitor) } static func ==(lhs: BilibiliDm_Community_Service_Dm_Live_Voice, rhs: BilibiliDm_Community_Service_Dm_Live_Voice) -> Bool { - if lhs.url != rhs.url {return false} - if lhs.fileFormat != rhs.fileFormat {return false} - if lhs.text != rhs.text {return false} - if lhs.fileDuration != rhs.fileDuration {return false} - if lhs.fileID != rhs.fileID {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true + if lhs.url != rhs.url {return false} + if lhs.fileFormat != rhs.fileFormat {return false} + if lhs.text != rhs.text {return false} + if lhs.fileDuration != rhs.fileDuration {return false} + if lhs.fileID != rhs.fileID {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } extension BilibiliDm_Community_Service_Dm_Live_Aggregation: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".Aggregation" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "is_aggregation"), - 2: .standard(proto: "activity_source"), - 3: .standard(proto: "activity_identity"), - 4: .standard(proto: "not_show"), + 1: .standard(proto: "is_aggregation"), + 2: .standard(proto: "activity_source"), + 3: .standard(proto: "activity_identity"), + 4: .standard(proto: "not_show"), ] mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularBoolField(value: &self.isAggregation) }() - case 2: try { try decoder.decodeSingularInt64Field(value: &self.activitySource) }() - case 3: try { try decoder.decodeSingularStringField(value: &self.activityIdentity) }() - case 4: try { try decoder.decodeSingularInt32Field(value: &self.notShow) }() - default: break - } - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBoolField(value: &self.isAggregation) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self.activitySource) }() + case 3: try { try decoder.decodeSingularStringField(value: &self.activityIdentity) }() + case 4: try { try decoder.decodeSingularInt32Field(value: &self.notShow) }() + default: break + } + } } func traverse(visitor: inout V) throws { - if self.isAggregation != false { - try visitor.visitSingularBoolField(value: self.isAggregation, fieldNumber: 1) - } - if self.activitySource != 0 { - try visitor.visitSingularInt64Field(value: self.activitySource, fieldNumber: 2) - } - if !self.activityIdentity.isEmpty { - try visitor.visitSingularStringField(value: self.activityIdentity, fieldNumber: 3) - } - if self.notShow != 0 { - try visitor.visitSingularInt32Field(value: self.notShow, fieldNumber: 4) - } - try unknownFields.traverse(visitor: &visitor) + if self.isAggregation != false { + try visitor.visitSingularBoolField(value: self.isAggregation, fieldNumber: 1) + } + if self.activitySource != 0 { + try visitor.visitSingularInt64Field(value: self.activitySource, fieldNumber: 2) + } + if !self.activityIdentity.isEmpty { + try visitor.visitSingularStringField(value: self.activityIdentity, fieldNumber: 3) + } + if self.notShow != 0 { + try visitor.visitSingularInt32Field(value: self.notShow, fieldNumber: 4) + } + try unknownFields.traverse(visitor: &visitor) } static func ==(lhs: BilibiliDm_Community_Service_Dm_Live_Aggregation, rhs: BilibiliDm_Community_Service_Dm_Live_Aggregation) -> Bool { - if lhs.isAggregation != rhs.isAggregation {return false} - if lhs.activitySource != rhs.activitySource {return false} - if lhs.activityIdentity != rhs.activityIdentity {return false} - if lhs.notShow != rhs.notShow {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true + if lhs.isAggregation != rhs.isAggregation {return false} + if lhs.activitySource != rhs.activitySource {return false} + if lhs.activityIdentity != rhs.activityIdentity {return false} + if lhs.notShow != rhs.notShow {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } extension BilibiliDm_Community_Service_Dm_Live_User: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".User" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "uid"), - 2: .same(proto: "name"), - 3: .standard(proto: "name_color"), - 4: .same(proto: "face"), - 5: .same(proto: "vip"), - 6: .same(proto: "svip"), - 7: .same(proto: "rank"), - 8: .standard(proto: "mobile_verify"), - 9: .standard(proto: "lpl_status"), - 10: .same(proto: "attr"), - 11: .same(proto: "medal"), - 12: .same(proto: "level"), - 13: .same(proto: "title"), - 14: .same(proto: "identify"), - 15: .same(proto: "wealth"), + 1: .same(proto: "uid"), + 2: .same(proto: "name"), + 3: .standard(proto: "name_color"), + 4: .same(proto: "face"), + 5: .same(proto: "vip"), + 6: .same(proto: "svip"), + 7: .same(proto: "rank"), + 8: .standard(proto: "mobile_verify"), + 9: .standard(proto: "lpl_status"), + 10: .same(proto: "attr"), + 11: .same(proto: "medal"), + 12: .same(proto: "level"), + 13: .same(proto: "title"), + 14: .same(proto: "identify"), + 15: .same(proto: "wealth"), + 16: .standard(proto: "group_medal"), ] fileprivate class _StorageClass { - var _uid: Int64 = 0 - var _name: String = String() - var _nameColor: String = String() - var _face: String = String() - var _vip: Int64 = 0 - var _svip: Int64 = 0 - var _rank: Int32 = 0 - var _mobileVerify: Int32 = 0 - var _lplStatus: Int64 = 0 - var _attr: Int64 = 0 - var _medal: BilibiliDm_Community_Service_Dm_Live_Medal? = nil - var _level: BilibiliDm_Community_Service_Dm_Live_UserLevel? = nil - var _title: BilibiliDm_Community_Service_Dm_Live_Title? = nil - var _identify: BilibiliDm_Community_Service_Dm_Live_Identify? = nil - var _wealth: BilibiliDm_Community_Service_Dm_Live_Wealth? = nil - - static let defaultInstance = _StorageClass() - - private init() {} - - init(copying source: _StorageClass) { - _uid = source._uid - _name = source._name - _nameColor = source._nameColor - _face = source._face - _vip = source._vip - _svip = source._svip - _rank = source._rank - _mobileVerify = source._mobileVerify - _lplStatus = source._lplStatus - _attr = source._attr - _medal = source._medal - _level = source._level - _title = source._title - _identify = source._identify - _wealth = source._wealth - } + var _uid: Int64 = 0 + var _name: String = String() + var _nameColor: String = String() + var _face: String = String() + var _vip: Int64 = 0 + var _svip: Int64 = 0 + var _rank: Int32 = 0 + var _mobileVerify: Int32 = 0 + var _lplStatus: Int64 = 0 + var _attr: Int64 = 0 + var _medal: BilibiliDm_Community_Service_Dm_Live_Medal? = nil + var _level: BilibiliDm_Community_Service_Dm_Live_UserLevel? = nil + var _title: BilibiliDm_Community_Service_Dm_Live_Title? = nil + var _identify: BilibiliDm_Community_Service_Dm_Live_Identify? = nil + var _wealth: BilibiliDm_Community_Service_Dm_Live_Wealth? = nil + var _groupMedal: BilibiliDm_Community_Service_Dm_Live_GroupMedal? = nil + + #if swift(>=5.10) + // This property is used as the initial default value for new instances of the type. + // The type itself is protecting the reference to its storage via CoW semantics. + // This will force a copy to be made of this reference when the first mutation occurs; + // hence, it is safe to mark this as `nonisolated(unsafe)`. + static nonisolated(unsafe) let defaultInstance = _StorageClass() + #else + static let defaultInstance = _StorageClass() + #endif + + private init() {} + + init(copying source: _StorageClass) { + _uid = source._uid + _name = source._name + _nameColor = source._nameColor + _face = source._face + _vip = source._vip + _svip = source._svip + _rank = source._rank + _mobileVerify = source._mobileVerify + _lplStatus = source._lplStatus + _attr = source._attr + _medal = source._medal + _level = source._level + _title = source._title + _identify = source._identify + _wealth = source._wealth + _groupMedal = source._groupMedal + } } fileprivate mutating func _uniqueStorage() -> _StorageClass { - if !isKnownUniquelyReferenced(&_storage) { - _storage = _StorageClass(copying: _storage) - } - return _storage + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage } mutating func decodeMessage(decoder: inout D) throws { - _ = _uniqueStorage() - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularInt64Field(value: &_storage._uid) }() - case 2: try { try decoder.decodeSingularStringField(value: &_storage._name) }() - case 3: try { try decoder.decodeSingularStringField(value: &_storage._nameColor) }() - case 4: try { try decoder.decodeSingularStringField(value: &_storage._face) }() - case 5: try { try decoder.decodeSingularInt64Field(value: &_storage._vip) }() - case 6: try { try decoder.decodeSingularInt64Field(value: &_storage._svip) }() - case 7: try { try decoder.decodeSingularInt32Field(value: &_storage._rank) }() - case 8: try { try decoder.decodeSingularInt32Field(value: &_storage._mobileVerify) }() - case 9: try { try decoder.decodeSingularInt64Field(value: &_storage._lplStatus) }() - case 10: try { try decoder.decodeSingularInt64Field(value: &_storage._attr) }() - case 11: try { try decoder.decodeSingularMessageField(value: &_storage._medal) }() - case 12: try { try decoder.decodeSingularMessageField(value: &_storage._level) }() - case 13: try { try decoder.decodeSingularMessageField(value: &_storage._title) }() - case 14: try { try decoder.decodeSingularMessageField(value: &_storage._identify) }() - case 15: try { try decoder.decodeSingularMessageField(value: &_storage._wealth) }() - default: break - } - } - } + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt64Field(value: &_storage._uid) }() + case 2: try { try decoder.decodeSingularStringField(value: &_storage._name) }() + case 3: try { try decoder.decodeSingularStringField(value: &_storage._nameColor) }() + case 4: try { try decoder.decodeSingularStringField(value: &_storage._face) }() + case 5: try { try decoder.decodeSingularInt64Field(value: &_storage._vip) }() + case 6: try { try decoder.decodeSingularInt64Field(value: &_storage._svip) }() + case 7: try { try decoder.decodeSingularInt32Field(value: &_storage._rank) }() + case 8: try { try decoder.decodeSingularInt32Field(value: &_storage._mobileVerify) }() + case 9: try { try decoder.decodeSingularInt64Field(value: &_storage._lplStatus) }() + case 10: try { try decoder.decodeSingularInt64Field(value: &_storage._attr) }() + case 11: try { try decoder.decodeSingularMessageField(value: &_storage._medal) }() + case 12: try { try decoder.decodeSingularMessageField(value: &_storage._level) }() + case 13: try { try decoder.decodeSingularMessageField(value: &_storage._title) }() + case 14: try { try decoder.decodeSingularMessageField(value: &_storage._identify) }() + case 15: try { try decoder.decodeSingularMessageField(value: &_storage._wealth) }() + case 16: try { try decoder.decodeSingularMessageField(value: &_storage._groupMedal) }() + default: break + } + } + } } func traverse(visitor: inout V) throws { - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if _storage._uid != 0 { - try visitor.visitSingularInt64Field(value: _storage._uid, fieldNumber: 1) - } - if !_storage._name.isEmpty { - try visitor.visitSingularStringField(value: _storage._name, fieldNumber: 2) - } - if !_storage._nameColor.isEmpty { - try visitor.visitSingularStringField(value: _storage._nameColor, fieldNumber: 3) - } - if !_storage._face.isEmpty { - try visitor.visitSingularStringField(value: _storage._face, fieldNumber: 4) - } - if _storage._vip != 0 { - try visitor.visitSingularInt64Field(value: _storage._vip, fieldNumber: 5) - } - if _storage._svip != 0 { - try visitor.visitSingularInt64Field(value: _storage._svip, fieldNumber: 6) - } - if _storage._rank != 0 { - try visitor.visitSingularInt32Field(value: _storage._rank, fieldNumber: 7) - } - if _storage._mobileVerify != 0 { - try visitor.visitSingularInt32Field(value: _storage._mobileVerify, fieldNumber: 8) - } - if _storage._lplStatus != 0 { - try visitor.visitSingularInt64Field(value: _storage._lplStatus, fieldNumber: 9) - } - if _storage._attr != 0 { - try visitor.visitSingularInt64Field(value: _storage._attr, fieldNumber: 10) - } - try { if let v = _storage._medal { - try visitor.visitSingularMessageField(value: v, fieldNumber: 11) - } }() - try { if let v = _storage._level { - try visitor.visitSingularMessageField(value: v, fieldNumber: 12) - } }() - try { if let v = _storage._title { - try visitor.visitSingularMessageField(value: v, fieldNumber: 13) - } }() - try { if let v = _storage._identify { - try visitor.visitSingularMessageField(value: v, fieldNumber: 14) - } }() - try { if let v = _storage._wealth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 15) - } }() - } - try unknownFields.traverse(visitor: &visitor) + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if _storage._uid != 0 { + try visitor.visitSingularInt64Field(value: _storage._uid, fieldNumber: 1) + } + if !_storage._name.isEmpty { + try visitor.visitSingularStringField(value: _storage._name, fieldNumber: 2) + } + if !_storage._nameColor.isEmpty { + try visitor.visitSingularStringField(value: _storage._nameColor, fieldNumber: 3) + } + if !_storage._face.isEmpty { + try visitor.visitSingularStringField(value: _storage._face, fieldNumber: 4) + } + if _storage._vip != 0 { + try visitor.visitSingularInt64Field(value: _storage._vip, fieldNumber: 5) + } + if _storage._svip != 0 { + try visitor.visitSingularInt64Field(value: _storage._svip, fieldNumber: 6) + } + if _storage._rank != 0 { + try visitor.visitSingularInt32Field(value: _storage._rank, fieldNumber: 7) + } + if _storage._mobileVerify != 0 { + try visitor.visitSingularInt32Field(value: _storage._mobileVerify, fieldNumber: 8) + } + if _storage._lplStatus != 0 { + try visitor.visitSingularInt64Field(value: _storage._lplStatus, fieldNumber: 9) + } + if _storage._attr != 0 { + try visitor.visitSingularInt64Field(value: _storage._attr, fieldNumber: 10) + } + try { if let v = _storage._medal { + try visitor.visitSingularMessageField(value: v, fieldNumber: 11) + } }() + try { if let v = _storage._level { + try visitor.visitSingularMessageField(value: v, fieldNumber: 12) + } }() + try { if let v = _storage._title { + try visitor.visitSingularMessageField(value: v, fieldNumber: 13) + } }() + try { if let v = _storage._identify { + try visitor.visitSingularMessageField(value: v, fieldNumber: 14) + } }() + try { if let v = _storage._wealth { + try visitor.visitSingularMessageField(value: v, fieldNumber: 15) + } }() + try { if let v = _storage._groupMedal { + try visitor.visitSingularMessageField(value: v, fieldNumber: 16) + } }() + } + try unknownFields.traverse(visitor: &visitor) } static func ==(lhs: BilibiliDm_Community_Service_Dm_Live_User, rhs: BilibiliDm_Community_Service_Dm_Live_User) -> Bool { - if lhs._storage !== rhs._storage { - let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in - let _storage = _args.0 - let rhs_storage = _args.1 - if _storage._uid != rhs_storage._uid {return false} - if _storage._name != rhs_storage._name {return false} - if _storage._nameColor != rhs_storage._nameColor {return false} - if _storage._face != rhs_storage._face {return false} - if _storage._vip != rhs_storage._vip {return false} - if _storage._svip != rhs_storage._svip {return false} - if _storage._rank != rhs_storage._rank {return false} - if _storage._mobileVerify != rhs_storage._mobileVerify {return false} - if _storage._lplStatus != rhs_storage._lplStatus {return false} - if _storage._attr != rhs_storage._attr {return false} - if _storage._medal != rhs_storage._medal {return false} - if _storage._level != rhs_storage._level {return false} - if _storage._title != rhs_storage._title {return false} - if _storage._identify != rhs_storage._identify {return false} - if _storage._wealth != rhs_storage._wealth {return false} - return true - } - if !storagesAreEqual {return false} - } - if lhs.unknownFields != rhs.unknownFields {return false} - return true + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._uid != rhs_storage._uid {return false} + if _storage._name != rhs_storage._name {return false} + if _storage._nameColor != rhs_storage._nameColor {return false} + if _storage._face != rhs_storage._face {return false} + if _storage._vip != rhs_storage._vip {return false} + if _storage._svip != rhs_storage._svip {return false} + if _storage._rank != rhs_storage._rank {return false} + if _storage._mobileVerify != rhs_storage._mobileVerify {return false} + if _storage._lplStatus != rhs_storage._lplStatus {return false} + if _storage._attr != rhs_storage._attr {return false} + if _storage._medal != rhs_storage._medal {return false} + if _storage._level != rhs_storage._level {return false} + if _storage._title != rhs_storage._title {return false} + if _storage._identify != rhs_storage._identify {return false} + if _storage._wealth != rhs_storage._wealth {return false} + if _storage._groupMedal != rhs_storage._groupMedal {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } extension BilibiliDm_Community_Service_Dm_Live_Identify: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".Identify" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "beginning_url"), - 2: .standard(proto: "ending_url"), - 3: .standard(proto: "jump_to_url"), + 1: .standard(proto: "beginning_url"), + 2: .standard(proto: "ending_url"), + 3: .standard(proto: "jump_to_url"), ] mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.beginningURL) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.endingURL) }() - case 3: try { try decoder.decodeSingularStringField(value: &self.jumpToURL) }() - default: break - } - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.beginningURL) }() + case 2: try { try decoder.decodeSingularStringField(value: &self.endingURL) }() + case 3: try { try decoder.decodeSingularStringField(value: &self.jumpToURL) }() + default: break + } + } } func traverse(visitor: inout V) throws { - if !self.beginningURL.isEmpty { - try visitor.visitSingularStringField(value: self.beginningURL, fieldNumber: 1) - } - if !self.endingURL.isEmpty { - try visitor.visitSingularStringField(value: self.endingURL, fieldNumber: 2) - } - if !self.jumpToURL.isEmpty { - try visitor.visitSingularStringField(value: self.jumpToURL, fieldNumber: 3) - } - try unknownFields.traverse(visitor: &visitor) + if !self.beginningURL.isEmpty { + try visitor.visitSingularStringField(value: self.beginningURL, fieldNumber: 1) + } + if !self.endingURL.isEmpty { + try visitor.visitSingularStringField(value: self.endingURL, fieldNumber: 2) + } + if !self.jumpToURL.isEmpty { + try visitor.visitSingularStringField(value: self.jumpToURL, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) } static func ==(lhs: BilibiliDm_Community_Service_Dm_Live_Identify, rhs: BilibiliDm_Community_Service_Dm_Live_Identify) -> Bool { - if lhs.beginningURL != rhs.beginningURL {return false} - if lhs.endingURL != rhs.endingURL {return false} - if lhs.jumpToURL != rhs.jumpToURL {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true + if lhs.beginningURL != rhs.beginningURL {return false} + if lhs.endingURL != rhs.endingURL {return false} + if lhs.jumpToURL != rhs.jumpToURL {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } extension BilibiliDm_Community_Service_Dm_Live_Medal: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".Medal" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "level"), - 2: .same(proto: "name"), - 3: .same(proto: "special"), - 4: .same(proto: "color"), - 5: .standard(proto: "icon_id"), - 6: .standard(proto: "border_color"), - 7: .standard(proto: "gradient_start_color"), - 8: .standard(proto: "gradient_end_color"), - 9: .same(proto: "privilege"), - 10: .same(proto: "light"), + 1: .same(proto: "level"), + 2: .same(proto: "name"), + 3: .same(proto: "special"), + 4: .same(proto: "color"), + 5: .standard(proto: "icon_id"), + 6: .standard(proto: "border_color"), + 7: .standard(proto: "gradient_start_color"), + 8: .standard(proto: "gradient_end_color"), + 9: .same(proto: "privilege"), + 10: .same(proto: "light"), ] mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularInt64Field(value: &self.level) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.name) }() - case 3: try { try decoder.decodeSingularStringField(value: &self.special) }() - case 4: try { try decoder.decodeSingularInt64Field(value: &self.color) }() - case 5: try { try decoder.decodeSingularInt64Field(value: &self.iconID) }() - case 6: try { try decoder.decodeSingularInt64Field(value: &self.borderColor) }() - case 7: try { try decoder.decodeSingularInt64Field(value: &self.gradientStartColor) }() - case 8: try { try decoder.decodeSingularInt64Field(value: &self.gradientEndColor) }() - case 9: try { try decoder.decodeSingularInt64Field(value: &self.privilege) }() - case 10: try { try decoder.decodeSingularInt64Field(value: &self.light) }() - default: break - } - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt64Field(value: &self.level) }() + case 2: try { try decoder.decodeSingularStringField(value: &self.name) }() + case 3: try { try decoder.decodeSingularStringField(value: &self.special) }() + case 4: try { try decoder.decodeSingularInt64Field(value: &self.color) }() + case 5: try { try decoder.decodeSingularInt64Field(value: &self.iconID) }() + case 6: try { try decoder.decodeSingularInt64Field(value: &self.borderColor) }() + case 7: try { try decoder.decodeSingularInt64Field(value: &self.gradientStartColor) }() + case 8: try { try decoder.decodeSingularInt64Field(value: &self.gradientEndColor) }() + case 9: try { try decoder.decodeSingularInt64Field(value: &self.privilege) }() + case 10: try { try decoder.decodeSingularInt64Field(value: &self.light) }() + default: break + } + } } func traverse(visitor: inout V) throws { - if self.level != 0 { - try visitor.visitSingularInt64Field(value: self.level, fieldNumber: 1) - } - if !self.name.isEmpty { - try visitor.visitSingularStringField(value: self.name, fieldNumber: 2) - } - if !self.special.isEmpty { - try visitor.visitSingularStringField(value: self.special, fieldNumber: 3) - } - if self.color != 0 { - try visitor.visitSingularInt64Field(value: self.color, fieldNumber: 4) - } - if self.iconID != 0 { - try visitor.visitSingularInt64Field(value: self.iconID, fieldNumber: 5) - } - if self.borderColor != 0 { - try visitor.visitSingularInt64Field(value: self.borderColor, fieldNumber: 6) - } - if self.gradientStartColor != 0 { - try visitor.visitSingularInt64Field(value: self.gradientStartColor, fieldNumber: 7) - } - if self.gradientEndColor != 0 { - try visitor.visitSingularInt64Field(value: self.gradientEndColor, fieldNumber: 8) - } - if self.privilege != 0 { - try visitor.visitSingularInt64Field(value: self.privilege, fieldNumber: 9) - } - if self.light != 0 { - try visitor.visitSingularInt64Field(value: self.light, fieldNumber: 10) - } - try unknownFields.traverse(visitor: &visitor) + if self.level != 0 { + try visitor.visitSingularInt64Field(value: self.level, fieldNumber: 1) + } + if !self.name.isEmpty { + try visitor.visitSingularStringField(value: self.name, fieldNumber: 2) + } + if !self.special.isEmpty { + try visitor.visitSingularStringField(value: self.special, fieldNumber: 3) + } + if self.color != 0 { + try visitor.visitSingularInt64Field(value: self.color, fieldNumber: 4) + } + if self.iconID != 0 { + try visitor.visitSingularInt64Field(value: self.iconID, fieldNumber: 5) + } + if self.borderColor != 0 { + try visitor.visitSingularInt64Field(value: self.borderColor, fieldNumber: 6) + } + if self.gradientStartColor != 0 { + try visitor.visitSingularInt64Field(value: self.gradientStartColor, fieldNumber: 7) + } + if self.gradientEndColor != 0 { + try visitor.visitSingularInt64Field(value: self.gradientEndColor, fieldNumber: 8) + } + if self.privilege != 0 { + try visitor.visitSingularInt64Field(value: self.privilege, fieldNumber: 9) + } + if self.light != 0 { + try visitor.visitSingularInt64Field(value: self.light, fieldNumber: 10) + } + try unknownFields.traverse(visitor: &visitor) } static func ==(lhs: BilibiliDm_Community_Service_Dm_Live_Medal, rhs: BilibiliDm_Community_Service_Dm_Live_Medal) -> Bool { - if lhs.level != rhs.level {return false} - if lhs.name != rhs.name {return false} - if lhs.special != rhs.special {return false} - if lhs.color != rhs.color {return false} - if lhs.iconID != rhs.iconID {return false} - if lhs.borderColor != rhs.borderColor {return false} - if lhs.gradientStartColor != rhs.gradientStartColor {return false} - if lhs.gradientEndColor != rhs.gradientEndColor {return false} - if lhs.privilege != rhs.privilege {return false} - if lhs.light != rhs.light {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true + if lhs.level != rhs.level {return false} + if lhs.name != rhs.name {return false} + if lhs.special != rhs.special {return false} + if lhs.color != rhs.color {return false} + if lhs.iconID != rhs.iconID {return false} + if lhs.borderColor != rhs.borderColor {return false} + if lhs.gradientStartColor != rhs.gradientStartColor {return false} + if lhs.gradientEndColor != rhs.gradientEndColor {return false} + if lhs.privilege != rhs.privilege {return false} + if lhs.light != rhs.light {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } extension BilibiliDm_Community_Service_Dm_Live_UserLevel: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".UserLevel" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "level"), - 2: .same(proto: "color"), - 3: .same(proto: "rank"), - 4: .standard(proto: "online_rank"), + 1: .same(proto: "level"), + 2: .same(proto: "color"), + 3: .same(proto: "rank"), + 4: .standard(proto: "online_rank"), ] mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularInt64Field(value: &self.level) }() - case 2: try { try decoder.decodeSingularInt64Field(value: &self.color) }() - case 3: try { try decoder.decodeSingularStringField(value: &self.rank) }() - case 4: try { try decoder.decodeSingularInt64Field(value: &self.onlineRank) }() - default: break - } - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt64Field(value: &self.level) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self.color) }() + case 3: try { try decoder.decodeSingularStringField(value: &self.rank) }() + case 4: try { try decoder.decodeSingularInt64Field(value: &self.onlineRank) }() + default: break + } + } } func traverse(visitor: inout V) throws { - if self.level != 0 { - try visitor.visitSingularInt64Field(value: self.level, fieldNumber: 1) - } - if self.color != 0 { - try visitor.visitSingularInt64Field(value: self.color, fieldNumber: 2) - } - if !self.rank.isEmpty { - try visitor.visitSingularStringField(value: self.rank, fieldNumber: 3) - } - if self.onlineRank != 0 { - try visitor.visitSingularInt64Field(value: self.onlineRank, fieldNumber: 4) - } - try unknownFields.traverse(visitor: &visitor) + if self.level != 0 { + try visitor.visitSingularInt64Field(value: self.level, fieldNumber: 1) + } + if self.color != 0 { + try visitor.visitSingularInt64Field(value: self.color, fieldNumber: 2) + } + if !self.rank.isEmpty { + try visitor.visitSingularStringField(value: self.rank, fieldNumber: 3) + } + if self.onlineRank != 0 { + try visitor.visitSingularInt64Field(value: self.onlineRank, fieldNumber: 4) + } + try unknownFields.traverse(visitor: &visitor) } static func ==(lhs: BilibiliDm_Community_Service_Dm_Live_UserLevel, rhs: BilibiliDm_Community_Service_Dm_Live_UserLevel) -> Bool { - if lhs.level != rhs.level {return false} - if lhs.color != rhs.color {return false} - if lhs.rank != rhs.rank {return false} - if lhs.onlineRank != rhs.onlineRank {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true + if lhs.level != rhs.level {return false} + if lhs.color != rhs.color {return false} + if lhs.rank != rhs.rank {return false} + if lhs.onlineRank != rhs.onlineRank {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } extension BilibiliDm_Community_Service_Dm_Live_Title: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".Title" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "title1"), - 2: .standard(proto: "old_title"), + 1: .same(proto: "title"), + 2: .standard(proto: "old_title"), ] mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.title1) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.oldTitle) }() - default: break - } - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.title) }() + case 2: try { try decoder.decodeSingularStringField(value: &self.oldTitle) }() + default: break + } + } } func traverse(visitor: inout V) throws { - if !self.title1.isEmpty { - try visitor.visitSingularStringField(value: self.title1, fieldNumber: 1) - } - if !self.oldTitle.isEmpty { - try visitor.visitSingularStringField(value: self.oldTitle, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) + if !self.title.isEmpty { + try visitor.visitSingularStringField(value: self.title, fieldNumber: 1) + } + if !self.oldTitle.isEmpty { + try visitor.visitSingularStringField(value: self.oldTitle, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) } static func ==(lhs: BilibiliDm_Community_Service_Dm_Live_Title, rhs: BilibiliDm_Community_Service_Dm_Live_Title) -> Bool { - if lhs.title1 != rhs.title1 {return false} - if lhs.oldTitle != rhs.oldTitle {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true + if lhs.title != rhs.title {return false} + if lhs.oldTitle != rhs.oldTitle {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } extension BilibiliDm_Community_Service_Dm_Live_Record: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".Record" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "dmid"), - 2: .standard(proto: "time_offset"), + 1: .same(proto: "dmid"), + 2: .standard(proto: "time_offset"), ] mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.dmid) }() - case 2: try { try decoder.decodeSingularInt64Field(value: &self.timeOffset) }() - default: break - } - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.dmid) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self.timeOffset) }() + default: break + } + } } func traverse(visitor: inout V) throws { - if !self.dmid.isEmpty { - try visitor.visitSingularStringField(value: self.dmid, fieldNumber: 1) - } - if self.timeOffset != 0 { - try visitor.visitSingularInt64Field(value: self.timeOffset, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) + if !self.dmid.isEmpty { + try visitor.visitSingularStringField(value: self.dmid, fieldNumber: 1) + } + if self.timeOffset != 0 { + try visitor.visitSingularInt64Field(value: self.timeOffset, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) } static func ==(lhs: BilibiliDm_Community_Service_Dm_Live_Record, rhs: BilibiliDm_Community_Service_Dm_Live_Record) -> Bool { - if lhs.dmid != rhs.dmid {return false} - if lhs.timeOffset != rhs.timeOffset {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true + if lhs.dmid != rhs.dmid {return false} + if lhs.timeOffset != rhs.timeOffset {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } extension BilibiliDm_Community_Service_Dm_Live_Wealth: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".Wealth" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "level"), + 1: .same(proto: "level"), ] mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularInt64Field(value: &self.level) }() - default: break - } - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt64Field(value: &self.level) }() + default: break + } + } } func traverse(visitor: inout V) throws { - if self.level != 0 { - try visitor.visitSingularInt64Field(value: self.level, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) + if self.level != 0 { + try visitor.visitSingularInt64Field(value: self.level, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) } static func ==(lhs: BilibiliDm_Community_Service_Dm_Live_Wealth, rhs: BilibiliDm_Community_Service_Dm_Live_Wealth) -> Bool { - if lhs.level != rhs.level {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true + if lhs.level != rhs.level {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } extension BilibiliDm_Community_Service_Dm_Live_Icon: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".Icon" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "prefix"), + 1: .same(proto: "prefix"), ] mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._prefix) }() - default: break - } - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._prefix) }() + default: break + } + } } func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._prefix { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try unknownFields.traverse(visitor: &visitor) + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._prefix { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) } static func ==(lhs: BilibiliDm_Community_Service_Dm_Live_Icon, rhs: BilibiliDm_Community_Service_Dm_Live_Icon) -> Bool { - if lhs._prefix != rhs._prefix {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true + if lhs._prefix != rhs._prefix {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } extension BilibiliDm_Community_Service_Dm_Live_Prefix: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".Prefix" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "type"), - 2: .same(proto: "resource"), + 1: .same(proto: "type"), + 2: .same(proto: "resource"), ] mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularInt32Field(value: &self.type) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.resource) }() - default: break - } - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self.type) }() + case 2: try { try decoder.decodeSingularStringField(value: &self.resource) }() + default: break + } + } } func traverse(visitor: inout V) throws { - if self.type != 0 { - try visitor.visitSingularInt32Field(value: self.type, fieldNumber: 1) - } - if !self.resource.isEmpty { - try visitor.visitSingularStringField(value: self.resource, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) + if self.type != 0 { + try visitor.visitSingularInt32Field(value: self.type, fieldNumber: 1) + } + if !self.resource.isEmpty { + try visitor.visitSingularStringField(value: self.resource, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) } static func ==(lhs: BilibiliDm_Community_Service_Dm_Live_Prefix, rhs: BilibiliDm_Community_Service_Dm_Live_Prefix) -> Bool { - if lhs.type != rhs.type {return false} - if lhs.resource != rhs.resource {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true + if lhs.type != rhs.type {return false} + if lhs.resource != rhs.resource {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension BilibiliDm_Community_Service_Dm_Live_GroupMedal: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".GroupMedal" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "medal_id"), + 2: .same(proto: "name"), + 3: .standard(proto: "is_lighted"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt64Field(value: &self.medalID) }() + case 2: try { try decoder.decodeSingularStringField(value: &self.name) }() + case 3: try { try decoder.decodeSingularInt64Field(value: &self.isLighted) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.medalID != 0 { + try visitor.visitSingularInt64Field(value: self.medalID, fieldNumber: 1) + } + if !self.name.isEmpty { + try visitor.visitSingularStringField(value: self.name, fieldNumber: 2) + } + if self.isLighted != 0 { + try visitor.visitSingularInt64Field(value: self.isLighted, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: BilibiliDm_Community_Service_Dm_Live_GroupMedal, rhs: BilibiliDm_Community_Service_Dm_Live_GroupMedal) -> Bool { + if lhs.medalID != rhs.medalID {return false} + if lhs.name != rhs.name {return false} + if lhs.isLighted != rhs.isLighted {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension BilibiliDm_Community_Service_Dm_Live_Reply: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Reply" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "show_reply"), + 2: .standard(proto: "reply_mid"), + 3: .standard(proto: "reply_uname"), + 4: .standard(proto: "reply_uname_color"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBoolField(value: &self.showReply) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self.replyMid) }() + case 3: try { try decoder.decodeSingularStringField(value: &self.replyUname) }() + case 4: try { try decoder.decodeSingularStringField(value: &self.replyUnameColor) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.showReply != false { + try visitor.visitSingularBoolField(value: self.showReply, fieldNumber: 1) + } + if self.replyMid != 0 { + try visitor.visitSingularInt64Field(value: self.replyMid, fieldNumber: 2) + } + if !self.replyUname.isEmpty { + try visitor.visitSingularStringField(value: self.replyUname, fieldNumber: 3) + } + if !self.replyUnameColor.isEmpty { + try visitor.visitSingularStringField(value: self.replyUnameColor, fieldNumber: 4) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: BilibiliDm_Community_Service_Dm_Live_Reply, rhs: BilibiliDm_Community_Service_Dm_Live_Reply) -> Bool { + if lhs.showReply != rhs.showReply {return false} + if lhs.replyMid != rhs.replyMid {return false} + if lhs.replyUname != rhs.replyUname {return false} + if lhs.replyUnameColor != rhs.replyUnameColor {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } diff --git a/IINA+/Utils/Danmaku/Danmaku.swift b/IINA+/Utils/Danmaku/Danmaku.swift index 063cfb7f..5ea2520e 100644 --- a/IINA+/Utils/Danmaku/Danmaku.swift +++ b/IINA+/Utils/Danmaku/Danmaku.swift @@ -11,19 +11,20 @@ import Alamofire import Marshal import SocketRocket import Gzip -import JavaScriptCore +@preconcurrency import JavaScriptCore import CryptoSwift import Marshal import SDWebImage protocol DanmakuDelegate { - func send(_ event: DanmakuEvent, sender: Danmaku) + @MainActor func send(_ event: DanmakuEvent, sender: Danmaku) } protocol DanmakuSubDelegate { - func send(_ event: DanmakuEvent) + @MainActor func send(_ event: DanmakuEvent) } +@MainActor class Danmaku: NSObject { var socket: SRWebSocket? = nil var liveSite: SupportSites = .unsupported @@ -104,7 +105,7 @@ class Danmaku: NSObject { heartBeatCount = 0 Task { - await douyinDM?.stop() + douyinDM?.stop() douyinDM = nil } } @@ -146,10 +147,7 @@ class Danmaku: NSObject { Log("Processes.shared.videoDecoder.getDouyuHtml") let info = try await videoDecoder.douyu.getDouyuHtml(url.absoluteString) - - await MainActor.run { - initDouYuSocket(info.roomId) - } + initDouYuSocket(info.roomId) case .huya: let str = try await AF.request(url.absoluteString).serializingString().value @@ -227,7 +225,7 @@ class Danmaku: NSObject { private func startTimer() { timer?.cancel() timer = nil - timer = DispatchSource.makeTimerSource(flags: [], queue: timerQueue) + timer = DispatchSource.makeTimerSource(flags: [], queue: .main) guard let timer = timer else { return } @@ -407,10 +405,10 @@ new Uint8Array(sendRegisterGroups(["live:\(id)", "chat:\(id)"])); } } - let dms = datas.compactMap(decodeBiliLiveDM(_:)) - if dms.count > 0 { - sendDM(.init(method: .sendDM, text: "", dms: dms)) - } + let dms = try? datas.compactMap(decodeBiliLiveDM(_:)) + if let dms, dms.count > 0 { + sendDM(.init(method: .sendDM, text: "", dms: dms)) + } case .huya: let bytes = [UInt8](data) guard let re = huyaJSContext?.evaluateScript("test(\(bytes));"), @@ -424,6 +422,7 @@ new Uint8Array(sendRegisterGroups(["live:\(id)", "chat:\(id)"])); self.delegate?.send(.init(method: .liveDMServer, text: ""), sender: self) return } else if str.starts(with: "EWebSocketCommandType") { + guard str != "EWebSocketCommandType.EWSCmdS2C_MsgPushReq_V2" else { return } Log("huya websocket info \(str)") return } else if str == "EWebSocketCommandType.EWSCmdS2C_HeartBeatRsp" { @@ -590,13 +589,13 @@ new Uint8Array(sendRegisterGroups(["live:\(id)", "chat:\(id)"])); sendDM(.init(method: .sendDM, text: "", dms: dms)) case .douyin: do { - let re = try DouYinResponse(serializedData: data) - let ree = try DouYinDMResponse(serializedData: re.data.gunzipped()) + let re = try DouYinResponse(serializedBytes: data) + let ree = try Douyin_Response(serializedBytes: re.data.gunzipped()) - let dms = ree.messages.filter { + let dms = ree.messagesList.filter { $0.method == "WebcastChatMessage" }.compactMap { - try? ChatMessage(serializedData: $0.payload) + try? Douyin_ChatMessage(serializedBytes: $0.payload) }.map { DanmakuComment(text: $0.content) } diff --git a/IINA+/Utils/Danmaku/DanmakuBiliLive.swift b/IINA+/Utils/Danmaku/DanmakuBiliLive.swift index 79a2d72b..65c991d6 100644 --- a/IINA+/Utils/Danmaku/DanmakuBiliLive.swift +++ b/IINA+/Utils/Danmaku/DanmakuBiliLive.swift @@ -218,7 +218,7 @@ extension Danmaku { let data = Data(base64Encoded: msg.dm) { do { - let re = try BilibiliDm_Community_Service_Dm_Live_Dm(serializedData: data) + let re = try BilibiliDm_Community_Service_Dm_Live_Dm(serializedBytes: data) if re.bizScene == .survive { return nil diff --git a/IINA+/Utils/Danmaku/DouYinDM.swift b/IINA+/Utils/Danmaku/DouYinDM.swift index f1b868b1..b9aec6e9 100644 --- a/IINA+/Utils/Danmaku/DouYinDM.swift +++ b/IINA+/Utils/Danmaku/DouYinDM.swift @@ -9,14 +9,10 @@ import Cocoa import WebKit +@MainActor class DouYinDM: NSObject { var url = "" - let douyin = Processes.shared.videoDecoder.douyin - - var privateKeys: [String] { - douyin.cookiesManager.privateKeys - } private var webView = WKWebView() var requestPrepared: ((URLRequest) -> Void)? @@ -29,9 +25,9 @@ class DouYinDM: NSObject { let code = "\("d2luZG93LmJ5dGVkX2FjcmF3bGVyLmZyb250aWVyU2lnbg==".base64Decode())({'\("WC1NUy1TVFVC".base64Decode())':'\(s.md5())'})" - let re = try await webView.evaluateJavaScriptAsync(code) + let re = try await webView.evaluateJavaScriptAsync(code, type: [String: String].self) - guard let value = (re as? [String: String])?.first?.value else { + guard let value = re?.first?.value else { throw DouYinDMError.signFailed } @@ -68,7 +64,7 @@ class DouYinDM: NSObject { } func getRoomId() async throws -> String { - + let douyin = await Processes.shared.videoDecoder.douyin let info = try await douyin.liveInfo(self.url) if let rid = (info as? DouYinEnterData.DouYinLiveInfo)?.roomId { @@ -84,10 +80,10 @@ class DouYinDM: NSObject { } func prepareCookies() async { + let douyin = await Processes.shared.videoDecoder.douyin - let storageDic = await MainActor.run { - return douyin.cookiesManager.storageDic - } + let storageDic = douyin.cookiesManager.storageDic + let privateKeys = douyin.cookiesManager.privateKeys let kvs = [ privateKeys[0].base64Decode(), @@ -101,7 +97,7 @@ class DouYinDM: NSObject { } for kv in kvs { - let _ = try? await webView.evaluateJavaScriptAsync("window.sessionStorage.setItem('\(kv.0)', '\(kv.1)')") + let _ = try? await webView.evaluateJavaScriptAsync("window.sessionStorage.setItem('\(kv.0)', '\(kv.1)')", type: String.self) } } @@ -109,24 +105,23 @@ class DouYinDM: NSObject { Task { do { let rid = try await getRoomId() + let douyin = await Processes.shared.videoDecoder.douyin + let cookies = try await douyin.cookiesManager.cookies() let ua = await douyin.cookiesManager.douyinUA() await prepareCookies() let req = try await initWS(rid, cookies: cookies, ua: ua) - await MainActor.run { - self.requestPrepared?(req) - } + requestPrepared?(req) } catch { Log("DouYinDM request error \(error)") } - await stop() + stop() } } - @MainActor func stop() { webView.navigationDelegate = nil webView.stopLoading() diff --git a/IINA+/Utils/Danmaku/DouYinDMResponse.pb.swift b/IINA+/Utils/Danmaku/DouYinDMResponse.pb.swift index d7a9642f..fcdd10c5 100644 --- a/IINA+/Utils/Danmaku/DouYinDMResponse.pb.swift +++ b/IINA+/Utils/Danmaku/DouYinDMResponse.pb.swift @@ -1,8 +1,10 @@ // DO NOT EDIT. // swift-format-ignore-file +// swiftlint:disable all // // Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: message.proto +// Source: dy.proto +// https://github.com/freeloop4032/douyin-live/blob/main/dy.proto // // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ @@ -20,37 +22,75 @@ fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAP typealias Version = _2 } -struct DouYinDMResponse { +enum Douyin_CommentTypeTag: SwiftProtobuf.Enum, Swift.CaseIterable { + typealias RawValue = Int + case unknown // = 0 + case star // = 1 + case UNRECOGNIZED(Int) + + init() { + self = .unknown + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknown + case 1: self = .star + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .unknown: return 0 + case .star: return 1 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + static let allCases: [Douyin_CommentTypeTag] = [ + .unknown, + .star, + ] + +} + +struct Douyin_Response: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - var messages: [Message] = [] + var messagesList: [Douyin_Message] = [] var cursor: String = String() - var fetchInterval: Int64 = 0 + var fetchInterval: UInt64 = 0 - var now: Int64 = 0 + var now: UInt64 = 0 var internalExt: String = String() - var fetchType: Int32 = 0 + var fetchType: UInt32 = 0 var routeParams: Dictionary = [:] - var heartbeatDuration: Int64 = 0 + var heartbeatDuration: UInt64 = 0 var needAck: Bool = false var pushServer: String = String() + var liveCursor: String = String() + + var historyNoMore: Bool = false + var unknownFields = SwiftProtobuf.UnknownStorage() init() {} } -struct Message { +struct Douyin_Message: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -65,183 +105,277 @@ struct Message { var offset: Int64 = 0 + var needWrdsStore: Bool = false + + var wrdsVersion: Int64 = 0 + + var wrdsSubKey: String = String() + var unknownFields = SwiftProtobuf.UnknownStorage() init() {} } -struct RoomUserSeqMessage { +/// 聊天 +struct Douyin_ChatMessage: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - var common: Common { - get {return _common ?? Common()} - set {_common = newValue} + var common: Douyin_Common { + get {return _storage._common ?? Douyin_Common()} + set {_uniqueStorage()._common = newValue} } /// Returns true if `common` has been explicitly set. - var hasCommon: Bool {return self._common != nil} + var hasCommon: Bool {return _storage._common != nil} /// Clears the value of `common`. Subsequent reads from it will return its default value. - mutating func clearCommon() {self._common = nil} + mutating func clearCommon() {_uniqueStorage()._common = nil} + + var user: Douyin_User { + get {return _storage._user ?? Douyin_User()} + set {_uniqueStorage()._user = newValue} + } + /// Returns true if `user` has been explicitly set. + var hasUser: Bool {return _storage._user != nil} + /// Clears the value of `user`. Subsequent reads from it will return its default value. + mutating func clearUser() {_uniqueStorage()._user = nil} + + var content: String { + get {return _storage._content} + set {_uniqueStorage()._content = newValue} + } + + var visibleToSender: Bool { + get {return _storage._visibleToSender} + set {_uniqueStorage()._visibleToSender = newValue} + } - var ranks: [RoomUserSeqMessage.Contributor] = [] + var backgroundImage: Douyin_Image { + get {return _storage._backgroundImage ?? Douyin_Image()} + set {_uniqueStorage()._backgroundImage = newValue} + } + /// Returns true if `backgroundImage` has been explicitly set. + var hasBackgroundImage: Bool {return _storage._backgroundImage != nil} + /// Clears the value of `backgroundImage`. Subsequent reads from it will return its default value. + mutating func clearBackgroundImage() {_uniqueStorage()._backgroundImage = nil} + + var fullScreenTextColor: String { + get {return _storage._fullScreenTextColor} + set {_uniqueStorage()._fullScreenTextColor = newValue} + } - var total: Int64 = 0 + var backgroundImageV2: Douyin_Image { + get {return _storage._backgroundImageV2 ?? Douyin_Image()} + set {_uniqueStorage()._backgroundImageV2 = newValue} + } + /// Returns true if `backgroundImageV2` has been explicitly set. + var hasBackgroundImageV2: Bool {return _storage._backgroundImageV2 != nil} + /// Clears the value of `backgroundImageV2`. Subsequent reads from it will return its default value. + mutating func clearBackgroundImageV2() {_uniqueStorage()._backgroundImageV2 = nil} + + var publicAreaCommon: Douyin_PublicAreaCommon { + get {return _storage._publicAreaCommon ?? Douyin_PublicAreaCommon()} + set {_uniqueStorage()._publicAreaCommon = newValue} + } + /// Returns true if `publicAreaCommon` has been explicitly set. + var hasPublicAreaCommon: Bool {return _storage._publicAreaCommon != nil} + /// Clears the value of `publicAreaCommon`. Subsequent reads from it will return its default value. + mutating func clearPublicAreaCommon() {_uniqueStorage()._publicAreaCommon = nil} - var popStr: String = String() + var giftImage: Douyin_Image { + get {return _storage._giftImage ?? Douyin_Image()} + set {_uniqueStorage()._giftImage = newValue} + } + /// Returns true if `giftImage` has been explicitly set. + var hasGiftImage: Bool {return _storage._giftImage != nil} + /// Clears the value of `giftImage`. Subsequent reads from it will return its default value. + mutating func clearGiftImage() {_uniqueStorage()._giftImage = nil} - var seats: [RoomUserSeqMessage.Contributor] = [] + var agreeMsgID: UInt64 { + get {return _storage._agreeMsgID} + set {_uniqueStorage()._agreeMsgID = newValue} + } - var popularity: Int64 = 0 + var priorityLevel: UInt32 { + get {return _storage._priorityLevel} + set {_uniqueStorage()._priorityLevel = newValue} + } - var totalUser: Int64 = 0 + var landscapeAreaCommon: Douyin_LandscapeAreaCommon { + get {return _storage._landscapeAreaCommon ?? Douyin_LandscapeAreaCommon()} + set {_uniqueStorage()._landscapeAreaCommon = newValue} + } + /// Returns true if `landscapeAreaCommon` has been explicitly set. + var hasLandscapeAreaCommon: Bool {return _storage._landscapeAreaCommon != nil} + /// Clears the value of `landscapeAreaCommon`. Subsequent reads from it will return its default value. + mutating func clearLandscapeAreaCommon() {_uniqueStorage()._landscapeAreaCommon = nil} - var totalUserStr: String = String() + var eventTime: UInt64 { + get {return _storage._eventTime} + set {_uniqueStorage()._eventTime = newValue} + } - var totalStr: String = String() + var sendReview: Bool { + get {return _storage._sendReview} + set {_uniqueStorage()._sendReview = newValue} + } - var onlineUserForAnchor: String = String() + var fromIntercom: Bool { + get {return _storage._fromIntercom} + set {_uniqueStorage()._fromIntercom = newValue} + } - var totalPvForAnchor: String = String() + var intercomHideUserCard: Bool { + get {return _storage._intercomHideUserCard} + set {_uniqueStorage()._intercomHideUserCard = newValue} + } - var unknownFields = SwiftProtobuf.UnknownStorage() + /// repeated chatTagsList = 19; + var chatBy: String { + get {return _storage._chatBy} + set {_uniqueStorage()._chatBy = newValue} + } + + var individualChatPriority: UInt32 { + get {return _storage._individualChatPriority} + set {_uniqueStorage()._individualChatPriority = newValue} + } - struct Contributor { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. + var rtfContent: Douyin_Text { + get {return _storage._rtfContent ?? Douyin_Text()} + set {_uniqueStorage()._rtfContent = newValue} + } + /// Returns true if `rtfContent` has been explicitly set. + var hasRtfContent: Bool {return _storage._rtfContent != nil} + /// Clears the value of `rtfContent`. Subsequent reads from it will return its default value. + mutating func clearRtfContent() {_uniqueStorage()._rtfContent = nil} - var score: Int64 = 0 + var unknownFields = SwiftProtobuf.UnknownStorage() - var user: User { - get {return _user ?? User()} - set {_user = newValue} - } - /// Returns true if `user` has been explicitly set. - var hasUser: Bool {return self._user != nil} - /// Clears the value of `user`. Subsequent reads from it will return its default value. - mutating func clearUser() {self._user = nil} + init() {} - var rank: Int64 = 0 + fileprivate var _storage = _StorageClass.defaultInstance +} - var delta: Int64 = 0 +struct Douyin_LandscapeAreaCommon: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. - var isHidden: Bool = false + var showHead: Bool = false - var scoreDescription: String = String() + var showNickname: Bool = false - var exactlyScore: String = String() + var showFontColor: Bool = false - var unknownFields = SwiftProtobuf.UnknownStorage() + var colorValueList: [String] = [] - init() {} + var commentTypeTagsList: [Douyin_CommentTypeTag] = [] - fileprivate var _user: User? = nil - } + var unknownFields = SwiftProtobuf.UnknownStorage() init() {} - - fileprivate var _common: Common? = nil } -struct GiftMessage { +/// 礼物消息 +struct Douyin_GiftMessage: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - var common: Common { - get {return _storage._common ?? Common()} - set {_uniqueStorage()._common = newValue} + var common: Douyin_Common { + get {return _storage._common ?? Douyin_Common()} + set {_uniqueStorage()._common = newValue} } /// Returns true if `common` has been explicitly set. var hasCommon: Bool {return _storage._common != nil} /// Clears the value of `common`. Subsequent reads from it will return its default value. mutating func clearCommon() {_uniqueStorage()._common = nil} - var giftID: Int64 { - get {return _storage._giftID} - set {_uniqueStorage()._giftID = newValue} + var giftID: UInt64 { + get {return _storage._giftID} + set {_uniqueStorage()._giftID = newValue} } - var fanTicketCount: Int64 { - get {return _storage._fanTicketCount} - set {_uniqueStorage()._fanTicketCount = newValue} + var fanTicketCount: UInt64 { + get {return _storage._fanTicketCount} + set {_uniqueStorage()._fanTicketCount = newValue} } - var groupCount: Int64 { - get {return _storage._groupCount} - set {_uniqueStorage()._groupCount = newValue} + var groupCount: UInt64 { + get {return _storage._groupCount} + set {_uniqueStorage()._groupCount = newValue} } - var repeatCount: Int64 { - get {return _storage._repeatCount} - set {_uniqueStorage()._repeatCount = newValue} + var repeatCount: UInt64 { + get {return _storage._repeatCount} + set {_uniqueStorage()._repeatCount = newValue} } - var comboCount: Int64 { - get {return _storage._comboCount} - set {_uniqueStorage()._comboCount = newValue} + var comboCount: UInt64 { + get {return _storage._comboCount} + set {_uniqueStorage()._comboCount = newValue} } - var user: User { - get {return _storage._user ?? User()} - set {_uniqueStorage()._user = newValue} + var user: Douyin_User { + get {return _storage._user ?? Douyin_User()} + set {_uniqueStorage()._user = newValue} } /// Returns true if `user` has been explicitly set. var hasUser: Bool {return _storage._user != nil} /// Clears the value of `user`. Subsequent reads from it will return its default value. mutating func clearUser() {_uniqueStorage()._user = nil} - var toUser: User { - get {return _storage._toUser ?? User()} - set {_uniqueStorage()._toUser = newValue} + var toUser: Douyin_User { + get {return _storage._toUser ?? Douyin_User()} + set {_uniqueStorage()._toUser = newValue} } /// Returns true if `toUser` has been explicitly set. var hasToUser: Bool {return _storage._toUser != nil} /// Clears the value of `toUser`. Subsequent reads from it will return its default value. mutating func clearToUser() {_uniqueStorage()._toUser = nil} - var repeatEnd: Int32 { - get {return _storage._repeatEnd} - set {_uniqueStorage()._repeatEnd = newValue} + var repeatEnd: UInt32 { + get {return _storage._repeatEnd} + set {_uniqueStorage()._repeatEnd = newValue} } - var textEffect: GiftMessage.TextEffect { - get {return _storage._textEffect ?? GiftMessage.TextEffect()} - set {_uniqueStorage()._textEffect = newValue} + var textEffect: Douyin_TextEffect { + get {return _storage._textEffect ?? Douyin_TextEffect()} + set {_uniqueStorage()._textEffect = newValue} } /// Returns true if `textEffect` has been explicitly set. var hasTextEffect: Bool {return _storage._textEffect != nil} /// Clears the value of `textEffect`. Subsequent reads from it will return its default value. mutating func clearTextEffect() {_uniqueStorage()._textEffect = nil} - var groupID: Int64 { - get {return _storage._groupID} - set {_uniqueStorage()._groupID = newValue} + var groupID: UInt64 { + get {return _storage._groupID} + set {_uniqueStorage()._groupID = newValue} } - var incomeTaskgifts: Int64 { - get {return _storage._incomeTaskgifts} - set {_uniqueStorage()._incomeTaskgifts = newValue} + var incomeTaskgifts: UInt64 { + get {return _storage._incomeTaskgifts} + set {_uniqueStorage()._incomeTaskgifts = newValue} } - var roomFanTicketCount: Int64 { - get {return _storage._roomFanTicketCount} - set {_uniqueStorage()._roomFanTicketCount = newValue} + var roomFanTicketCount: UInt64 { + get {return _storage._roomFanTicketCount} + set {_uniqueStorage()._roomFanTicketCount = newValue} } - var priority: GiftIMPriority { - get {return _storage._priority ?? GiftIMPriority()} - set {_uniqueStorage()._priority = newValue} + var priority: Douyin_GiftIMPriority { + get {return _storage._priority ?? Douyin_GiftIMPriority()} + set {_uniqueStorage()._priority = newValue} } /// Returns true if `priority` has been explicitly set. var hasPriority: Bool {return _storage._priority != nil} /// Clears the value of `priority`. Subsequent reads from it will return its default value. mutating func clearPriority() {_uniqueStorage()._priority = nil} - var gift: GiftStruct { - get {return _storage._gift ?? GiftStruct()} - set {_uniqueStorage()._gift = newValue} + var gift: Douyin_GiftStruct { + get {return _storage._gift ?? Douyin_GiftStruct()} + set {_uniqueStorage()._gift = newValue} } /// Returns true if `gift` has been explicitly set. var hasGift: Bool {return _storage._gift != nil} @@ -249,301 +383,222 @@ struct GiftMessage { mutating func clearGift() {_uniqueStorage()._gift = nil} var logID: String { - get {return _storage._logID} - set {_uniqueStorage()._logID = newValue} + get {return _storage._logID} + set {_uniqueStorage()._logID = newValue} } - var sendType: Int64 { - get {return _storage._sendType} - set {_uniqueStorage()._sendType = newValue} + var sendType: UInt64 { + get {return _storage._sendType} + set {_uniqueStorage()._sendType = newValue} } - var publicAreaCommon: PublicAreaCommon { - get {return _storage._publicAreaCommon ?? PublicAreaCommon()} - set {_uniqueStorage()._publicAreaCommon = newValue} + var publicAreaCommon: Douyin_PublicAreaCommon { + get {return _storage._publicAreaCommon ?? Douyin_PublicAreaCommon()} + set {_uniqueStorage()._publicAreaCommon = newValue} } /// Returns true if `publicAreaCommon` has been explicitly set. var hasPublicAreaCommon: Bool {return _storage._publicAreaCommon != nil} /// Clears the value of `publicAreaCommon`. Subsequent reads from it will return its default value. mutating func clearPublicAreaCommon() {_uniqueStorage()._publicAreaCommon = nil} - var trayDisplayText: Text { - get {return _storage._trayDisplayText ?? Text()} - set {_uniqueStorage()._trayDisplayText = newValue} + var trayDisplayText: Douyin_Text { + get {return _storage._trayDisplayText ?? Douyin_Text()} + set {_uniqueStorage()._trayDisplayText = newValue} } /// Returns true if `trayDisplayText` has been explicitly set. var hasTrayDisplayText: Bool {return _storage._trayDisplayText != nil} /// Clears the value of `trayDisplayText`. Subsequent reads from it will return its default value. mutating func clearTrayDisplayText() {_uniqueStorage()._trayDisplayText = nil} - var bannedDisplayEffects: Int64 { - get {return _storage._bannedDisplayEffects} - set {_uniqueStorage()._bannedDisplayEffects = newValue} + var bannedDisplayEffects: UInt64 { + get {return _storage._bannedDisplayEffects} + set {_uniqueStorage()._bannedDisplayEffects = newValue} } - var trayInfo: GiftTrayInfo { - get {return _storage._trayInfo ?? GiftTrayInfo()} - set {_uniqueStorage()._trayInfo = newValue} + /// GiftTrayInfo trayInfo = 21; + /// AssetEffectMixInfo assetEffectMixInfo = 22; + var displayForSelf: Bool { + get {return _storage._displayForSelf} + set {_uniqueStorage()._displayForSelf = newValue} } - /// Returns true if `trayInfo` has been explicitly set. - var hasTrayInfo: Bool {return _storage._trayInfo != nil} - /// Clears the value of `trayInfo`. Subsequent reads from it will return its default value. - mutating func clearTrayInfo() {_uniqueStorage()._trayInfo = nil} - var assetEffectMixInfo: AssetEffectMixInfo { - get {return _storage._assetEffectMixInfo ?? AssetEffectMixInfo()} - set {_uniqueStorage()._assetEffectMixInfo = newValue} + var interactGiftInfo: String { + get {return _storage._interactGiftInfo} + set {_uniqueStorage()._interactGiftInfo = newValue} } - /// Returns true if `assetEffectMixInfo` has been explicitly set. - var hasAssetEffectMixInfo: Bool {return _storage._assetEffectMixInfo != nil} - /// Clears the value of `assetEffectMixInfo`. Subsequent reads from it will return its default value. - mutating func clearAssetEffectMixInfo() {_uniqueStorage()._assetEffectMixInfo = nil} - var unknownFields = SwiftProtobuf.UnknownStorage() + var diyItemInfo: String { + get {return _storage._diyItemInfo} + set {_uniqueStorage()._diyItemInfo = newValue} + } - struct TextEffect { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - var portrait: GiftMessage.TextEffect.Detail { - get {return _portrait ?? GiftMessage.TextEffect.Detail()} - set {_portrait = newValue} - } - /// Returns true if `portrait` has been explicitly set. - var hasPortrait: Bool {return self._portrait != nil} - /// Clears the value of `portrait`. Subsequent reads from it will return its default value. - mutating func clearPortrait() {self._portrait = nil} - - var landscape: GiftMessage.TextEffect.Detail { - get {return _landscape ?? GiftMessage.TextEffect.Detail()} - set {_landscape = newValue} - } - /// Returns true if `landscape` has been explicitly set. - var hasLandscape: Bool {return self._landscape != nil} - /// Clears the value of `landscape`. Subsequent reads from it will return its default value. - mutating func clearLandscape() {self._landscape = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - struct Detail { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - var text: Text { - get {return _storage._text ?? Text()} - set {_uniqueStorage()._text = newValue} - } - /// Returns true if `text` has been explicitly set. - var hasText: Bool {return _storage._text != nil} - /// Clears the value of `text`. Subsequent reads from it will return its default value. - mutating func clearText() {_uniqueStorage()._text = nil} - - var textFontSize: Int32 { - get {return _storage._textFontSize} - set {_uniqueStorage()._textFontSize = newValue} - } - - var background: Image { - get {return _storage._background ?? Image()} - set {_uniqueStorage()._background = newValue} - } - /// Returns true if `background` has been explicitly set. - var hasBackground: Bool {return _storage._background != nil} - /// Clears the value of `background`. Subsequent reads from it will return its default value. - mutating func clearBackground() {_uniqueStorage()._background = nil} - - var start: Int32 { - get {return _storage._start} - set {_uniqueStorage()._start = newValue} - } - - var duration: Int32 { - get {return _storage._duration} - set {_uniqueStorage()._duration = newValue} - } - - var x: Int32 { - get {return _storage._x} - set {_uniqueStorage()._x = newValue} - } - - var y: Int32 { - get {return _storage._y} - set {_uniqueStorage()._y = newValue} - } - - var width: Int32 { - get {return _storage._width} - set {_uniqueStorage()._width = newValue} - } - - var height: Int32 { - get {return _storage._height} - set {_uniqueStorage()._height = newValue} - } - - var shadowDx: Int32 { - get {return _storage._shadowDx} - set {_uniqueStorage()._shadowDx = newValue} - } - - var shadowDy: Int32 { - get {return _storage._shadowDy} - set {_uniqueStorage()._shadowDy = newValue} - } - - var shadowRadius: Int32 { - get {return _storage._shadowRadius} - set {_uniqueStorage()._shadowRadius = newValue} - } - - var shadowColor: String { - get {return _storage._shadowColor} - set {_uniqueStorage()._shadowColor = newValue} - } - - var strokeColor: String { - get {return _storage._strokeColor} - set {_uniqueStorage()._strokeColor = newValue} - } - - var strokeWidth: Int32 { - get {return _storage._strokeWidth} - set {_uniqueStorage()._strokeWidth = newValue} - } - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _storage = _StorageClass.defaultInstance - } - - init() {} - - fileprivate var _portrait: GiftMessage.TextEffect.Detail? = nil - fileprivate var _landscape: GiftMessage.TextEffect.Detail? = nil + var minAssetSetList: [UInt64] { + get {return _storage._minAssetSetList} + set {_uniqueStorage()._minAssetSetList = newValue} } + var totalCount: UInt64 { + get {return _storage._totalCount} + set {_uniqueStorage()._totalCount = newValue} + } + + var clientGiftSource: UInt32 { + get {return _storage._clientGiftSource} + set {_uniqueStorage()._clientGiftSource = newValue} + } + + /// AnchorGiftData anchorGift = 31; + var toUserIdsList: [UInt64] { + get {return _storage._toUserIdsList} + set {_uniqueStorage()._toUserIdsList = newValue} + } + + var sendTime: UInt64 { + get {return _storage._sendTime} + set {_uniqueStorage()._sendTime = newValue} + } + + var forceDisplayEffects: UInt64 { + get {return _storage._forceDisplayEffects} + set {_uniqueStorage()._forceDisplayEffects = newValue} + } + + var traceID: String { + get {return _storage._traceID} + set {_uniqueStorage()._traceID = newValue} + } + + var effectDisplayTs: UInt64 { + get {return _storage._effectDisplayTs} + set {_uniqueStorage()._effectDisplayTs = newValue} + } + + var unknownFields = SwiftProtobuf.UnknownStorage() + init() {} fileprivate var _storage = _StorageClass.defaultInstance } -struct LikeMessage { +struct Douyin_GiftStruct: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - var common: Common { - get {return _common ?? Common()} - set {_common = newValue} + var image: Douyin_Image { + get {return _storage._image ?? Douyin_Image()} + set {_uniqueStorage()._image = newValue} } - /// Returns true if `common` has been explicitly set. - var hasCommon: Bool {return self._common != nil} - /// Clears the value of `common`. Subsequent reads from it will return its default value. - mutating func clearCommon() {self._common = nil} + /// Returns true if `image` has been explicitly set. + var hasImage: Bool {return _storage._image != nil} + /// Clears the value of `image`. Subsequent reads from it will return its default value. + mutating func clearImage() {_uniqueStorage()._image = nil} - var count: Int64 = 0 + var describe: String { + get {return _storage._describe} + set {_uniqueStorage()._describe = newValue} + } - var total: Int64 = 0 + var notify: Bool { + get {return _storage._notify} + set {_uniqueStorage()._notify = newValue} + } - var color: Int64 = 0 + var duration: UInt64 { + get {return _storage._duration} + set {_uniqueStorage()._duration = newValue} + } - var user: User { - get {return _user ?? User()} - set {_user = newValue} + var id: UInt64 { + get {return _storage._id} + set {_uniqueStorage()._id = newValue} } - /// Returns true if `user` has been explicitly set. - var hasUser: Bool {return self._user != nil} - /// Clears the value of `user`. Subsequent reads from it will return its default value. - mutating func clearUser() {self._user = nil} - var icon: String = String() + /// GiftStructFansClubInfo fansclubInfo = 6; + var forLinkmic: Bool { + get {return _storage._forLinkmic} + set {_uniqueStorage()._forLinkmic = newValue} + } - var unknownFields = SwiftProtobuf.UnknownStorage() + var doodle: Bool { + get {return _storage._doodle} + set {_uniqueStorage()._doodle = newValue} + } - init() {} + var forFansclub: Bool { + get {return _storage._forFansclub} + set {_uniqueStorage()._forFansclub = newValue} + } - fileprivate var _common: Common? = nil - fileprivate var _user: User? = nil -} + var combo: Bool { + get {return _storage._combo} + set {_uniqueStorage()._combo = newValue} + } -struct ChatMessage { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. + var type: UInt32 { + get {return _storage._type} + set {_uniqueStorage()._type = newValue} + } - var common: Common { - get {return _storage._common ?? Common()} - set {_uniqueStorage()._common = newValue} + var diamondCount: UInt32 { + get {return _storage._diamondCount} + set {_uniqueStorage()._diamondCount = newValue} } - /// Returns true if `common` has been explicitly set. - var hasCommon: Bool {return _storage._common != nil} - /// Clears the value of `common`. Subsequent reads from it will return its default value. - mutating func clearCommon() {_uniqueStorage()._common = nil} - var user: User { - get {return _storage._user ?? User()} - set {_uniqueStorage()._user = newValue} + var isDisplayedOnPanel: Bool { + get {return _storage._isDisplayedOnPanel} + set {_uniqueStorage()._isDisplayedOnPanel = newValue} } - /// Returns true if `user` has been explicitly set. - var hasUser: Bool {return _storage._user != nil} - /// Clears the value of `user`. Subsequent reads from it will return its default value. - mutating func clearUser() {_uniqueStorage()._user = nil} - var content: String { - get {return _storage._content} - set {_uniqueStorage()._content = newValue} + var primaryEffectID: UInt64 { + get {return _storage._primaryEffectID} + set {_uniqueStorage()._primaryEffectID = newValue} } - var visibleToSender: Bool { - get {return _storage._visibleToSender} - set {_uniqueStorage()._visibleToSender = newValue} + var giftLabelIcon: Douyin_Image { + get {return _storage._giftLabelIcon ?? Douyin_Image()} + set {_uniqueStorage()._giftLabelIcon = newValue} } + /// Returns true if `giftLabelIcon` has been explicitly set. + var hasGiftLabelIcon: Bool {return _storage._giftLabelIcon != nil} + /// Clears the value of `giftLabelIcon`. Subsequent reads from it will return its default value. + mutating func clearGiftLabelIcon() {_uniqueStorage()._giftLabelIcon = nil} - var backgroundImage: Image { - get {return _storage._backgroundImage ?? Image()} - set {_uniqueStorage()._backgroundImage = newValue} + var name: String { + get {return _storage._name} + set {_uniqueStorage()._name = newValue} } - /// Returns true if `backgroundImage` has been explicitly set. - var hasBackgroundImage: Bool {return _storage._backgroundImage != nil} - /// Clears the value of `backgroundImage`. Subsequent reads from it will return its default value. - mutating func clearBackgroundImage() {_uniqueStorage()._backgroundImage = nil} - var fullScreenTextColor: String { - get {return _storage._fullScreenTextColor} - set {_uniqueStorage()._fullScreenTextColor = newValue} + var region: String { + get {return _storage._region} + set {_uniqueStorage()._region = newValue} } - var backgroundImageV2: Image { - get {return _storage._backgroundImageV2 ?? Image()} - set {_uniqueStorage()._backgroundImageV2 = newValue} + var manual: String { + get {return _storage._manual} + set {_uniqueStorage()._manual = newValue} } - /// Returns true if `backgroundImageV2` has been explicitly set. - var hasBackgroundImageV2: Bool {return _storage._backgroundImageV2 != nil} - /// Clears the value of `backgroundImageV2`. Subsequent reads from it will return its default value. - mutating func clearBackgroundImageV2() {_uniqueStorage()._backgroundImageV2 = nil} - var publicAreaCommon: PublicAreaCommon { - get {return _storage._publicAreaCommon ?? PublicAreaCommon()} - set {_uniqueStorage()._publicAreaCommon = newValue} + var forCustom: Bool { + get {return _storage._forCustom} + set {_uniqueStorage()._forCustom = newValue} } - /// Returns true if `publicAreaCommon` has been explicitly set. - var hasPublicAreaCommon: Bool {return _storage._publicAreaCommon != nil} - /// Clears the value of `publicAreaCommon`. Subsequent reads from it will return its default value. - mutating func clearPublicAreaCommon() {_uniqueStorage()._publicAreaCommon = nil} - var giftImage: Image { - get {return _storage._giftImage ?? Image()} - set {_uniqueStorage()._giftImage = newValue} + /// specialEffectsMap = 20; + var icon: Douyin_Image { + get {return _storage._icon ?? Douyin_Image()} + set {_uniqueStorage()._icon = newValue} + } + /// Returns true if `icon` has been explicitly set. + var hasIcon: Bool {return _storage._icon != nil} + /// Clears the value of `icon`. Subsequent reads from it will return its default value. + mutating func clearIcon() {_uniqueStorage()._icon = nil} + + /// fixme 后面的就不写了还有几十个属性 + var actionType: UInt32 { + get {return _storage._actionType} + set {_uniqueStorage()._actionType = newValue} } - /// Returns true if `giftImage` has been explicitly set. - var hasGiftImage: Bool {return _storage._giftImage != nil} - /// Clears the value of `giftImage`. Subsequent reads from it will return its default value. - mutating func clearGiftImage() {_uniqueStorage()._giftImage = nil} var unknownFields = SwiftProtobuf.UnknownStorage() @@ -552,57 +607,140 @@ struct ChatMessage { fileprivate var _storage = _StorageClass.defaultInstance } -struct SocialMessage { +struct Douyin_GiftIMPriority: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var queueSizesList: [UInt64] = [] + + var selfQueuePriority: UInt64 = 0 + + var priority: UInt64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Douyin_TextEffect: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - var common: Common { - get {return _storage._common ?? Common()} - set {_uniqueStorage()._common = newValue} + var portrait: Douyin_TextEffectDetail { + get {return _portrait ?? Douyin_TextEffectDetail()} + set {_portrait = newValue} } - /// Returns true if `common` has been explicitly set. - var hasCommon: Bool {return _storage._common != nil} - /// Clears the value of `common`. Subsequent reads from it will return its default value. - mutating func clearCommon() {_uniqueStorage()._common = nil} + /// Returns true if `portrait` has been explicitly set. + var hasPortrait: Bool {return self._portrait != nil} + /// Clears the value of `portrait`. Subsequent reads from it will return its default value. + mutating func clearPortrait() {self._portrait = nil} - var user: User { - get {return _storage._user ?? User()} - set {_uniqueStorage()._user = newValue} + var landscape: Douyin_TextEffectDetail { + get {return _landscape ?? Douyin_TextEffectDetail()} + set {_landscape = newValue} } - /// Returns true if `user` has been explicitly set. - var hasUser: Bool {return _storage._user != nil} - /// Clears the value of `user`. Subsequent reads from it will return its default value. - mutating func clearUser() {_uniqueStorage()._user = nil} + /// Returns true if `landscape` has been explicitly set. + var hasLandscape: Bool {return self._landscape != nil} + /// Clears the value of `landscape`. Subsequent reads from it will return its default value. + mutating func clearLandscape() {self._landscape = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() - var shareType: Int64 { - get {return _storage._shareType} - set {_uniqueStorage()._shareType = newValue} + init() {} + + fileprivate var _portrait: Douyin_TextEffectDetail? = nil + fileprivate var _landscape: Douyin_TextEffectDetail? = nil +} + +struct Douyin_TextEffectDetail: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var text: Douyin_Text { + get {return _storage._text ?? Douyin_Text()} + set {_uniqueStorage()._text = newValue} } + /// Returns true if `text` has been explicitly set. + var hasText: Bool {return _storage._text != nil} + /// Clears the value of `text`. Subsequent reads from it will return its default value. + mutating func clearText() {_uniqueStorage()._text = nil} - var action: Int64 { - get {return _storage._action} - set {_uniqueStorage()._action = newValue} + var textFontSize: UInt32 { + get {return _storage._textFontSize} + set {_uniqueStorage()._textFontSize = newValue} } - var shareTarget: String { - get {return _storage._shareTarget} - set {_uniqueStorage()._shareTarget = newValue} + var background: Douyin_Image { + get {return _storage._background ?? Douyin_Image()} + set {_uniqueStorage()._background = newValue} } + /// Returns true if `background` has been explicitly set. + var hasBackground: Bool {return _storage._background != nil} + /// Clears the value of `background`. Subsequent reads from it will return its default value. + mutating func clearBackground() {_uniqueStorage()._background = nil} - var followCount: Int64 { - get {return _storage._followCount} - set {_uniqueStorage()._followCount = newValue} + var start: UInt32 { + get {return _storage._start} + set {_uniqueStorage()._start = newValue} } - var publicAreaCommon: PublicAreaCommon { - get {return _storage._publicAreaCommon ?? PublicAreaCommon()} - set {_uniqueStorage()._publicAreaCommon = newValue} + var duration: UInt32 { + get {return _storage._duration} + set {_uniqueStorage()._duration = newValue} + } + + var x: UInt32 { + get {return _storage._x} + set {_uniqueStorage()._x = newValue} + } + + var y: UInt32 { + get {return _storage._y} + set {_uniqueStorage()._y = newValue} + } + + var width: UInt32 { + get {return _storage._width} + set {_uniqueStorage()._width = newValue} + } + + var height: UInt32 { + get {return _storage._height} + set {_uniqueStorage()._height = newValue} + } + + var shadowDx: UInt32 { + get {return _storage._shadowDx} + set {_uniqueStorage()._shadowDx = newValue} + } + + var shadowDy: UInt32 { + get {return _storage._shadowDy} + set {_uniqueStorage()._shadowDy = newValue} + } + + var shadowRadius: UInt32 { + get {return _storage._shadowRadius} + set {_uniqueStorage()._shadowRadius = newValue} + } + + var shadowColor: String { + get {return _storage._shadowColor} + set {_uniqueStorage()._shadowColor = newValue} + } + + var strokeColor: String { + get {return _storage._strokeColor} + set {_uniqueStorage()._strokeColor = newValue} + } + + var strokeWidth: UInt32 { + get {return _storage._strokeWidth} + set {_uniqueStorage()._strokeWidth = newValue} } - /// Returns true if `publicAreaCommon` has been explicitly set. - var hasPublicAreaCommon: Bool {return _storage._publicAreaCommon != nil} - /// Clears the value of `publicAreaCommon`. Subsequent reads from it will return its default value. - mutating func clearPublicAreaCommon() {_uniqueStorage()._publicAreaCommon = nil} var unknownFields = SwiftProtobuf.UnknownStorage() @@ -611,37 +749,38 @@ struct SocialMessage { fileprivate var _storage = _StorageClass.defaultInstance } -struct MemberMessage { +/// 成员消息 +struct Douyin_MemberMessage: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - var common: Common { - get {return _storage._common ?? Common()} - set {_uniqueStorage()._common = newValue} + var common: Douyin_Common { + get {return _storage._common ?? Douyin_Common()} + set {_uniqueStorage()._common = newValue} } /// Returns true if `common` has been explicitly set. var hasCommon: Bool {return _storage._common != nil} /// Clears the value of `common`. Subsequent reads from it will return its default value. mutating func clearCommon() {_uniqueStorage()._common = nil} - var user: User { - get {return _storage._user ?? User()} - set {_uniqueStorage()._user = newValue} + var user: Douyin_User { + get {return _storage._user ?? Douyin_User()} + set {_uniqueStorage()._user = newValue} } /// Returns true if `user` has been explicitly set. var hasUser: Bool {return _storage._user != nil} /// Clears the value of `user`. Subsequent reads from it will return its default value. mutating func clearUser() {_uniqueStorage()._user = nil} - var memberCount: Int64 { - get {return _storage._memberCount} - set {_uniqueStorage()._memberCount = newValue} + var memberCount: UInt64 { + get {return _storage._memberCount} + set {_uniqueStorage()._memberCount = newValue} } - var `operator`: User { - get {return _storage._operator ?? User()} - set {_uniqueStorage()._operator = newValue} + var `operator`: Douyin_User { + get {return _storage._operator ?? Douyin_User()} + set {_uniqueStorage()._operator = newValue} } /// Returns true if ``operator`` has been explicitly set. var hasOperator: Bool {return _storage._operator != nil} @@ -649,48 +788,48 @@ struct MemberMessage { mutating func clearOperator() {_uniqueStorage()._operator = nil} var isSetToAdmin: Bool { - get {return _storage._isSetToAdmin} - set {_uniqueStorage()._isSetToAdmin = newValue} + get {return _storage._isSetToAdmin} + set {_uniqueStorage()._isSetToAdmin = newValue} } var isTopUser: Bool { - get {return _storage._isTopUser} - set {_uniqueStorage()._isTopUser = newValue} + get {return _storage._isTopUser} + set {_uniqueStorage()._isTopUser = newValue} } - var rankScore: Int64 { - get {return _storage._rankScore} - set {_uniqueStorage()._rankScore = newValue} + var rankScore: UInt64 { + get {return _storage._rankScore} + set {_uniqueStorage()._rankScore = newValue} } - var topUserNo: Int64 { - get {return _storage._topUserNo} - set {_uniqueStorage()._topUserNo = newValue} + var topUserNo: UInt64 { + get {return _storage._topUserNo} + set {_uniqueStorage()._topUserNo = newValue} } - var enterType: Int64 { - get {return _storage._enterType} - set {_uniqueStorage()._enterType = newValue} + var enterType: UInt64 { + get {return _storage._enterType} + set {_uniqueStorage()._enterType = newValue} } - var action: Int64 { - get {return _storage._action} - set {_uniqueStorage()._action = newValue} + var action: UInt64 { + get {return _storage._action} + set {_uniqueStorage()._action = newValue} } var actionDescription: String { - get {return _storage._actionDescription} - set {_uniqueStorage()._actionDescription = newValue} + get {return _storage._actionDescription} + set {_uniqueStorage()._actionDescription = newValue} } - var userID: Int64 { - get {return _storage._userID} - set {_uniqueStorage()._userID = newValue} + var userID: UInt64 { + get {return _storage._userID} + set {_uniqueStorage()._userID = newValue} } - var effectConfig: MemberMessage.EffectConfig { - get {return _storage._effectConfig ?? MemberMessage.EffectConfig()} - set {_uniqueStorage()._effectConfig = newValue} + var effectConfig: Douyin_EffectConfig { + get {return _storage._effectConfig ?? Douyin_EffectConfig()} + set {_uniqueStorage()._effectConfig = newValue} } /// Returns true if `effectConfig` has been explicitly set. var hasEffectConfig: Bool {return _storage._effectConfig != nil} @@ -698,273 +837,238 @@ struct MemberMessage { mutating func clearEffectConfig() {_uniqueStorage()._effectConfig = nil} var popStr: String { - get {return _storage._popStr} - set {_uniqueStorage()._popStr = newValue} + get {return _storage._popStr} + set {_uniqueStorage()._popStr = newValue} } - var enterEffectConfig: MemberMessage.EffectConfig { - get {return _storage._enterEffectConfig ?? MemberMessage.EffectConfig()} - set {_uniqueStorage()._enterEffectConfig = newValue} + var enterEffectConfig: Douyin_EffectConfig { + get {return _storage._enterEffectConfig ?? Douyin_EffectConfig()} + set {_uniqueStorage()._enterEffectConfig = newValue} } /// Returns true if `enterEffectConfig` has been explicitly set. var hasEnterEffectConfig: Bool {return _storage._enterEffectConfig != nil} /// Clears the value of `enterEffectConfig`. Subsequent reads from it will return its default value. mutating func clearEnterEffectConfig() {_uniqueStorage()._enterEffectConfig = nil} - var backgroundImage: Image { - get {return _storage._backgroundImage ?? Image()} - set {_uniqueStorage()._backgroundImage = newValue} + var backgroundImage: Douyin_Image { + get {return _storage._backgroundImage ?? Douyin_Image()} + set {_uniqueStorage()._backgroundImage = newValue} } /// Returns true if `backgroundImage` has been explicitly set. var hasBackgroundImage: Bool {return _storage._backgroundImage != nil} /// Clears the value of `backgroundImage`. Subsequent reads from it will return its default value. mutating func clearBackgroundImage() {_uniqueStorage()._backgroundImage = nil} - var backgroundImageV2: Image { - get {return _storage._backgroundImageV2 ?? Image()} - set {_uniqueStorage()._backgroundImageV2 = newValue} + var backgroundImageV2: Douyin_Image { + get {return _storage._backgroundImageV2 ?? Douyin_Image()} + set {_uniqueStorage()._backgroundImageV2 = newValue} } /// Returns true if `backgroundImageV2` has been explicitly set. var hasBackgroundImageV2: Bool {return _storage._backgroundImageV2 != nil} /// Clears the value of `backgroundImageV2`. Subsequent reads from it will return its default value. mutating func clearBackgroundImageV2() {_uniqueStorage()._backgroundImageV2 = nil} - var anchorDisplayText: Text { - get {return _storage._anchorDisplayText ?? Text()} - set {_uniqueStorage()._anchorDisplayText = newValue} + var anchorDisplayText: Douyin_Text { + get {return _storage._anchorDisplayText ?? Douyin_Text()} + set {_uniqueStorage()._anchorDisplayText = newValue} } /// Returns true if `anchorDisplayText` has been explicitly set. var hasAnchorDisplayText: Bool {return _storage._anchorDisplayText != nil} /// Clears the value of `anchorDisplayText`. Subsequent reads from it will return its default value. mutating func clearAnchorDisplayText() {_uniqueStorage()._anchorDisplayText = nil} - var publicAreaCommon: PublicAreaCommon { - get {return _storage._publicAreaCommon ?? PublicAreaCommon()} - set {_uniqueStorage()._publicAreaCommon = newValue} + var publicAreaCommon: Douyin_PublicAreaCommon { + get {return _storage._publicAreaCommon ?? Douyin_PublicAreaCommon()} + set {_uniqueStorage()._publicAreaCommon = newValue} } /// Returns true if `publicAreaCommon` has been explicitly set. var hasPublicAreaCommon: Bool {return _storage._publicAreaCommon != nil} /// Clears the value of `publicAreaCommon`. Subsequent reads from it will return its default value. mutating func clearPublicAreaCommon() {_uniqueStorage()._publicAreaCommon = nil} - var unknownFields = SwiftProtobuf.UnknownStorage() + var userEnterTipType: UInt64 { + get {return _storage._userEnterTipType} + set {_uniqueStorage()._userEnterTipType = newValue} + } - struct EffectConfig { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - var type: Int64 { - get {return _storage._type} - set {_uniqueStorage()._type = newValue} - } - - var icon: Image { - get {return _storage._icon ?? Image()} - set {_uniqueStorage()._icon = newValue} - } - /// Returns true if `icon` has been explicitly set. - var hasIcon: Bool {return _storage._icon != nil} - /// Clears the value of `icon`. Subsequent reads from it will return its default value. - mutating func clearIcon() {_uniqueStorage()._icon = nil} - - var avatarPos: Int64 { - get {return _storage._avatarPos} - set {_uniqueStorage()._avatarPos = newValue} - } - - var text: Text { - get {return _storage._text ?? Text()} - set {_uniqueStorage()._text = newValue} - } - /// Returns true if `text` has been explicitly set. - var hasText: Bool {return _storage._text != nil} - /// Clears the value of `text`. Subsequent reads from it will return its default value. - mutating func clearText() {_uniqueStorage()._text = nil} - - var textIcon: Image { - get {return _storage._textIcon ?? Image()} - set {_uniqueStorage()._textIcon = newValue} - } - /// Returns true if `textIcon` has been explicitly set. - var hasTextIcon: Bool {return _storage._textIcon != nil} - /// Clears the value of `textIcon`. Subsequent reads from it will return its default value. - mutating func clearTextIcon() {_uniqueStorage()._textIcon = nil} - - var stayTime: Int32 { - get {return _storage._stayTime} - set {_uniqueStorage()._stayTime = newValue} - } - - var animAssetID: Int64 { - get {return _storage._animAssetID} - set {_uniqueStorage()._animAssetID = newValue} - } - - var badge: Image { - get {return _storage._badge ?? Image()} - set {_uniqueStorage()._badge = newValue} - } - /// Returns true if `badge` has been explicitly set. - var hasBadge: Bool {return _storage._badge != nil} - /// Clears the value of `badge`. Subsequent reads from it will return its default value. - mutating func clearBadge() {_uniqueStorage()._badge = nil} - - var flexSettingArray: [Int64] { - get {return _storage._flexSettingArray} - set {_uniqueStorage()._flexSettingArray = newValue} - } - - var textIconOverlay: Image { - get {return _storage._textIconOverlay ?? Image()} - set {_uniqueStorage()._textIconOverlay = newValue} - } - /// Returns true if `textIconOverlay` has been explicitly set. - var hasTextIconOverlay: Bool {return _storage._textIconOverlay != nil} - /// Clears the value of `textIconOverlay`. Subsequent reads from it will return its default value. - mutating func clearTextIconOverlay() {_uniqueStorage()._textIconOverlay = nil} - - var animatedBadge: Image { - get {return _storage._animatedBadge ?? Image()} - set {_uniqueStorage()._animatedBadge = newValue} - } - /// Returns true if `animatedBadge` has been explicitly set. - var hasAnimatedBadge: Bool {return _storage._animatedBadge != nil} - /// Clears the value of `animatedBadge`. Subsequent reads from it will return its default value. - mutating func clearAnimatedBadge() {_uniqueStorage()._animatedBadge = nil} - - var hasSweepLight_p: Bool { - get {return _storage._hasSweepLight_p} - set {_uniqueStorage()._hasSweepLight_p = newValue} - } - - var textFlexSettingArray: [Int64] { - get {return _storage._textFlexSettingArray} - set {_uniqueStorage()._textFlexSettingArray = newValue} - } - - var centerAnimAssetID: Int64 { - get {return _storage._centerAnimAssetID} - set {_uniqueStorage()._centerAnimAssetID = newValue} - } - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _storage = _StorageClass.defaultInstance + var anchorEnterTipType: UInt64 { + get {return _storage._anchorEnterTipType} + set {_uniqueStorage()._anchorEnterTipType = newValue} } + var unknownFields = SwiftProtobuf.UnknownStorage() + init() {} fileprivate var _storage = _StorageClass.defaultInstance } -struct Common { +struct Douyin_PublicAreaCommon: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - var method: String { - get {return _storage._method} - set {_uniqueStorage()._method = newValue} + var userLabel: Douyin_Image { + get {return _userLabel ?? Douyin_Image()} + set {_userLabel = newValue} } + /// Returns true if `userLabel` has been explicitly set. + var hasUserLabel: Bool {return self._userLabel != nil} + /// Clears the value of `userLabel`. Subsequent reads from it will return its default value. + mutating func clearUserLabel() {self._userLabel = nil} + + var userConsumeInRoom: UInt64 = 0 + + var userSendGiftCntInRoom: UInt64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} - var msgID: Int64 { - get {return _storage._msgID} - set {_uniqueStorage()._msgID = newValue} + fileprivate var _userLabel: Douyin_Image? = nil +} + +struct Douyin_EffectConfig: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var type: UInt64 { + get {return _storage._type} + set {_uniqueStorage()._type = newValue} } - var roomID: Int64 { - get {return _storage._roomID} - set {_uniqueStorage()._roomID = newValue} + var icon: Douyin_Image { + get {return _storage._icon ?? Douyin_Image()} + set {_uniqueStorage()._icon = newValue} } + /// Returns true if `icon` has been explicitly set. + var hasIcon: Bool {return _storage._icon != nil} + /// Clears the value of `icon`. Subsequent reads from it will return its default value. + mutating func clearIcon() {_uniqueStorage()._icon = nil} - var createTime: Int64 { - get {return _storage._createTime} - set {_uniqueStorage()._createTime = newValue} + var avatarPos: UInt64 { + get {return _storage._avatarPos} + set {_uniqueStorage()._avatarPos = newValue} } - var monitor: Int32 { - get {return _storage._monitor} - set {_uniqueStorage()._monitor = newValue} + var text: Douyin_Text { + get {return _storage._text ?? Douyin_Text()} + set {_uniqueStorage()._text = newValue} } + /// Returns true if `text` has been explicitly set. + var hasText: Bool {return _storage._text != nil} + /// Clears the value of `text`. Subsequent reads from it will return its default value. + mutating func clearText() {_uniqueStorage()._text = nil} - var isShowMsg: Bool { - get {return _storage._isShowMsg} - set {_uniqueStorage()._isShowMsg = newValue} + var textIcon: Douyin_Image { + get {return _storage._textIcon ?? Douyin_Image()} + set {_uniqueStorage()._textIcon = newValue} } + /// Returns true if `textIcon` has been explicitly set. + var hasTextIcon: Bool {return _storage._textIcon != nil} + /// Clears the value of `textIcon`. Subsequent reads from it will return its default value. + mutating func clearTextIcon() {_uniqueStorage()._textIcon = nil} - var describe: String { - get {return _storage._describe} - set {_uniqueStorage()._describe = newValue} + var stayTime: UInt32 { + get {return _storage._stayTime} + set {_uniqueStorage()._stayTime = newValue} } - var displayText: Text { - get {return _storage._displayText ?? Text()} - set {_uniqueStorage()._displayText = newValue} + var animAssetID: UInt64 { + get {return _storage._animAssetID} + set {_uniqueStorage()._animAssetID = newValue} } - /// Returns true if `displayText` has been explicitly set. - var hasDisplayText: Bool {return _storage._displayText != nil} - /// Clears the value of `displayText`. Subsequent reads from it will return its default value. - mutating func clearDisplayText() {_uniqueStorage()._displayText = nil} - var foldType: Int64 { - get {return _storage._foldType} - set {_uniqueStorage()._foldType = newValue} + var badge: Douyin_Image { + get {return _storage._badge ?? Douyin_Image()} + set {_uniqueStorage()._badge = newValue} } + /// Returns true if `badge` has been explicitly set. + var hasBadge: Bool {return _storage._badge != nil} + /// Clears the value of `badge`. Subsequent reads from it will return its default value. + mutating func clearBadge() {_uniqueStorage()._badge = nil} - var anchorFoldType: Int64 { - get {return _storage._anchorFoldType} - set {_uniqueStorage()._anchorFoldType = newValue} + var flexSettingArrayList: [UInt64] { + get {return _storage._flexSettingArrayList} + set {_uniqueStorage()._flexSettingArrayList = newValue} } - var priorityScore: Int64 { - get {return _storage._priorityScore} - set {_uniqueStorage()._priorityScore = newValue} + var textIconOverlay: Douyin_Image { + get {return _storage._textIconOverlay ?? Douyin_Image()} + set {_uniqueStorage()._textIconOverlay = newValue} } + /// Returns true if `textIconOverlay` has been explicitly set. + var hasTextIconOverlay: Bool {return _storage._textIconOverlay != nil} + /// Clears the value of `textIconOverlay`. Subsequent reads from it will return its default value. + mutating func clearTextIconOverlay() {_uniqueStorage()._textIconOverlay = nil} - var logID: String { - get {return _storage._logID} - set {_uniqueStorage()._logID = newValue} + var animatedBadge: Douyin_Image { + get {return _storage._animatedBadge ?? Douyin_Image()} + set {_uniqueStorage()._animatedBadge = newValue} } + /// Returns true if `animatedBadge` has been explicitly set. + var hasAnimatedBadge: Bool {return _storage._animatedBadge != nil} + /// Clears the value of `animatedBadge`. Subsequent reads from it will return its default value. + mutating func clearAnimatedBadge() {_uniqueStorage()._animatedBadge = nil} - var msgProcessFilterK: String { - get {return _storage._msgProcessFilterK} - set {_uniqueStorage()._msgProcessFilterK = newValue} + var hasSweepLight_p: Bool { + get {return _storage._hasSweepLight_p} + set {_uniqueStorage()._hasSweepLight_p = newValue} } - var msgProcessFilterV: String { - get {return _storage._msgProcessFilterV} - set {_uniqueStorage()._msgProcessFilterV = newValue} + var textFlexSettingArrayList: [UInt64] { + get {return _storage._textFlexSettingArrayList} + set {_uniqueStorage()._textFlexSettingArrayList = newValue} } - var user: User { - get {return _storage._user ?? User()} - set {_uniqueStorage()._user = newValue} + var centerAnimAssetID: UInt64 { + get {return _storage._centerAnimAssetID} + set {_uniqueStorage()._centerAnimAssetID = newValue} + } + + var dynamicImage: Douyin_Image { + get {return _storage._dynamicImage ?? Douyin_Image()} + set {_uniqueStorage()._dynamicImage = newValue} + } + /// Returns true if `dynamicImage` has been explicitly set. + var hasDynamicImage: Bool {return _storage._dynamicImage != nil} + /// Clears the value of `dynamicImage`. Subsequent reads from it will return its default value. + mutating func clearDynamicImage() {_uniqueStorage()._dynamicImage = nil} + + var extraMap: Dictionary { + get {return _storage._extraMap} + set {_uniqueStorage()._extraMap = newValue} } - /// Returns true if `user` has been explicitly set. - var hasUser: Bool {return _storage._user != nil} - /// Clears the value of `user`. Subsequent reads from it will return its default value. - mutating func clearUser() {_uniqueStorage()._user = nil} - var room: Room { - get {return _storage._room ?? Room()} - set {_uniqueStorage()._room = newValue} + var mp4AnimAssetID: UInt64 { + get {return _storage._mp4AnimAssetID} + set {_uniqueStorage()._mp4AnimAssetID = newValue} } - /// Returns true if `room` has been explicitly set. - var hasRoom: Bool {return _storage._room != nil} - /// Clears the value of `room`. Subsequent reads from it will return its default value. - mutating func clearRoom() {_uniqueStorage()._room = nil} - var anchorFoldTypeV2: Int64 { - get {return _storage._anchorFoldTypeV2} - set {_uniqueStorage()._anchorFoldTypeV2 = newValue} + var priority: UInt64 { + get {return _storage._priority} + set {_uniqueStorage()._priority = newValue} } - var processAtSeiTimeMs: Int64 { - get {return _storage._processAtSeiTimeMs} - set {_uniqueStorage()._processAtSeiTimeMs = newValue} + var maxWaitTime: UInt64 { + get {return _storage._maxWaitTime} + set {_uniqueStorage()._maxWaitTime = newValue} + } + + var dressID: String { + get {return _storage._dressID} + set {_uniqueStorage()._dressID = newValue} + } + + var alignment: UInt64 { + get {return _storage._alignment} + set {_uniqueStorage()._alignment = newValue} + } + + var alignmentOffset: UInt64 { + get {return _storage._alignmentOffset} + set {_uniqueStorage()._alignmentOffset = newValue} } var unknownFields = SwiftProtobuf.UnknownStorage() @@ -974,312 +1078,101 @@ struct Common { fileprivate var _storage = _StorageClass.defaultInstance } -struct Text { +struct Douyin_Text: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. var key: String = String() - var defaultPattern: String = String() + var defaultPatter: String = String() - var defaultFormat: TextFormat { - get {return _defaultFormat ?? TextFormat()} - set {_defaultFormat = newValue} + var defaultFormat: Douyin_TextFormat { + get {return _defaultFormat ?? Douyin_TextFormat()} + set {_defaultFormat = newValue} } /// Returns true if `defaultFormat` has been explicitly set. var hasDefaultFormat: Bool {return self._defaultFormat != nil} /// Clears the value of `defaultFormat`. Subsequent reads from it will return its default value. mutating func clearDefaultFormat() {self._defaultFormat = nil} - var pieces: [TextPiece] = [] + var piecesList: [Douyin_TextPiece] = [] var unknownFields = SwiftProtobuf.UnknownStorage() init() {} - fileprivate var _defaultFormat: TextFormat? = nil + fileprivate var _defaultFormat: Douyin_TextFormat? = nil } -struct Room { +struct Douyin_TextPiece: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - var id: Int64 { - get {return _storage._id} - set {_uniqueStorage()._id = newValue} - } - - var idStr: String { - get {return _storage._idStr} - set {_uniqueStorage()._idStr = newValue} - } - - var status: Int64 { - get {return _storage._status} - set {_uniqueStorage()._status = newValue} - } - - var ownerUserID: Int64 { - get {return _storage._ownerUserID} - set {_uniqueStorage()._ownerUserID = newValue} - } - - var title: String { - get {return _storage._title} - set {_uniqueStorage()._title = newValue} - } - - var userCount: Int64 { - get {return _storage._userCount} - set {_uniqueStorage()._userCount = newValue} - } - - var createTime: Int64 { - get {return _storage._createTime} - set {_uniqueStorage()._createTime = newValue} - } - - var linkmicLayout: Int64 { - get {return _storage._linkmicLayout} - set {_uniqueStorage()._linkmicLayout = newValue} - } - - var finishTime: Int64 { - get {return _storage._finishTime} - set {_uniqueStorage()._finishTime = newValue} - } - - var extra: RoomExtra { - get {return _storage._extra ?? RoomExtra()} - set {_uniqueStorage()._extra = newValue} - } - /// Returns true if `extra` has been explicitly set. - var hasExtra: Bool {return _storage._extra != nil} - /// Clears the value of `extra`. Subsequent reads from it will return its default value. - mutating func clearExtra() {_uniqueStorage()._extra = nil} - - var dynamicCoverUri: String { - get {return _storage._dynamicCoverUri} - set {_uniqueStorage()._dynamicCoverUri = newValue} - } - - var dynamicCoverDict: Dictionary { - get {return _storage._dynamicCoverDict} - set {_uniqueStorage()._dynamicCoverDict = newValue} - } - - var lastPingTime: Int64 { - get {return _storage._lastPingTime} - set {_uniqueStorage()._lastPingTime = newValue} - } - - var liveID: Int64 { - get {return _storage._liveID} - set {_uniqueStorage()._liveID = newValue} - } - - var streamProvider: Int64 { - get {return _storage._streamProvider} - set {_uniqueStorage()._streamProvider = newValue} - } - - var osType: Int64 { - get {return _storage._osType} - set {_uniqueStorage()._osType = newValue} - } - - var clientVersion: Int64 { - get {return _storage._clientVersion} - set {_uniqueStorage()._clientVersion = newValue} - } - - var withLinkmic: Bool { - get {return _storage._withLinkmic} - set {_uniqueStorage()._withLinkmic = newValue} - } - - var enableRoomPerspective: Bool { - get {return _storage._enableRoomPerspective} - set {_uniqueStorage()._enableRoomPerspective = newValue} - } - - var cover: Image { - get {return _storage._cover ?? Image()} - set {_uniqueStorage()._cover = newValue} - } - /// Returns true if `cover` has been explicitly set. - var hasCover: Bool {return _storage._cover != nil} - /// Clears the value of `cover`. Subsequent reads from it will return its default value. - mutating func clearCover() {_uniqueStorage()._cover = nil} - - var dynamicCover: Image { - get {return _storage._dynamicCover ?? Image()} - set {_uniqueStorage()._dynamicCover = newValue} - } - /// Returns true if `dynamicCover` has been explicitly set. - var hasDynamicCover: Bool {return _storage._dynamicCover != nil} - /// Clears the value of `dynamicCover`. Subsequent reads from it will return its default value. - mutating func clearDynamicCover() {_uniqueStorage()._dynamicCover = nil} - - var dynamicCoverLow: Image { - get {return _storage._dynamicCoverLow ?? Image()} - set {_uniqueStorage()._dynamicCoverLow = newValue} - } - /// Returns true if `dynamicCoverLow` has been explicitly set. - var hasDynamicCoverLow: Bool {return _storage._dynamicCoverLow != nil} - /// Clears the value of `dynamicCoverLow`. Subsequent reads from it will return its default value. - mutating func clearDynamicCoverLow() {_uniqueStorage()._dynamicCoverLow = nil} - - var shareURL: String { - get {return _storage._shareURL} - set {_uniqueStorage()._shareURL = newValue} - } - - var anchorShareText: String { - get {return _storage._anchorShareText} - set {_uniqueStorage()._anchorShareText = newValue} + var type: Bool { + get {return _storage._type} + set {_uniqueStorage()._type = newValue} } - var userShareText: String { - get {return _storage._userShareText} - set {_uniqueStorage()._userShareText = newValue} - } - - var streamID: Int64 { - get {return _storage._streamID} - set {_uniqueStorage()._streamID = newValue} - } - - var streamIDStr: String { - get {return _storage._streamIDStr} - set {_uniqueStorage()._streamIDStr = newValue} - } - - var streamURL: StreamUrl { - get {return _storage._streamURL ?? StreamUrl()} - set {_uniqueStorage()._streamURL = newValue} - } - /// Returns true if `streamURL` has been explicitly set. - var hasStreamURL: Bool {return _storage._streamURL != nil} - /// Clears the value of `streamURL`. Subsequent reads from it will return its default value. - mutating func clearStreamURL() {_uniqueStorage()._streamURL = nil} - - var mosaicStatus: Int64 { - get {return _storage._mosaicStatus} - set {_uniqueStorage()._mosaicStatus = newValue} - } - - var mosaicTip: String { - get {return _storage._mosaicTip} - set {_uniqueStorage()._mosaicTip = newValue} - } - - var cellStyle: Int64 { - get {return _storage._cellStyle} - set {_uniqueStorage()._cellStyle = newValue} - } - - var linkMic: LinkMic { - get {return _storage._linkMic ?? LinkMic()} - set {_uniqueStorage()._linkMic = newValue} - } - /// Returns true if `linkMic` has been explicitly set. - var hasLinkMic: Bool {return _storage._linkMic != nil} - /// Clears the value of `linkMic`. Subsequent reads from it will return its default value. - mutating func clearLinkMic() {_uniqueStorage()._linkMic = nil} - - var luckymoneyNum: Int64 { - get {return _storage._luckymoneyNum} - set {_uniqueStorage()._luckymoneyNum = newValue} - } - - var decoList: [Decoration] { - get {return _storage._decoList} - set {_uniqueStorage()._decoList = newValue} - } - - var topFans: [TopFan] { - get {return _storage._topFans} - set {_uniqueStorage()._topFans = newValue} - } - - var stats: RoomStats { - get {return _storage._stats ?? RoomStats()} - set {_uniqueStorage()._stats = newValue} - } - /// Returns true if `stats` has been explicitly set. - var hasStats: Bool {return _storage._stats != nil} - /// Clears the value of `stats`. Subsequent reads from it will return its default value. - mutating func clearStats() {_uniqueStorage()._stats = nil} - - var sunDailyIconContent: String { - get {return _storage._sunDailyIconContent} - set {_uniqueStorage()._sunDailyIconContent = newValue} - } - - var distance: String { - get {return _storage._distance} - set {_uniqueStorage()._distance = newValue} - } - - var distanceCity: String { - get {return _storage._distanceCity} - set {_uniqueStorage()._distanceCity = newValue} - } - - var location: String { - get {return _storage._location} - set {_uniqueStorage()._location = newValue} - } - - var realDistance: String { - get {return _storage._realDistance} - set {_uniqueStorage()._realDistance = newValue} + var format: Douyin_TextFormat { + get {return _storage._format ?? Douyin_TextFormat()} + set {_uniqueStorage()._format = newValue} } + /// Returns true if `format` has been explicitly set. + var hasFormat: Bool {return _storage._format != nil} + /// Clears the value of `format`. Subsequent reads from it will return its default value. + mutating func clearFormat() {_uniqueStorage()._format = nil} - var feedRoomLabel: Image { - get {return _storage._feedRoomLabel ?? Image()} - set {_uniqueStorage()._feedRoomLabel = newValue} + var stringValue: String { + get {return _storage._stringValue} + set {_uniqueStorage()._stringValue = newValue} } - /// Returns true if `feedRoomLabel` has been explicitly set. - var hasFeedRoomLabel: Bool {return _storage._feedRoomLabel != nil} - /// Clears the value of `feedRoomLabel`. Subsequent reads from it will return its default value. - mutating func clearFeedRoomLabel() {_uniqueStorage()._feedRoomLabel = nil} - var commonLabelList: String { - get {return _storage._commonLabelList} - set {_uniqueStorage()._commonLabelList = newValue} + var userValue: Douyin_TextPieceUser { + get {return _storage._userValue ?? Douyin_TextPieceUser()} + set {_uniqueStorage()._userValue = newValue} } + /// Returns true if `userValue` has been explicitly set. + var hasUserValue: Bool {return _storage._userValue != nil} + /// Clears the value of `userValue`. Subsequent reads from it will return its default value. + mutating func clearUserValue() {_uniqueStorage()._userValue = nil} - var livingRoomAttrs: RoomUserAttr { - get {return _storage._livingRoomAttrs ?? RoomUserAttr()} - set {_uniqueStorage()._livingRoomAttrs = newValue} + var giftValue: Douyin_TextPieceGift { + get {return _storage._giftValue ?? Douyin_TextPieceGift()} + set {_uniqueStorage()._giftValue = newValue} } - /// Returns true if `livingRoomAttrs` has been explicitly set. - var hasLivingRoomAttrs: Bool {return _storage._livingRoomAttrs != nil} - /// Clears the value of `livingRoomAttrs`. Subsequent reads from it will return its default value. - mutating func clearLivingRoomAttrs() {_uniqueStorage()._livingRoomAttrs = nil} + /// Returns true if `giftValue` has been explicitly set. + var hasGiftValue: Bool {return _storage._giftValue != nil} + /// Clears the value of `giftValue`. Subsequent reads from it will return its default value. + mutating func clearGiftValue() {_uniqueStorage()._giftValue = nil} - var adminUserIds: [Int64] { - get {return _storage._adminUserIds} - set {_uniqueStorage()._adminUserIds = newValue} + var heartValue: Douyin_TextPieceHeart { + get {return _storage._heartValue ?? Douyin_TextPieceHeart()} + set {_uniqueStorage()._heartValue = newValue} } + /// Returns true if `heartValue` has been explicitly set. + var hasHeartValue: Bool {return _storage._heartValue != nil} + /// Clears the value of `heartValue`. Subsequent reads from it will return its default value. + mutating func clearHeartValue() {_uniqueStorage()._heartValue = nil} - var owner: User { - get {return _storage._owner ?? User()} - set {_uniqueStorage()._owner = newValue} + var patternRefValue: Douyin_TextPiecePatternRef { + get {return _storage._patternRefValue ?? Douyin_TextPiecePatternRef()} + set {_uniqueStorage()._patternRefValue = newValue} } - /// Returns true if `owner` has been explicitly set. - var hasOwner: Bool {return _storage._owner != nil} - /// Clears the value of `owner`. Subsequent reads from it will return its default value. - mutating func clearOwner() {_uniqueStorage()._owner = nil} + /// Returns true if `patternRefValue` has been explicitly set. + var hasPatternRefValue: Bool {return _storage._patternRefValue != nil} + /// Clears the value of `patternRefValue`. Subsequent reads from it will return its default value. + mutating func clearPatternRefValue() {_uniqueStorage()._patternRefValue = nil} - var privateInfo: String { - get {return _storage._privateInfo} - set {_uniqueStorage()._privateInfo = newValue} + var imageValue: Douyin_TextPieceImage { + get {return _storage._imageValue ?? Douyin_TextPieceImage()} + set {_uniqueStorage()._imageValue = newValue} } + /// Returns true if `imageValue` has been explicitly set. + var hasImageValue: Bool {return _storage._imageValue != nil} + /// Clears the value of `imageValue`. Subsequent reads from it will return its default value. + mutating func clearImageValue() {_uniqueStorage()._imageValue = nil} var unknownFields = SwiftProtobuf.UnknownStorage() @@ -1288,957 +1181,539 @@ struct Room { fileprivate var _storage = _StorageClass.defaultInstance } -struct RoomExtra { +struct Douyin_TextPieceImage: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - var unknownFields = SwiftProtobuf.UnknownStorage() + var image: Douyin_Image { + get {return _image ?? Douyin_Image()} + set {_image = newValue} + } + /// Returns true if `image` has been explicitly set. + var hasImage: Bool {return self._image != nil} + /// Clears the value of `image`. Subsequent reads from it will return its default value. + mutating func clearImage() {self._image = nil} - init() {} -} - -struct RoomStats { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. + var scalingRate: Float = 0 var unknownFields = SwiftProtobuf.UnknownStorage() init() {} + + fileprivate var _image: Douyin_Image? = nil } -struct RoomUserAttr { +struct Douyin_TextPiecePatternRef: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. + var key: String = String() + + var defaultPattern: String = String() + var unknownFields = SwiftProtobuf.UnknownStorage() init() {} } -struct StreamUrl { +struct Douyin_TextPieceHeart: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. + var color: String = String() + var unknownFields = SwiftProtobuf.UnknownStorage() init() {} } -struct LinkMic { +struct Douyin_TextPieceGift: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. + var giftID: UInt64 = 0 + + var nameRef: Douyin_PatternRef { + get {return _nameRef ?? Douyin_PatternRef()} + set {_nameRef = newValue} + } + /// Returns true if `nameRef` has been explicitly set. + var hasNameRef: Bool {return self._nameRef != nil} + /// Clears the value of `nameRef`. Subsequent reads from it will return its default value. + mutating func clearNameRef() {self._nameRef = nil} + var unknownFields = SwiftProtobuf.UnknownStorage() init() {} + + fileprivate var _nameRef: Douyin_PatternRef? = nil } -struct Decoration { +struct Douyin_PatternRef: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. + var key: String = String() + + var defaultPattern: String = String() + var unknownFields = SwiftProtobuf.UnknownStorage() init() {} } -struct TopFan { +struct Douyin_TextPieceUser: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. + var user: Douyin_User { + get {return _user ?? Douyin_User()} + set {_user = newValue} + } + /// Returns true if `user` has been explicitly set. + var hasUser: Bool {return self._user != nil} + /// Clears the value of `user`. Subsequent reads from it will return its default value. + mutating func clearUser() {self._user = nil} + + var withColon: Bool = false + var unknownFields = SwiftProtobuf.UnknownStorage() init() {} + + fileprivate var _user: Douyin_User? = nil } -struct User { +struct Douyin_TextFormat: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - var id: Int64 { - get {return _storage._id} - set {_uniqueStorage()._id = newValue} - } - - var shortID: Int64 { - get {return _storage._shortID} - set {_uniqueStorage()._shortID = newValue} - } - - var nickname: String { - get {return _storage._nickname} - set {_uniqueStorage()._nickname = newValue} - } - - var gender: Int32 { - get {return _storage._gender} - set {_uniqueStorage()._gender = newValue} - } - - var signature: String { - get {return _storage._signature} - set {_uniqueStorage()._signature = newValue} - } - - var level: Int32 { - get {return _storage._level} - set {_uniqueStorage()._level = newValue} - } + var color: String = String() - var birthday: Int64 { - get {return _storage._birthday} - set {_uniqueStorage()._birthday = newValue} - } + var bold: Bool = false - var telephone: String { - get {return _storage._telephone} - set {_uniqueStorage()._telephone = newValue} - } + var italic: Bool = false - var avatarThumb: Image { - get {return _storage._avatarThumb ?? Image()} - set {_uniqueStorage()._avatarThumb = newValue} - } - /// Returns true if `avatarThumb` has been explicitly set. - var hasAvatarThumb: Bool {return _storage._avatarThumb != nil} - /// Clears the value of `avatarThumb`. Subsequent reads from it will return its default value. - mutating func clearAvatarThumb() {_uniqueStorage()._avatarThumb = nil} + var weight: UInt32 = 0 - var avatarMedium: Image { - get {return _storage._avatarMedium ?? Image()} - set {_uniqueStorage()._avatarMedium = newValue} - } - /// Returns true if `avatarMedium` has been explicitly set. - var hasAvatarMedium: Bool {return _storage._avatarMedium != nil} - /// Clears the value of `avatarMedium`. Subsequent reads from it will return its default value. - mutating func clearAvatarMedium() {_uniqueStorage()._avatarMedium = nil} + var italicAngle: UInt32 = 0 - var avatarLarge: Image { - get {return _storage._avatarLarge ?? Image()} - set {_uniqueStorage()._avatarLarge = newValue} - } - /// Returns true if `avatarLarge` has been explicitly set. - var hasAvatarLarge: Bool {return _storage._avatarLarge != nil} - /// Clears the value of `avatarLarge`. Subsequent reads from it will return its default value. - mutating func clearAvatarLarge() {_uniqueStorage()._avatarLarge = nil} + var fontSize: UInt32 = 0 - var verified: Bool { - get {return _storage._verified} - set {_uniqueStorage()._verified = newValue} - } + var useHeighLightColor: Bool = false - var experience: Int32 { - get {return _storage._experience} - set {_uniqueStorage()._experience = newValue} - } + var useRemoteClor: Bool = false - var city: String { - get {return _storage._city} - set {_uniqueStorage()._city = newValue} - } + var unknownFields = SwiftProtobuf.UnknownStorage() - var status: Int32 { - get {return _storage._status} - set {_uniqueStorage()._status = newValue} - } + init() {} +} - var createTime: Int64 { - get {return _storage._createTime} - set {_uniqueStorage()._createTime = newValue} - } +/// 点赞 +struct Douyin_LikeMessage: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. - var modifyTime: Int64 { - get {return _storage._modifyTime} - set {_uniqueStorage()._modifyTime = newValue} + var common: Douyin_Common { + get {return _common ?? Douyin_Common()} + set {_common = newValue} } + /// Returns true if `common` has been explicitly set. + var hasCommon: Bool {return self._common != nil} + /// Clears the value of `common`. Subsequent reads from it will return its default value. + mutating func clearCommon() {self._common = nil} - var secret: Int32 { - get {return _storage._secret} - set {_uniqueStorage()._secret = newValue} - } + var count: UInt64 = 0 - var shareQrcodeUri: String { - get {return _storage._shareQrcodeUri} - set {_uniqueStorage()._shareQrcodeUri = newValue} - } + var total: UInt64 = 0 - var incomeSharePercent: Int32 { - get {return _storage._incomeSharePercent} - set {_uniqueStorage()._incomeSharePercent = newValue} - } + var color: UInt64 = 0 - var badgeImageList: Image { - get {return _storage._badgeImageList ?? Image()} - set {_uniqueStorage()._badgeImageList = newValue} + var user: Douyin_User { + get {return _user ?? Douyin_User()} + set {_user = newValue} } - /// Returns true if `badgeImageList` has been explicitly set. - var hasBadgeImageList: Bool {return _storage._badgeImageList != nil} - /// Clears the value of `badgeImageList`. Subsequent reads from it will return its default value. - mutating func clearBadgeImageList() {_uniqueStorage()._badgeImageList = nil} + /// Returns true if `user` has been explicitly set. + var hasUser: Bool {return self._user != nil} + /// Clears the value of `user`. Subsequent reads from it will return its default value. + mutating func clearUser() {self._user = nil} - var followInfo: User.FollowInfo { - get {return _storage._followInfo ?? User.FollowInfo()} - set {_uniqueStorage()._followInfo = newValue} - } - /// Returns true if `followInfo` has been explicitly set. - var hasFollowInfo: Bool {return _storage._followInfo != nil} - /// Clears the value of `followInfo`. Subsequent reads from it will return its default value. - mutating func clearFollowInfo() {_uniqueStorage()._followInfo = nil} + var icon: String = String() - var payGrade: User.PayGrade { - get {return _storage._payGrade ?? User.PayGrade()} - set {_uniqueStorage()._payGrade = newValue} + var doubleLikeDetail: Douyin_DoubleLikeDetail { + get {return _doubleLikeDetail ?? Douyin_DoubleLikeDetail()} + set {_doubleLikeDetail = newValue} } - /// Returns true if `payGrade` has been explicitly set. - var hasPayGrade: Bool {return _storage._payGrade != nil} - /// Clears the value of `payGrade`. Subsequent reads from it will return its default value. - mutating func clearPayGrade() {_uniqueStorage()._payGrade = nil} + /// Returns true if `doubleLikeDetail` has been explicitly set. + var hasDoubleLikeDetail: Bool {return self._doubleLikeDetail != nil} + /// Clears the value of `doubleLikeDetail`. Subsequent reads from it will return its default value. + mutating func clearDoubleLikeDetail() {self._doubleLikeDetail = nil} - var fansClub: User.FansClub { - get {return _storage._fansClub ?? User.FansClub()} - set {_uniqueStorage()._fansClub = newValue} + var displayControlInfo: Douyin_DisplayControlInfo { + get {return _displayControlInfo ?? Douyin_DisplayControlInfo()} + set {_displayControlInfo = newValue} } - /// Returns true if `fansClub` has been explicitly set. - var hasFansClub: Bool {return _storage._fansClub != nil} - /// Clears the value of `fansClub`. Subsequent reads from it will return its default value. - mutating func clearFansClub() {_uniqueStorage()._fansClub = nil} + /// Returns true if `displayControlInfo` has been explicitly set. + var hasDisplayControlInfo: Bool {return self._displayControlInfo != nil} + /// Clears the value of `displayControlInfo`. Subsequent reads from it will return its default value. + mutating func clearDisplayControlInfo() {self._displayControlInfo = nil} - var border: User.Border { - get {return _storage._border ?? User.Border()} - set {_uniqueStorage()._border = newValue} - } - /// Returns true if `border` has been explicitly set. - var hasBorder: Bool {return _storage._border != nil} - /// Clears the value of `border`. Subsequent reads from it will return its default value. - mutating func clearBorder() {_uniqueStorage()._border = nil} + var linkmicGuestUid: UInt64 = 0 - var specialID: String { - get {return _storage._specialID} - set {_uniqueStorage()._specialID = newValue} - } + var scene: String = String() - var avatarBorder: Image { - get {return _storage._avatarBorder ?? Image()} - set {_uniqueStorage()._avatarBorder = newValue} + var picoDisplayInfo: Douyin_PicoDisplayInfo { + get {return _picoDisplayInfo ?? Douyin_PicoDisplayInfo()} + set {_picoDisplayInfo = newValue} } - /// Returns true if `avatarBorder` has been explicitly set. - var hasAvatarBorder: Bool {return _storage._avatarBorder != nil} - /// Clears the value of `avatarBorder`. Subsequent reads from it will return its default value. - mutating func clearAvatarBorder() {_uniqueStorage()._avatarBorder = nil} + /// Returns true if `picoDisplayInfo` has been explicitly set. + var hasPicoDisplayInfo: Bool {return self._picoDisplayInfo != nil} + /// Clears the value of `picoDisplayInfo`. Subsequent reads from it will return its default value. + mutating func clearPicoDisplayInfo() {self._picoDisplayInfo = nil} - var medal: Image { - get {return _storage._medal ?? Image()} - set {_uniqueStorage()._medal = newValue} - } - /// Returns true if `medal` has been explicitly set. - var hasMedal: Bool {return _storage._medal != nil} - /// Clears the value of `medal`. Subsequent reads from it will return its default value. - mutating func clearMedal() {_uniqueStorage()._medal = nil} + var unknownFields = SwiftProtobuf.UnknownStorage() - var realTimeIcons: [Image] { - get {return _storage._realTimeIcons} - set {_uniqueStorage()._realTimeIcons = newValue} - } + init() {} - var newRealTimeIcons: [Image] { - get {return _storage._newRealTimeIcons} - set {_uniqueStorage()._newRealTimeIcons = newValue} - } + fileprivate var _common: Douyin_Common? = nil + fileprivate var _user: Douyin_User? = nil + fileprivate var _doubleLikeDetail: Douyin_DoubleLikeDetail? = nil + fileprivate var _displayControlInfo: Douyin_DisplayControlInfo? = nil + fileprivate var _picoDisplayInfo: Douyin_PicoDisplayInfo? = nil +} - var topVipNo: Int64 { - get {return _storage._topVipNo} - set {_uniqueStorage()._topVipNo = newValue} - } +struct Douyin_SocialMessage: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. - var userAttr: User.UserAttr { - get {return _storage._userAttr ?? User.UserAttr()} - set {_uniqueStorage()._userAttr = newValue} + var common: Douyin_Common { + get {return _storage._common ?? Douyin_Common()} + set {_uniqueStorage()._common = newValue} } - /// Returns true if `userAttr` has been explicitly set. - var hasUserAttr: Bool {return _storage._userAttr != nil} - /// Clears the value of `userAttr`. Subsequent reads from it will return its default value. - mutating func clearUserAttr() {_uniqueStorage()._userAttr = nil} + /// Returns true if `common` has been explicitly set. + var hasCommon: Bool {return _storage._common != nil} + /// Clears the value of `common`. Subsequent reads from it will return its default value. + mutating func clearCommon() {_uniqueStorage()._common = nil} - var ownRoom: User.OwnRoom { - get {return _storage._ownRoom ?? User.OwnRoom()} - set {_uniqueStorage()._ownRoom = newValue} + var user: Douyin_User { + get {return _storage._user ?? Douyin_User()} + set {_uniqueStorage()._user = newValue} } - /// Returns true if `ownRoom` has been explicitly set. - var hasOwnRoom: Bool {return _storage._ownRoom != nil} - /// Clears the value of `ownRoom`. Subsequent reads from it will return its default value. - mutating func clearOwnRoom() {_uniqueStorage()._ownRoom = nil} + /// Returns true if `user` has been explicitly set. + var hasUser: Bool {return _storage._user != nil} + /// Clears the value of `user`. Subsequent reads from it will return its default value. + mutating func clearUser() {_uniqueStorage()._user = nil} - var payScore: Int64 { - get {return _storage._payScore} - set {_uniqueStorage()._payScore = newValue} + var shareType: UInt64 { + get {return _storage._shareType} + set {_uniqueStorage()._shareType = newValue} } - var ticketCount: Int64 { - get {return _storage._ticketCount} - set {_uniqueStorage()._ticketCount = newValue} + var action: UInt64 { + get {return _storage._action} + set {_uniqueStorage()._action = newValue} } - var anchorInfo: User.AnchorInfo { - get {return _storage._anchorInfo ?? User.AnchorInfo()} - set {_uniqueStorage()._anchorInfo = newValue} + var shareTarget: String { + get {return _storage._shareTarget} + set {_uniqueStorage()._shareTarget = newValue} } - /// Returns true if `anchorInfo` has been explicitly set. - var hasAnchorInfo: Bool {return _storage._anchorInfo != nil} - /// Clears the value of `anchorInfo`. Subsequent reads from it will return its default value. - mutating func clearAnchorInfo() {_uniqueStorage()._anchorInfo = nil} - var linkMicStats: Int32 { - get {return _storage._linkMicStats} - set {_uniqueStorage()._linkMicStats = newValue} + var followCount: UInt64 { + get {return _storage._followCount} + set {_uniqueStorage()._followCount = newValue} } - var displayID: String { - get {return _storage._displayID} - set {_uniqueStorage()._displayID = newValue} + var publicAreaCommon: Douyin_PublicAreaCommon { + get {return _storage._publicAreaCommon ?? Douyin_PublicAreaCommon()} + set {_uniqueStorage()._publicAreaCommon = newValue} } + /// Returns true if `publicAreaCommon` has been explicitly set. + var hasPublicAreaCommon: Bool {return _storage._publicAreaCommon != nil} + /// Clears the value of `publicAreaCommon`. Subsequent reads from it will return its default value. + mutating func clearPublicAreaCommon() {_uniqueStorage()._publicAreaCommon = nil} var unknownFields = SwiftProtobuf.UnknownStorage() - struct UserAttr { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - } - - struct OwnRoom { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - } - - struct AnchorInfo { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - } - - struct FollowInfo { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - var followingCount: Int64 = 0 - - var followerCount: Int64 = 0 - - var followStatus: Int64 = 0 - - var pushStatus: Int64 = 0 + init() {} - var remarkName: String = String() + fileprivate var _storage = _StorageClass.defaultInstance +} - var unknownFields = SwiftProtobuf.UnknownStorage() +struct Douyin_PicoDisplayInfo: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. - init() {} + var comboSumCount: UInt64 { + get {return _storage._comboSumCount} + set {_uniqueStorage()._comboSumCount = newValue} } - struct FansClub { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - var data: User.FansClub.FansClubData { - get {return _data ?? User.FansClub.FansClubData()} - set {_data = newValue} - } - /// Returns true if `data` has been explicitly set. - var hasData: Bool {return self._data != nil} - /// Clears the value of `data`. Subsequent reads from it will return its default value. - mutating func clearData() {self._data = nil} - - var preferData: Dictionary = [:] - - var unknownFields = SwiftProtobuf.UnknownStorage() - - struct FansClubData { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - var clubName: String = String() - - var level: Int32 = 0 - - var userFansClubStatus: Int32 = 0 - - var badge: User.FansClub.FansClubData.UserBadge { - get {return _badge ?? User.FansClub.FansClubData.UserBadge()} - set {_badge = newValue} - } - /// Returns true if `badge` has been explicitly set. - var hasBadge: Bool {return self._badge != nil} - /// Clears the value of `badge`. Subsequent reads from it will return its default value. - mutating func clearBadge() {self._badge = nil} - - var availableGiftIds: [Int64] = [] - - var anchorID: Int64 = 0 - - var unknownFields = SwiftProtobuf.UnknownStorage() - - struct UserBadge { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - var icons: Dictionary = [:] - - var title: String = String() - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - } - - init() {} - - fileprivate var _badge: User.FansClub.FansClubData.UserBadge? = nil - } - - init() {} - - fileprivate var _data: User.FansClub.FansClubData? = nil + var emoji: String { + get {return _storage._emoji} + set {_uniqueStorage()._emoji = newValue} } - struct Border { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} + var emojiIcon: Douyin_Image { + get {return _storage._emojiIcon ?? Douyin_Image()} + set {_uniqueStorage()._emojiIcon = newValue} } + /// Returns true if `emojiIcon` has been explicitly set. + var hasEmojiIcon: Bool {return _storage._emojiIcon != nil} + /// Clears the value of `emojiIcon`. Subsequent reads from it will return its default value. + mutating func clearEmojiIcon() {_uniqueStorage()._emojiIcon = nil} - struct GradeBuffInfo { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - var buffLevel: Int64 = 0 - - var status: Int32 = 0 - - var endTime: Int64 = 0 - - var statsInfo: Dictionary = [:] - - var buffBadge: Image { - get {return _buffBadge ?? Image()} - set {_buffBadge = newValue} - } - /// Returns true if `buffBadge` has been explicitly set. - var hasBuffBadge: Bool {return self._buffBadge != nil} - /// Clears the value of `buffBadge`. Subsequent reads from it will return its default value. - mutating func clearBuffBadge() {self._buffBadge = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _buffBadge: Image? = nil + var emojiText: String { + get {return _storage._emojiText} + set {_uniqueStorage()._emojiText = newValue} } - struct PayGrade { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - var totalDiamondCount: Int64 { - get {return _storage._totalDiamondCount} - set {_uniqueStorage()._totalDiamondCount = newValue} - } - - var diamondIcon: Image { - get {return _storage._diamondIcon ?? Image()} - set {_uniqueStorage()._diamondIcon = newValue} - } - /// Returns true if `diamondIcon` has been explicitly set. - var hasDiamondIcon: Bool {return _storage._diamondIcon != nil} - /// Clears the value of `diamondIcon`. Subsequent reads from it will return its default value. - mutating func clearDiamondIcon() {_uniqueStorage()._diamondIcon = nil} - - var name: String { - get {return _storage._name} - set {_uniqueStorage()._name = newValue} - } - - var icon: Image { - get {return _storage._icon ?? Image()} - set {_uniqueStorage()._icon = newValue} - } - /// Returns true if `icon` has been explicitly set. - var hasIcon: Bool {return _storage._icon != nil} - /// Clears the value of `icon`. Subsequent reads from it will return its default value. - mutating func clearIcon() {_uniqueStorage()._icon = nil} - - var nextName: String { - get {return _storage._nextName} - set {_uniqueStorage()._nextName = newValue} - } - - var level: Int64 { - get {return _storage._level} - set {_uniqueStorage()._level = newValue} - } - - var nextIcon: Image { - get {return _storage._nextIcon ?? Image()} - set {_uniqueStorage()._nextIcon = newValue} - } - /// Returns true if `nextIcon` has been explicitly set. - var hasNextIcon: Bool {return _storage._nextIcon != nil} - /// Clears the value of `nextIcon`. Subsequent reads from it will return its default value. - mutating func clearNextIcon() {_uniqueStorage()._nextIcon = nil} - - var nextDiamond: Int64 { - get {return _storage._nextDiamond} - set {_uniqueStorage()._nextDiamond = newValue} - } - - var nowDiamond: Int64 { - get {return _storage._nowDiamond} - set {_uniqueStorage()._nowDiamond = newValue} - } - - var thisGradeMinDiamond: Int64 { - get {return _storage._thisGradeMinDiamond} - set {_uniqueStorage()._thisGradeMinDiamond = newValue} - } - - var thisGradeMaxDiamond: Int64 { - get {return _storage._thisGradeMaxDiamond} - set {_uniqueStorage()._thisGradeMaxDiamond = newValue} - } - - var payDiamondBak: Int64 { - get {return _storage._payDiamondBak} - set {_uniqueStorage()._payDiamondBak = newValue} - } - - var gradeDescribe: String { - get {return _storage._gradeDescribe} - set {_uniqueStorage()._gradeDescribe = newValue} - } - - var gradeIconList: [User.PayGrade.GradeIcon] { - get {return _storage._gradeIconList} - set {_uniqueStorage()._gradeIconList = newValue} - } - - var screenChatType: Int64 { - get {return _storage._screenChatType} - set {_uniqueStorage()._screenChatType = newValue} - } - - var imIcon: Image { - get {return _storage._imIcon ?? Image()} - set {_uniqueStorage()._imIcon = newValue} - } - /// Returns true if `imIcon` has been explicitly set. - var hasImIcon: Bool {return _storage._imIcon != nil} - /// Clears the value of `imIcon`. Subsequent reads from it will return its default value. - mutating func clearImIcon() {_uniqueStorage()._imIcon = nil} - - var imIconWithLevel: Image { - get {return _storage._imIconWithLevel ?? Image()} - set {_uniqueStorage()._imIconWithLevel = newValue} - } - /// Returns true if `imIconWithLevel` has been explicitly set. - var hasImIconWithLevel: Bool {return _storage._imIconWithLevel != nil} - /// Clears the value of `imIconWithLevel`. Subsequent reads from it will return its default value. - mutating func clearImIconWithLevel() {_uniqueStorage()._imIconWithLevel = nil} - - var liveIcon: Image { - get {return _storage._liveIcon ?? Image()} - set {_uniqueStorage()._liveIcon = newValue} - } - /// Returns true if `liveIcon` has been explicitly set. - var hasLiveIcon: Bool {return _storage._liveIcon != nil} - /// Clears the value of `liveIcon`. Subsequent reads from it will return its default value. - mutating func clearLiveIcon() {_uniqueStorage()._liveIcon = nil} - - var newImIconWithLevel: Image { - get {return _storage._newImIconWithLevel ?? Image()} - set {_uniqueStorage()._newImIconWithLevel = newValue} - } - /// Returns true if `newImIconWithLevel` has been explicitly set. - var hasNewImIconWithLevel: Bool {return _storage._newImIconWithLevel != nil} - /// Clears the value of `newImIconWithLevel`. Subsequent reads from it will return its default value. - mutating func clearNewImIconWithLevel() {_uniqueStorage()._newImIconWithLevel = nil} - - var newLiveIcon: Image { - get {return _storage._newLiveIcon ?? Image()} - set {_uniqueStorage()._newLiveIcon = newValue} - } - /// Returns true if `newLiveIcon` has been explicitly set. - var hasNewLiveIcon: Bool {return _storage._newLiveIcon != nil} - /// Clears the value of `newLiveIcon`. Subsequent reads from it will return its default value. - mutating func clearNewLiveIcon() {_uniqueStorage()._newLiveIcon = nil} - - var upgradeNeedConsume: Int64 { - get {return _storage._upgradeNeedConsume} - set {_uniqueStorage()._upgradeNeedConsume = newValue} - } - - var nextPrivileges: String { - get {return _storage._nextPrivileges} - set {_uniqueStorage()._nextPrivileges = newValue} - } - - var background: Image { - get {return _storage._background ?? Image()} - set {_uniqueStorage()._background = newValue} - } - /// Returns true if `background` has been explicitly set. - var hasBackground: Bool {return _storage._background != nil} - /// Clears the value of `background`. Subsequent reads from it will return its default value. - mutating func clearBackground() {_uniqueStorage()._background = nil} - - var backgroundBack: Image { - get {return _storage._backgroundBack ?? Image()} - set {_uniqueStorage()._backgroundBack = newValue} - } - /// Returns true if `backgroundBack` has been explicitly set. - var hasBackgroundBack: Bool {return _storage._backgroundBack != nil} - /// Clears the value of `backgroundBack`. Subsequent reads from it will return its default value. - mutating func clearBackgroundBack() {_uniqueStorage()._backgroundBack = nil} - - var score: Int64 { - get {return _storage._score} - set {_uniqueStorage()._score = newValue} - } - - var buffInfo: User.GradeBuffInfo { - get {return _storage._buffInfo ?? User.GradeBuffInfo()} - set {_uniqueStorage()._buffInfo = newValue} - } - /// Returns true if `buffInfo` has been explicitly set. - var hasBuffInfo: Bool {return _storage._buffInfo != nil} - /// Clears the value of `buffInfo`. Subsequent reads from it will return its default value. - mutating func clearBuffInfo() {_uniqueStorage()._buffInfo = nil} - - var gradeBanner: String { - get {return _storage._gradeBanner} - set {_uniqueStorage()._gradeBanner = newValue} - } - - var profileDialogBg: Image { - get {return _storage._profileDialogBg ?? Image()} - set {_uniqueStorage()._profileDialogBg = newValue} - } - /// Returns true if `profileDialogBg` has been explicitly set. - var hasProfileDialogBg: Bool {return _storage._profileDialogBg != nil} - /// Clears the value of `profileDialogBg`. Subsequent reads from it will return its default value. - mutating func clearProfileDialogBg() {_uniqueStorage()._profileDialogBg = nil} - - var profileDialogBgBack: Image { - get {return _storage._profileDialogBgBack ?? Image()} - set {_uniqueStorage()._profileDialogBgBack = newValue} - } - /// Returns true if `profileDialogBgBack` has been explicitly set. - var hasProfileDialogBgBack: Bool {return _storage._profileDialogBgBack != nil} - /// Clears the value of `profileDialogBgBack`. Subsequent reads from it will return its default value. - mutating func clearProfileDialogBgBack() {_uniqueStorage()._profileDialogBgBack = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - struct GradeIcon { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - var icon: Image { - get {return _icon ?? Image()} - set {_icon = newValue} - } - /// Returns true if `icon` has been explicitly set. - var hasIcon: Bool {return self._icon != nil} - /// Clears the value of `icon`. Subsequent reads from it will return its default value. - mutating func clearIcon() {self._icon = nil} - - var iconDiamond: Int64 = 0 - - var level: Int64 = 0 - - var levelStr: String = String() - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _icon: Image? = nil - } - - init() {} - - fileprivate var _storage = _StorageClass.defaultInstance - } + var unknownFields = SwiftProtobuf.UnknownStorage() init() {} fileprivate var _storage = _StorageClass.defaultInstance } -struct TextFormat { +struct Douyin_DoubleLikeDetail: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - var color: String = String() - - var bold: Bool = false - - var italic: Bool = false - - var weight: Int32 = 0 - - var italicAngle: Int32 = 0 + var doubleFlag: Bool = false - var fontSize: Int32 = 0 + var seqID: UInt32 = 0 - var userHeightLightColor: Bool = false + var renewalsNum: UInt32 = 0 - var useRemoteClor: Bool = false + var triggersNum: UInt32 = 0 var unknownFields = SwiftProtobuf.UnknownStorage() init() {} } -struct TextPiece { +struct Douyin_DisplayControlInfo: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - var type: Int32 = 0 + var showText: Bool = false - var format: TextFormat { - get {return _format ?? TextFormat()} - set {_format = newValue} - } - /// Returns true if `format` has been explicitly set. - var hasFormat: Bool {return self._format != nil} - /// Clears the value of `format`. Subsequent reads from it will return its default value. - mutating func clearFormat() {self._format = nil} - - var stringValue: String = String() - - var userValue: TextPieceUser { - get {return _userValue ?? TextPieceUser()} - set {_userValue = newValue} - } - /// Returns true if `userValue` has been explicitly set. - var hasUserValue: Bool {return self._userValue != nil} - /// Clears the value of `userValue`. Subsequent reads from it will return its default value. - mutating func clearUserValue() {self._userValue = nil} + var showIcons: Bool = false var unknownFields = SwiftProtobuf.UnknownStorage() init() {} - - fileprivate var _format: TextFormat? = nil - fileprivate var _userValue: TextPieceUser? = nil } -struct Image { +struct Douyin_EpisodeChatMessage: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - var urlList: [String] = [] - - var uri: String = String() - - var height: Int64 = 0 + var common: Douyin_Message { + get {return _storage._common ?? Douyin_Message()} + set {_uniqueStorage()._common = newValue} + } + /// Returns true if `common` has been explicitly set. + var hasCommon: Bool {return _storage._common != nil} + /// Clears the value of `common`. Subsequent reads from it will return its default value. + mutating func clearCommon() {_uniqueStorage()._common = nil} - var width: Int64 = 0 + var user: Douyin_User { + get {return _storage._user ?? Douyin_User()} + set {_uniqueStorage()._user = newValue} + } + /// Returns true if `user` has been explicitly set. + var hasUser: Bool {return _storage._user != nil} + /// Clears the value of `user`. Subsequent reads from it will return its default value. + mutating func clearUser() {_uniqueStorage()._user = nil} - var avgColor: String = String() + var content: String { + get {return _storage._content} + set {_uniqueStorage()._content = newValue} + } - var imageType: Int32 = 0 + var visibleToSende: Bool { + get {return _storage._visibleToSende} + set {_uniqueStorage()._visibleToSende = newValue} + } - var openWebURL: String = String() + /// BackgroundImage backgroundImage = 5; + /// PublicAreaCommon publicAreaCommon = 6; + var giftImage: Douyin_Image { + get {return _storage._giftImage ?? Douyin_Image()} + set {_uniqueStorage()._giftImage = newValue} + } + /// Returns true if `giftImage` has been explicitly set. + var hasGiftImage: Bool {return _storage._giftImage != nil} + /// Clears the value of `giftImage`. Subsequent reads from it will return its default value. + mutating func clearGiftImage() {_uniqueStorage()._giftImage = nil} - var content: Image.Content { - get {return _content ?? Image.Content()} - set {_content = newValue} + var agreeMsgID: UInt64 { + get {return _storage._agreeMsgID} + set {_uniqueStorage()._agreeMsgID = newValue} } - /// Returns true if `content` has been explicitly set. - var hasContent: Bool {return self._content != nil} - /// Clears the value of `content`. Subsequent reads from it will return its default value. - mutating func clearContent() {self._content = nil} - var isAnimated: Bool = false + var colorValueList: [String] { + get {return _storage._colorValueList} + set {_uniqueStorage()._colorValueList = newValue} + } var unknownFields = SwiftProtobuf.UnknownStorage() - struct Content { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - var name: String = String() - - var fontColor: String = String() - - var level: Int64 = 0 - - var alternativeText: String = String() - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - } - init() {} - fileprivate var _content: Image.Content? = nil + fileprivate var _storage = _StorageClass.defaultInstance } -struct TextPieceUser { +struct Douyin_MatchAgainstScoreMessage: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - var user: User { - get {return _user ?? User()} - set {_user = newValue} + var common: Douyin_Common { + get {return _common ?? Douyin_Common()} + set {_common = newValue} } - /// Returns true if `user` has been explicitly set. - var hasUser: Bool {return self._user != nil} - /// Clears the value of `user`. Subsequent reads from it will return its default value. - mutating func clearUser() {self._user = nil} + /// Returns true if `common` has been explicitly set. + var hasCommon: Bool {return self._common != nil} + /// Clears the value of `common`. Subsequent reads from it will return its default value. + mutating func clearCommon() {self._common = nil} - var withColon: Bool = false + var against: Douyin_Against { + get {return _against ?? Douyin_Against()} + set {_against = newValue} + } + /// Returns true if `against` has been explicitly set. + var hasAgainst: Bool {return self._against != nil} + /// Clears the value of `against`. Subsequent reads from it will return its default value. + mutating func clearAgainst() {self._against = nil} + + var matchStatus: UInt32 = 0 + + var displayStatus: UInt32 = 0 var unknownFields = SwiftProtobuf.UnknownStorage() init() {} - fileprivate var _user: User? = nil + fileprivate var _common: Douyin_Common? = nil + fileprivate var _against: Douyin_Against? = nil } -struct PublicAreaCommon { +struct Douyin_Against: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - var userLabel: Image { - get {return _userLabel ?? Image()} - set {_userLabel = newValue} + var leftName: String { + get {return _storage._leftName} + set {_uniqueStorage()._leftName = newValue} } - /// Returns true if `userLabel` has been explicitly set. - var hasUserLabel: Bool {return self._userLabel != nil} - /// Clears the value of `userLabel`. Subsequent reads from it will return its default value. - mutating func clearUserLabel() {self._userLabel = nil} - - var userConsumeInRoom: Int64 = 0 - var userSendGiftCntInRoom: Int64 = 0 - - var unknownFields = SwiftProtobuf.UnknownStorage() + var leftLogo: Douyin_Image { + get {return _storage._leftLogo ?? Douyin_Image()} + set {_uniqueStorage()._leftLogo = newValue} + } + /// Returns true if `leftLogo` has been explicitly set. + var hasLeftLogo: Bool {return _storage._leftLogo != nil} + /// Clears the value of `leftLogo`. Subsequent reads from it will return its default value. + mutating func clearLeftLogo() {_uniqueStorage()._leftLogo = nil} - init() {} + var leftGoal: String { + get {return _storage._leftGoal} + set {_uniqueStorage()._leftGoal = newValue} + } - fileprivate var _userLabel: Image? = nil -} + /// LeftPlayersList leftPlayersList = 4; + /// LeftGoalStageDetail leftGoalStageDetail = 5; + var rightName: String { + get {return _storage._rightName} + set {_uniqueStorage()._rightName = newValue} + } -struct GiftIMPriority { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. + var rightLogo: Douyin_Image { + get {return _storage._rightLogo ?? Douyin_Image()} + set {_uniqueStorage()._rightLogo = newValue} + } + /// Returns true if `rightLogo` has been explicitly set. + var hasRightLogo: Bool {return _storage._rightLogo != nil} + /// Clears the value of `rightLogo`. Subsequent reads from it will return its default value. + mutating func clearRightLogo() {_uniqueStorage()._rightLogo = nil} - var queueSizes: [Int64] = [] + var rightGoal: String { + get {return _storage._rightGoal} + set {_uniqueStorage()._rightGoal = newValue} + } - var selfQueuePriority: Int64 = 0 + /// RightPlayersList rightPlayersList = 9; + /// RightGoalStageDetail rightGoalStageDetail = 10; + var timestamp: UInt64 { + get {return _storage._timestamp} + set {_uniqueStorage()._timestamp = newValue} + } - var priority: Int64 = 0 + var version: UInt64 { + get {return _storage._version} + set {_uniqueStorage()._version = newValue} + } - var unknownFields = SwiftProtobuf.UnknownStorage() + var leftTeamID: UInt64 { + get {return _storage._leftTeamID} + set {_uniqueStorage()._leftTeamID = newValue} + } - init() {} -} + var rightTeamID: UInt64 { + get {return _storage._rightTeamID} + set {_uniqueStorage()._rightTeamID = newValue} + } -struct GiftTrayInfo { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. + var diffSei2AbsSecond: UInt64 { + get {return _storage._diffSei2AbsSecond} + set {_uniqueStorage()._diffSei2AbsSecond = newValue} + } - var trayDisplayText: Text { - get {return _storage._trayDisplayText ?? Text()} - set {_uniqueStorage()._trayDisplayText = newValue} + var finalGoalStage: UInt32 { + get {return _storage._finalGoalStage} + set {_uniqueStorage()._finalGoalStage = newValue} } - /// Returns true if `trayDisplayText` has been explicitly set. - var hasTrayDisplayText: Bool {return _storage._trayDisplayText != nil} - /// Clears the value of `trayDisplayText`. Subsequent reads from it will return its default value. - mutating func clearTrayDisplayText() {_uniqueStorage()._trayDisplayText = nil} - var trayBaseImg: Image { - get {return _storage._trayBaseImg ?? Image()} - set {_uniqueStorage()._trayBaseImg = newValue} + var currentGoalStage: UInt32 { + get {return _storage._currentGoalStage} + set {_uniqueStorage()._currentGoalStage = newValue} } - /// Returns true if `trayBaseImg` has been explicitly set. - var hasTrayBaseImg: Bool {return _storage._trayBaseImg != nil} - /// Clears the value of `trayBaseImg`. Subsequent reads from it will return its default value. - mutating func clearTrayBaseImg() {_uniqueStorage()._trayBaseImg = nil} - var trayHeadImg: Image { - get {return _storage._trayHeadImg ?? Image()} - set {_uniqueStorage()._trayHeadImg = newValue} + var leftScoreAddition: UInt32 { + get {return _storage._leftScoreAddition} + set {_uniqueStorage()._leftScoreAddition = newValue} } - /// Returns true if `trayHeadImg` has been explicitly set. - var hasTrayHeadImg: Bool {return _storage._trayHeadImg != nil} - /// Clears the value of `trayHeadImg`. Subsequent reads from it will return its default value. - mutating func clearTrayHeadImg() {_uniqueStorage()._trayHeadImg = nil} - var trayRightImg: Image { - get {return _storage._trayRightImg ?? Image()} - set {_uniqueStorage()._trayRightImg = newValue} + var rightScoreAddition: UInt32 { + get {return _storage._rightScoreAddition} + set {_uniqueStorage()._rightScoreAddition = newValue} } - /// Returns true if `trayRightImg` has been explicitly set. - var hasTrayRightImg: Bool {return _storage._trayRightImg != nil} - /// Clears the value of `trayRightImg`. Subsequent reads from it will return its default value. - mutating func clearTrayRightImg() {_uniqueStorage()._trayRightImg = nil} - var trayLevel: Int64 { - get {return _storage._trayLevel} - set {_uniqueStorage()._trayLevel = newValue} + var leftGoalInt: UInt64 { + get {return _storage._leftGoalInt} + set {_uniqueStorage()._leftGoalInt = newValue} } - var trayDynamicImg: Image { - get {return _storage._trayDynamicImg ?? Image()} - set {_uniqueStorage()._trayDynamicImg = newValue} + var rightGoalInt: UInt64 { + get {return _storage._rightGoalInt} + set {_uniqueStorage()._rightGoalInt = newValue} } - /// Returns true if `trayDynamicImg` has been explicitly set. - var hasTrayDynamicImg: Bool {return _storage._trayDynamicImg != nil} - /// Clears the value of `trayDynamicImg`. Subsequent reads from it will return its default value. - mutating func clearTrayDynamicImg() {_uniqueStorage()._trayDynamicImg = nil} var unknownFields = SwiftProtobuf.UnknownStorage() @@ -2247,451 +1722,411 @@ struct GiftTrayInfo { fileprivate var _storage = _StorageClass.defaultInstance } -struct GiftStruct { +struct Douyin_Common: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - var image: Image { - get {return _storage._image ?? Image()} - set {_uniqueStorage()._image = newValue} + var method: String { + get {return _storage._method} + set {_uniqueStorage()._method = newValue} } - /// Returns true if `image` has been explicitly set. - var hasImage: Bool {return _storage._image != nil} - /// Clears the value of `image`. Subsequent reads from it will return its default value. - mutating func clearImage() {_uniqueStorage()._image = nil} - var describe: String { - get {return _storage._describe} - set {_uniqueStorage()._describe = newValue} + var msgID: UInt64 { + get {return _storage._msgID} + set {_uniqueStorage()._msgID = newValue} } - var notify: Bool { - get {return _storage._notify} - set {_uniqueStorage()._notify = newValue} + var roomID: UInt64 { + get {return _storage._roomID} + set {_uniqueStorage()._roomID = newValue} } - var duration: Int64 { - get {return _storage._duration} - set {_uniqueStorage()._duration = newValue} + var createTime: UInt64 { + get {return _storage._createTime} + set {_uniqueStorage()._createTime = newValue} } - var id: Int64 { - get {return _storage._id} - set {_uniqueStorage()._id = newValue} + var monitor: UInt32 { + get {return _storage._monitor} + set {_uniqueStorage()._monitor = newValue} } - var fansclubInfo: GiftStruct.GiftStructFansClubInfo { - get {return _storage._fansclubInfo ?? GiftStruct.GiftStructFansClubInfo()} - set {_uniqueStorage()._fansclubInfo = newValue} + var isShowMsg: Bool { + get {return _storage._isShowMsg} + set {_uniqueStorage()._isShowMsg = newValue} } - /// Returns true if `fansclubInfo` has been explicitly set. - var hasFansclubInfo: Bool {return _storage._fansclubInfo != nil} - /// Clears the value of `fansclubInfo`. Subsequent reads from it will return its default value. - mutating func clearFansclubInfo() {_uniqueStorage()._fansclubInfo = nil} - var forLinkmic: Bool { - get {return _storage._forLinkmic} - set {_uniqueStorage()._forLinkmic = newValue} + var describe: String { + get {return _storage._describe} + set {_uniqueStorage()._describe = newValue} } - var doodle: Bool { - get {return _storage._doodle} - set {_uniqueStorage()._doodle = newValue} + /// DisplayText displayText = 8; + var foldType: UInt64 { + get {return _storage._foldType} + set {_uniqueStorage()._foldType = newValue} } - var forFansclub: Bool { - get {return _storage._forFansclub} - set {_uniqueStorage()._forFansclub = newValue} + var anchorFoldType: UInt64 { + get {return _storage._anchorFoldType} + set {_uniqueStorage()._anchorFoldType = newValue} } - var combo: Bool { - get {return _storage._combo} - set {_uniqueStorage()._combo = newValue} + var priorityScore: UInt64 { + get {return _storage._priorityScore} + set {_uniqueStorage()._priorityScore = newValue} } - var type: Int32 { - get {return _storage._type} - set {_uniqueStorage()._type = newValue} + var logID: String { + get {return _storage._logID} + set {_uniqueStorage()._logID = newValue} } - var diamondCount: Int32 { - get {return _storage._diamondCount} - set {_uniqueStorage()._diamondCount = newValue} + var msgProcessFilterK: String { + get {return _storage._msgProcessFilterK} + set {_uniqueStorage()._msgProcessFilterK = newValue} } - var isDisplayedOnPanel: Int32 { - get {return _storage._isDisplayedOnPanel} - set {_uniqueStorage()._isDisplayedOnPanel = newValue} + var msgProcessFilterV: String { + get {return _storage._msgProcessFilterV} + set {_uniqueStorage()._msgProcessFilterV = newValue} } - var primaryEffectID: Int64 { - get {return _storage._primaryEffectID} - set {_uniqueStorage()._primaryEffectID = newValue} + var user: Douyin_User { + get {return _storage._user ?? Douyin_User()} + set {_uniqueStorage()._user = newValue} } + /// Returns true if `user` has been explicitly set. + var hasUser: Bool {return _storage._user != nil} + /// Clears the value of `user`. Subsequent reads from it will return its default value. + mutating func clearUser() {_uniqueStorage()._user = nil} - var giftLabelIcon: Image { - get {return _storage._giftLabelIcon ?? Image()} - set {_uniqueStorage()._giftLabelIcon = newValue} + /// Room room = 16; + var anchorFoldTypeV2: UInt64 { + get {return _storage._anchorFoldTypeV2} + set {_uniqueStorage()._anchorFoldTypeV2 = newValue} } - /// Returns true if `giftLabelIcon` has been explicitly set. - var hasGiftLabelIcon: Bool {return _storage._giftLabelIcon != nil} - /// Clears the value of `giftLabelIcon`. Subsequent reads from it will return its default value. - mutating func clearGiftLabelIcon() {_uniqueStorage()._giftLabelIcon = nil} - var name: String { - get {return _storage._name} - set {_uniqueStorage()._name = newValue} + var processAtSeiTimeMs: UInt64 { + get {return _storage._processAtSeiTimeMs} + set {_uniqueStorage()._processAtSeiTimeMs = newValue} } - var region: String { - get {return _storage._region} - set {_uniqueStorage()._region = newValue} + var randomDispatchMs: UInt64 { + get {return _storage._randomDispatchMs} + set {_uniqueStorage()._randomDispatchMs = newValue} } - var manual: String { - get {return _storage._manual} - set {_uniqueStorage()._manual = newValue} + var isDispatch: Bool { + get {return _storage._isDispatch} + set {_uniqueStorage()._isDispatch = newValue} } - var forCustom: Bool { - get {return _storage._forCustom} - set {_uniqueStorage()._forCustom = newValue} + var channelID: UInt64 { + get {return _storage._channelID} + set {_uniqueStorage()._channelID = newValue} } - var specialEffects: Dictionary { - get {return _storage._specialEffects} - set {_uniqueStorage()._specialEffects = newValue} + var diffSei2AbsSecond: UInt64 { + get {return _storage._diffSei2AbsSecond} + set {_uniqueStorage()._diffSei2AbsSecond = newValue} } - var icon: Image { - get {return _storage._icon ?? Image()} - set {_uniqueStorage()._icon = newValue} + var anchorFoldDuration: UInt64 { + get {return _storage._anchorFoldDuration} + set {_uniqueStorage()._anchorFoldDuration = newValue} } - /// Returns true if `icon` has been explicitly set. - var hasIcon: Bool {return _storage._icon != nil} - /// Clears the value of `icon`. Subsequent reads from it will return its default value. - mutating func clearIcon() {_uniqueStorage()._icon = nil} - var actionType: Int32 { - get {return _storage._actionType} - set {_uniqueStorage()._actionType = newValue} - } + var unknownFields = SwiftProtobuf.UnknownStorage() - var watermelonSeeds: Int32 { - get {return _storage._watermelonSeeds} - set {_uniqueStorage()._watermelonSeeds = newValue} - } + init() {} - var goldEffect: String { - get {return _storage._goldEffect} - set {_uniqueStorage()._goldEffect = newValue} - } + fileprivate var _storage = _StorageClass.defaultInstance +} - var subs: [LuckyMoneyGiftMeta] { - get {return _storage._subs} - set {_uniqueStorage()._subs = newValue} - } +struct Douyin_User: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. - var goldenBeans: Int64 { - get {return _storage._goldenBeans} - set {_uniqueStorage()._goldenBeans = newValue} + var id: UInt64 { + get {return _storage._id} + set {_uniqueStorage()._id = newValue} } - var honorLevel: Int64 { - get {return _storage._honorLevel} - set {_uniqueStorage()._honorLevel = newValue} + var shortID: UInt64 { + get {return _storage._shortID} + set {_uniqueStorage()._shortID = newValue} } - var itemType: Int32 { - get {return _storage._itemType} - set {_uniqueStorage()._itemType = newValue} + var nickName: String { + get {return _storage._nickName} + set {_uniqueStorage()._nickName = newValue} } - var schemeURL: String { - get {return _storage._schemeURL} - set {_uniqueStorage()._schemeURL = newValue} + var gender: UInt32 { + get {return _storage._gender} + set {_uniqueStorage()._gender = newValue} } - var giftOperation: GiftPanelOperation { - get {return _storage._giftOperation ?? GiftPanelOperation()} - set {_uniqueStorage()._giftOperation = newValue} + var signature: String { + get {return _storage._signature} + set {_uniqueStorage()._signature = newValue} } - /// Returns true if `giftOperation` has been explicitly set. - var hasGiftOperation: Bool {return _storage._giftOperation != nil} - /// Clears the value of `giftOperation`. Subsequent reads from it will return its default value. - mutating func clearGiftOperation() {_uniqueStorage()._giftOperation = nil} - var eventName: String { - get {return _storage._eventName} - set {_uniqueStorage()._eventName = newValue} + var level: UInt32 { + get {return _storage._level} + set {_uniqueStorage()._level = newValue} } - var nobleLevel: Int64 { - get {return _storage._nobleLevel} - set {_uniqueStorage()._nobleLevel = newValue} + var birthday: UInt64 { + get {return _storage._birthday} + set {_uniqueStorage()._birthday = newValue} } - var guideURL: String { - get {return _storage._guideURL} - set {_uniqueStorage()._guideURL = newValue} + var telephone: String { + get {return _storage._telephone} + set {_uniqueStorage()._telephone = newValue} } - var punishMedicine: Bool { - get {return _storage._punishMedicine} - set {_uniqueStorage()._punishMedicine = newValue} + var avatarThumb: Douyin_Image { + get {return _storage._avatarThumb ?? Douyin_Image()} + set {_uniqueStorage()._avatarThumb = newValue} } + /// Returns true if `avatarThumb` has been explicitly set. + var hasAvatarThumb: Bool {return _storage._avatarThumb != nil} + /// Clears the value of `avatarThumb`. Subsequent reads from it will return its default value. + mutating func clearAvatarThumb() {_uniqueStorage()._avatarThumb = nil} - var forPortal: Bool { - get {return _storage._forPortal} - set {_uniqueStorage()._forPortal = newValue} + var avatarMedium: Douyin_Image { + get {return _storage._avatarMedium ?? Douyin_Image()} + set {_uniqueStorage()._avatarMedium = newValue} } + /// Returns true if `avatarMedium` has been explicitly set. + var hasAvatarMedium: Bool {return _storage._avatarMedium != nil} + /// Clears the value of `avatarMedium`. Subsequent reads from it will return its default value. + mutating func clearAvatarMedium() {_uniqueStorage()._avatarMedium = nil} - var businessText: String { - get {return _storage._businessText} - set {_uniqueStorage()._businessText = newValue} + var avatarLarge: Douyin_Image { + get {return _storage._avatarLarge ?? Douyin_Image()} + set {_uniqueStorage()._avatarLarge = newValue} } + /// Returns true if `avatarLarge` has been explicitly set. + var hasAvatarLarge: Bool {return _storage._avatarLarge != nil} + /// Clears the value of `avatarLarge`. Subsequent reads from it will return its default value. + mutating func clearAvatarLarge() {_uniqueStorage()._avatarLarge = nil} - var cnyGift: Bool { - get {return _storage._cnyGift} - set {_uniqueStorage()._cnyGift = newValue} + var verified: Bool { + get {return _storage._verified} + set {_uniqueStorage()._verified = newValue} } - var appID: Int64 { - get {return _storage._appID} - set {_uniqueStorage()._appID = newValue} + var experience: UInt32 { + get {return _storage._experience} + set {_uniqueStorage()._experience = newValue} } - var vipLevel: Int64 { - get {return _storage._vipLevel} - set {_uniqueStorage()._vipLevel = newValue} + var city: String { + get {return _storage._city} + set {_uniqueStorage()._city = newValue} } - var isGray: Bool { - get {return _storage._isGray} - set {_uniqueStorage()._isGray = newValue} + var status: Int32 { + get {return _storage._status} + set {_uniqueStorage()._status = newValue} } - var graySchemeURL: String { - get {return _storage._graySchemeURL} - set {_uniqueStorage()._graySchemeURL = newValue} + var createTime: UInt64 { + get {return _storage._createTime} + set {_uniqueStorage()._createTime = newValue} } - var giftScene: Int64 { - get {return _storage._giftScene} - set {_uniqueStorage()._giftScene = newValue} + var modifyTime: UInt64 { + get {return _storage._modifyTime} + set {_uniqueStorage()._modifyTime = newValue} } - var giftBanner: GiftBanner { - get {return _storage._giftBanner ?? GiftBanner()} - set {_uniqueStorage()._giftBanner = newValue} + var secret: UInt32 { + get {return _storage._secret} + set {_uniqueStorage()._secret = newValue} } - /// Returns true if `giftBanner` has been explicitly set. - var hasGiftBanner: Bool {return _storage._giftBanner != nil} - /// Clears the value of `giftBanner`. Subsequent reads from it will return its default value. - mutating func clearGiftBanner() {_uniqueStorage()._giftBanner = nil} - var triggerWords: [String] { - get {return _storage._triggerWords} - set {_uniqueStorage()._triggerWords = newValue} + var shareQrcodeUri: String { + get {return _storage._shareQrcodeUri} + set {_uniqueStorage()._shareQrcodeUri = newValue} } - var giftBuffInfos: [GiftBuffInfo] { - get {return _storage._giftBuffInfos} - set {_uniqueStorage()._giftBuffInfos = newValue} + var incomeSharePercent: UInt32 { + get {return _storage._incomeSharePercent} + set {_uniqueStorage()._incomeSharePercent = newValue} } - var forFirstRecharge: Bool { - get {return _storage._forFirstRecharge} - set {_uniqueStorage()._forFirstRecharge = newValue} + var badgeImageList: [Douyin_Image] { + get {return _storage._badgeImageList} + set {_uniqueStorage()._badgeImageList = newValue} } - var dynamicImgForSelected: Image { - get {return _storage._dynamicImgForSelected ?? Image()} - set {_uniqueStorage()._dynamicImgForSelected = newValue} + /// FollowInfo FollowInfo = 22; + /// PayGrade PayGrade = 23; + /// FansClub FansClub = 24; + /// Border Border = 25; + var specialID: String { + get {return _storage._specialID} + set {_uniqueStorage()._specialID = newValue} } - /// Returns true if `dynamicImgForSelected` has been explicitly set. - var hasDynamicImgForSelected: Bool {return _storage._dynamicImgForSelected != nil} - /// Clears the value of `dynamicImgForSelected`. Subsequent reads from it will return its default value. - mutating func clearDynamicImgForSelected() {_uniqueStorage()._dynamicImgForSelected = nil} - var afterSendAction: Int32 { - get {return _storage._afterSendAction} - set {_uniqueStorage()._afterSendAction = newValue} + var avatarBorder: Douyin_Image { + get {return _storage._avatarBorder ?? Douyin_Image()} + set {_uniqueStorage()._avatarBorder = newValue} } + /// Returns true if `avatarBorder` has been explicitly set. + var hasAvatarBorder: Bool {return _storage._avatarBorder != nil} + /// Clears the value of `avatarBorder`. Subsequent reads from it will return its default value. + mutating func clearAvatarBorder() {_uniqueStorage()._avatarBorder = nil} - var giftOfflineTime: Int64 { - get {return _storage._giftOfflineTime} - set {_uniqueStorage()._giftOfflineTime = newValue} + var medal: Douyin_Image { + get {return _storage._medal ?? Douyin_Image()} + set {_uniqueStorage()._medal = newValue} } + /// Returns true if `medal` has been explicitly set. + var hasMedal: Bool {return _storage._medal != nil} + /// Clears the value of `medal`. Subsequent reads from it will return its default value. + mutating func clearMedal() {_uniqueStorage()._medal = nil} - var topBarText: String { - get {return _storage._topBarText} - set {_uniqueStorage()._topBarText = newValue} + var realTimeIconsList: [Douyin_Image] { + get {return _storage._realTimeIconsList} + set {_uniqueStorage()._realTimeIconsList = newValue} } - var topRightAvatar: Image { - get {return _storage._topRightAvatar ?? Image()} - set {_uniqueStorage()._topRightAvatar = newValue} - } - /// Returns true if `topRightAvatar` has been explicitly set. - var hasTopRightAvatar: Bool {return _storage._topRightAvatar != nil} - /// Clears the value of `topRightAvatar`. Subsequent reads from it will return its default value. - mutating func clearTopRightAvatar() {_uniqueStorage()._topRightAvatar = nil} + var unknownFields = SwiftProtobuf.UnknownStorage() - var bannerSchemeURL: String { - get {return _storage._bannerSchemeURL} - set {_uniqueStorage()._bannerSchemeURL = newValue} - } + init() {} - var isLocked: Bool { - get {return _storage._isLocked} - set {_uniqueStorage()._isLocked = newValue} - } + fileprivate var _storage = _StorageClass.defaultInstance +} - var reqExtraType: Int64 { - get {return _storage._reqExtraType} - set {_uniqueStorage()._reqExtraType = newValue} - } +struct Douyin_Image: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. - var assetIds: [Int64] { - get {return _storage._assetIds} - set {_uniqueStorage()._assetIds = newValue} - } + var urlListList: [String] = [] + + var uri: String = String() + + var height: UInt64 = 0 + + var width: UInt64 = 0 + + var avgColor: String = String() - var giftPreviewInfo: GiftPreviewInfo { - get {return _storage._giftPreviewInfo ?? GiftPreviewInfo()} - set {_uniqueStorage()._giftPreviewInfo = newValue} + var imageType: UInt32 = 0 + + var openWebURL: String = String() + + var content: Douyin_ImageContent { + get {return _content ?? Douyin_ImageContent()} + set {_content = newValue} } - /// Returns true if `giftPreviewInfo` has been explicitly set. - var hasGiftPreviewInfo: Bool {return _storage._giftPreviewInfo != nil} - /// Clears the value of `giftPreviewInfo`. Subsequent reads from it will return its default value. - mutating func clearGiftPreviewInfo() {_uniqueStorage()._giftPreviewInfo = nil} + /// Returns true if `content` has been explicitly set. + var hasContent: Bool {return self._content != nil} + /// Clears the value of `content`. Subsequent reads from it will return its default value. + mutating func clearContent() {self._content = nil} - var giftTip: GiftTip { - get {return _storage._giftTip ?? GiftTip()} - set {_uniqueStorage()._giftTip = newValue} - } - /// Returns true if `giftTip` has been explicitly set. - var hasGiftTip: Bool {return _storage._giftTip != nil} - /// Clears the value of `giftTip`. Subsequent reads from it will return its default value. - mutating func clearGiftTip() {_uniqueStorage()._giftTip = nil} + var isAnimated: Bool = false - var needSweepLightCount: Int32 { - get {return _storage._needSweepLightCount} - set {_uniqueStorage()._needSweepLightCount = newValue} + var flexSettingList: Douyin_NinePatchSetting { + get {return _flexSettingList ?? Douyin_NinePatchSetting()} + set {_flexSettingList = newValue} } + /// Returns true if `flexSettingList` has been explicitly set. + var hasFlexSettingList: Bool {return self._flexSettingList != nil} + /// Clears the value of `flexSettingList`. Subsequent reads from it will return its default value. + mutating func clearFlexSettingList() {self._flexSettingList = nil} - var groupInfo: [GiftGroupInfo] { - get {return _storage._groupInfo} - set {_uniqueStorage()._groupInfo = newValue} + var textSettingList: Douyin_NinePatchSetting { + get {return _textSettingList ?? Douyin_NinePatchSetting()} + set {_textSettingList = newValue} } + /// Returns true if `textSettingList` has been explicitly set. + var hasTextSettingList: Bool {return self._textSettingList != nil} + /// Clears the value of `textSettingList`. Subsequent reads from it will return its default value. + mutating func clearTextSettingList() {self._textSettingList = nil} var unknownFields = SwiftProtobuf.UnknownStorage() - struct GiftStructFansClubInfo { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - var minLevel: Int32 = 0 - - var insertPos: Int32 = 0 - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - } - init() {} - fileprivate var _storage = _StorageClass.defaultInstance + fileprivate var _content: Douyin_ImageContent? = nil + fileprivate var _flexSettingList: Douyin_NinePatchSetting? = nil + fileprivate var _textSettingList: Douyin_NinePatchSetting? = nil } -struct AssetEffectMixInfo { +struct Douyin_NinePatchSetting: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. + var settingListList: [String] = [] + var unknownFields = SwiftProtobuf.UnknownStorage() init() {} } -struct LuckyMoneyGiftMeta { +struct Douyin_ImageContent: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - var unknownFields = SwiftProtobuf.UnknownStorage() + var name: String = String() - init() {} -} + var fontColor: String = String() -struct GiftPanelOperation { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. + var level: UInt64 = 0 + + var alternativeText: String = String() var unknownFields = SwiftProtobuf.UnknownStorage() init() {} } -struct GiftBanner { +struct Douyin_PushFrame: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} -} + var seqID: UInt64 = 0 -struct GiftBuffInfo { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. + var logID: UInt64 = 0 - var unknownFields = SwiftProtobuf.UnknownStorage() + var service: UInt64 = 0 - init() {} -} + var method: UInt64 = 0 -struct GiftPreviewInfo { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. + var headersList: [Douyin_HeadersList] = [] - var unknownFields = SwiftProtobuf.UnknownStorage() + var payloadEncoding: String = String() - init() {} -} + var payloadType: String = String() -struct GiftTip { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. + var payload: Data = Data() var unknownFields = SwiftProtobuf.UnknownStorage() init() {} } -struct GiftGroupInfo { +struct Douyin_HeadersList: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} -} + var key: String = String() -struct EffectMixImageInfo { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. + var value: String = String() var unknownFields = SwiftProtobuf.UnknownStorage() @@ -2700,4588 +2135,3883 @@ struct EffectMixImageInfo { // MARK: - Code below here is support for the SwiftProtobuf runtime. -extension DouYinDMResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = "DouYinDMResponse" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "messages"), - 2: .same(proto: "cursor"), - 3: .same(proto: "fetchInterval"), - 4: .same(proto: "now"), - 5: .same(proto: "internalExt"), - 6: .same(proto: "fetchType"), - 7: .same(proto: "routeParams"), - 8: .same(proto: "heartbeatDuration"), - 9: .same(proto: "needAck"), - 10: .same(proto: "pushServer"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeRepeatedMessageField(value: &self.messages) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.cursor) }() - case 3: try { try decoder.decodeSingularInt64Field(value: &self.fetchInterval) }() - case 4: try { try decoder.decodeSingularInt64Field(value: &self.now) }() - case 5: try { try decoder.decodeSingularStringField(value: &self.internalExt) }() - case 6: try { try decoder.decodeSingularInt32Field(value: &self.fetchType) }() - case 7: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &self.routeParams) }() - case 8: try { try decoder.decodeSingularInt64Field(value: &self.heartbeatDuration) }() - case 9: try { try decoder.decodeSingularBoolField(value: &self.needAck) }() - case 10: try { try decoder.decodeSingularStringField(value: &self.pushServer) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if !self.messages.isEmpty { - try visitor.visitRepeatedMessageField(value: self.messages, fieldNumber: 1) - } - if !self.cursor.isEmpty { - try visitor.visitSingularStringField(value: self.cursor, fieldNumber: 2) - } - if self.fetchInterval != 0 { - try visitor.visitSingularInt64Field(value: self.fetchInterval, fieldNumber: 3) - } - if self.now != 0 { - try visitor.visitSingularInt64Field(value: self.now, fieldNumber: 4) - } - if !self.internalExt.isEmpty { - try visitor.visitSingularStringField(value: self.internalExt, fieldNumber: 5) - } - if self.fetchType != 0 { - try visitor.visitSingularInt32Field(value: self.fetchType, fieldNumber: 6) - } - if !self.routeParams.isEmpty { - try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: self.routeParams, fieldNumber: 7) - } - if self.heartbeatDuration != 0 { - try visitor.visitSingularInt64Field(value: self.heartbeatDuration, fieldNumber: 8) - } - if self.needAck != false { - try visitor.visitSingularBoolField(value: self.needAck, fieldNumber: 9) - } - if !self.pushServer.isEmpty { - try visitor.visitSingularStringField(value: self.pushServer, fieldNumber: 10) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: DouYinDMResponse, rhs: DouYinDMResponse) -> Bool { - if lhs.messages != rhs.messages {return false} - if lhs.cursor != rhs.cursor {return false} - if lhs.fetchInterval != rhs.fetchInterval {return false} - if lhs.now != rhs.now {return false} - if lhs.internalExt != rhs.internalExt {return false} - if lhs.fetchType != rhs.fetchType {return false} - if lhs.routeParams != rhs.routeParams {return false} - if lhs.heartbeatDuration != rhs.heartbeatDuration {return false} - if lhs.needAck != rhs.needAck {return false} - if lhs.pushServer != rhs.pushServer {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} +fileprivate let _protobuf_package = "douyin" -extension Message: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = "Message" +extension Douyin_CommentTypeTag: SwiftProtobuf._ProtoNameProviding { static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "method"), - 2: .same(proto: "payload"), - 3: .same(proto: "msgId"), - 4: .same(proto: "msgType"), - 5: .same(proto: "offset"), + 0: .same(proto: "COMMENTTYPETAGUNKNOWN"), + 1: .same(proto: "COMMENTTYPETAGSTAR"), ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.method) }() - case 2: try { try decoder.decodeSingularBytesField(value: &self.payload) }() - case 3: try { try decoder.decodeSingularInt64Field(value: &self.msgID) }() - case 4: try { try decoder.decodeSingularInt32Field(value: &self.msgType) }() - case 5: try { try decoder.decodeSingularInt64Field(value: &self.offset) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if !self.method.isEmpty { - try visitor.visitSingularStringField(value: self.method, fieldNumber: 1) - } - if !self.payload.isEmpty { - try visitor.visitSingularBytesField(value: self.payload, fieldNumber: 2) - } - if self.msgID != 0 { - try visitor.visitSingularInt64Field(value: self.msgID, fieldNumber: 3) - } - if self.msgType != 0 { - try visitor.visitSingularInt32Field(value: self.msgType, fieldNumber: 4) - } - if self.offset != 0 { - try visitor.visitSingularInt64Field(value: self.offset, fieldNumber: 5) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Message, rhs: Message) -> Bool { - if lhs.method != rhs.method {return false} - if lhs.payload != rhs.payload {return false} - if lhs.msgID != rhs.msgID {return false} - if lhs.msgType != rhs.msgType {return false} - if lhs.offset != rhs.offset {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } } -extension RoomUserSeqMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = "RoomUserSeqMessage" +extension Douyin_Response: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Response" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "common"), - 2: .same(proto: "ranks"), - 3: .same(proto: "total"), - 4: .same(proto: "popStr"), - 5: .same(proto: "seats"), - 6: .same(proto: "popularity"), - 7: .same(proto: "totalUser"), - 8: .same(proto: "totalUserStr"), - 9: .same(proto: "totalStr"), - 10: .same(proto: "onlineUserForAnchor"), - 11: .same(proto: "totalPvForAnchor"), + 1: .same(proto: "messagesList"), + 2: .same(proto: "cursor"), + 3: .same(proto: "fetchInterval"), + 4: .same(proto: "now"), + 5: .same(proto: "internalExt"), + 6: .same(proto: "fetchType"), + 7: .same(proto: "routeParams"), + 8: .same(proto: "heartbeatDuration"), + 9: .same(proto: "needAck"), + 10: .same(proto: "pushServer"), + 11: .same(proto: "liveCursor"), + 12: .same(proto: "historyNoMore"), ] mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._common) }() - case 2: try { try decoder.decodeRepeatedMessageField(value: &self.ranks) }() - case 3: try { try decoder.decodeSingularInt64Field(value: &self.total) }() - case 4: try { try decoder.decodeSingularStringField(value: &self.popStr) }() - case 5: try { try decoder.decodeRepeatedMessageField(value: &self.seats) }() - case 6: try { try decoder.decodeSingularInt64Field(value: &self.popularity) }() - case 7: try { try decoder.decodeSingularInt64Field(value: &self.totalUser) }() - case 8: try { try decoder.decodeSingularStringField(value: &self.totalUserStr) }() - case 9: try { try decoder.decodeSingularStringField(value: &self.totalStr) }() - case 10: try { try decoder.decodeSingularStringField(value: &self.onlineUserForAnchor) }() - case 11: try { try decoder.decodeSingularStringField(value: &self.totalPvForAnchor) }() - default: break - } - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeRepeatedMessageField(value: &self.messagesList) }() + case 2: try { try decoder.decodeSingularStringField(value: &self.cursor) }() + case 3: try { try decoder.decodeSingularUInt64Field(value: &self.fetchInterval) }() + case 4: try { try decoder.decodeSingularUInt64Field(value: &self.now) }() + case 5: try { try decoder.decodeSingularStringField(value: &self.internalExt) }() + case 6: try { try decoder.decodeSingularUInt32Field(value: &self.fetchType) }() + case 7: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &self.routeParams) }() + case 8: try { try decoder.decodeSingularUInt64Field(value: &self.heartbeatDuration) }() + case 9: try { try decoder.decodeSingularBoolField(value: &self.needAck) }() + case 10: try { try decoder.decodeSingularStringField(value: &self.pushServer) }() + case 11: try { try decoder.decodeSingularStringField(value: &self.liveCursor) }() + case 12: try { try decoder.decodeSingularBoolField(value: &self.historyNoMore) }() + default: break + } + } } func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._common { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if !self.ranks.isEmpty { - try visitor.visitRepeatedMessageField(value: self.ranks, fieldNumber: 2) - } - if self.total != 0 { - try visitor.visitSingularInt64Field(value: self.total, fieldNumber: 3) - } - if !self.popStr.isEmpty { - try visitor.visitSingularStringField(value: self.popStr, fieldNumber: 4) - } - if !self.seats.isEmpty { - try visitor.visitRepeatedMessageField(value: self.seats, fieldNumber: 5) - } - if self.popularity != 0 { - try visitor.visitSingularInt64Field(value: self.popularity, fieldNumber: 6) - } - if self.totalUser != 0 { - try visitor.visitSingularInt64Field(value: self.totalUser, fieldNumber: 7) - } - if !self.totalUserStr.isEmpty { - try visitor.visitSingularStringField(value: self.totalUserStr, fieldNumber: 8) - } - if !self.totalStr.isEmpty { - try visitor.visitSingularStringField(value: self.totalStr, fieldNumber: 9) - } - if !self.onlineUserForAnchor.isEmpty { - try visitor.visitSingularStringField(value: self.onlineUserForAnchor, fieldNumber: 10) - } - if !self.totalPvForAnchor.isEmpty { - try visitor.visitSingularStringField(value: self.totalPvForAnchor, fieldNumber: 11) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: RoomUserSeqMessage, rhs: RoomUserSeqMessage) -> Bool { - if lhs._common != rhs._common {return false} - if lhs.ranks != rhs.ranks {return false} - if lhs.total != rhs.total {return false} - if lhs.popStr != rhs.popStr {return false} - if lhs.seats != rhs.seats {return false} - if lhs.popularity != rhs.popularity {return false} - if lhs.totalUser != rhs.totalUser {return false} - if lhs.totalUserStr != rhs.totalUserStr {return false} - if lhs.totalStr != rhs.totalStr {return false} - if lhs.onlineUserForAnchor != rhs.onlineUserForAnchor {return false} - if lhs.totalPvForAnchor != rhs.totalPvForAnchor {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true + if !self.messagesList.isEmpty { + try visitor.visitRepeatedMessageField(value: self.messagesList, fieldNumber: 1) + } + if !self.cursor.isEmpty { + try visitor.visitSingularStringField(value: self.cursor, fieldNumber: 2) + } + if self.fetchInterval != 0 { + try visitor.visitSingularUInt64Field(value: self.fetchInterval, fieldNumber: 3) + } + if self.now != 0 { + try visitor.visitSingularUInt64Field(value: self.now, fieldNumber: 4) + } + if !self.internalExt.isEmpty { + try visitor.visitSingularStringField(value: self.internalExt, fieldNumber: 5) + } + if self.fetchType != 0 { + try visitor.visitSingularUInt32Field(value: self.fetchType, fieldNumber: 6) + } + if !self.routeParams.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: self.routeParams, fieldNumber: 7) + } + if self.heartbeatDuration != 0 { + try visitor.visitSingularUInt64Field(value: self.heartbeatDuration, fieldNumber: 8) + } + if self.needAck != false { + try visitor.visitSingularBoolField(value: self.needAck, fieldNumber: 9) + } + if !self.pushServer.isEmpty { + try visitor.visitSingularStringField(value: self.pushServer, fieldNumber: 10) + } + if !self.liveCursor.isEmpty { + try visitor.visitSingularStringField(value: self.liveCursor, fieldNumber: 11) + } + if self.historyNoMore != false { + try visitor.visitSingularBoolField(value: self.historyNoMore, fieldNumber: 12) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Douyin_Response, rhs: Douyin_Response) -> Bool { + if lhs.messagesList != rhs.messagesList {return false} + if lhs.cursor != rhs.cursor {return false} + if lhs.fetchInterval != rhs.fetchInterval {return false} + if lhs.now != rhs.now {return false} + if lhs.internalExt != rhs.internalExt {return false} + if lhs.fetchType != rhs.fetchType {return false} + if lhs.routeParams != rhs.routeParams {return false} + if lhs.heartbeatDuration != rhs.heartbeatDuration {return false} + if lhs.needAck != rhs.needAck {return false} + if lhs.pushServer != rhs.pushServer {return false} + if lhs.liveCursor != rhs.liveCursor {return false} + if lhs.historyNoMore != rhs.historyNoMore {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } -extension RoomUserSeqMessage.Contributor: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = RoomUserSeqMessage.protoMessageName + ".Contributor" +extension Douyin_Message: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Message" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "score"), - 2: .same(proto: "user"), - 3: .same(proto: "rank"), - 4: .same(proto: "delta"), - 5: .same(proto: "isHidden"), - 6: .same(proto: "scoreDescription"), - 7: .same(proto: "exactlyScore"), + 1: .same(proto: "method"), + 2: .same(proto: "payload"), + 3: .same(proto: "msgId"), + 4: .same(proto: "msgType"), + 5: .same(proto: "offset"), + 6: .same(proto: "needWrdsStore"), + 7: .same(proto: "wrdsVersion"), + 8: .same(proto: "wrdsSubKey"), ] mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularInt64Field(value: &self.score) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._user) }() - case 3: try { try decoder.decodeSingularInt64Field(value: &self.rank) }() - case 4: try { try decoder.decodeSingularInt64Field(value: &self.delta) }() - case 5: try { try decoder.decodeSingularBoolField(value: &self.isHidden) }() - case 6: try { try decoder.decodeSingularStringField(value: &self.scoreDescription) }() - case 7: try { try decoder.decodeSingularStringField(value: &self.exactlyScore) }() - default: break - } - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.method) }() + case 2: try { try decoder.decodeSingularBytesField(value: &self.payload) }() + case 3: try { try decoder.decodeSingularInt64Field(value: &self.msgID) }() + case 4: try { try decoder.decodeSingularInt32Field(value: &self.msgType) }() + case 5: try { try decoder.decodeSingularInt64Field(value: &self.offset) }() + case 6: try { try decoder.decodeSingularBoolField(value: &self.needWrdsStore) }() + case 7: try { try decoder.decodeSingularInt64Field(value: &self.wrdsVersion) }() + case 8: try { try decoder.decodeSingularStringField(value: &self.wrdsSubKey) }() + default: break + } + } } func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.score != 0 { - try visitor.visitSingularInt64Field(value: self.score, fieldNumber: 1) - } - try { if let v = self._user { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - if self.rank != 0 { - try visitor.visitSingularInt64Field(value: self.rank, fieldNumber: 3) - } - if self.delta != 0 { - try visitor.visitSingularInt64Field(value: self.delta, fieldNumber: 4) - } - if self.isHidden != false { - try visitor.visitSingularBoolField(value: self.isHidden, fieldNumber: 5) - } - if !self.scoreDescription.isEmpty { - try visitor.visitSingularStringField(value: self.scoreDescription, fieldNumber: 6) - } - if !self.exactlyScore.isEmpty { - try visitor.visitSingularStringField(value: self.exactlyScore, fieldNumber: 7) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: RoomUserSeqMessage.Contributor, rhs: RoomUserSeqMessage.Contributor) -> Bool { - if lhs.score != rhs.score {return false} - if lhs._user != rhs._user {return false} - if lhs.rank != rhs.rank {return false} - if lhs.delta != rhs.delta {return false} - if lhs.isHidden != rhs.isHidden {return false} - if lhs.scoreDescription != rhs.scoreDescription {return false} - if lhs.exactlyScore != rhs.exactlyScore {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true + if !self.method.isEmpty { + try visitor.visitSingularStringField(value: self.method, fieldNumber: 1) + } + if !self.payload.isEmpty { + try visitor.visitSingularBytesField(value: self.payload, fieldNumber: 2) + } + if self.msgID != 0 { + try visitor.visitSingularInt64Field(value: self.msgID, fieldNumber: 3) + } + if self.msgType != 0 { + try visitor.visitSingularInt32Field(value: self.msgType, fieldNumber: 4) + } + if self.offset != 0 { + try visitor.visitSingularInt64Field(value: self.offset, fieldNumber: 5) + } + if self.needWrdsStore != false { + try visitor.visitSingularBoolField(value: self.needWrdsStore, fieldNumber: 6) + } + if self.wrdsVersion != 0 { + try visitor.visitSingularInt64Field(value: self.wrdsVersion, fieldNumber: 7) + } + if !self.wrdsSubKey.isEmpty { + try visitor.visitSingularStringField(value: self.wrdsSubKey, fieldNumber: 8) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Douyin_Message, rhs: Douyin_Message) -> Bool { + if lhs.method != rhs.method {return false} + if lhs.payload != rhs.payload {return false} + if lhs.msgID != rhs.msgID {return false} + if lhs.msgType != rhs.msgType {return false} + if lhs.offset != rhs.offset {return false} + if lhs.needWrdsStore != rhs.needWrdsStore {return false} + if lhs.wrdsVersion != rhs.wrdsVersion {return false} + if lhs.wrdsSubKey != rhs.wrdsSubKey {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } -extension GiftMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = "GiftMessage" +extension Douyin_ChatMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ChatMessage" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "common"), - 2: .same(proto: "giftId"), - 3: .same(proto: "fanTicketCount"), - 4: .same(proto: "groupCount"), - 5: .same(proto: "repeatCount"), - 6: .same(proto: "comboCount"), - 7: .same(proto: "user"), - 8: .same(proto: "toUser"), - 9: .same(proto: "repeatEnd"), - 10: .same(proto: "textEffect"), - 11: .same(proto: "groupId"), - 12: .same(proto: "incomeTaskgifts"), - 13: .same(proto: "roomFanTicketCount"), - 14: .same(proto: "priority"), - 15: .same(proto: "gift"), - 16: .same(proto: "logId"), - 17: .same(proto: "sendType"), - 18: .same(proto: "publicAreaCommon"), - 19: .same(proto: "trayDisplayText"), - 20: .same(proto: "bannedDisplayEffects"), - 21: .same(proto: "trayInfo"), - 24: .same(proto: "assetEffectMixInfo"), + 1: .same(proto: "common"), + 2: .same(proto: "user"), + 3: .same(proto: "content"), + 4: .same(proto: "visibleToSender"), + 5: .same(proto: "backgroundImage"), + 6: .same(proto: "fullScreenTextColor"), + 7: .same(proto: "backgroundImageV2"), + 8: .same(proto: "publicAreaCommon"), + 9: .same(proto: "giftImage"), + 11: .same(proto: "agreeMsgId"), + 12: .same(proto: "priorityLevel"), + 13: .same(proto: "landscapeAreaCommon"), + 15: .same(proto: "eventTime"), + 16: .same(proto: "sendReview"), + 17: .same(proto: "fromIntercom"), + 18: .same(proto: "intercomHideUserCard"), + 20: .same(proto: "chatBy"), + 21: .same(proto: "individualChatPriority"), + 22: .same(proto: "rtfContent"), ] fileprivate class _StorageClass { - var _common: Common? = nil - var _giftID: Int64 = 0 - var _fanTicketCount: Int64 = 0 - var _groupCount: Int64 = 0 - var _repeatCount: Int64 = 0 - var _comboCount: Int64 = 0 - var _user: User? = nil - var _toUser: User? = nil - var _repeatEnd: Int32 = 0 - var _textEffect: GiftMessage.TextEffect? = nil - var _groupID: Int64 = 0 - var _incomeTaskgifts: Int64 = 0 - var _roomFanTicketCount: Int64 = 0 - var _priority: GiftIMPriority? = nil - var _gift: GiftStruct? = nil - var _logID: String = String() - var _sendType: Int64 = 0 - var _publicAreaCommon: PublicAreaCommon? = nil - var _trayDisplayText: Text? = nil - var _bannedDisplayEffects: Int64 = 0 - var _trayInfo: GiftTrayInfo? = nil - var _assetEffectMixInfo: AssetEffectMixInfo? = nil - - static let defaultInstance = _StorageClass() - - private init() {} - - init(copying source: _StorageClass) { - _common = source._common - _giftID = source._giftID - _fanTicketCount = source._fanTicketCount - _groupCount = source._groupCount - _repeatCount = source._repeatCount - _comboCount = source._comboCount - _user = source._user - _toUser = source._toUser - _repeatEnd = source._repeatEnd - _textEffect = source._textEffect - _groupID = source._groupID - _incomeTaskgifts = source._incomeTaskgifts - _roomFanTicketCount = source._roomFanTicketCount - _priority = source._priority - _gift = source._gift - _logID = source._logID - _sendType = source._sendType - _publicAreaCommon = source._publicAreaCommon - _trayDisplayText = source._trayDisplayText - _bannedDisplayEffects = source._bannedDisplayEffects - _trayInfo = source._trayInfo - _assetEffectMixInfo = source._assetEffectMixInfo - } + var _common: Douyin_Common? = nil + var _user: Douyin_User? = nil + var _content: String = String() + var _visibleToSender: Bool = false + var _backgroundImage: Douyin_Image? = nil + var _fullScreenTextColor: String = String() + var _backgroundImageV2: Douyin_Image? = nil + var _publicAreaCommon: Douyin_PublicAreaCommon? = nil + var _giftImage: Douyin_Image? = nil + var _agreeMsgID: UInt64 = 0 + var _priorityLevel: UInt32 = 0 + var _landscapeAreaCommon: Douyin_LandscapeAreaCommon? = nil + var _eventTime: UInt64 = 0 + var _sendReview: Bool = false + var _fromIntercom: Bool = false + var _intercomHideUserCard: Bool = false + var _chatBy: String = String() + var _individualChatPriority: UInt32 = 0 + var _rtfContent: Douyin_Text? = nil + + #if swift(>=5.10) + // This property is used as the initial default value for new instances of the type. + // The type itself is protecting the reference to its storage via CoW semantics. + // This will force a copy to be made of this reference when the first mutation occurs; + // hence, it is safe to mark this as `nonisolated(unsafe)`. + static nonisolated(unsafe) let defaultInstance = _StorageClass() + #else + static let defaultInstance = _StorageClass() + #endif + + private init() {} + + init(copying source: _StorageClass) { + _common = source._common + _user = source._user + _content = source._content + _visibleToSender = source._visibleToSender + _backgroundImage = source._backgroundImage + _fullScreenTextColor = source._fullScreenTextColor + _backgroundImageV2 = source._backgroundImageV2 + _publicAreaCommon = source._publicAreaCommon + _giftImage = source._giftImage + _agreeMsgID = source._agreeMsgID + _priorityLevel = source._priorityLevel + _landscapeAreaCommon = source._landscapeAreaCommon + _eventTime = source._eventTime + _sendReview = source._sendReview + _fromIntercom = source._fromIntercom + _intercomHideUserCard = source._intercomHideUserCard + _chatBy = source._chatBy + _individualChatPriority = source._individualChatPriority + _rtfContent = source._rtfContent + } } fileprivate mutating func _uniqueStorage() -> _StorageClass { - if !isKnownUniquelyReferenced(&_storage) { - _storage = _StorageClass(copying: _storage) - } - return _storage + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage } mutating func decodeMessage(decoder: inout D) throws { - _ = _uniqueStorage() - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &_storage._common) }() - case 2: try { try decoder.decodeSingularInt64Field(value: &_storage._giftID) }() - case 3: try { try decoder.decodeSingularInt64Field(value: &_storage._fanTicketCount) }() - case 4: try { try decoder.decodeSingularInt64Field(value: &_storage._groupCount) }() - case 5: try { try decoder.decodeSingularInt64Field(value: &_storage._repeatCount) }() - case 6: try { try decoder.decodeSingularInt64Field(value: &_storage._comboCount) }() - case 7: try { try decoder.decodeSingularMessageField(value: &_storage._user) }() - case 8: try { try decoder.decodeSingularMessageField(value: &_storage._toUser) }() - case 9: try { try decoder.decodeSingularInt32Field(value: &_storage._repeatEnd) }() - case 10: try { try decoder.decodeSingularMessageField(value: &_storage._textEffect) }() - case 11: try { try decoder.decodeSingularInt64Field(value: &_storage._groupID) }() - case 12: try { try decoder.decodeSingularInt64Field(value: &_storage._incomeTaskgifts) }() - case 13: try { try decoder.decodeSingularInt64Field(value: &_storage._roomFanTicketCount) }() - case 14: try { try decoder.decodeSingularMessageField(value: &_storage._priority) }() - case 15: try { try decoder.decodeSingularMessageField(value: &_storage._gift) }() - case 16: try { try decoder.decodeSingularStringField(value: &_storage._logID) }() - case 17: try { try decoder.decodeSingularInt64Field(value: &_storage._sendType) }() - case 18: try { try decoder.decodeSingularMessageField(value: &_storage._publicAreaCommon) }() - case 19: try { try decoder.decodeSingularMessageField(value: &_storage._trayDisplayText) }() - case 20: try { try decoder.decodeSingularInt64Field(value: &_storage._bannedDisplayEffects) }() - case 21: try { try decoder.decodeSingularMessageField(value: &_storage._trayInfo) }() - case 24: try { try decoder.decodeSingularMessageField(value: &_storage._assetEffectMixInfo) }() - default: break - } - } - } + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &_storage._common) }() + case 2: try { try decoder.decodeSingularMessageField(value: &_storage._user) }() + case 3: try { try decoder.decodeSingularStringField(value: &_storage._content) }() + case 4: try { try decoder.decodeSingularBoolField(value: &_storage._visibleToSender) }() + case 5: try { try decoder.decodeSingularMessageField(value: &_storage._backgroundImage) }() + case 6: try { try decoder.decodeSingularStringField(value: &_storage._fullScreenTextColor) }() + case 7: try { try decoder.decodeSingularMessageField(value: &_storage._backgroundImageV2) }() + case 8: try { try decoder.decodeSingularMessageField(value: &_storage._publicAreaCommon) }() + case 9: try { try decoder.decodeSingularMessageField(value: &_storage._giftImage) }() + case 11: try { try decoder.decodeSingularUInt64Field(value: &_storage._agreeMsgID) }() + case 12: try { try decoder.decodeSingularUInt32Field(value: &_storage._priorityLevel) }() + case 13: try { try decoder.decodeSingularMessageField(value: &_storage._landscapeAreaCommon) }() + case 15: try { try decoder.decodeSingularUInt64Field(value: &_storage._eventTime) }() + case 16: try { try decoder.decodeSingularBoolField(value: &_storage._sendReview) }() + case 17: try { try decoder.decodeSingularBoolField(value: &_storage._fromIntercom) }() + case 18: try { try decoder.decodeSingularBoolField(value: &_storage._intercomHideUserCard) }() + case 20: try { try decoder.decodeSingularStringField(value: &_storage._chatBy) }() + case 21: try { try decoder.decodeSingularUInt32Field(value: &_storage._individualChatPriority) }() + case 22: try { try decoder.decodeSingularMessageField(value: &_storage._rtfContent) }() + default: break + } + } + } } func traverse(visitor: inout V) throws { - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = _storage._common { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if _storage._giftID != 0 { - try visitor.visitSingularInt64Field(value: _storage._giftID, fieldNumber: 2) - } - if _storage._fanTicketCount != 0 { - try visitor.visitSingularInt64Field(value: _storage._fanTicketCount, fieldNumber: 3) - } - if _storage._groupCount != 0 { - try visitor.visitSingularInt64Field(value: _storage._groupCount, fieldNumber: 4) - } - if _storage._repeatCount != 0 { - try visitor.visitSingularInt64Field(value: _storage._repeatCount, fieldNumber: 5) - } - if _storage._comboCount != 0 { - try visitor.visitSingularInt64Field(value: _storage._comboCount, fieldNumber: 6) - } - try { if let v = _storage._user { - try visitor.visitSingularMessageField(value: v, fieldNumber: 7) - } }() - try { if let v = _storage._toUser { - try visitor.visitSingularMessageField(value: v, fieldNumber: 8) - } }() - if _storage._repeatEnd != 0 { - try visitor.visitSingularInt32Field(value: _storage._repeatEnd, fieldNumber: 9) - } - try { if let v = _storage._textEffect { - try visitor.visitSingularMessageField(value: v, fieldNumber: 10) - } }() - if _storage._groupID != 0 { - try visitor.visitSingularInt64Field(value: _storage._groupID, fieldNumber: 11) - } - if _storage._incomeTaskgifts != 0 { - try visitor.visitSingularInt64Field(value: _storage._incomeTaskgifts, fieldNumber: 12) - } - if _storage._roomFanTicketCount != 0 { - try visitor.visitSingularInt64Field(value: _storage._roomFanTicketCount, fieldNumber: 13) - } - try { if let v = _storage._priority { - try visitor.visitSingularMessageField(value: v, fieldNumber: 14) - } }() - try { if let v = _storage._gift { - try visitor.visitSingularMessageField(value: v, fieldNumber: 15) - } }() - if !_storage._logID.isEmpty { - try visitor.visitSingularStringField(value: _storage._logID, fieldNumber: 16) - } - if _storage._sendType != 0 { - try visitor.visitSingularInt64Field(value: _storage._sendType, fieldNumber: 17) - } - try { if let v = _storage._publicAreaCommon { - try visitor.visitSingularMessageField(value: v, fieldNumber: 18) - } }() - try { if let v = _storage._trayDisplayText { - try visitor.visitSingularMessageField(value: v, fieldNumber: 19) - } }() - if _storage._bannedDisplayEffects != 0 { - try visitor.visitSingularInt64Field(value: _storage._bannedDisplayEffects, fieldNumber: 20) - } - try { if let v = _storage._trayInfo { - try visitor.visitSingularMessageField(value: v, fieldNumber: 21) - } }() - try { if let v = _storage._assetEffectMixInfo { - try visitor.visitSingularMessageField(value: v, fieldNumber: 24) - } }() - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: GiftMessage, rhs: GiftMessage) -> Bool { - if lhs._storage !== rhs._storage { - let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in - let _storage = _args.0 - let rhs_storage = _args.1 - if _storage._common != rhs_storage._common {return false} - if _storage._giftID != rhs_storage._giftID {return false} - if _storage._fanTicketCount != rhs_storage._fanTicketCount {return false} - if _storage._groupCount != rhs_storage._groupCount {return false} - if _storage._repeatCount != rhs_storage._repeatCount {return false} - if _storage._comboCount != rhs_storage._comboCount {return false} - if _storage._user != rhs_storage._user {return false} - if _storage._toUser != rhs_storage._toUser {return false} - if _storage._repeatEnd != rhs_storage._repeatEnd {return false} - if _storage._textEffect != rhs_storage._textEffect {return false} - if _storage._groupID != rhs_storage._groupID {return false} - if _storage._incomeTaskgifts != rhs_storage._incomeTaskgifts {return false} - if _storage._roomFanTicketCount != rhs_storage._roomFanTicketCount {return false} - if _storage._priority != rhs_storage._priority {return false} - if _storage._gift != rhs_storage._gift {return false} - if _storage._logID != rhs_storage._logID {return false} - if _storage._sendType != rhs_storage._sendType {return false} - if _storage._publicAreaCommon != rhs_storage._publicAreaCommon {return false} - if _storage._trayDisplayText != rhs_storage._trayDisplayText {return false} - if _storage._bannedDisplayEffects != rhs_storage._bannedDisplayEffects {return false} - if _storage._trayInfo != rhs_storage._trayInfo {return false} - if _storage._assetEffectMixInfo != rhs_storage._assetEffectMixInfo {return false} - return true - } - if !storagesAreEqual {return false} - } - if lhs.unknownFields != rhs.unknownFields {return false} - return true + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = _storage._common { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try { if let v = _storage._user { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + if !_storage._content.isEmpty { + try visitor.visitSingularStringField(value: _storage._content, fieldNumber: 3) + } + if _storage._visibleToSender != false { + try visitor.visitSingularBoolField(value: _storage._visibleToSender, fieldNumber: 4) + } + try { if let v = _storage._backgroundImage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 5) + } }() + if !_storage._fullScreenTextColor.isEmpty { + try visitor.visitSingularStringField(value: _storage._fullScreenTextColor, fieldNumber: 6) + } + try { if let v = _storage._backgroundImageV2 { + try visitor.visitSingularMessageField(value: v, fieldNumber: 7) + } }() + try { if let v = _storage._publicAreaCommon { + try visitor.visitSingularMessageField(value: v, fieldNumber: 8) + } }() + try { if let v = _storage._giftImage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 9) + } }() + if _storage._agreeMsgID != 0 { + try visitor.visitSingularUInt64Field(value: _storage._agreeMsgID, fieldNumber: 11) + } + if _storage._priorityLevel != 0 { + try visitor.visitSingularUInt32Field(value: _storage._priorityLevel, fieldNumber: 12) + } + try { if let v = _storage._landscapeAreaCommon { + try visitor.visitSingularMessageField(value: v, fieldNumber: 13) + } }() + if _storage._eventTime != 0 { + try visitor.visitSingularUInt64Field(value: _storage._eventTime, fieldNumber: 15) + } + if _storage._sendReview != false { + try visitor.visitSingularBoolField(value: _storage._sendReview, fieldNumber: 16) + } + if _storage._fromIntercom != false { + try visitor.visitSingularBoolField(value: _storage._fromIntercom, fieldNumber: 17) + } + if _storage._intercomHideUserCard != false { + try visitor.visitSingularBoolField(value: _storage._intercomHideUserCard, fieldNumber: 18) + } + if !_storage._chatBy.isEmpty { + try visitor.visitSingularStringField(value: _storage._chatBy, fieldNumber: 20) + } + if _storage._individualChatPriority != 0 { + try visitor.visitSingularUInt32Field(value: _storage._individualChatPriority, fieldNumber: 21) + } + try { if let v = _storage._rtfContent { + try visitor.visitSingularMessageField(value: v, fieldNumber: 22) + } }() + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Douyin_ChatMessage, rhs: Douyin_ChatMessage) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._common != rhs_storage._common {return false} + if _storage._user != rhs_storage._user {return false} + if _storage._content != rhs_storage._content {return false} + if _storage._visibleToSender != rhs_storage._visibleToSender {return false} + if _storage._backgroundImage != rhs_storage._backgroundImage {return false} + if _storage._fullScreenTextColor != rhs_storage._fullScreenTextColor {return false} + if _storage._backgroundImageV2 != rhs_storage._backgroundImageV2 {return false} + if _storage._publicAreaCommon != rhs_storage._publicAreaCommon {return false} + if _storage._giftImage != rhs_storage._giftImage {return false} + if _storage._agreeMsgID != rhs_storage._agreeMsgID {return false} + if _storage._priorityLevel != rhs_storage._priorityLevel {return false} + if _storage._landscapeAreaCommon != rhs_storage._landscapeAreaCommon {return false} + if _storage._eventTime != rhs_storage._eventTime {return false} + if _storage._sendReview != rhs_storage._sendReview {return false} + if _storage._fromIntercom != rhs_storage._fromIntercom {return false} + if _storage._intercomHideUserCard != rhs_storage._intercomHideUserCard {return false} + if _storage._chatBy != rhs_storage._chatBy {return false} + if _storage._individualChatPriority != rhs_storage._individualChatPriority {return false} + if _storage._rtfContent != rhs_storage._rtfContent {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } -extension GiftMessage.TextEffect: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = GiftMessage.protoMessageName + ".TextEffect" +extension Douyin_LandscapeAreaCommon: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".LandscapeAreaCommon" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "portrait"), - 2: .same(proto: "landscape"), + 1: .same(proto: "showHead"), + 2: .same(proto: "showNickname"), + 3: .same(proto: "showFontColor"), + 4: .same(proto: "colorValueList"), + 5: .same(proto: "commentTypeTagsList"), ] mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._portrait) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._landscape) }() - default: break - } - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBoolField(value: &self.showHead) }() + case 2: try { try decoder.decodeSingularBoolField(value: &self.showNickname) }() + case 3: try { try decoder.decodeSingularBoolField(value: &self.showFontColor) }() + case 4: try { try decoder.decodeRepeatedStringField(value: &self.colorValueList) }() + case 5: try { try decoder.decodeRepeatedEnumField(value: &self.commentTypeTagsList) }() + default: break + } + } } func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._portrait { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._landscape { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: GiftMessage.TextEffect, rhs: GiftMessage.TextEffect) -> Bool { - if lhs._portrait != rhs._portrait {return false} - if lhs._landscape != rhs._landscape {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true + if self.showHead != false { + try visitor.visitSingularBoolField(value: self.showHead, fieldNumber: 1) + } + if self.showNickname != false { + try visitor.visitSingularBoolField(value: self.showNickname, fieldNumber: 2) + } + if self.showFontColor != false { + try visitor.visitSingularBoolField(value: self.showFontColor, fieldNumber: 3) + } + if !self.colorValueList.isEmpty { + try visitor.visitRepeatedStringField(value: self.colorValueList, fieldNumber: 4) + } + if !self.commentTypeTagsList.isEmpty { + try visitor.visitPackedEnumField(value: self.commentTypeTagsList, fieldNumber: 5) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Douyin_LandscapeAreaCommon, rhs: Douyin_LandscapeAreaCommon) -> Bool { + if lhs.showHead != rhs.showHead {return false} + if lhs.showNickname != rhs.showNickname {return false} + if lhs.showFontColor != rhs.showFontColor {return false} + if lhs.colorValueList != rhs.colorValueList {return false} + if lhs.commentTypeTagsList != rhs.commentTypeTagsList {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } -extension GiftMessage.TextEffect.Detail: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = GiftMessage.TextEffect.protoMessageName + ".Detail" +extension Douyin_GiftMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".GiftMessage" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "text"), - 2: .same(proto: "textFontSize"), - 3: .same(proto: "background"), - 4: .same(proto: "start"), - 5: .same(proto: "duration"), - 6: .same(proto: "x"), - 7: .same(proto: "y"), - 8: .same(proto: "width"), - 9: .same(proto: "height"), - 10: .same(proto: "shadowDx"), - 11: .same(proto: "shadowDy"), - 12: .same(proto: "shadowRadius"), - 13: .same(proto: "shadowColor"), - 14: .same(proto: "strokeColor"), - 15: .same(proto: "strokeWidth"), + 1: .same(proto: "common"), + 2: .same(proto: "giftId"), + 3: .same(proto: "fanTicketCount"), + 4: .same(proto: "groupCount"), + 5: .same(proto: "repeatCount"), + 6: .same(proto: "comboCount"), + 7: .same(proto: "user"), + 8: .same(proto: "toUser"), + 9: .same(proto: "repeatEnd"), + 10: .same(proto: "textEffect"), + 11: .same(proto: "groupId"), + 12: .same(proto: "incomeTaskgifts"), + 13: .same(proto: "roomFanTicketCount"), + 14: .same(proto: "priority"), + 15: .same(proto: "gift"), + 16: .same(proto: "logId"), + 17: .same(proto: "sendType"), + 18: .same(proto: "publicAreaCommon"), + 19: .same(proto: "trayDisplayText"), + 20: .same(proto: "bannedDisplayEffects"), + 25: .same(proto: "displayForSelf"), + 26: .same(proto: "interactGiftInfo"), + 27: .same(proto: "diyItemInfo"), + 28: .same(proto: "minAssetSetList"), + 29: .same(proto: "totalCount"), + 30: .same(proto: "clientGiftSource"), + 32: .same(proto: "toUserIdsList"), + 33: .same(proto: "sendTime"), + 34: .same(proto: "forceDisplayEffects"), + 35: .same(proto: "traceId"), + 36: .same(proto: "effectDisplayTs"), ] fileprivate class _StorageClass { - var _text: Text? = nil - var _textFontSize: Int32 = 0 - var _background: Image? = nil - var _start: Int32 = 0 - var _duration: Int32 = 0 - var _x: Int32 = 0 - var _y: Int32 = 0 - var _width: Int32 = 0 - var _height: Int32 = 0 - var _shadowDx: Int32 = 0 - var _shadowDy: Int32 = 0 - var _shadowRadius: Int32 = 0 - var _shadowColor: String = String() - var _strokeColor: String = String() - var _strokeWidth: Int32 = 0 - - static let defaultInstance = _StorageClass() - - private init() {} - - init(copying source: _StorageClass) { - _text = source._text - _textFontSize = source._textFontSize - _background = source._background - _start = source._start - _duration = source._duration - _x = source._x - _y = source._y - _width = source._width - _height = source._height - _shadowDx = source._shadowDx - _shadowDy = source._shadowDy - _shadowRadius = source._shadowRadius - _shadowColor = source._shadowColor - _strokeColor = source._strokeColor - _strokeWidth = source._strokeWidth - } + var _common: Douyin_Common? = nil + var _giftID: UInt64 = 0 + var _fanTicketCount: UInt64 = 0 + var _groupCount: UInt64 = 0 + var _repeatCount: UInt64 = 0 + var _comboCount: UInt64 = 0 + var _user: Douyin_User? = nil + var _toUser: Douyin_User? = nil + var _repeatEnd: UInt32 = 0 + var _textEffect: Douyin_TextEffect? = nil + var _groupID: UInt64 = 0 + var _incomeTaskgifts: UInt64 = 0 + var _roomFanTicketCount: UInt64 = 0 + var _priority: Douyin_GiftIMPriority? = nil + var _gift: Douyin_GiftStruct? = nil + var _logID: String = String() + var _sendType: UInt64 = 0 + var _publicAreaCommon: Douyin_PublicAreaCommon? = nil + var _trayDisplayText: Douyin_Text? = nil + var _bannedDisplayEffects: UInt64 = 0 + var _displayForSelf: Bool = false + var _interactGiftInfo: String = String() + var _diyItemInfo: String = String() + var _minAssetSetList: [UInt64] = [] + var _totalCount: UInt64 = 0 + var _clientGiftSource: UInt32 = 0 + var _toUserIdsList: [UInt64] = [] + var _sendTime: UInt64 = 0 + var _forceDisplayEffects: UInt64 = 0 + var _traceID: String = String() + var _effectDisplayTs: UInt64 = 0 + + #if swift(>=5.10) + // This property is used as the initial default value for new instances of the type. + // The type itself is protecting the reference to its storage via CoW semantics. + // This will force a copy to be made of this reference when the first mutation occurs; + // hence, it is safe to mark this as `nonisolated(unsafe)`. + static nonisolated(unsafe) let defaultInstance = _StorageClass() + #else + static let defaultInstance = _StorageClass() + #endif + + private init() {} + + init(copying source: _StorageClass) { + _common = source._common + _giftID = source._giftID + _fanTicketCount = source._fanTicketCount + _groupCount = source._groupCount + _repeatCount = source._repeatCount + _comboCount = source._comboCount + _user = source._user + _toUser = source._toUser + _repeatEnd = source._repeatEnd + _textEffect = source._textEffect + _groupID = source._groupID + _incomeTaskgifts = source._incomeTaskgifts + _roomFanTicketCount = source._roomFanTicketCount + _priority = source._priority + _gift = source._gift + _logID = source._logID + _sendType = source._sendType + _publicAreaCommon = source._publicAreaCommon + _trayDisplayText = source._trayDisplayText + _bannedDisplayEffects = source._bannedDisplayEffects + _displayForSelf = source._displayForSelf + _interactGiftInfo = source._interactGiftInfo + _diyItemInfo = source._diyItemInfo + _minAssetSetList = source._minAssetSetList + _totalCount = source._totalCount + _clientGiftSource = source._clientGiftSource + _toUserIdsList = source._toUserIdsList + _sendTime = source._sendTime + _forceDisplayEffects = source._forceDisplayEffects + _traceID = source._traceID + _effectDisplayTs = source._effectDisplayTs + } } fileprivate mutating func _uniqueStorage() -> _StorageClass { - if !isKnownUniquelyReferenced(&_storage) { - _storage = _StorageClass(copying: _storage) - } - return _storage - } - - mutating func decodeMessage(decoder: inout D) throws { - _ = _uniqueStorage() - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &_storage._text) }() - case 2: try { try decoder.decodeSingularInt32Field(value: &_storage._textFontSize) }() - case 3: try { try decoder.decodeSingularMessageField(value: &_storage._background) }() - case 4: try { try decoder.decodeSingularInt32Field(value: &_storage._start) }() - case 5: try { try decoder.decodeSingularInt32Field(value: &_storage._duration) }() - case 6: try { try decoder.decodeSingularInt32Field(value: &_storage._x) }() - case 7: try { try decoder.decodeSingularInt32Field(value: &_storage._y) }() - case 8: try { try decoder.decodeSingularInt32Field(value: &_storage._width) }() - case 9: try { try decoder.decodeSingularInt32Field(value: &_storage._height) }() - case 10: try { try decoder.decodeSingularInt32Field(value: &_storage._shadowDx) }() - case 11: try { try decoder.decodeSingularInt32Field(value: &_storage._shadowDy) }() - case 12: try { try decoder.decodeSingularInt32Field(value: &_storage._shadowRadius) }() - case 13: try { try decoder.decodeSingularStringField(value: &_storage._shadowColor) }() - case 14: try { try decoder.decodeSingularStringField(value: &_storage._strokeColor) }() - case 15: try { try decoder.decodeSingularInt32Field(value: &_storage._strokeWidth) }() - default: break - } - } - } - } - - func traverse(visitor: inout V) throws { - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = _storage._text { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if _storage._textFontSize != 0 { - try visitor.visitSingularInt32Field(value: _storage._textFontSize, fieldNumber: 2) - } - try { if let v = _storage._background { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - if _storage._start != 0 { - try visitor.visitSingularInt32Field(value: _storage._start, fieldNumber: 4) - } - if _storage._duration != 0 { - try visitor.visitSingularInt32Field(value: _storage._duration, fieldNumber: 5) - } - if _storage._x != 0 { - try visitor.visitSingularInt32Field(value: _storage._x, fieldNumber: 6) - } - if _storage._y != 0 { - try visitor.visitSingularInt32Field(value: _storage._y, fieldNumber: 7) - } - if _storage._width != 0 { - try visitor.visitSingularInt32Field(value: _storage._width, fieldNumber: 8) - } - if _storage._height != 0 { - try visitor.visitSingularInt32Field(value: _storage._height, fieldNumber: 9) - } - if _storage._shadowDx != 0 { - try visitor.visitSingularInt32Field(value: _storage._shadowDx, fieldNumber: 10) - } - if _storage._shadowDy != 0 { - try visitor.visitSingularInt32Field(value: _storage._shadowDy, fieldNumber: 11) - } - if _storage._shadowRadius != 0 { - try visitor.visitSingularInt32Field(value: _storage._shadowRadius, fieldNumber: 12) - } - if !_storage._shadowColor.isEmpty { - try visitor.visitSingularStringField(value: _storage._shadowColor, fieldNumber: 13) - } - if !_storage._strokeColor.isEmpty { - try visitor.visitSingularStringField(value: _storage._strokeColor, fieldNumber: 14) - } - if _storage._strokeWidth != 0 { - try visitor.visitSingularInt32Field(value: _storage._strokeWidth, fieldNumber: 15) - } - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: GiftMessage.TextEffect.Detail, rhs: GiftMessage.TextEffect.Detail) -> Bool { - if lhs._storage !== rhs._storage { - let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in - let _storage = _args.0 - let rhs_storage = _args.1 - if _storage._text != rhs_storage._text {return false} - if _storage._textFontSize != rhs_storage._textFontSize {return false} - if _storage._background != rhs_storage._background {return false} - if _storage._start != rhs_storage._start {return false} - if _storage._duration != rhs_storage._duration {return false} - if _storage._x != rhs_storage._x {return false} - if _storage._y != rhs_storage._y {return false} - if _storage._width != rhs_storage._width {return false} - if _storage._height != rhs_storage._height {return false} - if _storage._shadowDx != rhs_storage._shadowDx {return false} - if _storage._shadowDy != rhs_storage._shadowDy {return false} - if _storage._shadowRadius != rhs_storage._shadowRadius {return false} - if _storage._shadowColor != rhs_storage._shadowColor {return false} - if _storage._strokeColor != rhs_storage._strokeColor {return false} - if _storage._strokeWidth != rhs_storage._strokeWidth {return false} - return true - } - if !storagesAreEqual {return false} - } - if lhs.unknownFields != rhs.unknownFields {return false} - return true + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage } -} - -extension LikeMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = "LikeMessage" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "common"), - 2: .same(proto: "count"), - 3: .same(proto: "total"), - 4: .same(proto: "color"), - 5: .same(proto: "user"), - 6: .same(proto: "icon"), - ] mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._common) }() - case 2: try { try decoder.decodeSingularInt64Field(value: &self.count) }() - case 3: try { try decoder.decodeSingularInt64Field(value: &self.total) }() - case 4: try { try decoder.decodeSingularInt64Field(value: &self.color) }() - case 5: try { try decoder.decodeSingularMessageField(value: &self._user) }() - case 6: try { try decoder.decodeSingularStringField(value: &self.icon) }() - default: break - } - } + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &_storage._common) }() + case 2: try { try decoder.decodeSingularUInt64Field(value: &_storage._giftID) }() + case 3: try { try decoder.decodeSingularUInt64Field(value: &_storage._fanTicketCount) }() + case 4: try { try decoder.decodeSingularUInt64Field(value: &_storage._groupCount) }() + case 5: try { try decoder.decodeSingularUInt64Field(value: &_storage._repeatCount) }() + case 6: try { try decoder.decodeSingularUInt64Field(value: &_storage._comboCount) }() + case 7: try { try decoder.decodeSingularMessageField(value: &_storage._user) }() + case 8: try { try decoder.decodeSingularMessageField(value: &_storage._toUser) }() + case 9: try { try decoder.decodeSingularUInt32Field(value: &_storage._repeatEnd) }() + case 10: try { try decoder.decodeSingularMessageField(value: &_storage._textEffect) }() + case 11: try { try decoder.decodeSingularUInt64Field(value: &_storage._groupID) }() + case 12: try { try decoder.decodeSingularUInt64Field(value: &_storage._incomeTaskgifts) }() + case 13: try { try decoder.decodeSingularUInt64Field(value: &_storage._roomFanTicketCount) }() + case 14: try { try decoder.decodeSingularMessageField(value: &_storage._priority) }() + case 15: try { try decoder.decodeSingularMessageField(value: &_storage._gift) }() + case 16: try { try decoder.decodeSingularStringField(value: &_storage._logID) }() + case 17: try { try decoder.decodeSingularUInt64Field(value: &_storage._sendType) }() + case 18: try { try decoder.decodeSingularMessageField(value: &_storage._publicAreaCommon) }() + case 19: try { try decoder.decodeSingularMessageField(value: &_storage._trayDisplayText) }() + case 20: try { try decoder.decodeSingularUInt64Field(value: &_storage._bannedDisplayEffects) }() + case 25: try { try decoder.decodeSingularBoolField(value: &_storage._displayForSelf) }() + case 26: try { try decoder.decodeSingularStringField(value: &_storage._interactGiftInfo) }() + case 27: try { try decoder.decodeSingularStringField(value: &_storage._diyItemInfo) }() + case 28: try { try decoder.decodeRepeatedUInt64Field(value: &_storage._minAssetSetList) }() + case 29: try { try decoder.decodeSingularUInt64Field(value: &_storage._totalCount) }() + case 30: try { try decoder.decodeSingularUInt32Field(value: &_storage._clientGiftSource) }() + case 32: try { try decoder.decodeRepeatedUInt64Field(value: &_storage._toUserIdsList) }() + case 33: try { try decoder.decodeSingularUInt64Field(value: &_storage._sendTime) }() + case 34: try { try decoder.decodeSingularUInt64Field(value: &_storage._forceDisplayEffects) }() + case 35: try { try decoder.decodeSingularStringField(value: &_storage._traceID) }() + case 36: try { try decoder.decodeSingularUInt64Field(value: &_storage._effectDisplayTs) }() + default: break + } + } + } } func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._common { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if self.count != 0 { - try visitor.visitSingularInt64Field(value: self.count, fieldNumber: 2) - } - if self.total != 0 { - try visitor.visitSingularInt64Field(value: self.total, fieldNumber: 3) - } - if self.color != 0 { - try visitor.visitSingularInt64Field(value: self.color, fieldNumber: 4) - } - try { if let v = self._user { - try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - } }() - if !self.icon.isEmpty { - try visitor.visitSingularStringField(value: self.icon, fieldNumber: 6) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: LikeMessage, rhs: LikeMessage) -> Bool { - if lhs._common != rhs._common {return false} - if lhs.count != rhs.count {return false} - if lhs.total != rhs.total {return false} - if lhs.color != rhs.color {return false} - if lhs._user != rhs._user {return false} - if lhs.icon != rhs.icon {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = _storage._common { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + if _storage._giftID != 0 { + try visitor.visitSingularUInt64Field(value: _storage._giftID, fieldNumber: 2) + } + if _storage._fanTicketCount != 0 { + try visitor.visitSingularUInt64Field(value: _storage._fanTicketCount, fieldNumber: 3) + } + if _storage._groupCount != 0 { + try visitor.visitSingularUInt64Field(value: _storage._groupCount, fieldNumber: 4) + } + if _storage._repeatCount != 0 { + try visitor.visitSingularUInt64Field(value: _storage._repeatCount, fieldNumber: 5) + } + if _storage._comboCount != 0 { + try visitor.visitSingularUInt64Field(value: _storage._comboCount, fieldNumber: 6) + } + try { if let v = _storage._user { + try visitor.visitSingularMessageField(value: v, fieldNumber: 7) + } }() + try { if let v = _storage._toUser { + try visitor.visitSingularMessageField(value: v, fieldNumber: 8) + } }() + if _storage._repeatEnd != 0 { + try visitor.visitSingularUInt32Field(value: _storage._repeatEnd, fieldNumber: 9) + } + try { if let v = _storage._textEffect { + try visitor.visitSingularMessageField(value: v, fieldNumber: 10) + } }() + if _storage._groupID != 0 { + try visitor.visitSingularUInt64Field(value: _storage._groupID, fieldNumber: 11) + } + if _storage._incomeTaskgifts != 0 { + try visitor.visitSingularUInt64Field(value: _storage._incomeTaskgifts, fieldNumber: 12) + } + if _storage._roomFanTicketCount != 0 { + try visitor.visitSingularUInt64Field(value: _storage._roomFanTicketCount, fieldNumber: 13) + } + try { if let v = _storage._priority { + try visitor.visitSingularMessageField(value: v, fieldNumber: 14) + } }() + try { if let v = _storage._gift { + try visitor.visitSingularMessageField(value: v, fieldNumber: 15) + } }() + if !_storage._logID.isEmpty { + try visitor.visitSingularStringField(value: _storage._logID, fieldNumber: 16) + } + if _storage._sendType != 0 { + try visitor.visitSingularUInt64Field(value: _storage._sendType, fieldNumber: 17) + } + try { if let v = _storage._publicAreaCommon { + try visitor.visitSingularMessageField(value: v, fieldNumber: 18) + } }() + try { if let v = _storage._trayDisplayText { + try visitor.visitSingularMessageField(value: v, fieldNumber: 19) + } }() + if _storage._bannedDisplayEffects != 0 { + try visitor.visitSingularUInt64Field(value: _storage._bannedDisplayEffects, fieldNumber: 20) + } + if _storage._displayForSelf != false { + try visitor.visitSingularBoolField(value: _storage._displayForSelf, fieldNumber: 25) + } + if !_storage._interactGiftInfo.isEmpty { + try visitor.visitSingularStringField(value: _storage._interactGiftInfo, fieldNumber: 26) + } + if !_storage._diyItemInfo.isEmpty { + try visitor.visitSingularStringField(value: _storage._diyItemInfo, fieldNumber: 27) + } + if !_storage._minAssetSetList.isEmpty { + try visitor.visitPackedUInt64Field(value: _storage._minAssetSetList, fieldNumber: 28) + } + if _storage._totalCount != 0 { + try visitor.visitSingularUInt64Field(value: _storage._totalCount, fieldNumber: 29) + } + if _storage._clientGiftSource != 0 { + try visitor.visitSingularUInt32Field(value: _storage._clientGiftSource, fieldNumber: 30) + } + if !_storage._toUserIdsList.isEmpty { + try visitor.visitPackedUInt64Field(value: _storage._toUserIdsList, fieldNumber: 32) + } + if _storage._sendTime != 0 { + try visitor.visitSingularUInt64Field(value: _storage._sendTime, fieldNumber: 33) + } + if _storage._forceDisplayEffects != 0 { + try visitor.visitSingularUInt64Field(value: _storage._forceDisplayEffects, fieldNumber: 34) + } + if !_storage._traceID.isEmpty { + try visitor.visitSingularStringField(value: _storage._traceID, fieldNumber: 35) + } + if _storage._effectDisplayTs != 0 { + try visitor.visitSingularUInt64Field(value: _storage._effectDisplayTs, fieldNumber: 36) + } + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Douyin_GiftMessage, rhs: Douyin_GiftMessage) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._common != rhs_storage._common {return false} + if _storage._giftID != rhs_storage._giftID {return false} + if _storage._fanTicketCount != rhs_storage._fanTicketCount {return false} + if _storage._groupCount != rhs_storage._groupCount {return false} + if _storage._repeatCount != rhs_storage._repeatCount {return false} + if _storage._comboCount != rhs_storage._comboCount {return false} + if _storage._user != rhs_storage._user {return false} + if _storage._toUser != rhs_storage._toUser {return false} + if _storage._repeatEnd != rhs_storage._repeatEnd {return false} + if _storage._textEffect != rhs_storage._textEffect {return false} + if _storage._groupID != rhs_storage._groupID {return false} + if _storage._incomeTaskgifts != rhs_storage._incomeTaskgifts {return false} + if _storage._roomFanTicketCount != rhs_storage._roomFanTicketCount {return false} + if _storage._priority != rhs_storage._priority {return false} + if _storage._gift != rhs_storage._gift {return false} + if _storage._logID != rhs_storage._logID {return false} + if _storage._sendType != rhs_storage._sendType {return false} + if _storage._publicAreaCommon != rhs_storage._publicAreaCommon {return false} + if _storage._trayDisplayText != rhs_storage._trayDisplayText {return false} + if _storage._bannedDisplayEffects != rhs_storage._bannedDisplayEffects {return false} + if _storage._displayForSelf != rhs_storage._displayForSelf {return false} + if _storage._interactGiftInfo != rhs_storage._interactGiftInfo {return false} + if _storage._diyItemInfo != rhs_storage._diyItemInfo {return false} + if _storage._minAssetSetList != rhs_storage._minAssetSetList {return false} + if _storage._totalCount != rhs_storage._totalCount {return false} + if _storage._clientGiftSource != rhs_storage._clientGiftSource {return false} + if _storage._toUserIdsList != rhs_storage._toUserIdsList {return false} + if _storage._sendTime != rhs_storage._sendTime {return false} + if _storage._forceDisplayEffects != rhs_storage._forceDisplayEffects {return false} + if _storage._traceID != rhs_storage._traceID {return false} + if _storage._effectDisplayTs != rhs_storage._effectDisplayTs {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } -extension ChatMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = "ChatMessage" +extension Douyin_GiftStruct: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".GiftStruct" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "common"), - 2: .same(proto: "user"), - 3: .same(proto: "content"), - 4: .same(proto: "visibleToSender"), - 5: .same(proto: "backgroundImage"), - 6: .same(proto: "fullScreenTextColor"), - 7: .same(proto: "backgroundImageV2"), - 9: .same(proto: "publicAreaCommon"), - 10: .same(proto: "giftImage"), + 1: .same(proto: "image"), + 2: .same(proto: "describe"), + 3: .same(proto: "notify"), + 4: .same(proto: "duration"), + 5: .same(proto: "id"), + 7: .same(proto: "forLinkmic"), + 8: .same(proto: "doodle"), + 9: .same(proto: "forFansclub"), + 10: .same(proto: "combo"), + 11: .same(proto: "type"), + 12: .same(proto: "diamondCount"), + 13: .same(proto: "isDisplayedOnPanel"), + 14: .same(proto: "primaryEffectId"), + 15: .same(proto: "giftLabelIcon"), + 16: .same(proto: "name"), + 17: .same(proto: "region"), + 18: .same(proto: "manual"), + 19: .same(proto: "forCustom"), + 21: .same(proto: "icon"), + 22: .same(proto: "actionType"), ] fileprivate class _StorageClass { - var _common: Common? = nil - var _user: User? = nil - var _content: String = String() - var _visibleToSender: Bool = false - var _backgroundImage: Image? = nil - var _fullScreenTextColor: String = String() - var _backgroundImageV2: Image? = nil - var _publicAreaCommon: PublicAreaCommon? = nil - var _giftImage: Image? = nil - - static let defaultInstance = _StorageClass() - - private init() {} - - init(copying source: _StorageClass) { - _common = source._common - _user = source._user - _content = source._content - _visibleToSender = source._visibleToSender - _backgroundImage = source._backgroundImage - _fullScreenTextColor = source._fullScreenTextColor - _backgroundImageV2 = source._backgroundImageV2 - _publicAreaCommon = source._publicAreaCommon - _giftImage = source._giftImage - } + var _image: Douyin_Image? = nil + var _describe: String = String() + var _notify: Bool = false + var _duration: UInt64 = 0 + var _id: UInt64 = 0 + var _forLinkmic: Bool = false + var _doodle: Bool = false + var _forFansclub: Bool = false + var _combo: Bool = false + var _type: UInt32 = 0 + var _diamondCount: UInt32 = 0 + var _isDisplayedOnPanel: Bool = false + var _primaryEffectID: UInt64 = 0 + var _giftLabelIcon: Douyin_Image? = nil + var _name: String = String() + var _region: String = String() + var _manual: String = String() + var _forCustom: Bool = false + var _icon: Douyin_Image? = nil + var _actionType: UInt32 = 0 + + #if swift(>=5.10) + // This property is used as the initial default value for new instances of the type. + // The type itself is protecting the reference to its storage via CoW semantics. + // This will force a copy to be made of this reference when the first mutation occurs; + // hence, it is safe to mark this as `nonisolated(unsafe)`. + static nonisolated(unsafe) let defaultInstance = _StorageClass() + #else + static let defaultInstance = _StorageClass() + #endif + + private init() {} + + init(copying source: _StorageClass) { + _image = source._image + _describe = source._describe + _notify = source._notify + _duration = source._duration + _id = source._id + _forLinkmic = source._forLinkmic + _doodle = source._doodle + _forFansclub = source._forFansclub + _combo = source._combo + _type = source._type + _diamondCount = source._diamondCount + _isDisplayedOnPanel = source._isDisplayedOnPanel + _primaryEffectID = source._primaryEffectID + _giftLabelIcon = source._giftLabelIcon + _name = source._name + _region = source._region + _manual = source._manual + _forCustom = source._forCustom + _icon = source._icon + _actionType = source._actionType + } } fileprivate mutating func _uniqueStorage() -> _StorageClass { - if !isKnownUniquelyReferenced(&_storage) { - _storage = _StorageClass(copying: _storage) - } - return _storage + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage } mutating func decodeMessage(decoder: inout D) throws { - _ = _uniqueStorage() - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &_storage._common) }() - case 2: try { try decoder.decodeSingularMessageField(value: &_storage._user) }() - case 3: try { try decoder.decodeSingularStringField(value: &_storage._content) }() - case 4: try { try decoder.decodeSingularBoolField(value: &_storage._visibleToSender) }() - case 5: try { try decoder.decodeSingularMessageField(value: &_storage._backgroundImage) }() - case 6: try { try decoder.decodeSingularStringField(value: &_storage._fullScreenTextColor) }() - case 7: try { try decoder.decodeSingularMessageField(value: &_storage._backgroundImageV2) }() - case 9: try { try decoder.decodeSingularMessageField(value: &_storage._publicAreaCommon) }() - case 10: try { try decoder.decodeSingularMessageField(value: &_storage._giftImage) }() - default: break - } - } - } + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &_storage._image) }() + case 2: try { try decoder.decodeSingularStringField(value: &_storage._describe) }() + case 3: try { try decoder.decodeSingularBoolField(value: &_storage._notify) }() + case 4: try { try decoder.decodeSingularUInt64Field(value: &_storage._duration) }() + case 5: try { try decoder.decodeSingularUInt64Field(value: &_storage._id) }() + case 7: try { try decoder.decodeSingularBoolField(value: &_storage._forLinkmic) }() + case 8: try { try decoder.decodeSingularBoolField(value: &_storage._doodle) }() + case 9: try { try decoder.decodeSingularBoolField(value: &_storage._forFansclub) }() + case 10: try { try decoder.decodeSingularBoolField(value: &_storage._combo) }() + case 11: try { try decoder.decodeSingularUInt32Field(value: &_storage._type) }() + case 12: try { try decoder.decodeSingularUInt32Field(value: &_storage._diamondCount) }() + case 13: try { try decoder.decodeSingularBoolField(value: &_storage._isDisplayedOnPanel) }() + case 14: try { try decoder.decodeSingularUInt64Field(value: &_storage._primaryEffectID) }() + case 15: try { try decoder.decodeSingularMessageField(value: &_storage._giftLabelIcon) }() + case 16: try { try decoder.decodeSingularStringField(value: &_storage._name) }() + case 17: try { try decoder.decodeSingularStringField(value: &_storage._region) }() + case 18: try { try decoder.decodeSingularStringField(value: &_storage._manual) }() + case 19: try { try decoder.decodeSingularBoolField(value: &_storage._forCustom) }() + case 21: try { try decoder.decodeSingularMessageField(value: &_storage._icon) }() + case 22: try { try decoder.decodeSingularUInt32Field(value: &_storage._actionType) }() + default: break + } + } + } } func traverse(visitor: inout V) throws { - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = _storage._common { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = _storage._user { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - if !_storage._content.isEmpty { - try visitor.visitSingularStringField(value: _storage._content, fieldNumber: 3) - } - if _storage._visibleToSender != false { - try visitor.visitSingularBoolField(value: _storage._visibleToSender, fieldNumber: 4) - } - try { if let v = _storage._backgroundImage { - try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - } }() - if !_storage._fullScreenTextColor.isEmpty { - try visitor.visitSingularStringField(value: _storage._fullScreenTextColor, fieldNumber: 6) - } - try { if let v = _storage._backgroundImageV2 { - try visitor.visitSingularMessageField(value: v, fieldNumber: 7) - } }() - try { if let v = _storage._publicAreaCommon { - try visitor.visitSingularMessageField(value: v, fieldNumber: 9) - } }() - try { if let v = _storage._giftImage { - try visitor.visitSingularMessageField(value: v, fieldNumber: 10) - } }() - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: ChatMessage, rhs: ChatMessage) -> Bool { - if lhs._storage !== rhs._storage { - let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in - let _storage = _args.0 - let rhs_storage = _args.1 - if _storage._common != rhs_storage._common {return false} - if _storage._user != rhs_storage._user {return false} - if _storage._content != rhs_storage._content {return false} - if _storage._visibleToSender != rhs_storage._visibleToSender {return false} - if _storage._backgroundImage != rhs_storage._backgroundImage {return false} - if _storage._fullScreenTextColor != rhs_storage._fullScreenTextColor {return false} - if _storage._backgroundImageV2 != rhs_storage._backgroundImageV2 {return false} - if _storage._publicAreaCommon != rhs_storage._publicAreaCommon {return false} - if _storage._giftImage != rhs_storage._giftImage {return false} - return true - } - if !storagesAreEqual {return false} - } - if lhs.unknownFields != rhs.unknownFields {return false} - return true + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = _storage._image { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + if !_storage._describe.isEmpty { + try visitor.visitSingularStringField(value: _storage._describe, fieldNumber: 2) + } + if _storage._notify != false { + try visitor.visitSingularBoolField(value: _storage._notify, fieldNumber: 3) + } + if _storage._duration != 0 { + try visitor.visitSingularUInt64Field(value: _storage._duration, fieldNumber: 4) + } + if _storage._id != 0 { + try visitor.visitSingularUInt64Field(value: _storage._id, fieldNumber: 5) + } + if _storage._forLinkmic != false { + try visitor.visitSingularBoolField(value: _storage._forLinkmic, fieldNumber: 7) + } + if _storage._doodle != false { + try visitor.visitSingularBoolField(value: _storage._doodle, fieldNumber: 8) + } + if _storage._forFansclub != false { + try visitor.visitSingularBoolField(value: _storage._forFansclub, fieldNumber: 9) + } + if _storage._combo != false { + try visitor.visitSingularBoolField(value: _storage._combo, fieldNumber: 10) + } + if _storage._type != 0 { + try visitor.visitSingularUInt32Field(value: _storage._type, fieldNumber: 11) + } + if _storage._diamondCount != 0 { + try visitor.visitSingularUInt32Field(value: _storage._diamondCount, fieldNumber: 12) + } + if _storage._isDisplayedOnPanel != false { + try visitor.visitSingularBoolField(value: _storage._isDisplayedOnPanel, fieldNumber: 13) + } + if _storage._primaryEffectID != 0 { + try visitor.visitSingularUInt64Field(value: _storage._primaryEffectID, fieldNumber: 14) + } + try { if let v = _storage._giftLabelIcon { + try visitor.visitSingularMessageField(value: v, fieldNumber: 15) + } }() + if !_storage._name.isEmpty { + try visitor.visitSingularStringField(value: _storage._name, fieldNumber: 16) + } + if !_storage._region.isEmpty { + try visitor.visitSingularStringField(value: _storage._region, fieldNumber: 17) + } + if !_storage._manual.isEmpty { + try visitor.visitSingularStringField(value: _storage._manual, fieldNumber: 18) + } + if _storage._forCustom != false { + try visitor.visitSingularBoolField(value: _storage._forCustom, fieldNumber: 19) + } + try { if let v = _storage._icon { + try visitor.visitSingularMessageField(value: v, fieldNumber: 21) + } }() + if _storage._actionType != 0 { + try visitor.visitSingularUInt32Field(value: _storage._actionType, fieldNumber: 22) + } + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Douyin_GiftStruct, rhs: Douyin_GiftStruct) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._image != rhs_storage._image {return false} + if _storage._describe != rhs_storage._describe {return false} + if _storage._notify != rhs_storage._notify {return false} + if _storage._duration != rhs_storage._duration {return false} + if _storage._id != rhs_storage._id {return false} + if _storage._forLinkmic != rhs_storage._forLinkmic {return false} + if _storage._doodle != rhs_storage._doodle {return false} + if _storage._forFansclub != rhs_storage._forFansclub {return false} + if _storage._combo != rhs_storage._combo {return false} + if _storage._type != rhs_storage._type {return false} + if _storage._diamondCount != rhs_storage._diamondCount {return false} + if _storage._isDisplayedOnPanel != rhs_storage._isDisplayedOnPanel {return false} + if _storage._primaryEffectID != rhs_storage._primaryEffectID {return false} + if _storage._giftLabelIcon != rhs_storage._giftLabelIcon {return false} + if _storage._name != rhs_storage._name {return false} + if _storage._region != rhs_storage._region {return false} + if _storage._manual != rhs_storage._manual {return false} + if _storage._forCustom != rhs_storage._forCustom {return false} + if _storage._icon != rhs_storage._icon {return false} + if _storage._actionType != rhs_storage._actionType {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } -extension SocialMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = "SocialMessage" +extension Douyin_GiftIMPriority: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".GiftIMPriority" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "common"), - 2: .same(proto: "user"), - 3: .same(proto: "shareType"), - 4: .same(proto: "action"), - 5: .same(proto: "shareTarget"), - 6: .same(proto: "followCount"), - 7: .same(proto: "publicAreaCommon"), + 1: .same(proto: "queueSizesList"), + 2: .same(proto: "selfQueuePriority"), + 3: .same(proto: "priority"), ] - fileprivate class _StorageClass { - var _common: Common? = nil - var _user: User? = nil - var _shareType: Int64 = 0 - var _action: Int64 = 0 - var _shareTarget: String = String() - var _followCount: Int64 = 0 - var _publicAreaCommon: PublicAreaCommon? = nil - - static let defaultInstance = _StorageClass() - - private init() {} - - init(copying source: _StorageClass) { - _common = source._common - _user = source._user - _shareType = source._shareType - _action = source._action - _shareTarget = source._shareTarget - _followCount = source._followCount - _publicAreaCommon = source._publicAreaCommon - } - } - - fileprivate mutating func _uniqueStorage() -> _StorageClass { - if !isKnownUniquelyReferenced(&_storage) { - _storage = _StorageClass(copying: _storage) - } - return _storage - } - mutating func decodeMessage(decoder: inout D) throws { - _ = _uniqueStorage() - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &_storage._common) }() - case 2: try { try decoder.decodeSingularMessageField(value: &_storage._user) }() - case 3: try { try decoder.decodeSingularInt64Field(value: &_storage._shareType) }() - case 4: try { try decoder.decodeSingularInt64Field(value: &_storage._action) }() - case 5: try { try decoder.decodeSingularStringField(value: &_storage._shareTarget) }() - case 6: try { try decoder.decodeSingularInt64Field(value: &_storage._followCount) }() - case 7: try { try decoder.decodeSingularMessageField(value: &_storage._publicAreaCommon) }() - default: break - } - } - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeRepeatedUInt64Field(value: &self.queueSizesList) }() + case 2: try { try decoder.decodeSingularUInt64Field(value: &self.selfQueuePriority) }() + case 3: try { try decoder.decodeSingularUInt64Field(value: &self.priority) }() + default: break + } + } } func traverse(visitor: inout V) throws { - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = _storage._common { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = _storage._user { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - if _storage._shareType != 0 { - try visitor.visitSingularInt64Field(value: _storage._shareType, fieldNumber: 3) - } - if _storage._action != 0 { - try visitor.visitSingularInt64Field(value: _storage._action, fieldNumber: 4) - } - if !_storage._shareTarget.isEmpty { - try visitor.visitSingularStringField(value: _storage._shareTarget, fieldNumber: 5) - } - if _storage._followCount != 0 { - try visitor.visitSingularInt64Field(value: _storage._followCount, fieldNumber: 6) - } - try { if let v = _storage._publicAreaCommon { - try visitor.visitSingularMessageField(value: v, fieldNumber: 7) - } }() - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: SocialMessage, rhs: SocialMessage) -> Bool { - if lhs._storage !== rhs._storage { - let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in - let _storage = _args.0 - let rhs_storage = _args.1 - if _storage._common != rhs_storage._common {return false} - if _storage._user != rhs_storage._user {return false} - if _storage._shareType != rhs_storage._shareType {return false} - if _storage._action != rhs_storage._action {return false} - if _storage._shareTarget != rhs_storage._shareTarget {return false} - if _storage._followCount != rhs_storage._followCount {return false} - if _storage._publicAreaCommon != rhs_storage._publicAreaCommon {return false} - return true - } - if !storagesAreEqual {return false} - } - if lhs.unknownFields != rhs.unknownFields {return false} - return true + if !self.queueSizesList.isEmpty { + try visitor.visitPackedUInt64Field(value: self.queueSizesList, fieldNumber: 1) + } + if self.selfQueuePriority != 0 { + try visitor.visitSingularUInt64Field(value: self.selfQueuePriority, fieldNumber: 2) + } + if self.priority != 0 { + try visitor.visitSingularUInt64Field(value: self.priority, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Douyin_GiftIMPriority, rhs: Douyin_GiftIMPriority) -> Bool { + if lhs.queueSizesList != rhs.queueSizesList {return false} + if lhs.selfQueuePriority != rhs.selfQueuePriority {return false} + if lhs.priority != rhs.priority {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } -extension MemberMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = "MemberMessage" +extension Douyin_TextEffect: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TextEffect" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "common"), - 2: .same(proto: "user"), - 3: .same(proto: "memberCount"), - 4: .same(proto: "operator"), - 5: .same(proto: "isSetToAdmin"), - 6: .same(proto: "isTopUser"), - 7: .same(proto: "rankScore"), - 8: .same(proto: "topUserNo"), - 9: .same(proto: "enterType"), - 10: .same(proto: "action"), - 11: .same(proto: "actionDescription"), - 12: .same(proto: "userId"), - 13: .same(proto: "effectConfig"), - 14: .same(proto: "popStr"), - 15: .same(proto: "enterEffectConfig"), - 16: .same(proto: "backgroundImage"), - 17: .same(proto: "backgroundImageV2"), - 18: .same(proto: "anchorDisplayText"), - 19: .same(proto: "publicAreaCommon"), + 1: .same(proto: "portrait"), + 2: .same(proto: "landscape"), ] - fileprivate class _StorageClass { - var _common: Common? = nil - var _user: User? = nil - var _memberCount: Int64 = 0 - var _operator: User? = nil - var _isSetToAdmin: Bool = false - var _isTopUser: Bool = false - var _rankScore: Int64 = 0 - var _topUserNo: Int64 = 0 - var _enterType: Int64 = 0 - var _action: Int64 = 0 - var _actionDescription: String = String() - var _userID: Int64 = 0 - var _effectConfig: MemberMessage.EffectConfig? = nil - var _popStr: String = String() - var _enterEffectConfig: MemberMessage.EffectConfig? = nil - var _backgroundImage: Image? = nil - var _backgroundImageV2: Image? = nil - var _anchorDisplayText: Text? = nil - var _publicAreaCommon: PublicAreaCommon? = nil - - static let defaultInstance = _StorageClass() - - private init() {} - - init(copying source: _StorageClass) { - _common = source._common - _user = source._user - _memberCount = source._memberCount - _operator = source._operator - _isSetToAdmin = source._isSetToAdmin - _isTopUser = source._isTopUser - _rankScore = source._rankScore - _topUserNo = source._topUserNo - _enterType = source._enterType - _action = source._action - _actionDescription = source._actionDescription - _userID = source._userID - _effectConfig = source._effectConfig - _popStr = source._popStr - _enterEffectConfig = source._enterEffectConfig - _backgroundImage = source._backgroundImage - _backgroundImageV2 = source._backgroundImageV2 - _anchorDisplayText = source._anchorDisplayText - _publicAreaCommon = source._publicAreaCommon - } - } - - fileprivate mutating func _uniqueStorage() -> _StorageClass { - if !isKnownUniquelyReferenced(&_storage) { - _storage = _StorageClass(copying: _storage) - } - return _storage - } - mutating func decodeMessage(decoder: inout D) throws { - _ = _uniqueStorage() - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &_storage._common) }() - case 2: try { try decoder.decodeSingularMessageField(value: &_storage._user) }() - case 3: try { try decoder.decodeSingularInt64Field(value: &_storage._memberCount) }() - case 4: try { try decoder.decodeSingularMessageField(value: &_storage._operator) }() - case 5: try { try decoder.decodeSingularBoolField(value: &_storage._isSetToAdmin) }() - case 6: try { try decoder.decodeSingularBoolField(value: &_storage._isTopUser) }() - case 7: try { try decoder.decodeSingularInt64Field(value: &_storage._rankScore) }() - case 8: try { try decoder.decodeSingularInt64Field(value: &_storage._topUserNo) }() - case 9: try { try decoder.decodeSingularInt64Field(value: &_storage._enterType) }() - case 10: try { try decoder.decodeSingularInt64Field(value: &_storage._action) }() - case 11: try { try decoder.decodeSingularStringField(value: &_storage._actionDescription) }() - case 12: try { try decoder.decodeSingularInt64Field(value: &_storage._userID) }() - case 13: try { try decoder.decodeSingularMessageField(value: &_storage._effectConfig) }() - case 14: try { try decoder.decodeSingularStringField(value: &_storage._popStr) }() - case 15: try { try decoder.decodeSingularMessageField(value: &_storage._enterEffectConfig) }() - case 16: try { try decoder.decodeSingularMessageField(value: &_storage._backgroundImage) }() - case 17: try { try decoder.decodeSingularMessageField(value: &_storage._backgroundImageV2) }() - case 18: try { try decoder.decodeSingularMessageField(value: &_storage._anchorDisplayText) }() - case 19: try { try decoder.decodeSingularMessageField(value: &_storage._publicAreaCommon) }() - default: break - } - } - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._portrait) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._landscape) }() + default: break + } + } } func traverse(visitor: inout V) throws { - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = _storage._common { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = _storage._user { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - if _storage._memberCount != 0 { - try visitor.visitSingularInt64Field(value: _storage._memberCount, fieldNumber: 3) - } - try { if let v = _storage._operator { - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } }() - if _storage._isSetToAdmin != false { - try visitor.visitSingularBoolField(value: _storage._isSetToAdmin, fieldNumber: 5) - } - if _storage._isTopUser != false { - try visitor.visitSingularBoolField(value: _storage._isTopUser, fieldNumber: 6) - } - if _storage._rankScore != 0 { - try visitor.visitSingularInt64Field(value: _storage._rankScore, fieldNumber: 7) - } - if _storage._topUserNo != 0 { - try visitor.visitSingularInt64Field(value: _storage._topUserNo, fieldNumber: 8) - } - if _storage._enterType != 0 { - try visitor.visitSingularInt64Field(value: _storage._enterType, fieldNumber: 9) - } - if _storage._action != 0 { - try visitor.visitSingularInt64Field(value: _storage._action, fieldNumber: 10) - } - if !_storage._actionDescription.isEmpty { - try visitor.visitSingularStringField(value: _storage._actionDescription, fieldNumber: 11) - } - if _storage._userID != 0 { - try visitor.visitSingularInt64Field(value: _storage._userID, fieldNumber: 12) - } - try { if let v = _storage._effectConfig { - try visitor.visitSingularMessageField(value: v, fieldNumber: 13) - } }() - if !_storage._popStr.isEmpty { - try visitor.visitSingularStringField(value: _storage._popStr, fieldNumber: 14) - } - try { if let v = _storage._enterEffectConfig { - try visitor.visitSingularMessageField(value: v, fieldNumber: 15) - } }() - try { if let v = _storage._backgroundImage { - try visitor.visitSingularMessageField(value: v, fieldNumber: 16) - } }() - try { if let v = _storage._backgroundImageV2 { - try visitor.visitSingularMessageField(value: v, fieldNumber: 17) - } }() - try { if let v = _storage._anchorDisplayText { - try visitor.visitSingularMessageField(value: v, fieldNumber: 18) - } }() - try { if let v = _storage._publicAreaCommon { - try visitor.visitSingularMessageField(value: v, fieldNumber: 19) - } }() - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: MemberMessage, rhs: MemberMessage) -> Bool { - if lhs._storage !== rhs._storage { - let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in - let _storage = _args.0 - let rhs_storage = _args.1 - if _storage._common != rhs_storage._common {return false} - if _storage._user != rhs_storage._user {return false} - if _storage._memberCount != rhs_storage._memberCount {return false} - if _storage._operator != rhs_storage._operator {return false} - if _storage._isSetToAdmin != rhs_storage._isSetToAdmin {return false} - if _storage._isTopUser != rhs_storage._isTopUser {return false} - if _storage._rankScore != rhs_storage._rankScore {return false} - if _storage._topUserNo != rhs_storage._topUserNo {return false} - if _storage._enterType != rhs_storage._enterType {return false} - if _storage._action != rhs_storage._action {return false} - if _storage._actionDescription != rhs_storage._actionDescription {return false} - if _storage._userID != rhs_storage._userID {return false} - if _storage._effectConfig != rhs_storage._effectConfig {return false} - if _storage._popStr != rhs_storage._popStr {return false} - if _storage._enterEffectConfig != rhs_storage._enterEffectConfig {return false} - if _storage._backgroundImage != rhs_storage._backgroundImage {return false} - if _storage._backgroundImageV2 != rhs_storage._backgroundImageV2 {return false} - if _storage._anchorDisplayText != rhs_storage._anchorDisplayText {return false} - if _storage._publicAreaCommon != rhs_storage._publicAreaCommon {return false} - return true - } - if !storagesAreEqual {return false} - } - if lhs.unknownFields != rhs.unknownFields {return false} - return true + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._portrait { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try { if let v = self._landscape { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Douyin_TextEffect, rhs: Douyin_TextEffect) -> Bool { + if lhs._portrait != rhs._portrait {return false} + if lhs._landscape != rhs._landscape {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } -extension MemberMessage.EffectConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = MemberMessage.protoMessageName + ".EffectConfig" +extension Douyin_TextEffectDetail: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TextEffectDetail" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "type"), - 2: .same(proto: "icon"), - 3: .same(proto: "avatarPos"), - 4: .same(proto: "text"), - 5: .same(proto: "textIcon"), - 6: .same(proto: "stayTime"), - 7: .same(proto: "animAssetId"), - 8: .same(proto: "badge"), - 9: .same(proto: "flexSettingArray"), - 10: .same(proto: "textIconOverlay"), - 11: .same(proto: "animatedBadge"), - 12: .same(proto: "hasSweepLight"), - 13: .same(proto: "textFlexSettingArray"), - 14: .same(proto: "centerAnimAssetId"), + 1: .same(proto: "text"), + 2: .same(proto: "textFontSize"), + 3: .same(proto: "background"), + 4: .same(proto: "start"), + 5: .same(proto: "duration"), + 6: .same(proto: "x"), + 7: .same(proto: "y"), + 8: .same(proto: "width"), + 9: .same(proto: "height"), + 10: .same(proto: "shadowDx"), + 11: .same(proto: "shadowDy"), + 12: .same(proto: "shadowRadius"), + 13: .same(proto: "shadowColor"), + 14: .same(proto: "strokeColor"), + 15: .same(proto: "strokeWidth"), ] fileprivate class _StorageClass { - var _type: Int64 = 0 - var _icon: Image? = nil - var _avatarPos: Int64 = 0 - var _text: Text? = nil - var _textIcon: Image? = nil - var _stayTime: Int32 = 0 - var _animAssetID: Int64 = 0 - var _badge: Image? = nil - var _flexSettingArray: [Int64] = [] - var _textIconOverlay: Image? = nil - var _animatedBadge: Image? = nil - var _hasSweepLight_p: Bool = false - var _textFlexSettingArray: [Int64] = [] - var _centerAnimAssetID: Int64 = 0 - - static let defaultInstance = _StorageClass() - - private init() {} - - init(copying source: _StorageClass) { - _type = source._type - _icon = source._icon - _avatarPos = source._avatarPos - _text = source._text - _textIcon = source._textIcon - _stayTime = source._stayTime - _animAssetID = source._animAssetID - _badge = source._badge - _flexSettingArray = source._flexSettingArray - _textIconOverlay = source._textIconOverlay - _animatedBadge = source._animatedBadge - _hasSweepLight_p = source._hasSweepLight_p - _textFlexSettingArray = source._textFlexSettingArray - _centerAnimAssetID = source._centerAnimAssetID - } + var _text: Douyin_Text? = nil + var _textFontSize: UInt32 = 0 + var _background: Douyin_Image? = nil + var _start: UInt32 = 0 + var _duration: UInt32 = 0 + var _x: UInt32 = 0 + var _y: UInt32 = 0 + var _width: UInt32 = 0 + var _height: UInt32 = 0 + var _shadowDx: UInt32 = 0 + var _shadowDy: UInt32 = 0 + var _shadowRadius: UInt32 = 0 + var _shadowColor: String = String() + var _strokeColor: String = String() + var _strokeWidth: UInt32 = 0 + + #if swift(>=5.10) + // This property is used as the initial default value for new instances of the type. + // The type itself is protecting the reference to its storage via CoW semantics. + // This will force a copy to be made of this reference when the first mutation occurs; + // hence, it is safe to mark this as `nonisolated(unsafe)`. + static nonisolated(unsafe) let defaultInstance = _StorageClass() + #else + static let defaultInstance = _StorageClass() + #endif + + private init() {} + + init(copying source: _StorageClass) { + _text = source._text + _textFontSize = source._textFontSize + _background = source._background + _start = source._start + _duration = source._duration + _x = source._x + _y = source._y + _width = source._width + _height = source._height + _shadowDx = source._shadowDx + _shadowDy = source._shadowDy + _shadowRadius = source._shadowRadius + _shadowColor = source._shadowColor + _strokeColor = source._strokeColor + _strokeWidth = source._strokeWidth + } } fileprivate mutating func _uniqueStorage() -> _StorageClass { - if !isKnownUniquelyReferenced(&_storage) { - _storage = _StorageClass(copying: _storage) - } - return _storage + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage } mutating func decodeMessage(decoder: inout D) throws { - _ = _uniqueStorage() - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularInt64Field(value: &_storage._type) }() - case 2: try { try decoder.decodeSingularMessageField(value: &_storage._icon) }() - case 3: try { try decoder.decodeSingularInt64Field(value: &_storage._avatarPos) }() - case 4: try { try decoder.decodeSingularMessageField(value: &_storage._text) }() - case 5: try { try decoder.decodeSingularMessageField(value: &_storage._textIcon) }() - case 6: try { try decoder.decodeSingularInt32Field(value: &_storage._stayTime) }() - case 7: try { try decoder.decodeSingularInt64Field(value: &_storage._animAssetID) }() - case 8: try { try decoder.decodeSingularMessageField(value: &_storage._badge) }() - case 9: try { try decoder.decodeRepeatedInt64Field(value: &_storage._flexSettingArray) }() - case 10: try { try decoder.decodeSingularMessageField(value: &_storage._textIconOverlay) }() - case 11: try { try decoder.decodeSingularMessageField(value: &_storage._animatedBadge) }() - case 12: try { try decoder.decodeSingularBoolField(value: &_storage._hasSweepLight_p) }() - case 13: try { try decoder.decodeRepeatedInt64Field(value: &_storage._textFlexSettingArray) }() - case 14: try { try decoder.decodeSingularInt64Field(value: &_storage._centerAnimAssetID) }() - default: break - } - } - } + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &_storage._text) }() + case 2: try { try decoder.decodeSingularUInt32Field(value: &_storage._textFontSize) }() + case 3: try { try decoder.decodeSingularMessageField(value: &_storage._background) }() + case 4: try { try decoder.decodeSingularUInt32Field(value: &_storage._start) }() + case 5: try { try decoder.decodeSingularUInt32Field(value: &_storage._duration) }() + case 6: try { try decoder.decodeSingularUInt32Field(value: &_storage._x) }() + case 7: try { try decoder.decodeSingularUInt32Field(value: &_storage._y) }() + case 8: try { try decoder.decodeSingularUInt32Field(value: &_storage._width) }() + case 9: try { try decoder.decodeSingularUInt32Field(value: &_storage._height) }() + case 10: try { try decoder.decodeSingularUInt32Field(value: &_storage._shadowDx) }() + case 11: try { try decoder.decodeSingularUInt32Field(value: &_storage._shadowDy) }() + case 12: try { try decoder.decodeSingularUInt32Field(value: &_storage._shadowRadius) }() + case 13: try { try decoder.decodeSingularStringField(value: &_storage._shadowColor) }() + case 14: try { try decoder.decodeSingularStringField(value: &_storage._strokeColor) }() + case 15: try { try decoder.decodeSingularUInt32Field(value: &_storage._strokeWidth) }() + default: break + } + } + } } func traverse(visitor: inout V) throws { - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if _storage._type != 0 { - try visitor.visitSingularInt64Field(value: _storage._type, fieldNumber: 1) - } - try { if let v = _storage._icon { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - if _storage._avatarPos != 0 { - try visitor.visitSingularInt64Field(value: _storage._avatarPos, fieldNumber: 3) - } - try { if let v = _storage._text { - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } }() - try { if let v = _storage._textIcon { - try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - } }() - if _storage._stayTime != 0 { - try visitor.visitSingularInt32Field(value: _storage._stayTime, fieldNumber: 6) - } - if _storage._animAssetID != 0 { - try visitor.visitSingularInt64Field(value: _storage._animAssetID, fieldNumber: 7) - } - try { if let v = _storage._badge { - try visitor.visitSingularMessageField(value: v, fieldNumber: 8) - } }() - if !_storage._flexSettingArray.isEmpty { - try visitor.visitPackedInt64Field(value: _storage._flexSettingArray, fieldNumber: 9) - } - try { if let v = _storage._textIconOverlay { - try visitor.visitSingularMessageField(value: v, fieldNumber: 10) - } }() - try { if let v = _storage._animatedBadge { - try visitor.visitSingularMessageField(value: v, fieldNumber: 11) - } }() - if _storage._hasSweepLight_p != false { - try visitor.visitSingularBoolField(value: _storage._hasSweepLight_p, fieldNumber: 12) - } - if !_storage._textFlexSettingArray.isEmpty { - try visitor.visitPackedInt64Field(value: _storage._textFlexSettingArray, fieldNumber: 13) - } - if _storage._centerAnimAssetID != 0 { - try visitor.visitSingularInt64Field(value: _storage._centerAnimAssetID, fieldNumber: 14) - } - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: MemberMessage.EffectConfig, rhs: MemberMessage.EffectConfig) -> Bool { - if lhs._storage !== rhs._storage { - let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in - let _storage = _args.0 - let rhs_storage = _args.1 - if _storage._type != rhs_storage._type {return false} - if _storage._icon != rhs_storage._icon {return false} - if _storage._avatarPos != rhs_storage._avatarPos {return false} - if _storage._text != rhs_storage._text {return false} - if _storage._textIcon != rhs_storage._textIcon {return false} - if _storage._stayTime != rhs_storage._stayTime {return false} - if _storage._animAssetID != rhs_storage._animAssetID {return false} - if _storage._badge != rhs_storage._badge {return false} - if _storage._flexSettingArray != rhs_storage._flexSettingArray {return false} - if _storage._textIconOverlay != rhs_storage._textIconOverlay {return false} - if _storage._animatedBadge != rhs_storage._animatedBadge {return false} - if _storage._hasSweepLight_p != rhs_storage._hasSweepLight_p {return false} - if _storage._textFlexSettingArray != rhs_storage._textFlexSettingArray {return false} - if _storage._centerAnimAssetID != rhs_storage._centerAnimAssetID {return false} - return true - } - if !storagesAreEqual {return false} - } - if lhs.unknownFields != rhs.unknownFields {return false} - return true + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = _storage._text { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + if _storage._textFontSize != 0 { + try visitor.visitSingularUInt32Field(value: _storage._textFontSize, fieldNumber: 2) + } + try { if let v = _storage._background { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + } }() + if _storage._start != 0 { + try visitor.visitSingularUInt32Field(value: _storage._start, fieldNumber: 4) + } + if _storage._duration != 0 { + try visitor.visitSingularUInt32Field(value: _storage._duration, fieldNumber: 5) + } + if _storage._x != 0 { + try visitor.visitSingularUInt32Field(value: _storage._x, fieldNumber: 6) + } + if _storage._y != 0 { + try visitor.visitSingularUInt32Field(value: _storage._y, fieldNumber: 7) + } + if _storage._width != 0 { + try visitor.visitSingularUInt32Field(value: _storage._width, fieldNumber: 8) + } + if _storage._height != 0 { + try visitor.visitSingularUInt32Field(value: _storage._height, fieldNumber: 9) + } + if _storage._shadowDx != 0 { + try visitor.visitSingularUInt32Field(value: _storage._shadowDx, fieldNumber: 10) + } + if _storage._shadowDy != 0 { + try visitor.visitSingularUInt32Field(value: _storage._shadowDy, fieldNumber: 11) + } + if _storage._shadowRadius != 0 { + try visitor.visitSingularUInt32Field(value: _storage._shadowRadius, fieldNumber: 12) + } + if !_storage._shadowColor.isEmpty { + try visitor.visitSingularStringField(value: _storage._shadowColor, fieldNumber: 13) + } + if !_storage._strokeColor.isEmpty { + try visitor.visitSingularStringField(value: _storage._strokeColor, fieldNumber: 14) + } + if _storage._strokeWidth != 0 { + try visitor.visitSingularUInt32Field(value: _storage._strokeWidth, fieldNumber: 15) + } + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Douyin_TextEffectDetail, rhs: Douyin_TextEffectDetail) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._text != rhs_storage._text {return false} + if _storage._textFontSize != rhs_storage._textFontSize {return false} + if _storage._background != rhs_storage._background {return false} + if _storage._start != rhs_storage._start {return false} + if _storage._duration != rhs_storage._duration {return false} + if _storage._x != rhs_storage._x {return false} + if _storage._y != rhs_storage._y {return false} + if _storage._width != rhs_storage._width {return false} + if _storage._height != rhs_storage._height {return false} + if _storage._shadowDx != rhs_storage._shadowDx {return false} + if _storage._shadowDy != rhs_storage._shadowDy {return false} + if _storage._shadowRadius != rhs_storage._shadowRadius {return false} + if _storage._shadowColor != rhs_storage._shadowColor {return false} + if _storage._strokeColor != rhs_storage._strokeColor {return false} + if _storage._strokeWidth != rhs_storage._strokeWidth {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } -extension Common: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = "Common" +extension Douyin_MemberMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".MemberMessage" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "method"), - 2: .same(proto: "msgId"), - 3: .same(proto: "roomId"), - 4: .same(proto: "createTime"), - 5: .same(proto: "monitor"), - 6: .same(proto: "isShowMsg"), - 7: .same(proto: "describe"), - 8: .same(proto: "displayText"), - 9: .same(proto: "foldType"), - 10: .same(proto: "anchorFoldType"), - 11: .same(proto: "priorityScore"), - 12: .same(proto: "logId"), - 13: .same(proto: "msgProcessFilterK"), - 14: .same(proto: "msgProcessFilterV"), - 15: .same(proto: "user"), - 16: .same(proto: "room"), - 17: .same(proto: "anchorFoldTypeV2"), - 18: .same(proto: "processAtSeiTimeMs"), + 1: .same(proto: "common"), + 2: .same(proto: "user"), + 3: .same(proto: "memberCount"), + 4: .same(proto: "operator"), + 5: .same(proto: "isSetToAdmin"), + 6: .same(proto: "isTopUser"), + 7: .same(proto: "rankScore"), + 8: .same(proto: "topUserNo"), + 9: .same(proto: "enterType"), + 10: .same(proto: "action"), + 11: .same(proto: "actionDescription"), + 12: .same(proto: "userId"), + 13: .same(proto: "effectConfig"), + 14: .same(proto: "popStr"), + 15: .same(proto: "enterEffectConfig"), + 16: .same(proto: "backgroundImage"), + 17: .same(proto: "backgroundImageV2"), + 18: .same(proto: "anchorDisplayText"), + 19: .same(proto: "publicAreaCommon"), + 20: .same(proto: "userEnterTipType"), + 21: .same(proto: "anchorEnterTipType"), ] fileprivate class _StorageClass { - var _method: String = String() - var _msgID: Int64 = 0 - var _roomID: Int64 = 0 - var _createTime: Int64 = 0 - var _monitor: Int32 = 0 - var _isShowMsg: Bool = false - var _describe: String = String() - var _displayText: Text? = nil - var _foldType: Int64 = 0 - var _anchorFoldType: Int64 = 0 - var _priorityScore: Int64 = 0 - var _logID: String = String() - var _msgProcessFilterK: String = String() - var _msgProcessFilterV: String = String() - var _user: User? = nil - var _room: Room? = nil - var _anchorFoldTypeV2: Int64 = 0 - var _processAtSeiTimeMs: Int64 = 0 - - static let defaultInstance = _StorageClass() - - private init() {} - - init(copying source: _StorageClass) { - _method = source._method - _msgID = source._msgID - _roomID = source._roomID - _createTime = source._createTime - _monitor = source._monitor - _isShowMsg = source._isShowMsg - _describe = source._describe - _displayText = source._displayText - _foldType = source._foldType - _anchorFoldType = source._anchorFoldType - _priorityScore = source._priorityScore - _logID = source._logID - _msgProcessFilterK = source._msgProcessFilterK - _msgProcessFilterV = source._msgProcessFilterV - _user = source._user - _room = source._room - _anchorFoldTypeV2 = source._anchorFoldTypeV2 - _processAtSeiTimeMs = source._processAtSeiTimeMs - } + var _common: Douyin_Common? = nil + var _user: Douyin_User? = nil + var _memberCount: UInt64 = 0 + var _operator: Douyin_User? = nil + var _isSetToAdmin: Bool = false + var _isTopUser: Bool = false + var _rankScore: UInt64 = 0 + var _topUserNo: UInt64 = 0 + var _enterType: UInt64 = 0 + var _action: UInt64 = 0 + var _actionDescription: String = String() + var _userID: UInt64 = 0 + var _effectConfig: Douyin_EffectConfig? = nil + var _popStr: String = String() + var _enterEffectConfig: Douyin_EffectConfig? = nil + var _backgroundImage: Douyin_Image? = nil + var _backgroundImageV2: Douyin_Image? = nil + var _anchorDisplayText: Douyin_Text? = nil + var _publicAreaCommon: Douyin_PublicAreaCommon? = nil + var _userEnterTipType: UInt64 = 0 + var _anchorEnterTipType: UInt64 = 0 + + #if swift(>=5.10) + // This property is used as the initial default value for new instances of the type. + // The type itself is protecting the reference to its storage via CoW semantics. + // This will force a copy to be made of this reference when the first mutation occurs; + // hence, it is safe to mark this as `nonisolated(unsafe)`. + static nonisolated(unsafe) let defaultInstance = _StorageClass() + #else + static let defaultInstance = _StorageClass() + #endif + + private init() {} + + init(copying source: _StorageClass) { + _common = source._common + _user = source._user + _memberCount = source._memberCount + _operator = source._operator + _isSetToAdmin = source._isSetToAdmin + _isTopUser = source._isTopUser + _rankScore = source._rankScore + _topUserNo = source._topUserNo + _enterType = source._enterType + _action = source._action + _actionDescription = source._actionDescription + _userID = source._userID + _effectConfig = source._effectConfig + _popStr = source._popStr + _enterEffectConfig = source._enterEffectConfig + _backgroundImage = source._backgroundImage + _backgroundImageV2 = source._backgroundImageV2 + _anchorDisplayText = source._anchorDisplayText + _publicAreaCommon = source._publicAreaCommon + _userEnterTipType = source._userEnterTipType + _anchorEnterTipType = source._anchorEnterTipType + } } fileprivate mutating func _uniqueStorage() -> _StorageClass { - if !isKnownUniquelyReferenced(&_storage) { - _storage = _StorageClass(copying: _storage) - } - return _storage + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage } mutating func decodeMessage(decoder: inout D) throws { - _ = _uniqueStorage() - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &_storage._method) }() - case 2: try { try decoder.decodeSingularInt64Field(value: &_storage._msgID) }() - case 3: try { try decoder.decodeSingularInt64Field(value: &_storage._roomID) }() - case 4: try { try decoder.decodeSingularInt64Field(value: &_storage._createTime) }() - case 5: try { try decoder.decodeSingularInt32Field(value: &_storage._monitor) }() - case 6: try { try decoder.decodeSingularBoolField(value: &_storage._isShowMsg) }() - case 7: try { try decoder.decodeSingularStringField(value: &_storage._describe) }() - case 8: try { try decoder.decodeSingularMessageField(value: &_storage._displayText) }() - case 9: try { try decoder.decodeSingularInt64Field(value: &_storage._foldType) }() - case 10: try { try decoder.decodeSingularInt64Field(value: &_storage._anchorFoldType) }() - case 11: try { try decoder.decodeSingularInt64Field(value: &_storage._priorityScore) }() - case 12: try { try decoder.decodeSingularStringField(value: &_storage._logID) }() - case 13: try { try decoder.decodeSingularStringField(value: &_storage._msgProcessFilterK) }() - case 14: try { try decoder.decodeSingularStringField(value: &_storage._msgProcessFilterV) }() - case 15: try { try decoder.decodeSingularMessageField(value: &_storage._user) }() - case 16: try { try decoder.decodeSingularMessageField(value: &_storage._room) }() - case 17: try { try decoder.decodeSingularInt64Field(value: &_storage._anchorFoldTypeV2) }() - case 18: try { try decoder.decodeSingularInt64Field(value: &_storage._processAtSeiTimeMs) }() - default: break - } - } - } + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &_storage._common) }() + case 2: try { try decoder.decodeSingularMessageField(value: &_storage._user) }() + case 3: try { try decoder.decodeSingularUInt64Field(value: &_storage._memberCount) }() + case 4: try { try decoder.decodeSingularMessageField(value: &_storage._operator) }() + case 5: try { try decoder.decodeSingularBoolField(value: &_storage._isSetToAdmin) }() + case 6: try { try decoder.decodeSingularBoolField(value: &_storage._isTopUser) }() + case 7: try { try decoder.decodeSingularUInt64Field(value: &_storage._rankScore) }() + case 8: try { try decoder.decodeSingularUInt64Field(value: &_storage._topUserNo) }() + case 9: try { try decoder.decodeSingularUInt64Field(value: &_storage._enterType) }() + case 10: try { try decoder.decodeSingularUInt64Field(value: &_storage._action) }() + case 11: try { try decoder.decodeSingularStringField(value: &_storage._actionDescription) }() + case 12: try { try decoder.decodeSingularUInt64Field(value: &_storage._userID) }() + case 13: try { try decoder.decodeSingularMessageField(value: &_storage._effectConfig) }() + case 14: try { try decoder.decodeSingularStringField(value: &_storage._popStr) }() + case 15: try { try decoder.decodeSingularMessageField(value: &_storage._enterEffectConfig) }() + case 16: try { try decoder.decodeSingularMessageField(value: &_storage._backgroundImage) }() + case 17: try { try decoder.decodeSingularMessageField(value: &_storage._backgroundImageV2) }() + case 18: try { try decoder.decodeSingularMessageField(value: &_storage._anchorDisplayText) }() + case 19: try { try decoder.decodeSingularMessageField(value: &_storage._publicAreaCommon) }() + case 20: try { try decoder.decodeSingularUInt64Field(value: &_storage._userEnterTipType) }() + case 21: try { try decoder.decodeSingularUInt64Field(value: &_storage._anchorEnterTipType) }() + default: break + } + } + } } func traverse(visitor: inout V) throws { - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if !_storage._method.isEmpty { - try visitor.visitSingularStringField(value: _storage._method, fieldNumber: 1) - } - if _storage._msgID != 0 { - try visitor.visitSingularInt64Field(value: _storage._msgID, fieldNumber: 2) - } - if _storage._roomID != 0 { - try visitor.visitSingularInt64Field(value: _storage._roomID, fieldNumber: 3) - } - if _storage._createTime != 0 { - try visitor.visitSingularInt64Field(value: _storage._createTime, fieldNumber: 4) - } - if _storage._monitor != 0 { - try visitor.visitSingularInt32Field(value: _storage._monitor, fieldNumber: 5) - } - if _storage._isShowMsg != false { - try visitor.visitSingularBoolField(value: _storage._isShowMsg, fieldNumber: 6) - } - if !_storage._describe.isEmpty { - try visitor.visitSingularStringField(value: _storage._describe, fieldNumber: 7) - } - try { if let v = _storage._displayText { - try visitor.visitSingularMessageField(value: v, fieldNumber: 8) - } }() - if _storage._foldType != 0 { - try visitor.visitSingularInt64Field(value: _storage._foldType, fieldNumber: 9) - } - if _storage._anchorFoldType != 0 { - try visitor.visitSingularInt64Field(value: _storage._anchorFoldType, fieldNumber: 10) - } - if _storage._priorityScore != 0 { - try visitor.visitSingularInt64Field(value: _storage._priorityScore, fieldNumber: 11) - } - if !_storage._logID.isEmpty { - try visitor.visitSingularStringField(value: _storage._logID, fieldNumber: 12) - } - if !_storage._msgProcessFilterK.isEmpty { - try visitor.visitSingularStringField(value: _storage._msgProcessFilterK, fieldNumber: 13) - } - if !_storage._msgProcessFilterV.isEmpty { - try visitor.visitSingularStringField(value: _storage._msgProcessFilterV, fieldNumber: 14) - } - try { if let v = _storage._user { - try visitor.visitSingularMessageField(value: v, fieldNumber: 15) - } }() - try { if let v = _storage._room { - try visitor.visitSingularMessageField(value: v, fieldNumber: 16) - } }() - if _storage._anchorFoldTypeV2 != 0 { - try visitor.visitSingularInt64Field(value: _storage._anchorFoldTypeV2, fieldNumber: 17) - } - if _storage._processAtSeiTimeMs != 0 { - try visitor.visitSingularInt64Field(value: _storage._processAtSeiTimeMs, fieldNumber: 18) - } - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Common, rhs: Common) -> Bool { - if lhs._storage !== rhs._storage { - let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in - let _storage = _args.0 - let rhs_storage = _args.1 - if _storage._method != rhs_storage._method {return false} - if _storage._msgID != rhs_storage._msgID {return false} - if _storage._roomID != rhs_storage._roomID {return false} - if _storage._createTime != rhs_storage._createTime {return false} - if _storage._monitor != rhs_storage._monitor {return false} - if _storage._isShowMsg != rhs_storage._isShowMsg {return false} - if _storage._describe != rhs_storage._describe {return false} - if _storage._displayText != rhs_storage._displayText {return false} - if _storage._foldType != rhs_storage._foldType {return false} - if _storage._anchorFoldType != rhs_storage._anchorFoldType {return false} - if _storage._priorityScore != rhs_storage._priorityScore {return false} - if _storage._logID != rhs_storage._logID {return false} - if _storage._msgProcessFilterK != rhs_storage._msgProcessFilterK {return false} - if _storage._msgProcessFilterV != rhs_storage._msgProcessFilterV {return false} - if _storage._user != rhs_storage._user {return false} - if _storage._room != rhs_storage._room {return false} - if _storage._anchorFoldTypeV2 != rhs_storage._anchorFoldTypeV2 {return false} - if _storage._processAtSeiTimeMs != rhs_storage._processAtSeiTimeMs {return false} - return true - } - if !storagesAreEqual {return false} - } - if lhs.unknownFields != rhs.unknownFields {return false} - return true + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = _storage._common { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try { if let v = _storage._user { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + if _storage._memberCount != 0 { + try visitor.visitSingularUInt64Field(value: _storage._memberCount, fieldNumber: 3) + } + try { if let v = _storage._operator { + try visitor.visitSingularMessageField(value: v, fieldNumber: 4) + } }() + if _storage._isSetToAdmin != false { + try visitor.visitSingularBoolField(value: _storage._isSetToAdmin, fieldNumber: 5) + } + if _storage._isTopUser != false { + try visitor.visitSingularBoolField(value: _storage._isTopUser, fieldNumber: 6) + } + if _storage._rankScore != 0 { + try visitor.visitSingularUInt64Field(value: _storage._rankScore, fieldNumber: 7) + } + if _storage._topUserNo != 0 { + try visitor.visitSingularUInt64Field(value: _storage._topUserNo, fieldNumber: 8) + } + if _storage._enterType != 0 { + try visitor.visitSingularUInt64Field(value: _storage._enterType, fieldNumber: 9) + } + if _storage._action != 0 { + try visitor.visitSingularUInt64Field(value: _storage._action, fieldNumber: 10) + } + if !_storage._actionDescription.isEmpty { + try visitor.visitSingularStringField(value: _storage._actionDescription, fieldNumber: 11) + } + if _storage._userID != 0 { + try visitor.visitSingularUInt64Field(value: _storage._userID, fieldNumber: 12) + } + try { if let v = _storage._effectConfig { + try visitor.visitSingularMessageField(value: v, fieldNumber: 13) + } }() + if !_storage._popStr.isEmpty { + try visitor.visitSingularStringField(value: _storage._popStr, fieldNumber: 14) + } + try { if let v = _storage._enterEffectConfig { + try visitor.visitSingularMessageField(value: v, fieldNumber: 15) + } }() + try { if let v = _storage._backgroundImage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 16) + } }() + try { if let v = _storage._backgroundImageV2 { + try visitor.visitSingularMessageField(value: v, fieldNumber: 17) + } }() + try { if let v = _storage._anchorDisplayText { + try visitor.visitSingularMessageField(value: v, fieldNumber: 18) + } }() + try { if let v = _storage._publicAreaCommon { + try visitor.visitSingularMessageField(value: v, fieldNumber: 19) + } }() + if _storage._userEnterTipType != 0 { + try visitor.visitSingularUInt64Field(value: _storage._userEnterTipType, fieldNumber: 20) + } + if _storage._anchorEnterTipType != 0 { + try visitor.visitSingularUInt64Field(value: _storage._anchorEnterTipType, fieldNumber: 21) + } + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Douyin_MemberMessage, rhs: Douyin_MemberMessage) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._common != rhs_storage._common {return false} + if _storage._user != rhs_storage._user {return false} + if _storage._memberCount != rhs_storage._memberCount {return false} + if _storage._operator != rhs_storage._operator {return false} + if _storage._isSetToAdmin != rhs_storage._isSetToAdmin {return false} + if _storage._isTopUser != rhs_storage._isTopUser {return false} + if _storage._rankScore != rhs_storage._rankScore {return false} + if _storage._topUserNo != rhs_storage._topUserNo {return false} + if _storage._enterType != rhs_storage._enterType {return false} + if _storage._action != rhs_storage._action {return false} + if _storage._actionDescription != rhs_storage._actionDescription {return false} + if _storage._userID != rhs_storage._userID {return false} + if _storage._effectConfig != rhs_storage._effectConfig {return false} + if _storage._popStr != rhs_storage._popStr {return false} + if _storage._enterEffectConfig != rhs_storage._enterEffectConfig {return false} + if _storage._backgroundImage != rhs_storage._backgroundImage {return false} + if _storage._backgroundImageV2 != rhs_storage._backgroundImageV2 {return false} + if _storage._anchorDisplayText != rhs_storage._anchorDisplayText {return false} + if _storage._publicAreaCommon != rhs_storage._publicAreaCommon {return false} + if _storage._userEnterTipType != rhs_storage._userEnterTipType {return false} + if _storage._anchorEnterTipType != rhs_storage._anchorEnterTipType {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } -extension Text: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = "Text" +extension Douyin_PublicAreaCommon: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PublicAreaCommon" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "key"), - 2: .same(proto: "defaultPattern"), - 3: .same(proto: "defaultFormat"), - 4: .same(proto: "pieces"), + 1: .same(proto: "userLabel"), + 2: .same(proto: "userConsumeInRoom"), + 3: .same(proto: "userSendGiftCntInRoom"), ] mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.key) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.defaultPattern) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._defaultFormat) }() - case 4: try { try decoder.decodeRepeatedMessageField(value: &self.pieces) }() - default: break - } - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._userLabel) }() + case 2: try { try decoder.decodeSingularUInt64Field(value: &self.userConsumeInRoom) }() + case 3: try { try decoder.decodeSingularUInt64Field(value: &self.userSendGiftCntInRoom) }() + default: break + } + } } func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if !self.key.isEmpty { - try visitor.visitSingularStringField(value: self.key, fieldNumber: 1) - } - if !self.defaultPattern.isEmpty { - try visitor.visitSingularStringField(value: self.defaultPattern, fieldNumber: 2) - } - try { if let v = self._defaultFormat { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - if !self.pieces.isEmpty { - try visitor.visitRepeatedMessageField(value: self.pieces, fieldNumber: 4) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Text, rhs: Text) -> Bool { - if lhs.key != rhs.key {return false} - if lhs.defaultPattern != rhs.defaultPattern {return false} - if lhs._defaultFormat != rhs._defaultFormat {return false} - if lhs.pieces != rhs.pieces {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._userLabel { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + if self.userConsumeInRoom != 0 { + try visitor.visitSingularUInt64Field(value: self.userConsumeInRoom, fieldNumber: 2) + } + if self.userSendGiftCntInRoom != 0 { + try visitor.visitSingularUInt64Field(value: self.userSendGiftCntInRoom, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Douyin_PublicAreaCommon, rhs: Douyin_PublicAreaCommon) -> Bool { + if lhs._userLabel != rhs._userLabel {return false} + if lhs.userConsumeInRoom != rhs.userConsumeInRoom {return false} + if lhs.userSendGiftCntInRoom != rhs.userSendGiftCntInRoom {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } -extension Room: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = "Room" +extension Douyin_EffectConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".EffectConfig" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "id"), - 2: .same(proto: "idStr"), - 3: .same(proto: "status"), - 4: .same(proto: "ownerUserId"), - 5: .same(proto: "title"), - 6: .same(proto: "userCount"), - 7: .same(proto: "createTime"), - 8: .same(proto: "linkmicLayout"), - 9: .same(proto: "finishTime"), - 10: .same(proto: "extra"), - 11: .same(proto: "dynamicCoverUri"), - 12: .same(proto: "dynamicCoverDict"), - 13: .same(proto: "lastPingTime"), - 14: .same(proto: "liveId"), - 15: .same(proto: "streamProvider"), - 16: .same(proto: "osType"), - 17: .same(proto: "clientVersion"), - 18: .same(proto: "withLinkmic"), - 19: .same(proto: "enableRoomPerspective"), - 20: .same(proto: "cover"), - 21: .same(proto: "dynamicCover"), - 22: .same(proto: "dynamicCoverLow"), - 23: .same(proto: "shareUrl"), - 24: .same(proto: "anchorShareText"), - 25: .same(proto: "userShareText"), - 26: .same(proto: "streamId"), - 27: .same(proto: "streamIdStr"), - 28: .same(proto: "streamUrl"), - 29: .same(proto: "mosaicStatus"), - 30: .same(proto: "mosaicTip"), - 31: .same(proto: "cellStyle"), - 32: .same(proto: "linkMic"), - 33: .same(proto: "luckymoneyNum"), - 34: .same(proto: "decoList"), - 35: .same(proto: "topFans"), - 36: .same(proto: "stats"), - 37: .same(proto: "sunDailyIconContent"), - 38: .same(proto: "distance"), - 39: .same(proto: "distanceCity"), - 40: .same(proto: "location"), - 41: .same(proto: "realDistance"), - 42: .same(proto: "feedRoomLabel"), - 43: .same(proto: "commonLabelList"), - 44: .same(proto: "livingRoomAttrs"), - 45: .same(proto: "adminUserIds"), - 46: .same(proto: "owner"), - 47: .same(proto: "privateInfo"), + 1: .same(proto: "type"), + 2: .same(proto: "icon"), + 3: .same(proto: "avatarPos"), + 4: .same(proto: "text"), + 5: .same(proto: "textIcon"), + 6: .same(proto: "stayTime"), + 7: .same(proto: "animAssetId"), + 8: .same(proto: "badge"), + 9: .same(proto: "flexSettingArrayList"), + 10: .same(proto: "textIconOverlay"), + 11: .same(proto: "animatedBadge"), + 12: .same(proto: "hasSweepLight"), + 13: .same(proto: "textFlexSettingArrayList"), + 14: .same(proto: "centerAnimAssetId"), + 15: .same(proto: "dynamicImage"), + 16: .same(proto: "extraMap"), + 17: .same(proto: "mp4AnimAssetId"), + 18: .same(proto: "priority"), + 19: .same(proto: "maxWaitTime"), + 20: .same(proto: "dressId"), + 21: .same(proto: "alignment"), + 22: .same(proto: "alignmentOffset"), ] fileprivate class _StorageClass { - var _id: Int64 = 0 - var _idStr: String = String() - var _status: Int64 = 0 - var _ownerUserID: Int64 = 0 - var _title: String = String() - var _userCount: Int64 = 0 - var _createTime: Int64 = 0 - var _linkmicLayout: Int64 = 0 - var _finishTime: Int64 = 0 - var _extra: RoomExtra? = nil - var _dynamicCoverUri: String = String() - var _dynamicCoverDict: Dictionary = [:] - var _lastPingTime: Int64 = 0 - var _liveID: Int64 = 0 - var _streamProvider: Int64 = 0 - var _osType: Int64 = 0 - var _clientVersion: Int64 = 0 - var _withLinkmic: Bool = false - var _enableRoomPerspective: Bool = false - var _cover: Image? = nil - var _dynamicCover: Image? = nil - var _dynamicCoverLow: Image? = nil - var _shareURL: String = String() - var _anchorShareText: String = String() - var _userShareText: String = String() - var _streamID: Int64 = 0 - var _streamIDStr: String = String() - var _streamURL: StreamUrl? = nil - var _mosaicStatus: Int64 = 0 - var _mosaicTip: String = String() - var _cellStyle: Int64 = 0 - var _linkMic: LinkMic? = nil - var _luckymoneyNum: Int64 = 0 - var _decoList: [Decoration] = [] - var _topFans: [TopFan] = [] - var _stats: RoomStats? = nil - var _sunDailyIconContent: String = String() - var _distance: String = String() - var _distanceCity: String = String() - var _location: String = String() - var _realDistance: String = String() - var _feedRoomLabel: Image? = nil - var _commonLabelList: String = String() - var _livingRoomAttrs: RoomUserAttr? = nil - var _adminUserIds: [Int64] = [] - var _owner: User? = nil - var _privateInfo: String = String() - - static let defaultInstance = _StorageClass() - - private init() {} - - init(copying source: _StorageClass) { - _id = source._id - _idStr = source._idStr - _status = source._status - _ownerUserID = source._ownerUserID - _title = source._title - _userCount = source._userCount - _createTime = source._createTime - _linkmicLayout = source._linkmicLayout - _finishTime = source._finishTime - _extra = source._extra - _dynamicCoverUri = source._dynamicCoverUri - _dynamicCoverDict = source._dynamicCoverDict - _lastPingTime = source._lastPingTime - _liveID = source._liveID - _streamProvider = source._streamProvider - _osType = source._osType - _clientVersion = source._clientVersion - _withLinkmic = source._withLinkmic - _enableRoomPerspective = source._enableRoomPerspective - _cover = source._cover - _dynamicCover = source._dynamicCover - _dynamicCoverLow = source._dynamicCoverLow - _shareURL = source._shareURL - _anchorShareText = source._anchorShareText - _userShareText = source._userShareText - _streamID = source._streamID - _streamIDStr = source._streamIDStr - _streamURL = source._streamURL - _mosaicStatus = source._mosaicStatus - _mosaicTip = source._mosaicTip - _cellStyle = source._cellStyle - _linkMic = source._linkMic - _luckymoneyNum = source._luckymoneyNum - _decoList = source._decoList - _topFans = source._topFans - _stats = source._stats - _sunDailyIconContent = source._sunDailyIconContent - _distance = source._distance - _distanceCity = source._distanceCity - _location = source._location - _realDistance = source._realDistance - _feedRoomLabel = source._feedRoomLabel - _commonLabelList = source._commonLabelList - _livingRoomAttrs = source._livingRoomAttrs - _adminUserIds = source._adminUserIds - _owner = source._owner - _privateInfo = source._privateInfo - } + var _type: UInt64 = 0 + var _icon: Douyin_Image? = nil + var _avatarPos: UInt64 = 0 + var _text: Douyin_Text? = nil + var _textIcon: Douyin_Image? = nil + var _stayTime: UInt32 = 0 + var _animAssetID: UInt64 = 0 + var _badge: Douyin_Image? = nil + var _flexSettingArrayList: [UInt64] = [] + var _textIconOverlay: Douyin_Image? = nil + var _animatedBadge: Douyin_Image? = nil + var _hasSweepLight_p: Bool = false + var _textFlexSettingArrayList: [UInt64] = [] + var _centerAnimAssetID: UInt64 = 0 + var _dynamicImage: Douyin_Image? = nil + var _extraMap: Dictionary = [:] + var _mp4AnimAssetID: UInt64 = 0 + var _priority: UInt64 = 0 + var _maxWaitTime: UInt64 = 0 + var _dressID: String = String() + var _alignment: UInt64 = 0 + var _alignmentOffset: UInt64 = 0 + + #if swift(>=5.10) + // This property is used as the initial default value for new instances of the type. + // The type itself is protecting the reference to its storage via CoW semantics. + // This will force a copy to be made of this reference when the first mutation occurs; + // hence, it is safe to mark this as `nonisolated(unsafe)`. + static nonisolated(unsafe) let defaultInstance = _StorageClass() + #else + static let defaultInstance = _StorageClass() + #endif + + private init() {} + + init(copying source: _StorageClass) { + _type = source._type + _icon = source._icon + _avatarPos = source._avatarPos + _text = source._text + _textIcon = source._textIcon + _stayTime = source._stayTime + _animAssetID = source._animAssetID + _badge = source._badge + _flexSettingArrayList = source._flexSettingArrayList + _textIconOverlay = source._textIconOverlay + _animatedBadge = source._animatedBadge + _hasSweepLight_p = source._hasSweepLight_p + _textFlexSettingArrayList = source._textFlexSettingArrayList + _centerAnimAssetID = source._centerAnimAssetID + _dynamicImage = source._dynamicImage + _extraMap = source._extraMap + _mp4AnimAssetID = source._mp4AnimAssetID + _priority = source._priority + _maxWaitTime = source._maxWaitTime + _dressID = source._dressID + _alignment = source._alignment + _alignmentOffset = source._alignmentOffset + } } fileprivate mutating func _uniqueStorage() -> _StorageClass { - if !isKnownUniquelyReferenced(&_storage) { - _storage = _StorageClass(copying: _storage) - } - return _storage - } - - mutating func decodeMessage(decoder: inout D) throws { - _ = _uniqueStorage() - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularInt64Field(value: &_storage._id) }() - case 2: try { try decoder.decodeSingularStringField(value: &_storage._idStr) }() - case 3: try { try decoder.decodeSingularInt64Field(value: &_storage._status) }() - case 4: try { try decoder.decodeSingularInt64Field(value: &_storage._ownerUserID) }() - case 5: try { try decoder.decodeSingularStringField(value: &_storage._title) }() - case 6: try { try decoder.decodeSingularInt64Field(value: &_storage._userCount) }() - case 7: try { try decoder.decodeSingularInt64Field(value: &_storage._createTime) }() - case 8: try { try decoder.decodeSingularInt64Field(value: &_storage._linkmicLayout) }() - case 9: try { try decoder.decodeSingularInt64Field(value: &_storage._finishTime) }() - case 10: try { try decoder.decodeSingularMessageField(value: &_storage._extra) }() - case 11: try { try decoder.decodeSingularStringField(value: &_storage._dynamicCoverUri) }() - case 12: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._dynamicCoverDict) }() - case 13: try { try decoder.decodeSingularInt64Field(value: &_storage._lastPingTime) }() - case 14: try { try decoder.decodeSingularInt64Field(value: &_storage._liveID) }() - case 15: try { try decoder.decodeSingularInt64Field(value: &_storage._streamProvider) }() - case 16: try { try decoder.decodeSingularInt64Field(value: &_storage._osType) }() - case 17: try { try decoder.decodeSingularInt64Field(value: &_storage._clientVersion) }() - case 18: try { try decoder.decodeSingularBoolField(value: &_storage._withLinkmic) }() - case 19: try { try decoder.decodeSingularBoolField(value: &_storage._enableRoomPerspective) }() - case 20: try { try decoder.decodeSingularMessageField(value: &_storage._cover) }() - case 21: try { try decoder.decodeSingularMessageField(value: &_storage._dynamicCover) }() - case 22: try { try decoder.decodeSingularMessageField(value: &_storage._dynamicCoverLow) }() - case 23: try { try decoder.decodeSingularStringField(value: &_storage._shareURL) }() - case 24: try { try decoder.decodeSingularStringField(value: &_storage._anchorShareText) }() - case 25: try { try decoder.decodeSingularStringField(value: &_storage._userShareText) }() - case 26: try { try decoder.decodeSingularInt64Field(value: &_storage._streamID) }() - case 27: try { try decoder.decodeSingularStringField(value: &_storage._streamIDStr) }() - case 28: try { try decoder.decodeSingularMessageField(value: &_storage._streamURL) }() - case 29: try { try decoder.decodeSingularInt64Field(value: &_storage._mosaicStatus) }() - case 30: try { try decoder.decodeSingularStringField(value: &_storage._mosaicTip) }() - case 31: try { try decoder.decodeSingularInt64Field(value: &_storage._cellStyle) }() - case 32: try { try decoder.decodeSingularMessageField(value: &_storage._linkMic) }() - case 33: try { try decoder.decodeSingularInt64Field(value: &_storage._luckymoneyNum) }() - case 34: try { try decoder.decodeRepeatedMessageField(value: &_storage._decoList) }() - case 35: try { try decoder.decodeRepeatedMessageField(value: &_storage._topFans) }() - case 36: try { try decoder.decodeSingularMessageField(value: &_storage._stats) }() - case 37: try { try decoder.decodeSingularStringField(value: &_storage._sunDailyIconContent) }() - case 38: try { try decoder.decodeSingularStringField(value: &_storage._distance) }() - case 39: try { try decoder.decodeSingularStringField(value: &_storage._distanceCity) }() - case 40: try { try decoder.decodeSingularStringField(value: &_storage._location) }() - case 41: try { try decoder.decodeSingularStringField(value: &_storage._realDistance) }() - case 42: try { try decoder.decodeSingularMessageField(value: &_storage._feedRoomLabel) }() - case 43: try { try decoder.decodeSingularStringField(value: &_storage._commonLabelList) }() - case 44: try { try decoder.decodeSingularMessageField(value: &_storage._livingRoomAttrs) }() - case 45: try { try decoder.decodeRepeatedInt64Field(value: &_storage._adminUserIds) }() - case 46: try { try decoder.decodeSingularMessageField(value: &_storage._owner) }() - case 47: try { try decoder.decodeSingularStringField(value: &_storage._privateInfo) }() - default: break - } - } - } - } - - func traverse(visitor: inout V) throws { - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if _storage._id != 0 { - try visitor.visitSingularInt64Field(value: _storage._id, fieldNumber: 1) - } - if !_storage._idStr.isEmpty { - try visitor.visitSingularStringField(value: _storage._idStr, fieldNumber: 2) - } - if _storage._status != 0 { - try visitor.visitSingularInt64Field(value: _storage._status, fieldNumber: 3) - } - if _storage._ownerUserID != 0 { - try visitor.visitSingularInt64Field(value: _storage._ownerUserID, fieldNumber: 4) - } - if !_storage._title.isEmpty { - try visitor.visitSingularStringField(value: _storage._title, fieldNumber: 5) - } - if _storage._userCount != 0 { - try visitor.visitSingularInt64Field(value: _storage._userCount, fieldNumber: 6) - } - if _storage._createTime != 0 { - try visitor.visitSingularInt64Field(value: _storage._createTime, fieldNumber: 7) - } - if _storage._linkmicLayout != 0 { - try visitor.visitSingularInt64Field(value: _storage._linkmicLayout, fieldNumber: 8) - } - if _storage._finishTime != 0 { - try visitor.visitSingularInt64Field(value: _storage._finishTime, fieldNumber: 9) - } - try { if let v = _storage._extra { - try visitor.visitSingularMessageField(value: v, fieldNumber: 10) - } }() - if !_storage._dynamicCoverUri.isEmpty { - try visitor.visitSingularStringField(value: _storage._dynamicCoverUri, fieldNumber: 11) - } - if !_storage._dynamicCoverDict.isEmpty { - try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._dynamicCoverDict, fieldNumber: 12) - } - if _storage._lastPingTime != 0 { - try visitor.visitSingularInt64Field(value: _storage._lastPingTime, fieldNumber: 13) - } - if _storage._liveID != 0 { - try visitor.visitSingularInt64Field(value: _storage._liveID, fieldNumber: 14) - } - if _storage._streamProvider != 0 { - try visitor.visitSingularInt64Field(value: _storage._streamProvider, fieldNumber: 15) - } - if _storage._osType != 0 { - try visitor.visitSingularInt64Field(value: _storage._osType, fieldNumber: 16) - } - if _storage._clientVersion != 0 { - try visitor.visitSingularInt64Field(value: _storage._clientVersion, fieldNumber: 17) - } - if _storage._withLinkmic != false { - try visitor.visitSingularBoolField(value: _storage._withLinkmic, fieldNumber: 18) - } - if _storage._enableRoomPerspective != false { - try visitor.visitSingularBoolField(value: _storage._enableRoomPerspective, fieldNumber: 19) - } - try { if let v = _storage._cover { - try visitor.visitSingularMessageField(value: v, fieldNumber: 20) - } }() - try { if let v = _storage._dynamicCover { - try visitor.visitSingularMessageField(value: v, fieldNumber: 21) - } }() - try { if let v = _storage._dynamicCoverLow { - try visitor.visitSingularMessageField(value: v, fieldNumber: 22) - } }() - if !_storage._shareURL.isEmpty { - try visitor.visitSingularStringField(value: _storage._shareURL, fieldNumber: 23) - } - if !_storage._anchorShareText.isEmpty { - try visitor.visitSingularStringField(value: _storage._anchorShareText, fieldNumber: 24) - } - if !_storage._userShareText.isEmpty { - try visitor.visitSingularStringField(value: _storage._userShareText, fieldNumber: 25) - } - if _storage._streamID != 0 { - try visitor.visitSingularInt64Field(value: _storage._streamID, fieldNumber: 26) - } - if !_storage._streamIDStr.isEmpty { - try visitor.visitSingularStringField(value: _storage._streamIDStr, fieldNumber: 27) - } - try { if let v = _storage._streamURL { - try visitor.visitSingularMessageField(value: v, fieldNumber: 28) - } }() - if _storage._mosaicStatus != 0 { - try visitor.visitSingularInt64Field(value: _storage._mosaicStatus, fieldNumber: 29) - } - if !_storage._mosaicTip.isEmpty { - try visitor.visitSingularStringField(value: _storage._mosaicTip, fieldNumber: 30) - } - if _storage._cellStyle != 0 { - try visitor.visitSingularInt64Field(value: _storage._cellStyle, fieldNumber: 31) - } - try { if let v = _storage._linkMic { - try visitor.visitSingularMessageField(value: v, fieldNumber: 32) - } }() - if _storage._luckymoneyNum != 0 { - try visitor.visitSingularInt64Field(value: _storage._luckymoneyNum, fieldNumber: 33) - } - if !_storage._decoList.isEmpty { - try visitor.visitRepeatedMessageField(value: _storage._decoList, fieldNumber: 34) - } - if !_storage._topFans.isEmpty { - try visitor.visitRepeatedMessageField(value: _storage._topFans, fieldNumber: 35) - } - try { if let v = _storage._stats { - try visitor.visitSingularMessageField(value: v, fieldNumber: 36) - } }() - if !_storage._sunDailyIconContent.isEmpty { - try visitor.visitSingularStringField(value: _storage._sunDailyIconContent, fieldNumber: 37) - } - if !_storage._distance.isEmpty { - try visitor.visitSingularStringField(value: _storage._distance, fieldNumber: 38) - } - if !_storage._distanceCity.isEmpty { - try visitor.visitSingularStringField(value: _storage._distanceCity, fieldNumber: 39) - } - if !_storage._location.isEmpty { - try visitor.visitSingularStringField(value: _storage._location, fieldNumber: 40) - } - if !_storage._realDistance.isEmpty { - try visitor.visitSingularStringField(value: _storage._realDistance, fieldNumber: 41) - } - try { if let v = _storage._feedRoomLabel { - try visitor.visitSingularMessageField(value: v, fieldNumber: 42) - } }() - if !_storage._commonLabelList.isEmpty { - try visitor.visitSingularStringField(value: _storage._commonLabelList, fieldNumber: 43) - } - try { if let v = _storage._livingRoomAttrs { - try visitor.visitSingularMessageField(value: v, fieldNumber: 44) - } }() - if !_storage._adminUserIds.isEmpty { - try visitor.visitPackedInt64Field(value: _storage._adminUserIds, fieldNumber: 45) - } - try { if let v = _storage._owner { - try visitor.visitSingularMessageField(value: v, fieldNumber: 46) - } }() - if !_storage._privateInfo.isEmpty { - try visitor.visitSingularStringField(value: _storage._privateInfo, fieldNumber: 47) - } - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Room, rhs: Room) -> Bool { - if lhs._storage !== rhs._storage { - let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in - let _storage = _args.0 - let rhs_storage = _args.1 - if _storage._id != rhs_storage._id {return false} - if _storage._idStr != rhs_storage._idStr {return false} - if _storage._status != rhs_storage._status {return false} - if _storage._ownerUserID != rhs_storage._ownerUserID {return false} - if _storage._title != rhs_storage._title {return false} - if _storage._userCount != rhs_storage._userCount {return false} - if _storage._createTime != rhs_storage._createTime {return false} - if _storage._linkmicLayout != rhs_storage._linkmicLayout {return false} - if _storage._finishTime != rhs_storage._finishTime {return false} - if _storage._extra != rhs_storage._extra {return false} - if _storage._dynamicCoverUri != rhs_storage._dynamicCoverUri {return false} - if _storage._dynamicCoverDict != rhs_storage._dynamicCoverDict {return false} - if _storage._lastPingTime != rhs_storage._lastPingTime {return false} - if _storage._liveID != rhs_storage._liveID {return false} - if _storage._streamProvider != rhs_storage._streamProvider {return false} - if _storage._osType != rhs_storage._osType {return false} - if _storage._clientVersion != rhs_storage._clientVersion {return false} - if _storage._withLinkmic != rhs_storage._withLinkmic {return false} - if _storage._enableRoomPerspective != rhs_storage._enableRoomPerspective {return false} - if _storage._cover != rhs_storage._cover {return false} - if _storage._dynamicCover != rhs_storage._dynamicCover {return false} - if _storage._dynamicCoverLow != rhs_storage._dynamicCoverLow {return false} - if _storage._shareURL != rhs_storage._shareURL {return false} - if _storage._anchorShareText != rhs_storage._anchorShareText {return false} - if _storage._userShareText != rhs_storage._userShareText {return false} - if _storage._streamID != rhs_storage._streamID {return false} - if _storage._streamIDStr != rhs_storage._streamIDStr {return false} - if _storage._streamURL != rhs_storage._streamURL {return false} - if _storage._mosaicStatus != rhs_storage._mosaicStatus {return false} - if _storage._mosaicTip != rhs_storage._mosaicTip {return false} - if _storage._cellStyle != rhs_storage._cellStyle {return false} - if _storage._linkMic != rhs_storage._linkMic {return false} - if _storage._luckymoneyNum != rhs_storage._luckymoneyNum {return false} - if _storage._decoList != rhs_storage._decoList {return false} - if _storage._topFans != rhs_storage._topFans {return false} - if _storage._stats != rhs_storage._stats {return false} - if _storage._sunDailyIconContent != rhs_storage._sunDailyIconContent {return false} - if _storage._distance != rhs_storage._distance {return false} - if _storage._distanceCity != rhs_storage._distanceCity {return false} - if _storage._location != rhs_storage._location {return false} - if _storage._realDistance != rhs_storage._realDistance {return false} - if _storage._feedRoomLabel != rhs_storage._feedRoomLabel {return false} - if _storage._commonLabelList != rhs_storage._commonLabelList {return false} - if _storage._livingRoomAttrs != rhs_storage._livingRoomAttrs {return false} - if _storage._adminUserIds != rhs_storage._adminUserIds {return false} - if _storage._owner != rhs_storage._owner {return false} - if _storage._privateInfo != rhs_storage._privateInfo {return false} - return true - } - if !storagesAreEqual {return false} - } - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension RoomExtra: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = "RoomExtra" - static let _protobuf_nameMap = SwiftProtobuf._NameMap() - - mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } - } - - func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: RoomExtra, rhs: RoomExtra) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension RoomStats: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = "RoomStats" - static let _protobuf_nameMap = SwiftProtobuf._NameMap() - - mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } - } - - func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: RoomStats, rhs: RoomStats) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension RoomUserAttr: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = "RoomUserAttr" - static let _protobuf_nameMap = SwiftProtobuf._NameMap() - - mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } - } - - func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: RoomUserAttr, rhs: RoomUserAttr) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension StreamUrl: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = "StreamUrl" - static let _protobuf_nameMap = SwiftProtobuf._NameMap() - - mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } - } - - func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: StreamUrl, rhs: StreamUrl) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension LinkMic: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = "LinkMic" - static let _protobuf_nameMap = SwiftProtobuf._NameMap() - - mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage } - func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: LinkMic, rhs: LinkMic) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Decoration: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = "Decoration" - static let _protobuf_nameMap = SwiftProtobuf._NameMap() - mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularUInt64Field(value: &_storage._type) }() + case 2: try { try decoder.decodeSingularMessageField(value: &_storage._icon) }() + case 3: try { try decoder.decodeSingularUInt64Field(value: &_storage._avatarPos) }() + case 4: try { try decoder.decodeSingularMessageField(value: &_storage._text) }() + case 5: try { try decoder.decodeSingularMessageField(value: &_storage._textIcon) }() + case 6: try { try decoder.decodeSingularUInt32Field(value: &_storage._stayTime) }() + case 7: try { try decoder.decodeSingularUInt64Field(value: &_storage._animAssetID) }() + case 8: try { try decoder.decodeSingularMessageField(value: &_storage._badge) }() + case 9: try { try decoder.decodeRepeatedUInt64Field(value: &_storage._flexSettingArrayList) }() + case 10: try { try decoder.decodeSingularMessageField(value: &_storage._textIconOverlay) }() + case 11: try { try decoder.decodeSingularMessageField(value: &_storage._animatedBadge) }() + case 12: try { try decoder.decodeSingularBoolField(value: &_storage._hasSweepLight_p) }() + case 13: try { try decoder.decodeRepeatedUInt64Field(value: &_storage._textFlexSettingArrayList) }() + case 14: try { try decoder.decodeSingularUInt64Field(value: &_storage._centerAnimAssetID) }() + case 15: try { try decoder.decodeSingularMessageField(value: &_storage._dynamicImage) }() + case 16: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._extraMap) }() + case 17: try { try decoder.decodeSingularUInt64Field(value: &_storage._mp4AnimAssetID) }() + case 18: try { try decoder.decodeSingularUInt64Field(value: &_storage._priority) }() + case 19: try { try decoder.decodeSingularUInt64Field(value: &_storage._maxWaitTime) }() + case 20: try { try decoder.decodeSingularStringField(value: &_storage._dressID) }() + case 21: try { try decoder.decodeSingularUInt64Field(value: &_storage._alignment) }() + case 22: try { try decoder.decodeSingularUInt64Field(value: &_storage._alignmentOffset) }() + default: break + } + } + } } func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Decoration, rhs: Decoration) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if _storage._type != 0 { + try visitor.visitSingularUInt64Field(value: _storage._type, fieldNumber: 1) + } + try { if let v = _storage._icon { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + if _storage._avatarPos != 0 { + try visitor.visitSingularUInt64Field(value: _storage._avatarPos, fieldNumber: 3) + } + try { if let v = _storage._text { + try visitor.visitSingularMessageField(value: v, fieldNumber: 4) + } }() + try { if let v = _storage._textIcon { + try visitor.visitSingularMessageField(value: v, fieldNumber: 5) + } }() + if _storage._stayTime != 0 { + try visitor.visitSingularUInt32Field(value: _storage._stayTime, fieldNumber: 6) + } + if _storage._animAssetID != 0 { + try visitor.visitSingularUInt64Field(value: _storage._animAssetID, fieldNumber: 7) + } + try { if let v = _storage._badge { + try visitor.visitSingularMessageField(value: v, fieldNumber: 8) + } }() + if !_storage._flexSettingArrayList.isEmpty { + try visitor.visitPackedUInt64Field(value: _storage._flexSettingArrayList, fieldNumber: 9) + } + try { if let v = _storage._textIconOverlay { + try visitor.visitSingularMessageField(value: v, fieldNumber: 10) + } }() + try { if let v = _storage._animatedBadge { + try visitor.visitSingularMessageField(value: v, fieldNumber: 11) + } }() + if _storage._hasSweepLight_p != false { + try visitor.visitSingularBoolField(value: _storage._hasSweepLight_p, fieldNumber: 12) + } + if !_storage._textFlexSettingArrayList.isEmpty { + try visitor.visitPackedUInt64Field(value: _storage._textFlexSettingArrayList, fieldNumber: 13) + } + if _storage._centerAnimAssetID != 0 { + try visitor.visitSingularUInt64Field(value: _storage._centerAnimAssetID, fieldNumber: 14) + } + try { if let v = _storage._dynamicImage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 15) + } }() + if !_storage._extraMap.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._extraMap, fieldNumber: 16) + } + if _storage._mp4AnimAssetID != 0 { + try visitor.visitSingularUInt64Field(value: _storage._mp4AnimAssetID, fieldNumber: 17) + } + if _storage._priority != 0 { + try visitor.visitSingularUInt64Field(value: _storage._priority, fieldNumber: 18) + } + if _storage._maxWaitTime != 0 { + try visitor.visitSingularUInt64Field(value: _storage._maxWaitTime, fieldNumber: 19) + } + if !_storage._dressID.isEmpty { + try visitor.visitSingularStringField(value: _storage._dressID, fieldNumber: 20) + } + if _storage._alignment != 0 { + try visitor.visitSingularUInt64Field(value: _storage._alignment, fieldNumber: 21) + } + if _storage._alignmentOffset != 0 { + try visitor.visitSingularUInt64Field(value: _storage._alignmentOffset, fieldNumber: 22) + } + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Douyin_EffectConfig, rhs: Douyin_EffectConfig) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._type != rhs_storage._type {return false} + if _storage._icon != rhs_storage._icon {return false} + if _storage._avatarPos != rhs_storage._avatarPos {return false} + if _storage._text != rhs_storage._text {return false} + if _storage._textIcon != rhs_storage._textIcon {return false} + if _storage._stayTime != rhs_storage._stayTime {return false} + if _storage._animAssetID != rhs_storage._animAssetID {return false} + if _storage._badge != rhs_storage._badge {return false} + if _storage._flexSettingArrayList != rhs_storage._flexSettingArrayList {return false} + if _storage._textIconOverlay != rhs_storage._textIconOverlay {return false} + if _storage._animatedBadge != rhs_storage._animatedBadge {return false} + if _storage._hasSweepLight_p != rhs_storage._hasSweepLight_p {return false} + if _storage._textFlexSettingArrayList != rhs_storage._textFlexSettingArrayList {return false} + if _storage._centerAnimAssetID != rhs_storage._centerAnimAssetID {return false} + if _storage._dynamicImage != rhs_storage._dynamicImage {return false} + if _storage._extraMap != rhs_storage._extraMap {return false} + if _storage._mp4AnimAssetID != rhs_storage._mp4AnimAssetID {return false} + if _storage._priority != rhs_storage._priority {return false} + if _storage._maxWaitTime != rhs_storage._maxWaitTime {return false} + if _storage._dressID != rhs_storage._dressID {return false} + if _storage._alignment != rhs_storage._alignment {return false} + if _storage._alignmentOffset != rhs_storage._alignmentOffset {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } -extension TopFan: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = "TopFan" - static let _protobuf_nameMap = SwiftProtobuf._NameMap() +extension Douyin_Text: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Text" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "key"), + 2: .same(proto: "defaultPatter"), + 3: .same(proto: "defaultFormat"), + 4: .same(proto: "piecesList"), + ] mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.key) }() + case 2: try { try decoder.decodeSingularStringField(value: &self.defaultPatter) }() + case 3: try { try decoder.decodeSingularMessageField(value: &self._defaultFormat) }() + case 4: try { try decoder.decodeRepeatedMessageField(value: &self.piecesList) }() + default: break + } + } } func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: TopFan, rhs: TopFan) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if !self.key.isEmpty { + try visitor.visitSingularStringField(value: self.key, fieldNumber: 1) + } + if !self.defaultPatter.isEmpty { + try visitor.visitSingularStringField(value: self.defaultPatter, fieldNumber: 2) + } + try { if let v = self._defaultFormat { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + } }() + if !self.piecesList.isEmpty { + try visitor.visitRepeatedMessageField(value: self.piecesList, fieldNumber: 4) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Douyin_Text, rhs: Douyin_Text) -> Bool { + if lhs.key != rhs.key {return false} + if lhs.defaultPatter != rhs.defaultPatter {return false} + if lhs._defaultFormat != rhs._defaultFormat {return false} + if lhs.piecesList != rhs.piecesList {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } -extension User: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = "User" +extension Douyin_TextPiece: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TextPiece" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "id"), - 2: .same(proto: "shortId"), - 3: .same(proto: "nickname"), - 4: .same(proto: "gender"), - 5: .same(proto: "signature"), - 6: .same(proto: "level"), - 7: .same(proto: "birthday"), - 8: .same(proto: "telephone"), - 9: .same(proto: "avatarThumb"), - 10: .same(proto: "avatarMedium"), - 11: .same(proto: "avatarLarge"), - 12: .same(proto: "verified"), - 13: .same(proto: "experience"), - 14: .same(proto: "city"), - 15: .same(proto: "status"), - 16: .same(proto: "createTime"), - 17: .same(proto: "modifyTime"), - 18: .same(proto: "secret"), - 19: .same(proto: "shareQrcodeUri"), - 20: .same(proto: "incomeSharePercent"), - 21: .same(proto: "badgeImageList"), - 22: .same(proto: "followInfo"), - 23: .same(proto: "payGrade"), - 24: .same(proto: "fansClub"), - 25: .same(proto: "border"), - 26: .same(proto: "specialId"), - 27: .same(proto: "avatarBorder"), - 28: .same(proto: "medal"), - 29: .same(proto: "realTimeIcons"), - 30: .same(proto: "newRealTimeIcons"), - 31: .same(proto: "topVipNo"), - 32: .same(proto: "userAttr"), - 33: .same(proto: "ownRoom"), - 34: .same(proto: "payScore"), - 35: .same(proto: "ticketCount"), - 36: .same(proto: "anchorInfo"), - 37: .same(proto: "linkMicStats"), - 38: .same(proto: "displayId"), + 1: .same(proto: "type"), + 2: .same(proto: "format"), + 3: .same(proto: "stringValue"), + 4: .same(proto: "userValue"), + 5: .same(proto: "giftValue"), + 6: .same(proto: "heartValue"), + 7: .same(proto: "patternRefValue"), + 8: .same(proto: "imageValue"), ] fileprivate class _StorageClass { - var _id: Int64 = 0 - var _shortID: Int64 = 0 - var _nickname: String = String() - var _gender: Int32 = 0 - var _signature: String = String() - var _level: Int32 = 0 - var _birthday: Int64 = 0 - var _telephone: String = String() - var _avatarThumb: Image? = nil - var _avatarMedium: Image? = nil - var _avatarLarge: Image? = nil - var _verified: Bool = false - var _experience: Int32 = 0 - var _city: String = String() - var _status: Int32 = 0 - var _createTime: Int64 = 0 - var _modifyTime: Int64 = 0 - var _secret: Int32 = 0 - var _shareQrcodeUri: String = String() - var _incomeSharePercent: Int32 = 0 - var _badgeImageList: Image? = nil - var _followInfo: User.FollowInfo? = nil - var _payGrade: User.PayGrade? = nil - var _fansClub: User.FansClub? = nil - var _border: User.Border? = nil - var _specialID: String = String() - var _avatarBorder: Image? = nil - var _medal: Image? = nil - var _realTimeIcons: [Image] = [] - var _newRealTimeIcons: [Image] = [] - var _topVipNo: Int64 = 0 - var _userAttr: User.UserAttr? = nil - var _ownRoom: User.OwnRoom? = nil - var _payScore: Int64 = 0 - var _ticketCount: Int64 = 0 - var _anchorInfo: User.AnchorInfo? = nil - var _linkMicStats: Int32 = 0 - var _displayID: String = String() - - static let defaultInstance = _StorageClass() - - private init() {} - - init(copying source: _StorageClass) { - _id = source._id - _shortID = source._shortID - _nickname = source._nickname - _gender = source._gender - _signature = source._signature - _level = source._level - _birthday = source._birthday - _telephone = source._telephone - _avatarThumb = source._avatarThumb - _avatarMedium = source._avatarMedium - _avatarLarge = source._avatarLarge - _verified = source._verified - _experience = source._experience - _city = source._city - _status = source._status - _createTime = source._createTime - _modifyTime = source._modifyTime - _secret = source._secret - _shareQrcodeUri = source._shareQrcodeUri - _incomeSharePercent = source._incomeSharePercent - _badgeImageList = source._badgeImageList - _followInfo = source._followInfo - _payGrade = source._payGrade - _fansClub = source._fansClub - _border = source._border - _specialID = source._specialID - _avatarBorder = source._avatarBorder - _medal = source._medal - _realTimeIcons = source._realTimeIcons - _newRealTimeIcons = source._newRealTimeIcons - _topVipNo = source._topVipNo - _userAttr = source._userAttr - _ownRoom = source._ownRoom - _payScore = source._payScore - _ticketCount = source._ticketCount - _anchorInfo = source._anchorInfo - _linkMicStats = source._linkMicStats - _displayID = source._displayID - } + var _type: Bool = false + var _format: Douyin_TextFormat? = nil + var _stringValue: String = String() + var _userValue: Douyin_TextPieceUser? = nil + var _giftValue: Douyin_TextPieceGift? = nil + var _heartValue: Douyin_TextPieceHeart? = nil + var _patternRefValue: Douyin_TextPiecePatternRef? = nil + var _imageValue: Douyin_TextPieceImage? = nil + + #if swift(>=5.10) + // This property is used as the initial default value for new instances of the type. + // The type itself is protecting the reference to its storage via CoW semantics. + // This will force a copy to be made of this reference when the first mutation occurs; + // hence, it is safe to mark this as `nonisolated(unsafe)`. + static nonisolated(unsafe) let defaultInstance = _StorageClass() + #else + static let defaultInstance = _StorageClass() + #endif + + private init() {} + + init(copying source: _StorageClass) { + _type = source._type + _format = source._format + _stringValue = source._stringValue + _userValue = source._userValue + _giftValue = source._giftValue + _heartValue = source._heartValue + _patternRefValue = source._patternRefValue + _imageValue = source._imageValue + } } fileprivate mutating func _uniqueStorage() -> _StorageClass { - if !isKnownUniquelyReferenced(&_storage) { - _storage = _StorageClass(copying: _storage) - } - return _storage + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage } mutating func decodeMessage(decoder: inout D) throws { - _ = _uniqueStorage() - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularInt64Field(value: &_storage._id) }() - case 2: try { try decoder.decodeSingularInt64Field(value: &_storage._shortID) }() - case 3: try { try decoder.decodeSingularStringField(value: &_storage._nickname) }() - case 4: try { try decoder.decodeSingularInt32Field(value: &_storage._gender) }() - case 5: try { try decoder.decodeSingularStringField(value: &_storage._signature) }() - case 6: try { try decoder.decodeSingularInt32Field(value: &_storage._level) }() - case 7: try { try decoder.decodeSingularInt64Field(value: &_storage._birthday) }() - case 8: try { try decoder.decodeSingularStringField(value: &_storage._telephone) }() - case 9: try { try decoder.decodeSingularMessageField(value: &_storage._avatarThumb) }() - case 10: try { try decoder.decodeSingularMessageField(value: &_storage._avatarMedium) }() - case 11: try { try decoder.decodeSingularMessageField(value: &_storage._avatarLarge) }() - case 12: try { try decoder.decodeSingularBoolField(value: &_storage._verified) }() - case 13: try { try decoder.decodeSingularInt32Field(value: &_storage._experience) }() - case 14: try { try decoder.decodeSingularStringField(value: &_storage._city) }() - case 15: try { try decoder.decodeSingularInt32Field(value: &_storage._status) }() - case 16: try { try decoder.decodeSingularInt64Field(value: &_storage._createTime) }() - case 17: try { try decoder.decodeSingularInt64Field(value: &_storage._modifyTime) }() - case 18: try { try decoder.decodeSingularInt32Field(value: &_storage._secret) }() - case 19: try { try decoder.decodeSingularStringField(value: &_storage._shareQrcodeUri) }() - case 20: try { try decoder.decodeSingularInt32Field(value: &_storage._incomeSharePercent) }() - case 21: try { try decoder.decodeSingularMessageField(value: &_storage._badgeImageList) }() - case 22: try { try decoder.decodeSingularMessageField(value: &_storage._followInfo) }() - case 23: try { try decoder.decodeSingularMessageField(value: &_storage._payGrade) }() - case 24: try { try decoder.decodeSingularMessageField(value: &_storage._fansClub) }() - case 25: try { try decoder.decodeSingularMessageField(value: &_storage._border) }() - case 26: try { try decoder.decodeSingularStringField(value: &_storage._specialID) }() - case 27: try { try decoder.decodeSingularMessageField(value: &_storage._avatarBorder) }() - case 28: try { try decoder.decodeSingularMessageField(value: &_storage._medal) }() - case 29: try { try decoder.decodeRepeatedMessageField(value: &_storage._realTimeIcons) }() - case 30: try { try decoder.decodeRepeatedMessageField(value: &_storage._newRealTimeIcons) }() - case 31: try { try decoder.decodeSingularInt64Field(value: &_storage._topVipNo) }() - case 32: try { try decoder.decodeSingularMessageField(value: &_storage._userAttr) }() - case 33: try { try decoder.decodeSingularMessageField(value: &_storage._ownRoom) }() - case 34: try { try decoder.decodeSingularInt64Field(value: &_storage._payScore) }() - case 35: try { try decoder.decodeSingularInt64Field(value: &_storage._ticketCount) }() - case 36: try { try decoder.decodeSingularMessageField(value: &_storage._anchorInfo) }() - case 37: try { try decoder.decodeSingularInt32Field(value: &_storage._linkMicStats) }() - case 38: try { try decoder.decodeSingularStringField(value: &_storage._displayID) }() - default: break - } - } - } + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBoolField(value: &_storage._type) }() + case 2: try { try decoder.decodeSingularMessageField(value: &_storage._format) }() + case 3: try { try decoder.decodeSingularStringField(value: &_storage._stringValue) }() + case 4: try { try decoder.decodeSingularMessageField(value: &_storage._userValue) }() + case 5: try { try decoder.decodeSingularMessageField(value: &_storage._giftValue) }() + case 6: try { try decoder.decodeSingularMessageField(value: &_storage._heartValue) }() + case 7: try { try decoder.decodeSingularMessageField(value: &_storage._patternRefValue) }() + case 8: try { try decoder.decodeSingularMessageField(value: &_storage._imageValue) }() + default: break + } + } + } } func traverse(visitor: inout V) throws { - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if _storage._id != 0 { - try visitor.visitSingularInt64Field(value: _storage._id, fieldNumber: 1) - } - if _storage._shortID != 0 { - try visitor.visitSingularInt64Field(value: _storage._shortID, fieldNumber: 2) - } - if !_storage._nickname.isEmpty { - try visitor.visitSingularStringField(value: _storage._nickname, fieldNumber: 3) - } - if _storage._gender != 0 { - try visitor.visitSingularInt32Field(value: _storage._gender, fieldNumber: 4) - } - if !_storage._signature.isEmpty { - try visitor.visitSingularStringField(value: _storage._signature, fieldNumber: 5) - } - if _storage._level != 0 { - try visitor.visitSingularInt32Field(value: _storage._level, fieldNumber: 6) - } - if _storage._birthday != 0 { - try visitor.visitSingularInt64Field(value: _storage._birthday, fieldNumber: 7) - } - if !_storage._telephone.isEmpty { - try visitor.visitSingularStringField(value: _storage._telephone, fieldNumber: 8) - } - try { if let v = _storage._avatarThumb { - try visitor.visitSingularMessageField(value: v, fieldNumber: 9) - } }() - try { if let v = _storage._avatarMedium { - try visitor.visitSingularMessageField(value: v, fieldNumber: 10) - } }() - try { if let v = _storage._avatarLarge { - try visitor.visitSingularMessageField(value: v, fieldNumber: 11) - } }() - if _storage._verified != false { - try visitor.visitSingularBoolField(value: _storage._verified, fieldNumber: 12) - } - if _storage._experience != 0 { - try visitor.visitSingularInt32Field(value: _storage._experience, fieldNumber: 13) - } - if !_storage._city.isEmpty { - try visitor.visitSingularStringField(value: _storage._city, fieldNumber: 14) - } - if _storage._status != 0 { - try visitor.visitSingularInt32Field(value: _storage._status, fieldNumber: 15) - } - if _storage._createTime != 0 { - try visitor.visitSingularInt64Field(value: _storage._createTime, fieldNumber: 16) - } - if _storage._modifyTime != 0 { - try visitor.visitSingularInt64Field(value: _storage._modifyTime, fieldNumber: 17) - } - if _storage._secret != 0 { - try visitor.visitSingularInt32Field(value: _storage._secret, fieldNumber: 18) - } - if !_storage._shareQrcodeUri.isEmpty { - try visitor.visitSingularStringField(value: _storage._shareQrcodeUri, fieldNumber: 19) - } - if _storage._incomeSharePercent != 0 { - try visitor.visitSingularInt32Field(value: _storage._incomeSharePercent, fieldNumber: 20) - } - try { if let v = _storage._badgeImageList { - try visitor.visitSingularMessageField(value: v, fieldNumber: 21) - } }() - try { if let v = _storage._followInfo { - try visitor.visitSingularMessageField(value: v, fieldNumber: 22) - } }() - try { if let v = _storage._payGrade { - try visitor.visitSingularMessageField(value: v, fieldNumber: 23) - } }() - try { if let v = _storage._fansClub { - try visitor.visitSingularMessageField(value: v, fieldNumber: 24) - } }() - try { if let v = _storage._border { - try visitor.visitSingularMessageField(value: v, fieldNumber: 25) - } }() - if !_storage._specialID.isEmpty { - try visitor.visitSingularStringField(value: _storage._specialID, fieldNumber: 26) - } - try { if let v = _storage._avatarBorder { - try visitor.visitSingularMessageField(value: v, fieldNumber: 27) - } }() - try { if let v = _storage._medal { - try visitor.visitSingularMessageField(value: v, fieldNumber: 28) - } }() - if !_storage._realTimeIcons.isEmpty { - try visitor.visitRepeatedMessageField(value: _storage._realTimeIcons, fieldNumber: 29) - } - if !_storage._newRealTimeIcons.isEmpty { - try visitor.visitRepeatedMessageField(value: _storage._newRealTimeIcons, fieldNumber: 30) - } - if _storage._topVipNo != 0 { - try visitor.visitSingularInt64Field(value: _storage._topVipNo, fieldNumber: 31) - } - try { if let v = _storage._userAttr { - try visitor.visitSingularMessageField(value: v, fieldNumber: 32) - } }() - try { if let v = _storage._ownRoom { - try visitor.visitSingularMessageField(value: v, fieldNumber: 33) - } }() - if _storage._payScore != 0 { - try visitor.visitSingularInt64Field(value: _storage._payScore, fieldNumber: 34) - } - if _storage._ticketCount != 0 { - try visitor.visitSingularInt64Field(value: _storage._ticketCount, fieldNumber: 35) - } - try { if let v = _storage._anchorInfo { - try visitor.visitSingularMessageField(value: v, fieldNumber: 36) - } }() - if _storage._linkMicStats != 0 { - try visitor.visitSingularInt32Field(value: _storage._linkMicStats, fieldNumber: 37) - } - if !_storage._displayID.isEmpty { - try visitor.visitSingularStringField(value: _storage._displayID, fieldNumber: 38) - } - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: User, rhs: User) -> Bool { - if lhs._storage !== rhs._storage { - let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in - let _storage = _args.0 - let rhs_storage = _args.1 - if _storage._id != rhs_storage._id {return false} - if _storage._shortID != rhs_storage._shortID {return false} - if _storage._nickname != rhs_storage._nickname {return false} - if _storage._gender != rhs_storage._gender {return false} - if _storage._signature != rhs_storage._signature {return false} - if _storage._level != rhs_storage._level {return false} - if _storage._birthday != rhs_storage._birthday {return false} - if _storage._telephone != rhs_storage._telephone {return false} - if _storage._avatarThumb != rhs_storage._avatarThumb {return false} - if _storage._avatarMedium != rhs_storage._avatarMedium {return false} - if _storage._avatarLarge != rhs_storage._avatarLarge {return false} - if _storage._verified != rhs_storage._verified {return false} - if _storage._experience != rhs_storage._experience {return false} - if _storage._city != rhs_storage._city {return false} - if _storage._status != rhs_storage._status {return false} - if _storage._createTime != rhs_storage._createTime {return false} - if _storage._modifyTime != rhs_storage._modifyTime {return false} - if _storage._secret != rhs_storage._secret {return false} - if _storage._shareQrcodeUri != rhs_storage._shareQrcodeUri {return false} - if _storage._incomeSharePercent != rhs_storage._incomeSharePercent {return false} - if _storage._badgeImageList != rhs_storage._badgeImageList {return false} - if _storage._followInfo != rhs_storage._followInfo {return false} - if _storage._payGrade != rhs_storage._payGrade {return false} - if _storage._fansClub != rhs_storage._fansClub {return false} - if _storage._border != rhs_storage._border {return false} - if _storage._specialID != rhs_storage._specialID {return false} - if _storage._avatarBorder != rhs_storage._avatarBorder {return false} - if _storage._medal != rhs_storage._medal {return false} - if _storage._realTimeIcons != rhs_storage._realTimeIcons {return false} - if _storage._newRealTimeIcons != rhs_storage._newRealTimeIcons {return false} - if _storage._topVipNo != rhs_storage._topVipNo {return false} - if _storage._userAttr != rhs_storage._userAttr {return false} - if _storage._ownRoom != rhs_storage._ownRoom {return false} - if _storage._payScore != rhs_storage._payScore {return false} - if _storage._ticketCount != rhs_storage._ticketCount {return false} - if _storage._anchorInfo != rhs_storage._anchorInfo {return false} - if _storage._linkMicStats != rhs_storage._linkMicStats {return false} - if _storage._displayID != rhs_storage._displayID {return false} - return true - } - if !storagesAreEqual {return false} - } - if lhs.unknownFields != rhs.unknownFields {return false} - return true + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if _storage._type != false { + try visitor.visitSingularBoolField(value: _storage._type, fieldNumber: 1) + } + try { if let v = _storage._format { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + if !_storage._stringValue.isEmpty { + try visitor.visitSingularStringField(value: _storage._stringValue, fieldNumber: 3) + } + try { if let v = _storage._userValue { + try visitor.visitSingularMessageField(value: v, fieldNumber: 4) + } }() + try { if let v = _storage._giftValue { + try visitor.visitSingularMessageField(value: v, fieldNumber: 5) + } }() + try { if let v = _storage._heartValue { + try visitor.visitSingularMessageField(value: v, fieldNumber: 6) + } }() + try { if let v = _storage._patternRefValue { + try visitor.visitSingularMessageField(value: v, fieldNumber: 7) + } }() + try { if let v = _storage._imageValue { + try visitor.visitSingularMessageField(value: v, fieldNumber: 8) + } }() + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Douyin_TextPiece, rhs: Douyin_TextPiece) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._type != rhs_storage._type {return false} + if _storage._format != rhs_storage._format {return false} + if _storage._stringValue != rhs_storage._stringValue {return false} + if _storage._userValue != rhs_storage._userValue {return false} + if _storage._giftValue != rhs_storage._giftValue {return false} + if _storage._heartValue != rhs_storage._heartValue {return false} + if _storage._patternRefValue != rhs_storage._patternRefValue {return false} + if _storage._imageValue != rhs_storage._imageValue {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } -extension User.UserAttr: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = User.protoMessageName + ".UserAttr" - static let _protobuf_nameMap = SwiftProtobuf._NameMap() +extension Douyin_TextPieceImage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TextPieceImage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "image"), + 2: .same(proto: "scalingRate"), + ] mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._image) }() + case 2: try { try decoder.decodeSingularFloatField(value: &self.scalingRate) }() + default: break + } + } } func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: User.UserAttr, rhs: User.UserAttr) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._image { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + if self.scalingRate.bitPattern != 0 { + try visitor.visitSingularFloatField(value: self.scalingRate, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Douyin_TextPieceImage, rhs: Douyin_TextPieceImage) -> Bool { + if lhs._image != rhs._image {return false} + if lhs.scalingRate != rhs.scalingRate {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } -extension User.OwnRoom: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = User.protoMessageName + ".OwnRoom" - static let _protobuf_nameMap = SwiftProtobuf._NameMap() +extension Douyin_TextPiecePatternRef: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TextPiecePatternRef" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "key"), + 2: .same(proto: "defaultPattern"), + ] mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.key) }() + case 2: try { try decoder.decodeSingularStringField(value: &self.defaultPattern) }() + default: break + } + } } func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) + if !self.key.isEmpty { + try visitor.visitSingularStringField(value: self.key, fieldNumber: 1) + } + if !self.defaultPattern.isEmpty { + try visitor.visitSingularStringField(value: self.defaultPattern, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: User.OwnRoom, rhs: User.OwnRoom) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true + static func ==(lhs: Douyin_TextPiecePatternRef, rhs: Douyin_TextPiecePatternRef) -> Bool { + if lhs.key != rhs.key {return false} + if lhs.defaultPattern != rhs.defaultPattern {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } -extension User.AnchorInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = User.protoMessageName + ".AnchorInfo" - static let _protobuf_nameMap = SwiftProtobuf._NameMap() +extension Douyin_TextPieceHeart: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TextPieceHeart" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "color"), + ] mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.color) }() + default: break + } + } } func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) + if !self.color.isEmpty { + try visitor.visitSingularStringField(value: self.color, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: User.AnchorInfo, rhs: User.AnchorInfo) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true + static func ==(lhs: Douyin_TextPieceHeart, rhs: Douyin_TextPieceHeart) -> Bool { + if lhs.color != rhs.color {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } -extension User.FollowInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = User.protoMessageName + ".FollowInfo" +extension Douyin_TextPieceGift: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TextPieceGift" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "followingCount"), - 2: .same(proto: "followerCount"), - 3: .same(proto: "followStatus"), - 4: .same(proto: "pushStatus"), - 5: .same(proto: "remarkName"), + 1: .same(proto: "giftId"), + 2: .same(proto: "nameRef"), ] mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularInt64Field(value: &self.followingCount) }() - case 2: try { try decoder.decodeSingularInt64Field(value: &self.followerCount) }() - case 3: try { try decoder.decodeSingularInt64Field(value: &self.followStatus) }() - case 4: try { try decoder.decodeSingularInt64Field(value: &self.pushStatus) }() - case 5: try { try decoder.decodeSingularStringField(value: &self.remarkName) }() - default: break - } - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularUInt64Field(value: &self.giftID) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._nameRef) }() + default: break + } + } } func traverse(visitor: inout V) throws { - if self.followingCount != 0 { - try visitor.visitSingularInt64Field(value: self.followingCount, fieldNumber: 1) - } - if self.followerCount != 0 { - try visitor.visitSingularInt64Field(value: self.followerCount, fieldNumber: 2) - } - if self.followStatus != 0 { - try visitor.visitSingularInt64Field(value: self.followStatus, fieldNumber: 3) - } - if self.pushStatus != 0 { - try visitor.visitSingularInt64Field(value: self.pushStatus, fieldNumber: 4) - } - if !self.remarkName.isEmpty { - try visitor.visitSingularStringField(value: self.remarkName, fieldNumber: 5) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: User.FollowInfo, rhs: User.FollowInfo) -> Bool { - if lhs.followingCount != rhs.followingCount {return false} - if lhs.followerCount != rhs.followerCount {return false} - if lhs.followStatus != rhs.followStatus {return false} - if lhs.pushStatus != rhs.pushStatus {return false} - if lhs.remarkName != rhs.remarkName {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if self.giftID != 0 { + try visitor.visitSingularUInt64Field(value: self.giftID, fieldNumber: 1) + } + try { if let v = self._nameRef { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Douyin_TextPieceGift, rhs: Douyin_TextPieceGift) -> Bool { + if lhs.giftID != rhs.giftID {return false} + if lhs._nameRef != rhs._nameRef {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } -extension User.FansClub: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = User.protoMessageName + ".FansClub" +extension Douyin_PatternRef: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PatternRef" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "data"), - 2: .same(proto: "preferData"), + 1: .same(proto: "key"), + 2: .same(proto: "defaultPattern"), ] mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._data) }() - case 2: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &self.preferData) }() - default: break - } - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.key) }() + case 2: try { try decoder.decodeSingularStringField(value: &self.defaultPattern) }() + default: break + } + } } func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._data { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if !self.preferData.isEmpty { - try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: self.preferData, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: User.FansClub, rhs: User.FansClub) -> Bool { - if lhs._data != rhs._data {return false} - if lhs.preferData != rhs.preferData {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension User.FansClub.FansClubData: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = User.FansClub.protoMessageName + ".FansClubData" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "clubName"), - 2: .same(proto: "level"), - 3: .same(proto: "userFansClubStatus"), - 4: .same(proto: "badge"), - 5: .same(proto: "availableGiftIds"), - 6: .same(proto: "anchorId"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.clubName) }() - case 2: try { try decoder.decodeSingularInt32Field(value: &self.level) }() - case 3: try { try decoder.decodeSingularInt32Field(value: &self.userFansClubStatus) }() - case 4: try { try decoder.decodeSingularMessageField(value: &self._badge) }() - case 5: try { try decoder.decodeRepeatedInt64Field(value: &self.availableGiftIds) }() - case 6: try { try decoder.decodeSingularInt64Field(value: &self.anchorID) }() - default: break - } - } + if !self.key.isEmpty { + try visitor.visitSingularStringField(value: self.key, fieldNumber: 1) + } + if !self.defaultPattern.isEmpty { + try visitor.visitSingularStringField(value: self.defaultPattern, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) } - func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if !self.clubName.isEmpty { - try visitor.visitSingularStringField(value: self.clubName, fieldNumber: 1) - } - if self.level != 0 { - try visitor.visitSingularInt32Field(value: self.level, fieldNumber: 2) - } - if self.userFansClubStatus != 0 { - try visitor.visitSingularInt32Field(value: self.userFansClubStatus, fieldNumber: 3) - } - try { if let v = self._badge { - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } }() - if !self.availableGiftIds.isEmpty { - try visitor.visitPackedInt64Field(value: self.availableGiftIds, fieldNumber: 5) - } - if self.anchorID != 0 { - try visitor.visitSingularInt64Field(value: self.anchorID, fieldNumber: 6) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: User.FansClub.FansClubData, rhs: User.FansClub.FansClubData) -> Bool { - if lhs.clubName != rhs.clubName {return false} - if lhs.level != rhs.level {return false} - if lhs.userFansClubStatus != rhs.userFansClubStatus {return false} - if lhs._badge != rhs._badge {return false} - if lhs.availableGiftIds != rhs.availableGiftIds {return false} - if lhs.anchorID != rhs.anchorID {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true + static func ==(lhs: Douyin_PatternRef, rhs: Douyin_PatternRef) -> Bool { + if lhs.key != rhs.key {return false} + if lhs.defaultPattern != rhs.defaultPattern {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } -extension User.FansClub.FansClubData.UserBadge: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = User.FansClub.FansClubData.protoMessageName + ".UserBadge" +extension Douyin_TextPieceUser: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TextPieceUser" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "icons"), - 2: .same(proto: "title"), + 1: .same(proto: "user"), + 2: .same(proto: "withColon"), ] mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &self.icons) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.title) }() - default: break - } - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._user) }() + case 2: try { try decoder.decodeSingularBoolField(value: &self.withColon) }() + default: break + } + } } func traverse(visitor: inout V) throws { - if !self.icons.isEmpty { - try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: self.icons, fieldNumber: 1) - } - if !self.title.isEmpty { - try visitor.visitSingularStringField(value: self.title, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: User.FansClub.FansClubData.UserBadge, rhs: User.FansClub.FansClubData.UserBadge) -> Bool { - if lhs.icons != rhs.icons {return false} - if lhs.title != rhs.title {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._user { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + if self.withColon != false { + try visitor.visitSingularBoolField(value: self.withColon, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Douyin_TextPieceUser, rhs: Douyin_TextPieceUser) -> Bool { + if lhs._user != rhs._user {return false} + if lhs.withColon != rhs.withColon {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } -extension User.Border: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = User.protoMessageName + ".Border" - static let _protobuf_nameMap = SwiftProtobuf._NameMap() +extension Douyin_TextFormat: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TextFormat" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "color"), + 2: .same(proto: "bold"), + 3: .same(proto: "italic"), + 4: .same(proto: "weight"), + 5: .same(proto: "italicAngle"), + 6: .same(proto: "fontSize"), + 7: .same(proto: "useHeighLightColor"), + 8: .same(proto: "useRemoteClor"), + ] mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.color) }() + case 2: try { try decoder.decodeSingularBoolField(value: &self.bold) }() + case 3: try { try decoder.decodeSingularBoolField(value: &self.italic) }() + case 4: try { try decoder.decodeSingularUInt32Field(value: &self.weight) }() + case 5: try { try decoder.decodeSingularUInt32Field(value: &self.italicAngle) }() + case 6: try { try decoder.decodeSingularUInt32Field(value: &self.fontSize) }() + case 7: try { try decoder.decodeSingularBoolField(value: &self.useHeighLightColor) }() + case 8: try { try decoder.decodeSingularBoolField(value: &self.useRemoteClor) }() + default: break + } + } } func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: User.Border, rhs: User.Border) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true + if !self.color.isEmpty { + try visitor.visitSingularStringField(value: self.color, fieldNumber: 1) + } + if self.bold != false { + try visitor.visitSingularBoolField(value: self.bold, fieldNumber: 2) + } + if self.italic != false { + try visitor.visitSingularBoolField(value: self.italic, fieldNumber: 3) + } + if self.weight != 0 { + try visitor.visitSingularUInt32Field(value: self.weight, fieldNumber: 4) + } + if self.italicAngle != 0 { + try visitor.visitSingularUInt32Field(value: self.italicAngle, fieldNumber: 5) + } + if self.fontSize != 0 { + try visitor.visitSingularUInt32Field(value: self.fontSize, fieldNumber: 6) + } + if self.useHeighLightColor != false { + try visitor.visitSingularBoolField(value: self.useHeighLightColor, fieldNumber: 7) + } + if self.useRemoteClor != false { + try visitor.visitSingularBoolField(value: self.useRemoteClor, fieldNumber: 8) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Douyin_TextFormat, rhs: Douyin_TextFormat) -> Bool { + if lhs.color != rhs.color {return false} + if lhs.bold != rhs.bold {return false} + if lhs.italic != rhs.italic {return false} + if lhs.weight != rhs.weight {return false} + if lhs.italicAngle != rhs.italicAngle {return false} + if lhs.fontSize != rhs.fontSize {return false} + if lhs.useHeighLightColor != rhs.useHeighLightColor {return false} + if lhs.useRemoteClor != rhs.useRemoteClor {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } -extension User.GradeBuffInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = User.protoMessageName + ".GradeBuffInfo" +extension Douyin_LikeMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".LikeMessage" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "buffLevel"), - 2: .same(proto: "status"), - 3: .same(proto: "endTime"), - 4: .same(proto: "statsInfo"), - 5: .same(proto: "buffBadge"), + 1: .same(proto: "common"), + 2: .same(proto: "count"), + 3: .same(proto: "total"), + 4: .same(proto: "color"), + 5: .same(proto: "user"), + 6: .same(proto: "icon"), + 7: .same(proto: "doubleLikeDetail"), + 8: .same(proto: "displayControlInfo"), + 9: .same(proto: "linkmicGuestUid"), + 10: .same(proto: "scene"), + 11: .same(proto: "picoDisplayInfo"), ] mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularInt64Field(value: &self.buffLevel) }() - case 2: try { try decoder.decodeSingularInt32Field(value: &self.status) }() - case 3: try { try decoder.decodeSingularInt64Field(value: &self.endTime) }() - case 4: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &self.statsInfo) }() - case 5: try { try decoder.decodeSingularMessageField(value: &self._buffBadge) }() - default: break - } - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._common) }() + case 2: try { try decoder.decodeSingularUInt64Field(value: &self.count) }() + case 3: try { try decoder.decodeSingularUInt64Field(value: &self.total) }() + case 4: try { try decoder.decodeSingularUInt64Field(value: &self.color) }() + case 5: try { try decoder.decodeSingularMessageField(value: &self._user) }() + case 6: try { try decoder.decodeSingularStringField(value: &self.icon) }() + case 7: try { try decoder.decodeSingularMessageField(value: &self._doubleLikeDetail) }() + case 8: try { try decoder.decodeSingularMessageField(value: &self._displayControlInfo) }() + case 9: try { try decoder.decodeSingularUInt64Field(value: &self.linkmicGuestUid) }() + case 10: try { try decoder.decodeSingularStringField(value: &self.scene) }() + case 11: try { try decoder.decodeSingularMessageField(value: &self._picoDisplayInfo) }() + default: break + } + } } func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.buffLevel != 0 { - try visitor.visitSingularInt64Field(value: self.buffLevel, fieldNumber: 1) - } - if self.status != 0 { - try visitor.visitSingularInt32Field(value: self.status, fieldNumber: 2) - } - if self.endTime != 0 { - try visitor.visitSingularInt64Field(value: self.endTime, fieldNumber: 3) - } - if !self.statsInfo.isEmpty { - try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: self.statsInfo, fieldNumber: 4) - } - try { if let v = self._buffBadge { - try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: User.GradeBuffInfo, rhs: User.GradeBuffInfo) -> Bool { - if lhs.buffLevel != rhs.buffLevel {return false} - if lhs.status != rhs.status {return false} - if lhs.endTime != rhs.endTime {return false} - if lhs.statsInfo != rhs.statsInfo {return false} - if lhs._buffBadge != rhs._buffBadge {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._common { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + if self.count != 0 { + try visitor.visitSingularUInt64Field(value: self.count, fieldNumber: 2) + } + if self.total != 0 { + try visitor.visitSingularUInt64Field(value: self.total, fieldNumber: 3) + } + if self.color != 0 { + try visitor.visitSingularUInt64Field(value: self.color, fieldNumber: 4) + } + try { if let v = self._user { + try visitor.visitSingularMessageField(value: v, fieldNumber: 5) + } }() + if !self.icon.isEmpty { + try visitor.visitSingularStringField(value: self.icon, fieldNumber: 6) + } + try { if let v = self._doubleLikeDetail { + try visitor.visitSingularMessageField(value: v, fieldNumber: 7) + } }() + try { if let v = self._displayControlInfo { + try visitor.visitSingularMessageField(value: v, fieldNumber: 8) + } }() + if self.linkmicGuestUid != 0 { + try visitor.visitSingularUInt64Field(value: self.linkmicGuestUid, fieldNumber: 9) + } + if !self.scene.isEmpty { + try visitor.visitSingularStringField(value: self.scene, fieldNumber: 10) + } + try { if let v = self._picoDisplayInfo { + try visitor.visitSingularMessageField(value: v, fieldNumber: 11) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Douyin_LikeMessage, rhs: Douyin_LikeMessage) -> Bool { + if lhs._common != rhs._common {return false} + if lhs.count != rhs.count {return false} + if lhs.total != rhs.total {return false} + if lhs.color != rhs.color {return false} + if lhs._user != rhs._user {return false} + if lhs.icon != rhs.icon {return false} + if lhs._doubleLikeDetail != rhs._doubleLikeDetail {return false} + if lhs._displayControlInfo != rhs._displayControlInfo {return false} + if lhs.linkmicGuestUid != rhs.linkmicGuestUid {return false} + if lhs.scene != rhs.scene {return false} + if lhs._picoDisplayInfo != rhs._picoDisplayInfo {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } -extension User.PayGrade: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = User.protoMessageName + ".PayGrade" +extension Douyin_SocialMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".SocialMessage" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "totalDiamondCount"), - 2: .same(proto: "diamondIcon"), - 3: .same(proto: "name"), - 4: .same(proto: "icon"), - 5: .same(proto: "nextName"), - 6: .same(proto: "level"), - 7: .same(proto: "nextIcon"), - 8: .same(proto: "nextDiamond"), - 9: .same(proto: "nowDiamond"), - 10: .same(proto: "thisGradeMinDiamond"), - 11: .same(proto: "thisGradeMaxDiamond"), - 12: .same(proto: "payDiamondBak"), - 13: .same(proto: "gradeDescribe"), - 14: .same(proto: "gradeIconList"), - 15: .same(proto: "screenChatType"), - 16: .same(proto: "imIcon"), - 17: .same(proto: "imIconWithLevel"), - 18: .same(proto: "liveIcon"), - 19: .same(proto: "newImIconWithLevel"), - 20: .same(proto: "newLiveIcon"), - 21: .same(proto: "upgradeNeedConsume"), - 22: .same(proto: "nextPrivileges"), - 23: .same(proto: "background"), - 24: .same(proto: "backgroundBack"), - 25: .same(proto: "score"), - 26: .same(proto: "buffInfo"), - 1001: .same(proto: "gradeBanner"), - 1002: .same(proto: "profileDialogBg"), - 1003: .same(proto: "profileDialogBgBack"), + 1: .same(proto: "common"), + 2: .same(proto: "user"), + 3: .same(proto: "shareType"), + 4: .same(proto: "action"), + 5: .same(proto: "shareTarget"), + 6: .same(proto: "followCount"), + 7: .same(proto: "publicAreaCommon"), ] fileprivate class _StorageClass { - var _totalDiamondCount: Int64 = 0 - var _diamondIcon: Image? = nil - var _name: String = String() - var _icon: Image? = nil - var _nextName: String = String() - var _level: Int64 = 0 - var _nextIcon: Image? = nil - var _nextDiamond: Int64 = 0 - var _nowDiamond: Int64 = 0 - var _thisGradeMinDiamond: Int64 = 0 - var _thisGradeMaxDiamond: Int64 = 0 - var _payDiamondBak: Int64 = 0 - var _gradeDescribe: String = String() - var _gradeIconList: [User.PayGrade.GradeIcon] = [] - var _screenChatType: Int64 = 0 - var _imIcon: Image? = nil - var _imIconWithLevel: Image? = nil - var _liveIcon: Image? = nil - var _newImIconWithLevel: Image? = nil - var _newLiveIcon: Image? = nil - var _upgradeNeedConsume: Int64 = 0 - var _nextPrivileges: String = String() - var _background: Image? = nil - var _backgroundBack: Image? = nil - var _score: Int64 = 0 - var _buffInfo: User.GradeBuffInfo? = nil - var _gradeBanner: String = String() - var _profileDialogBg: Image? = nil - var _profileDialogBgBack: Image? = nil - - static let defaultInstance = _StorageClass() - - private init() {} - - init(copying source: _StorageClass) { - _totalDiamondCount = source._totalDiamondCount - _diamondIcon = source._diamondIcon - _name = source._name - _icon = source._icon - _nextName = source._nextName - _level = source._level - _nextIcon = source._nextIcon - _nextDiamond = source._nextDiamond - _nowDiamond = source._nowDiamond - _thisGradeMinDiamond = source._thisGradeMinDiamond - _thisGradeMaxDiamond = source._thisGradeMaxDiamond - _payDiamondBak = source._payDiamondBak - _gradeDescribe = source._gradeDescribe - _gradeIconList = source._gradeIconList - _screenChatType = source._screenChatType - _imIcon = source._imIcon - _imIconWithLevel = source._imIconWithLevel - _liveIcon = source._liveIcon - _newImIconWithLevel = source._newImIconWithLevel - _newLiveIcon = source._newLiveIcon - _upgradeNeedConsume = source._upgradeNeedConsume - _nextPrivileges = source._nextPrivileges - _background = source._background - _backgroundBack = source._backgroundBack - _score = source._score - _buffInfo = source._buffInfo - _gradeBanner = source._gradeBanner - _profileDialogBg = source._profileDialogBg - _profileDialogBgBack = source._profileDialogBgBack - } + var _common: Douyin_Common? = nil + var _user: Douyin_User? = nil + var _shareType: UInt64 = 0 + var _action: UInt64 = 0 + var _shareTarget: String = String() + var _followCount: UInt64 = 0 + var _publicAreaCommon: Douyin_PublicAreaCommon? = nil + + #if swift(>=5.10) + // This property is used as the initial default value for new instances of the type. + // The type itself is protecting the reference to its storage via CoW semantics. + // This will force a copy to be made of this reference when the first mutation occurs; + // hence, it is safe to mark this as `nonisolated(unsafe)`. + static nonisolated(unsafe) let defaultInstance = _StorageClass() + #else + static let defaultInstance = _StorageClass() + #endif + + private init() {} + + init(copying source: _StorageClass) { + _common = source._common + _user = source._user + _shareType = source._shareType + _action = source._action + _shareTarget = source._shareTarget + _followCount = source._followCount + _publicAreaCommon = source._publicAreaCommon + } } fileprivate mutating func _uniqueStorage() -> _StorageClass { - if !isKnownUniquelyReferenced(&_storage) { - _storage = _StorageClass(copying: _storage) - } - return _storage + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage } mutating func decodeMessage(decoder: inout D) throws { - _ = _uniqueStorage() - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularInt64Field(value: &_storage._totalDiamondCount) }() - case 2: try { try decoder.decodeSingularMessageField(value: &_storage._diamondIcon) }() - case 3: try { try decoder.decodeSingularStringField(value: &_storage._name) }() - case 4: try { try decoder.decodeSingularMessageField(value: &_storage._icon) }() - case 5: try { try decoder.decodeSingularStringField(value: &_storage._nextName) }() - case 6: try { try decoder.decodeSingularInt64Field(value: &_storage._level) }() - case 7: try { try decoder.decodeSingularMessageField(value: &_storage._nextIcon) }() - case 8: try { try decoder.decodeSingularInt64Field(value: &_storage._nextDiamond) }() - case 9: try { try decoder.decodeSingularInt64Field(value: &_storage._nowDiamond) }() - case 10: try { try decoder.decodeSingularInt64Field(value: &_storage._thisGradeMinDiamond) }() - case 11: try { try decoder.decodeSingularInt64Field(value: &_storage._thisGradeMaxDiamond) }() - case 12: try { try decoder.decodeSingularInt64Field(value: &_storage._payDiamondBak) }() - case 13: try { try decoder.decodeSingularStringField(value: &_storage._gradeDescribe) }() - case 14: try { try decoder.decodeRepeatedMessageField(value: &_storage._gradeIconList) }() - case 15: try { try decoder.decodeSingularInt64Field(value: &_storage._screenChatType) }() - case 16: try { try decoder.decodeSingularMessageField(value: &_storage._imIcon) }() - case 17: try { try decoder.decodeSingularMessageField(value: &_storage._imIconWithLevel) }() - case 18: try { try decoder.decodeSingularMessageField(value: &_storage._liveIcon) }() - case 19: try { try decoder.decodeSingularMessageField(value: &_storage._newImIconWithLevel) }() - case 20: try { try decoder.decodeSingularMessageField(value: &_storage._newLiveIcon) }() - case 21: try { try decoder.decodeSingularInt64Field(value: &_storage._upgradeNeedConsume) }() - case 22: try { try decoder.decodeSingularStringField(value: &_storage._nextPrivileges) }() - case 23: try { try decoder.decodeSingularMessageField(value: &_storage._background) }() - case 24: try { try decoder.decodeSingularMessageField(value: &_storage._backgroundBack) }() - case 25: try { try decoder.decodeSingularInt64Field(value: &_storage._score) }() - case 26: try { try decoder.decodeSingularMessageField(value: &_storage._buffInfo) }() - case 1001: try { try decoder.decodeSingularStringField(value: &_storage._gradeBanner) }() - case 1002: try { try decoder.decodeSingularMessageField(value: &_storage._profileDialogBg) }() - case 1003: try { try decoder.decodeSingularMessageField(value: &_storage._profileDialogBgBack) }() - default: break - } - } - } + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &_storage._common) }() + case 2: try { try decoder.decodeSingularMessageField(value: &_storage._user) }() + case 3: try { try decoder.decodeSingularUInt64Field(value: &_storage._shareType) }() + case 4: try { try decoder.decodeSingularUInt64Field(value: &_storage._action) }() + case 5: try { try decoder.decodeSingularStringField(value: &_storage._shareTarget) }() + case 6: try { try decoder.decodeSingularUInt64Field(value: &_storage._followCount) }() + case 7: try { try decoder.decodeSingularMessageField(value: &_storage._publicAreaCommon) }() + default: break + } + } + } } func traverse(visitor: inout V) throws { - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if _storage._totalDiamondCount != 0 { - try visitor.visitSingularInt64Field(value: _storage._totalDiamondCount, fieldNumber: 1) - } - try { if let v = _storage._diamondIcon { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - if !_storage._name.isEmpty { - try visitor.visitSingularStringField(value: _storage._name, fieldNumber: 3) - } - try { if let v = _storage._icon { - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } }() - if !_storage._nextName.isEmpty { - try visitor.visitSingularStringField(value: _storage._nextName, fieldNumber: 5) - } - if _storage._level != 0 { - try visitor.visitSingularInt64Field(value: _storage._level, fieldNumber: 6) - } - try { if let v = _storage._nextIcon { - try visitor.visitSingularMessageField(value: v, fieldNumber: 7) - } }() - if _storage._nextDiamond != 0 { - try visitor.visitSingularInt64Field(value: _storage._nextDiamond, fieldNumber: 8) - } - if _storage._nowDiamond != 0 { - try visitor.visitSingularInt64Field(value: _storage._nowDiamond, fieldNumber: 9) - } - if _storage._thisGradeMinDiamond != 0 { - try visitor.visitSingularInt64Field(value: _storage._thisGradeMinDiamond, fieldNumber: 10) - } - if _storage._thisGradeMaxDiamond != 0 { - try visitor.visitSingularInt64Field(value: _storage._thisGradeMaxDiamond, fieldNumber: 11) - } - if _storage._payDiamondBak != 0 { - try visitor.visitSingularInt64Field(value: _storage._payDiamondBak, fieldNumber: 12) - } - if !_storage._gradeDescribe.isEmpty { - try visitor.visitSingularStringField(value: _storage._gradeDescribe, fieldNumber: 13) - } - if !_storage._gradeIconList.isEmpty { - try visitor.visitRepeatedMessageField(value: _storage._gradeIconList, fieldNumber: 14) - } - if _storage._screenChatType != 0 { - try visitor.visitSingularInt64Field(value: _storage._screenChatType, fieldNumber: 15) - } - try { if let v = _storage._imIcon { - try visitor.visitSingularMessageField(value: v, fieldNumber: 16) - } }() - try { if let v = _storage._imIconWithLevel { - try visitor.visitSingularMessageField(value: v, fieldNumber: 17) - } }() - try { if let v = _storage._liveIcon { - try visitor.visitSingularMessageField(value: v, fieldNumber: 18) - } }() - try { if let v = _storage._newImIconWithLevel { - try visitor.visitSingularMessageField(value: v, fieldNumber: 19) - } }() - try { if let v = _storage._newLiveIcon { - try visitor.visitSingularMessageField(value: v, fieldNumber: 20) - } }() - if _storage._upgradeNeedConsume != 0 { - try visitor.visitSingularInt64Field(value: _storage._upgradeNeedConsume, fieldNumber: 21) - } - if !_storage._nextPrivileges.isEmpty { - try visitor.visitSingularStringField(value: _storage._nextPrivileges, fieldNumber: 22) - } - try { if let v = _storage._background { - try visitor.visitSingularMessageField(value: v, fieldNumber: 23) - } }() - try { if let v = _storage._backgroundBack { - try visitor.visitSingularMessageField(value: v, fieldNumber: 24) - } }() - if _storage._score != 0 { - try visitor.visitSingularInt64Field(value: _storage._score, fieldNumber: 25) - } - try { if let v = _storage._buffInfo { - try visitor.visitSingularMessageField(value: v, fieldNumber: 26) - } }() - if !_storage._gradeBanner.isEmpty { - try visitor.visitSingularStringField(value: _storage._gradeBanner, fieldNumber: 1001) - } - try { if let v = _storage._profileDialogBg { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1002) - } }() - try { if let v = _storage._profileDialogBgBack { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1003) - } }() - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: User.PayGrade, rhs: User.PayGrade) -> Bool { - if lhs._storage !== rhs._storage { - let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in - let _storage = _args.0 - let rhs_storage = _args.1 - if _storage._totalDiamondCount != rhs_storage._totalDiamondCount {return false} - if _storage._diamondIcon != rhs_storage._diamondIcon {return false} - if _storage._name != rhs_storage._name {return false} - if _storage._icon != rhs_storage._icon {return false} - if _storage._nextName != rhs_storage._nextName {return false} - if _storage._level != rhs_storage._level {return false} - if _storage._nextIcon != rhs_storage._nextIcon {return false} - if _storage._nextDiamond != rhs_storage._nextDiamond {return false} - if _storage._nowDiamond != rhs_storage._nowDiamond {return false} - if _storage._thisGradeMinDiamond != rhs_storage._thisGradeMinDiamond {return false} - if _storage._thisGradeMaxDiamond != rhs_storage._thisGradeMaxDiamond {return false} - if _storage._payDiamondBak != rhs_storage._payDiamondBak {return false} - if _storage._gradeDescribe != rhs_storage._gradeDescribe {return false} - if _storage._gradeIconList != rhs_storage._gradeIconList {return false} - if _storage._screenChatType != rhs_storage._screenChatType {return false} - if _storage._imIcon != rhs_storage._imIcon {return false} - if _storage._imIconWithLevel != rhs_storage._imIconWithLevel {return false} - if _storage._liveIcon != rhs_storage._liveIcon {return false} - if _storage._newImIconWithLevel != rhs_storage._newImIconWithLevel {return false} - if _storage._newLiveIcon != rhs_storage._newLiveIcon {return false} - if _storage._upgradeNeedConsume != rhs_storage._upgradeNeedConsume {return false} - if _storage._nextPrivileges != rhs_storage._nextPrivileges {return false} - if _storage._background != rhs_storage._background {return false} - if _storage._backgroundBack != rhs_storage._backgroundBack {return false} - if _storage._score != rhs_storage._score {return false} - if _storage._buffInfo != rhs_storage._buffInfo {return false} - if _storage._gradeBanner != rhs_storage._gradeBanner {return false} - if _storage._profileDialogBg != rhs_storage._profileDialogBg {return false} - if _storage._profileDialogBgBack != rhs_storage._profileDialogBgBack {return false} - return true - } - if !storagesAreEqual {return false} - } - if lhs.unknownFields != rhs.unknownFields {return false} - return true + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = _storage._common { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try { if let v = _storage._user { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + if _storage._shareType != 0 { + try visitor.visitSingularUInt64Field(value: _storage._shareType, fieldNumber: 3) + } + if _storage._action != 0 { + try visitor.visitSingularUInt64Field(value: _storage._action, fieldNumber: 4) + } + if !_storage._shareTarget.isEmpty { + try visitor.visitSingularStringField(value: _storage._shareTarget, fieldNumber: 5) + } + if _storage._followCount != 0 { + try visitor.visitSingularUInt64Field(value: _storage._followCount, fieldNumber: 6) + } + try { if let v = _storage._publicAreaCommon { + try visitor.visitSingularMessageField(value: v, fieldNumber: 7) + } }() + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Douyin_SocialMessage, rhs: Douyin_SocialMessage) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._common != rhs_storage._common {return false} + if _storage._user != rhs_storage._user {return false} + if _storage._shareType != rhs_storage._shareType {return false} + if _storage._action != rhs_storage._action {return false} + if _storage._shareTarget != rhs_storage._shareTarget {return false} + if _storage._followCount != rhs_storage._followCount {return false} + if _storage._publicAreaCommon != rhs_storage._publicAreaCommon {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } -extension User.PayGrade.GradeIcon: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = User.PayGrade.protoMessageName + ".GradeIcon" +extension Douyin_PicoDisplayInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PicoDisplayInfo" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "icon"), - 2: .same(proto: "iconDiamond"), - 3: .same(proto: "level"), - 4: .same(proto: "levelStr"), + 1: .same(proto: "comboSumCount"), + 2: .same(proto: "emoji"), + 3: .same(proto: "emojiIcon"), + 4: .same(proto: "emojiText"), ] - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._icon) }() - case 2: try { try decoder.decodeSingularInt64Field(value: &self.iconDiamond) }() - case 3: try { try decoder.decodeSingularInt64Field(value: &self.level) }() - case 4: try { try decoder.decodeSingularStringField(value: &self.levelStr) }() - default: break - } - } + fileprivate class _StorageClass { + var _comboSumCount: UInt64 = 0 + var _emoji: String = String() + var _emojiIcon: Douyin_Image? = nil + var _emojiText: String = String() + + #if swift(>=5.10) + // This property is used as the initial default value for new instances of the type. + // The type itself is protecting the reference to its storage via CoW semantics. + // This will force a copy to be made of this reference when the first mutation occurs; + // hence, it is safe to mark this as `nonisolated(unsafe)`. + static nonisolated(unsafe) let defaultInstance = _StorageClass() + #else + static let defaultInstance = _StorageClass() + #endif + + private init() {} + + init(copying source: _StorageClass) { + _comboSumCount = source._comboSumCount + _emoji = source._emoji + _emojiIcon = source._emojiIcon + _emojiText = source._emojiText + } } - func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._icon { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if self.iconDiamond != 0 { - try visitor.visitSingularInt64Field(value: self.iconDiamond, fieldNumber: 2) - } - if self.level != 0 { - try visitor.visitSingularInt64Field(value: self.level, fieldNumber: 3) - } - if !self.levelStr.isEmpty { - try visitor.visitSingularStringField(value: self.levelStr, fieldNumber: 4) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: User.PayGrade.GradeIcon, rhs: User.PayGrade.GradeIcon) -> Bool { - if lhs._icon != rhs._icon {return false} - if lhs.iconDiamond != rhs.iconDiamond {return false} - if lhs.level != rhs.level {return false} - if lhs.levelStr != rhs.levelStr {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage } -} - -extension TextFormat: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = "TextFormat" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "color"), - 2: .same(proto: "bold"), - 3: .same(proto: "italic"), - 4: .same(proto: "weight"), - 5: .same(proto: "italicAngle"), - 6: .same(proto: "fontSize"), - 7: .same(proto: "userHeightLightColor"), - 8: .same(proto: "useRemoteClor"), - ] mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.color) }() - case 2: try { try decoder.decodeSingularBoolField(value: &self.bold) }() - case 3: try { try decoder.decodeSingularBoolField(value: &self.italic) }() - case 4: try { try decoder.decodeSingularInt32Field(value: &self.weight) }() - case 5: try { try decoder.decodeSingularInt32Field(value: &self.italicAngle) }() - case 6: try { try decoder.decodeSingularInt32Field(value: &self.fontSize) }() - case 7: try { try decoder.decodeSingularBoolField(value: &self.userHeightLightColor) }() - case 8: try { try decoder.decodeSingularBoolField(value: &self.useRemoteClor) }() - default: break - } - } + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularUInt64Field(value: &_storage._comboSumCount) }() + case 2: try { try decoder.decodeSingularStringField(value: &_storage._emoji) }() + case 3: try { try decoder.decodeSingularMessageField(value: &_storage._emojiIcon) }() + case 4: try { try decoder.decodeSingularStringField(value: &_storage._emojiText) }() + default: break + } + } + } } func traverse(visitor: inout V) throws { - if !self.color.isEmpty { - try visitor.visitSingularStringField(value: self.color, fieldNumber: 1) - } - if self.bold != false { - try visitor.visitSingularBoolField(value: self.bold, fieldNumber: 2) - } - if self.italic != false { - try visitor.visitSingularBoolField(value: self.italic, fieldNumber: 3) - } - if self.weight != 0 { - try visitor.visitSingularInt32Field(value: self.weight, fieldNumber: 4) - } - if self.italicAngle != 0 { - try visitor.visitSingularInt32Field(value: self.italicAngle, fieldNumber: 5) - } - if self.fontSize != 0 { - try visitor.visitSingularInt32Field(value: self.fontSize, fieldNumber: 6) - } - if self.userHeightLightColor != false { - try visitor.visitSingularBoolField(value: self.userHeightLightColor, fieldNumber: 7) - } - if self.useRemoteClor != false { - try visitor.visitSingularBoolField(value: self.useRemoteClor, fieldNumber: 8) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: TextFormat, rhs: TextFormat) -> Bool { - if lhs.color != rhs.color {return false} - if lhs.bold != rhs.bold {return false} - if lhs.italic != rhs.italic {return false} - if lhs.weight != rhs.weight {return false} - if lhs.italicAngle != rhs.italicAngle {return false} - if lhs.fontSize != rhs.fontSize {return false} - if lhs.userHeightLightColor != rhs.userHeightLightColor {return false} - if lhs.useRemoteClor != rhs.useRemoteClor {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if _storage._comboSumCount != 0 { + try visitor.visitSingularUInt64Field(value: _storage._comboSumCount, fieldNumber: 1) + } + if !_storage._emoji.isEmpty { + try visitor.visitSingularStringField(value: _storage._emoji, fieldNumber: 2) + } + try { if let v = _storage._emojiIcon { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + } }() + if !_storage._emojiText.isEmpty { + try visitor.visitSingularStringField(value: _storage._emojiText, fieldNumber: 4) + } + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Douyin_PicoDisplayInfo, rhs: Douyin_PicoDisplayInfo) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._comboSumCount != rhs_storage._comboSumCount {return false} + if _storage._emoji != rhs_storage._emoji {return false} + if _storage._emojiIcon != rhs_storage._emojiIcon {return false} + if _storage._emojiText != rhs_storage._emojiText {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } -extension TextPiece: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = "TextPiece" +extension Douyin_DoubleLikeDetail: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".DoubleLikeDetail" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "type"), - 2: .same(proto: "format"), - 11: .same(proto: "stringValue"), - 21: .same(proto: "userValue"), + 1: .same(proto: "doubleFlag"), + 2: .same(proto: "seqId"), + 3: .same(proto: "renewalsNum"), + 4: .same(proto: "triggersNum"), ] mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularInt32Field(value: &self.type) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._format) }() - case 11: try { try decoder.decodeSingularStringField(value: &self.stringValue) }() - case 21: try { try decoder.decodeSingularMessageField(value: &self._userValue) }() - default: break - } - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBoolField(value: &self.doubleFlag) }() + case 2: try { try decoder.decodeSingularUInt32Field(value: &self.seqID) }() + case 3: try { try decoder.decodeSingularUInt32Field(value: &self.renewalsNum) }() + case 4: try { try decoder.decodeSingularUInt32Field(value: &self.triggersNum) }() + default: break + } + } } func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.type != 0 { - try visitor.visitSingularInt32Field(value: self.type, fieldNumber: 1) - } - try { if let v = self._format { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - if !self.stringValue.isEmpty { - try visitor.visitSingularStringField(value: self.stringValue, fieldNumber: 11) - } - try { if let v = self._userValue { - try visitor.visitSingularMessageField(value: v, fieldNumber: 21) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: TextPiece, rhs: TextPiece) -> Bool { - if lhs.type != rhs.type {return false} - if lhs._format != rhs._format {return false} - if lhs.stringValue != rhs.stringValue {return false} - if lhs._userValue != rhs._userValue {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true + if self.doubleFlag != false { + try visitor.visitSingularBoolField(value: self.doubleFlag, fieldNumber: 1) + } + if self.seqID != 0 { + try visitor.visitSingularUInt32Field(value: self.seqID, fieldNumber: 2) + } + if self.renewalsNum != 0 { + try visitor.visitSingularUInt32Field(value: self.renewalsNum, fieldNumber: 3) + } + if self.triggersNum != 0 { + try visitor.visitSingularUInt32Field(value: self.triggersNum, fieldNumber: 4) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Douyin_DoubleLikeDetail, rhs: Douyin_DoubleLikeDetail) -> Bool { + if lhs.doubleFlag != rhs.doubleFlag {return false} + if lhs.seqID != rhs.seqID {return false} + if lhs.renewalsNum != rhs.renewalsNum {return false} + if lhs.triggersNum != rhs.triggersNum {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } -extension Image: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = "Image" +extension Douyin_DisplayControlInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".DisplayControlInfo" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "urlList"), - 2: .same(proto: "uri"), - 3: .same(proto: "height"), - 4: .same(proto: "width"), - 5: .same(proto: "avgColor"), - 6: .same(proto: "imageType"), - 7: .same(proto: "openWebUrl"), - 8: .same(proto: "content"), - 9: .same(proto: "isAnimated"), + 1: .same(proto: "showText"), + 2: .same(proto: "showIcons"), ] mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeRepeatedStringField(value: &self.urlList) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.uri) }() - case 3: try { try decoder.decodeSingularInt64Field(value: &self.height) }() - case 4: try { try decoder.decodeSingularInt64Field(value: &self.width) }() - case 5: try { try decoder.decodeSingularStringField(value: &self.avgColor) }() - case 6: try { try decoder.decodeSingularInt32Field(value: &self.imageType) }() - case 7: try { try decoder.decodeSingularStringField(value: &self.openWebURL) }() - case 8: try { try decoder.decodeSingularMessageField(value: &self._content) }() - case 9: try { try decoder.decodeSingularBoolField(value: &self.isAnimated) }() - default: break - } - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBoolField(value: &self.showText) }() + case 2: try { try decoder.decodeSingularBoolField(value: &self.showIcons) }() + default: break + } + } } func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if !self.urlList.isEmpty { - try visitor.visitRepeatedStringField(value: self.urlList, fieldNumber: 1) - } - if !self.uri.isEmpty { - try visitor.visitSingularStringField(value: self.uri, fieldNumber: 2) - } - if self.height != 0 { - try visitor.visitSingularInt64Field(value: self.height, fieldNumber: 3) - } - if self.width != 0 { - try visitor.visitSingularInt64Field(value: self.width, fieldNumber: 4) - } - if !self.avgColor.isEmpty { - try visitor.visitSingularStringField(value: self.avgColor, fieldNumber: 5) - } - if self.imageType != 0 { - try visitor.visitSingularInt32Field(value: self.imageType, fieldNumber: 6) - } - if !self.openWebURL.isEmpty { - try visitor.visitSingularStringField(value: self.openWebURL, fieldNumber: 7) - } - try { if let v = self._content { - try visitor.visitSingularMessageField(value: v, fieldNumber: 8) - } }() - if self.isAnimated != false { - try visitor.visitSingularBoolField(value: self.isAnimated, fieldNumber: 9) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Image, rhs: Image) -> Bool { - if lhs.urlList != rhs.urlList {return false} - if lhs.uri != rhs.uri {return false} - if lhs.height != rhs.height {return false} - if lhs.width != rhs.width {return false} - if lhs.avgColor != rhs.avgColor {return false} - if lhs.imageType != rhs.imageType {return false} - if lhs.openWebURL != rhs.openWebURL {return false} - if lhs._content != rhs._content {return false} - if lhs.isAnimated != rhs.isAnimated {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Image.Content: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = Image.protoMessageName + ".Content" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "name"), - 2: .same(proto: "fontColor"), - 3: .same(proto: "level"), - 4: .same(proto: "alternativeText"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.name) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.fontColor) }() - case 3: try { try decoder.decodeSingularInt64Field(value: &self.level) }() - case 4: try { try decoder.decodeSingularStringField(value: &self.alternativeText) }() - default: break - } - } + if self.showText != false { + try visitor.visitSingularBoolField(value: self.showText, fieldNumber: 1) + } + if self.showIcons != false { + try visitor.visitSingularBoolField(value: self.showIcons, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) } - func traverse(visitor: inout V) throws { - if !self.name.isEmpty { - try visitor.visitSingularStringField(value: self.name, fieldNumber: 1) - } - if !self.fontColor.isEmpty { - try visitor.visitSingularStringField(value: self.fontColor, fieldNumber: 2) - } - if self.level != 0 { - try visitor.visitSingularInt64Field(value: self.level, fieldNumber: 3) - } - if !self.alternativeText.isEmpty { - try visitor.visitSingularStringField(value: self.alternativeText, fieldNumber: 4) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Image.Content, rhs: Image.Content) -> Bool { - if lhs.name != rhs.name {return false} - if lhs.fontColor != rhs.fontColor {return false} - if lhs.level != rhs.level {return false} - if lhs.alternativeText != rhs.alternativeText {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true + static func ==(lhs: Douyin_DisplayControlInfo, rhs: Douyin_DisplayControlInfo) -> Bool { + if lhs.showText != rhs.showText {return false} + if lhs.showIcons != rhs.showIcons {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } -extension TextPieceUser: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = "TextPieceUser" +extension Douyin_EpisodeChatMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".EpisodeChatMessage" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "user"), - 2: .same(proto: "withColon"), + 1: .same(proto: "common"), + 2: .same(proto: "user"), + 3: .same(proto: "content"), + 4: .same(proto: "visibleToSende"), + 7: .same(proto: "giftImage"), + 8: .same(proto: "agreeMsgId"), + 9: .same(proto: "colorValueList"), ] - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._user) }() - case 2: try { try decoder.decodeSingularBoolField(value: &self.withColon) }() - default: break - } - } + fileprivate class _StorageClass { + var _common: Douyin_Message? = nil + var _user: Douyin_User? = nil + var _content: String = String() + var _visibleToSende: Bool = false + var _giftImage: Douyin_Image? = nil + var _agreeMsgID: UInt64 = 0 + var _colorValueList: [String] = [] + + #if swift(>=5.10) + // This property is used as the initial default value for new instances of the type. + // The type itself is protecting the reference to its storage via CoW semantics. + // This will force a copy to be made of this reference when the first mutation occurs; + // hence, it is safe to mark this as `nonisolated(unsafe)`. + static nonisolated(unsafe) let defaultInstance = _StorageClass() + #else + static let defaultInstance = _StorageClass() + #endif + + private init() {} + + init(copying source: _StorageClass) { + _common = source._common + _user = source._user + _content = source._content + _visibleToSende = source._visibleToSende + _giftImage = source._giftImage + _agreeMsgID = source._agreeMsgID + _colorValueList = source._colorValueList + } } - func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._user { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if self.withColon != false { - try visitor.visitSingularBoolField(value: self.withColon, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: TextPieceUser, rhs: TextPieceUser) -> Bool { - if lhs._user != rhs._user {return false} - if lhs.withColon != rhs.withColon {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage } -} - -extension PublicAreaCommon: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = "PublicAreaCommon" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "userLabel"), - 2: .same(proto: "userConsumeInRoom"), - 3: .same(proto: "userSendGiftCntInRoom"), - ] mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._userLabel) }() - case 2: try { try decoder.decodeSingularInt64Field(value: &self.userConsumeInRoom) }() - case 3: try { try decoder.decodeSingularInt64Field(value: &self.userSendGiftCntInRoom) }() - default: break - } - } + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &_storage._common) }() + case 2: try { try decoder.decodeSingularMessageField(value: &_storage._user) }() + case 3: try { try decoder.decodeSingularStringField(value: &_storage._content) }() + case 4: try { try decoder.decodeSingularBoolField(value: &_storage._visibleToSende) }() + case 7: try { try decoder.decodeSingularMessageField(value: &_storage._giftImage) }() + case 8: try { try decoder.decodeSingularUInt64Field(value: &_storage._agreeMsgID) }() + case 9: try { try decoder.decodeRepeatedStringField(value: &_storage._colorValueList) }() + default: break + } + } + } } func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._userLabel { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if self.userConsumeInRoom != 0 { - try visitor.visitSingularInt64Field(value: self.userConsumeInRoom, fieldNumber: 2) - } - if self.userSendGiftCntInRoom != 0 { - try visitor.visitSingularInt64Field(value: self.userSendGiftCntInRoom, fieldNumber: 3) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: PublicAreaCommon, rhs: PublicAreaCommon) -> Bool { - if lhs._userLabel != rhs._userLabel {return false} - if lhs.userConsumeInRoom != rhs.userConsumeInRoom {return false} - if lhs.userSendGiftCntInRoom != rhs.userSendGiftCntInRoom {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = _storage._common { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try { if let v = _storage._user { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + if !_storage._content.isEmpty { + try visitor.visitSingularStringField(value: _storage._content, fieldNumber: 3) + } + if _storage._visibleToSende != false { + try visitor.visitSingularBoolField(value: _storage._visibleToSende, fieldNumber: 4) + } + try { if let v = _storage._giftImage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 7) + } }() + if _storage._agreeMsgID != 0 { + try visitor.visitSingularUInt64Field(value: _storage._agreeMsgID, fieldNumber: 8) + } + if !_storage._colorValueList.isEmpty { + try visitor.visitRepeatedStringField(value: _storage._colorValueList, fieldNumber: 9) + } + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Douyin_EpisodeChatMessage, rhs: Douyin_EpisodeChatMessage) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._common != rhs_storage._common {return false} + if _storage._user != rhs_storage._user {return false} + if _storage._content != rhs_storage._content {return false} + if _storage._visibleToSende != rhs_storage._visibleToSende {return false} + if _storage._giftImage != rhs_storage._giftImage {return false} + if _storage._agreeMsgID != rhs_storage._agreeMsgID {return false} + if _storage._colorValueList != rhs_storage._colorValueList {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } -extension GiftIMPriority: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = "GiftIMPriority" +extension Douyin_MatchAgainstScoreMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".MatchAgainstScoreMessage" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "queueSizes"), - 2: .same(proto: "selfQueuePriority"), - 3: .same(proto: "priority"), + 1: .same(proto: "common"), + 2: .same(proto: "against"), + 3: .same(proto: "matchStatus"), + 4: .same(proto: "displayStatus"), ] mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeRepeatedInt64Field(value: &self.queueSizes) }() - case 2: try { try decoder.decodeSingularInt64Field(value: &self.selfQueuePriority) }() - case 3: try { try decoder.decodeSingularInt64Field(value: &self.priority) }() - default: break - } - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._common) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._against) }() + case 3: try { try decoder.decodeSingularUInt32Field(value: &self.matchStatus) }() + case 4: try { try decoder.decodeSingularUInt32Field(value: &self.displayStatus) }() + default: break + } + } } func traverse(visitor: inout V) throws { - if !self.queueSizes.isEmpty { - try visitor.visitPackedInt64Field(value: self.queueSizes, fieldNumber: 1) - } - if self.selfQueuePriority != 0 { - try visitor.visitSingularInt64Field(value: self.selfQueuePriority, fieldNumber: 2) - } - if self.priority != 0 { - try visitor.visitSingularInt64Field(value: self.priority, fieldNumber: 3) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: GiftIMPriority, rhs: GiftIMPriority) -> Bool { - if lhs.queueSizes != rhs.queueSizes {return false} - if lhs.selfQueuePriority != rhs.selfQueuePriority {return false} - if lhs.priority != rhs.priority {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._common { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try { if let v = self._against { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + if self.matchStatus != 0 { + try visitor.visitSingularUInt32Field(value: self.matchStatus, fieldNumber: 3) + } + if self.displayStatus != 0 { + try visitor.visitSingularUInt32Field(value: self.displayStatus, fieldNumber: 4) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Douyin_MatchAgainstScoreMessage, rhs: Douyin_MatchAgainstScoreMessage) -> Bool { + if lhs._common != rhs._common {return false} + if lhs._against != rhs._against {return false} + if lhs.matchStatus != rhs.matchStatus {return false} + if lhs.displayStatus != rhs.displayStatus {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } -extension GiftTrayInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = "GiftTrayInfo" +extension Douyin_Against: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Against" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "trayDisplayText"), - 2: .same(proto: "trayBaseImg"), - 3: .same(proto: "trayHeadImg"), - 4: .same(proto: "trayRightImg"), - 5: .same(proto: "trayLevel"), - 6: .same(proto: "trayDynamicImg"), + 1: .same(proto: "leftName"), + 2: .same(proto: "leftLogo"), + 3: .same(proto: "leftGoal"), + 6: .same(proto: "rightName"), + 7: .same(proto: "rightLogo"), + 8: .same(proto: "rightGoal"), + 11: .same(proto: "timestamp"), + 12: .same(proto: "version"), + 13: .same(proto: "leftTeamId"), + 14: .same(proto: "rightTeamId"), + 15: .same(proto: "diffSei2absSecond"), + 16: .same(proto: "finalGoalStage"), + 17: .same(proto: "currentGoalStage"), + 18: .same(proto: "leftScoreAddition"), + 19: .same(proto: "rightScoreAddition"), + 20: .same(proto: "leftGoalInt"), + 21: .same(proto: "rightGoalInt"), ] fileprivate class _StorageClass { - var _trayDisplayText: Text? = nil - var _trayBaseImg: Image? = nil - var _trayHeadImg: Image? = nil - var _trayRightImg: Image? = nil - var _trayLevel: Int64 = 0 - var _trayDynamicImg: Image? = nil - - static let defaultInstance = _StorageClass() - - private init() {} - - init(copying source: _StorageClass) { - _trayDisplayText = source._trayDisplayText - _trayBaseImg = source._trayBaseImg - _trayHeadImg = source._trayHeadImg - _trayRightImg = source._trayRightImg - _trayLevel = source._trayLevel - _trayDynamicImg = source._trayDynamicImg - } + var _leftName: String = String() + var _leftLogo: Douyin_Image? = nil + var _leftGoal: String = String() + var _rightName: String = String() + var _rightLogo: Douyin_Image? = nil + var _rightGoal: String = String() + var _timestamp: UInt64 = 0 + var _version: UInt64 = 0 + var _leftTeamID: UInt64 = 0 + var _rightTeamID: UInt64 = 0 + var _diffSei2AbsSecond: UInt64 = 0 + var _finalGoalStage: UInt32 = 0 + var _currentGoalStage: UInt32 = 0 + var _leftScoreAddition: UInt32 = 0 + var _rightScoreAddition: UInt32 = 0 + var _leftGoalInt: UInt64 = 0 + var _rightGoalInt: UInt64 = 0 + + #if swift(>=5.10) + // This property is used as the initial default value for new instances of the type. + // The type itself is protecting the reference to its storage via CoW semantics. + // This will force a copy to be made of this reference when the first mutation occurs; + // hence, it is safe to mark this as `nonisolated(unsafe)`. + static nonisolated(unsafe) let defaultInstance = _StorageClass() + #else + static let defaultInstance = _StorageClass() + #endif + + private init() {} + + init(copying source: _StorageClass) { + _leftName = source._leftName + _leftLogo = source._leftLogo + _leftGoal = source._leftGoal + _rightName = source._rightName + _rightLogo = source._rightLogo + _rightGoal = source._rightGoal + _timestamp = source._timestamp + _version = source._version + _leftTeamID = source._leftTeamID + _rightTeamID = source._rightTeamID + _diffSei2AbsSecond = source._diffSei2AbsSecond + _finalGoalStage = source._finalGoalStage + _currentGoalStage = source._currentGoalStage + _leftScoreAddition = source._leftScoreAddition + _rightScoreAddition = source._rightScoreAddition + _leftGoalInt = source._leftGoalInt + _rightGoalInt = source._rightGoalInt + } } fileprivate mutating func _uniqueStorage() -> _StorageClass { - if !isKnownUniquelyReferenced(&_storage) { - _storage = _StorageClass(copying: _storage) - } - return _storage + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage } mutating func decodeMessage(decoder: inout D) throws { - _ = _uniqueStorage() - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &_storage._trayDisplayText) }() - case 2: try { try decoder.decodeSingularMessageField(value: &_storage._trayBaseImg) }() - case 3: try { try decoder.decodeSingularMessageField(value: &_storage._trayHeadImg) }() - case 4: try { try decoder.decodeSingularMessageField(value: &_storage._trayRightImg) }() - case 5: try { try decoder.decodeSingularInt64Field(value: &_storage._trayLevel) }() - case 6: try { try decoder.decodeSingularMessageField(value: &_storage._trayDynamicImg) }() - default: break - } - } - } + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &_storage._leftName) }() + case 2: try { try decoder.decodeSingularMessageField(value: &_storage._leftLogo) }() + case 3: try { try decoder.decodeSingularStringField(value: &_storage._leftGoal) }() + case 6: try { try decoder.decodeSingularStringField(value: &_storage._rightName) }() + case 7: try { try decoder.decodeSingularMessageField(value: &_storage._rightLogo) }() + case 8: try { try decoder.decodeSingularStringField(value: &_storage._rightGoal) }() + case 11: try { try decoder.decodeSingularUInt64Field(value: &_storage._timestamp) }() + case 12: try { try decoder.decodeSingularUInt64Field(value: &_storage._version) }() + case 13: try { try decoder.decodeSingularUInt64Field(value: &_storage._leftTeamID) }() + case 14: try { try decoder.decodeSingularUInt64Field(value: &_storage._rightTeamID) }() + case 15: try { try decoder.decodeSingularUInt64Field(value: &_storage._diffSei2AbsSecond) }() + case 16: try { try decoder.decodeSingularUInt32Field(value: &_storage._finalGoalStage) }() + case 17: try { try decoder.decodeSingularUInt32Field(value: &_storage._currentGoalStage) }() + case 18: try { try decoder.decodeSingularUInt32Field(value: &_storage._leftScoreAddition) }() + case 19: try { try decoder.decodeSingularUInt32Field(value: &_storage._rightScoreAddition) }() + case 20: try { try decoder.decodeSingularUInt64Field(value: &_storage._leftGoalInt) }() + case 21: try { try decoder.decodeSingularUInt64Field(value: &_storage._rightGoalInt) }() + default: break + } + } + } } func traverse(visitor: inout V) throws { - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = _storage._trayDisplayText { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = _storage._trayBaseImg { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try { if let v = _storage._trayHeadImg { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try { if let v = _storage._trayRightImg { - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } }() - if _storage._trayLevel != 0 { - try visitor.visitSingularInt64Field(value: _storage._trayLevel, fieldNumber: 5) - } - try { if let v = _storage._trayDynamicImg { - try visitor.visitSingularMessageField(value: v, fieldNumber: 6) - } }() - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: GiftTrayInfo, rhs: GiftTrayInfo) -> Bool { - if lhs._storage !== rhs._storage { - let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in - let _storage = _args.0 - let rhs_storage = _args.1 - if _storage._trayDisplayText != rhs_storage._trayDisplayText {return false} - if _storage._trayBaseImg != rhs_storage._trayBaseImg {return false} - if _storage._trayHeadImg != rhs_storage._trayHeadImg {return false} - if _storage._trayRightImg != rhs_storage._trayRightImg {return false} - if _storage._trayLevel != rhs_storage._trayLevel {return false} - if _storage._trayDynamicImg != rhs_storage._trayDynamicImg {return false} - return true - } - if !storagesAreEqual {return false} - } - if lhs.unknownFields != rhs.unknownFields {return false} - return true + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if !_storage._leftName.isEmpty { + try visitor.visitSingularStringField(value: _storage._leftName, fieldNumber: 1) + } + try { if let v = _storage._leftLogo { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + if !_storage._leftGoal.isEmpty { + try visitor.visitSingularStringField(value: _storage._leftGoal, fieldNumber: 3) + } + if !_storage._rightName.isEmpty { + try visitor.visitSingularStringField(value: _storage._rightName, fieldNumber: 6) + } + try { if let v = _storage._rightLogo { + try visitor.visitSingularMessageField(value: v, fieldNumber: 7) + } }() + if !_storage._rightGoal.isEmpty { + try visitor.visitSingularStringField(value: _storage._rightGoal, fieldNumber: 8) + } + if _storage._timestamp != 0 { + try visitor.visitSingularUInt64Field(value: _storage._timestamp, fieldNumber: 11) + } + if _storage._version != 0 { + try visitor.visitSingularUInt64Field(value: _storage._version, fieldNumber: 12) + } + if _storage._leftTeamID != 0 { + try visitor.visitSingularUInt64Field(value: _storage._leftTeamID, fieldNumber: 13) + } + if _storage._rightTeamID != 0 { + try visitor.visitSingularUInt64Field(value: _storage._rightTeamID, fieldNumber: 14) + } + if _storage._diffSei2AbsSecond != 0 { + try visitor.visitSingularUInt64Field(value: _storage._diffSei2AbsSecond, fieldNumber: 15) + } + if _storage._finalGoalStage != 0 { + try visitor.visitSingularUInt32Field(value: _storage._finalGoalStage, fieldNumber: 16) + } + if _storage._currentGoalStage != 0 { + try visitor.visitSingularUInt32Field(value: _storage._currentGoalStage, fieldNumber: 17) + } + if _storage._leftScoreAddition != 0 { + try visitor.visitSingularUInt32Field(value: _storage._leftScoreAddition, fieldNumber: 18) + } + if _storage._rightScoreAddition != 0 { + try visitor.visitSingularUInt32Field(value: _storage._rightScoreAddition, fieldNumber: 19) + } + if _storage._leftGoalInt != 0 { + try visitor.visitSingularUInt64Field(value: _storage._leftGoalInt, fieldNumber: 20) + } + if _storage._rightGoalInt != 0 { + try visitor.visitSingularUInt64Field(value: _storage._rightGoalInt, fieldNumber: 21) + } + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Douyin_Against, rhs: Douyin_Against) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._leftName != rhs_storage._leftName {return false} + if _storage._leftLogo != rhs_storage._leftLogo {return false} + if _storage._leftGoal != rhs_storage._leftGoal {return false} + if _storage._rightName != rhs_storage._rightName {return false} + if _storage._rightLogo != rhs_storage._rightLogo {return false} + if _storage._rightGoal != rhs_storage._rightGoal {return false} + if _storage._timestamp != rhs_storage._timestamp {return false} + if _storage._version != rhs_storage._version {return false} + if _storage._leftTeamID != rhs_storage._leftTeamID {return false} + if _storage._rightTeamID != rhs_storage._rightTeamID {return false} + if _storage._diffSei2AbsSecond != rhs_storage._diffSei2AbsSecond {return false} + if _storage._finalGoalStage != rhs_storage._finalGoalStage {return false} + if _storage._currentGoalStage != rhs_storage._currentGoalStage {return false} + if _storage._leftScoreAddition != rhs_storage._leftScoreAddition {return false} + if _storage._rightScoreAddition != rhs_storage._rightScoreAddition {return false} + if _storage._leftGoalInt != rhs_storage._leftGoalInt {return false} + if _storage._rightGoalInt != rhs_storage._rightGoalInt {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } -extension GiftStruct: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = "GiftStruct" +extension Douyin_Common: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Common" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "image"), - 2: .same(proto: "describe"), - 3: .same(proto: "notify"), - 4: .same(proto: "duration"), - 5: .same(proto: "id"), - 6: .same(proto: "fansclubInfo"), - 7: .same(proto: "forLinkmic"), - 8: .same(proto: "doodle"), - 9: .same(proto: "forFansclub"), - 10: .same(proto: "combo"), - 11: .same(proto: "type"), - 12: .same(proto: "diamondCount"), - 13: .same(proto: "isDisplayedOnPanel"), - 14: .same(proto: "primaryEffectId"), - 15: .same(proto: "giftLabelIcon"), - 16: .same(proto: "name"), - 17: .same(proto: "region"), - 18: .same(proto: "manual"), - 19: .same(proto: "forCustom"), - 20: .same(proto: "specialEffects"), - 21: .same(proto: "icon"), - 22: .same(proto: "actionType"), - 23: .same(proto: "watermelonSeeds"), - 24: .same(proto: "goldEffect"), - 25: .same(proto: "subs"), - 26: .same(proto: "goldenBeans"), - 27: .same(proto: "honorLevel"), - 28: .same(proto: "itemType"), - 29: .same(proto: "schemeUrl"), - 30: .same(proto: "giftOperation"), - 31: .same(proto: "eventName"), - 32: .same(proto: "nobleLevel"), - 33: .same(proto: "guideUrl"), - 34: .same(proto: "punishMedicine"), - 35: .same(proto: "forPortal"), - 36: .same(proto: "businessText"), - 37: .same(proto: "cnyGift"), - 38: .same(proto: "appId"), - 39: .same(proto: "vipLevel"), - 40: .same(proto: "isGray"), - 41: .same(proto: "graySchemeUrl"), - 42: .same(proto: "giftScene"), - 43: .same(proto: "giftBanner"), - 44: .same(proto: "triggerWords"), - 45: .same(proto: "giftBuffInfos"), - 46: .same(proto: "forFirstRecharge"), - 47: .same(proto: "dynamicImgForSelected"), - 48: .same(proto: "afterSendAction"), - 49: .same(proto: "giftOfflineTime"), - 50: .same(proto: "topBarText"), - 51: .same(proto: "topRightAvatar"), - 52: .same(proto: "bannerSchemeUrl"), - 53: .same(proto: "isLocked"), - 54: .same(proto: "reqExtraType"), - 55: .same(proto: "assetIds"), - 56: .same(proto: "giftPreviewInfo"), - 57: .same(proto: "giftTip"), - 58: .same(proto: "needSweepLightCount"), - 59: .same(proto: "groupInfo"), + 1: .same(proto: "method"), + 2: .same(proto: "msgId"), + 3: .same(proto: "roomId"), + 4: .same(proto: "createTime"), + 5: .same(proto: "monitor"), + 6: .same(proto: "isShowMsg"), + 7: .same(proto: "describe"), + 9: .same(proto: "foldType"), + 10: .same(proto: "anchorFoldType"), + 11: .same(proto: "priorityScore"), + 12: .same(proto: "logId"), + 13: .same(proto: "msgProcessFilterK"), + 14: .same(proto: "msgProcessFilterV"), + 15: .same(proto: "user"), + 17: .same(proto: "anchorFoldTypeV2"), + 18: .same(proto: "processAtSeiTimeMs"), + 19: .same(proto: "randomDispatchMs"), + 20: .same(proto: "isDispatch"), + 21: .same(proto: "channelId"), + 22: .same(proto: "diffSei2absSecond"), + 23: .same(proto: "anchorFoldDuration"), ] fileprivate class _StorageClass { - var _image: Image? = nil - var _describe: String = String() - var _notify: Bool = false - var _duration: Int64 = 0 - var _id: Int64 = 0 - var _fansclubInfo: GiftStruct.GiftStructFansClubInfo? = nil - var _forLinkmic: Bool = false - var _doodle: Bool = false - var _forFansclub: Bool = false - var _combo: Bool = false - var _type: Int32 = 0 - var _diamondCount: Int32 = 0 - var _isDisplayedOnPanel: Int32 = 0 - var _primaryEffectID: Int64 = 0 - var _giftLabelIcon: Image? = nil - var _name: String = String() - var _region: String = String() - var _manual: String = String() - var _forCustom: Bool = false - var _specialEffects: Dictionary = [:] - var _icon: Image? = nil - var _actionType: Int32 = 0 - var _watermelonSeeds: Int32 = 0 - var _goldEffect: String = String() - var _subs: [LuckyMoneyGiftMeta] = [] - var _goldenBeans: Int64 = 0 - var _honorLevel: Int64 = 0 - var _itemType: Int32 = 0 - var _schemeURL: String = String() - var _giftOperation: GiftPanelOperation? = nil - var _eventName: String = String() - var _nobleLevel: Int64 = 0 - var _guideURL: String = String() - var _punishMedicine: Bool = false - var _forPortal: Bool = false - var _businessText: String = String() - var _cnyGift: Bool = false - var _appID: Int64 = 0 - var _vipLevel: Int64 = 0 - var _isGray: Bool = false - var _graySchemeURL: String = String() - var _giftScene: Int64 = 0 - var _giftBanner: GiftBanner? = nil - var _triggerWords: [String] = [] - var _giftBuffInfos: [GiftBuffInfo] = [] - var _forFirstRecharge: Bool = false - var _dynamicImgForSelected: Image? = nil - var _afterSendAction: Int32 = 0 - var _giftOfflineTime: Int64 = 0 - var _topBarText: String = String() - var _topRightAvatar: Image? = nil - var _bannerSchemeURL: String = String() - var _isLocked: Bool = false - var _reqExtraType: Int64 = 0 - var _assetIds: [Int64] = [] - var _giftPreviewInfo: GiftPreviewInfo? = nil - var _giftTip: GiftTip? = nil - var _needSweepLightCount: Int32 = 0 - var _groupInfo: [GiftGroupInfo] = [] - - static let defaultInstance = _StorageClass() - - private init() {} - - init(copying source: _StorageClass) { - _image = source._image - _describe = source._describe - _notify = source._notify - _duration = source._duration - _id = source._id - _fansclubInfo = source._fansclubInfo - _forLinkmic = source._forLinkmic - _doodle = source._doodle - _forFansclub = source._forFansclub - _combo = source._combo - _type = source._type - _diamondCount = source._diamondCount - _isDisplayedOnPanel = source._isDisplayedOnPanel - _primaryEffectID = source._primaryEffectID - _giftLabelIcon = source._giftLabelIcon - _name = source._name - _region = source._region - _manual = source._manual - _forCustom = source._forCustom - _specialEffects = source._specialEffects - _icon = source._icon - _actionType = source._actionType - _watermelonSeeds = source._watermelonSeeds - _goldEffect = source._goldEffect - _subs = source._subs - _goldenBeans = source._goldenBeans - _honorLevel = source._honorLevel - _itemType = source._itemType - _schemeURL = source._schemeURL - _giftOperation = source._giftOperation - _eventName = source._eventName - _nobleLevel = source._nobleLevel - _guideURL = source._guideURL - _punishMedicine = source._punishMedicine - _forPortal = source._forPortal - _businessText = source._businessText - _cnyGift = source._cnyGift - _appID = source._appID - _vipLevel = source._vipLevel - _isGray = source._isGray - _graySchemeURL = source._graySchemeURL - _giftScene = source._giftScene - _giftBanner = source._giftBanner - _triggerWords = source._triggerWords - _giftBuffInfos = source._giftBuffInfos - _forFirstRecharge = source._forFirstRecharge - _dynamicImgForSelected = source._dynamicImgForSelected - _afterSendAction = source._afterSendAction - _giftOfflineTime = source._giftOfflineTime - _topBarText = source._topBarText - _topRightAvatar = source._topRightAvatar - _bannerSchemeURL = source._bannerSchemeURL - _isLocked = source._isLocked - _reqExtraType = source._reqExtraType - _assetIds = source._assetIds - _giftPreviewInfo = source._giftPreviewInfo - _giftTip = source._giftTip - _needSweepLightCount = source._needSweepLightCount - _groupInfo = source._groupInfo - } + var _method: String = String() + var _msgID: UInt64 = 0 + var _roomID: UInt64 = 0 + var _createTime: UInt64 = 0 + var _monitor: UInt32 = 0 + var _isShowMsg: Bool = false + var _describe: String = String() + var _foldType: UInt64 = 0 + var _anchorFoldType: UInt64 = 0 + var _priorityScore: UInt64 = 0 + var _logID: String = String() + var _msgProcessFilterK: String = String() + var _msgProcessFilterV: String = String() + var _user: Douyin_User? = nil + var _anchorFoldTypeV2: UInt64 = 0 + var _processAtSeiTimeMs: UInt64 = 0 + var _randomDispatchMs: UInt64 = 0 + var _isDispatch: Bool = false + var _channelID: UInt64 = 0 + var _diffSei2AbsSecond: UInt64 = 0 + var _anchorFoldDuration: UInt64 = 0 + + #if swift(>=5.10) + // This property is used as the initial default value for new instances of the type. + // The type itself is protecting the reference to its storage via CoW semantics. + // This will force a copy to be made of this reference when the first mutation occurs; + // hence, it is safe to mark this as `nonisolated(unsafe)`. + static nonisolated(unsafe) let defaultInstance = _StorageClass() + #else + static let defaultInstance = _StorageClass() + #endif + + private init() {} + + init(copying source: _StorageClass) { + _method = source._method + _msgID = source._msgID + _roomID = source._roomID + _createTime = source._createTime + _monitor = source._monitor + _isShowMsg = source._isShowMsg + _describe = source._describe + _foldType = source._foldType + _anchorFoldType = source._anchorFoldType + _priorityScore = source._priorityScore + _logID = source._logID + _msgProcessFilterK = source._msgProcessFilterK + _msgProcessFilterV = source._msgProcessFilterV + _user = source._user + _anchorFoldTypeV2 = source._anchorFoldTypeV2 + _processAtSeiTimeMs = source._processAtSeiTimeMs + _randomDispatchMs = source._randomDispatchMs + _isDispatch = source._isDispatch + _channelID = source._channelID + _diffSei2AbsSecond = source._diffSei2AbsSecond + _anchorFoldDuration = source._anchorFoldDuration + } } fileprivate mutating func _uniqueStorage() -> _StorageClass { - if !isKnownUniquelyReferenced(&_storage) { - _storage = _StorageClass(copying: _storage) - } - return _storage + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage } mutating func decodeMessage(decoder: inout D) throws { - _ = _uniqueStorage() - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &_storage._image) }() - case 2: try { try decoder.decodeSingularStringField(value: &_storage._describe) }() - case 3: try { try decoder.decodeSingularBoolField(value: &_storage._notify) }() - case 4: try { try decoder.decodeSingularInt64Field(value: &_storage._duration) }() - case 5: try { try decoder.decodeSingularInt64Field(value: &_storage._id) }() - case 6: try { try decoder.decodeSingularMessageField(value: &_storage._fansclubInfo) }() - case 7: try { try decoder.decodeSingularBoolField(value: &_storage._forLinkmic) }() - case 8: try { try decoder.decodeSingularBoolField(value: &_storage._doodle) }() - case 9: try { try decoder.decodeSingularBoolField(value: &_storage._forFansclub) }() - case 10: try { try decoder.decodeSingularBoolField(value: &_storage._combo) }() - case 11: try { try decoder.decodeSingularInt32Field(value: &_storage._type) }() - case 12: try { try decoder.decodeSingularInt32Field(value: &_storage._diamondCount) }() - case 13: try { try decoder.decodeSingularInt32Field(value: &_storage._isDisplayedOnPanel) }() - case 14: try { try decoder.decodeSingularInt64Field(value: &_storage._primaryEffectID) }() - case 15: try { try decoder.decodeSingularMessageField(value: &_storage._giftLabelIcon) }() - case 16: try { try decoder.decodeSingularStringField(value: &_storage._name) }() - case 17: try { try decoder.decodeSingularStringField(value: &_storage._region) }() - case 18: try { try decoder.decodeSingularStringField(value: &_storage._manual) }() - case 19: try { try decoder.decodeSingularBoolField(value: &_storage._forCustom) }() - case 20: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._specialEffects) }() - case 21: try { try decoder.decodeSingularMessageField(value: &_storage._icon) }() - case 22: try { try decoder.decodeSingularInt32Field(value: &_storage._actionType) }() - case 23: try { try decoder.decodeSingularInt32Field(value: &_storage._watermelonSeeds) }() - case 24: try { try decoder.decodeSingularStringField(value: &_storage._goldEffect) }() - case 25: try { try decoder.decodeRepeatedMessageField(value: &_storage._subs) }() - case 26: try { try decoder.decodeSingularInt64Field(value: &_storage._goldenBeans) }() - case 27: try { try decoder.decodeSingularInt64Field(value: &_storage._honorLevel) }() - case 28: try { try decoder.decodeSingularInt32Field(value: &_storage._itemType) }() - case 29: try { try decoder.decodeSingularStringField(value: &_storage._schemeURL) }() - case 30: try { try decoder.decodeSingularMessageField(value: &_storage._giftOperation) }() - case 31: try { try decoder.decodeSingularStringField(value: &_storage._eventName) }() - case 32: try { try decoder.decodeSingularInt64Field(value: &_storage._nobleLevel) }() - case 33: try { try decoder.decodeSingularStringField(value: &_storage._guideURL) }() - case 34: try { try decoder.decodeSingularBoolField(value: &_storage._punishMedicine) }() - case 35: try { try decoder.decodeSingularBoolField(value: &_storage._forPortal) }() - case 36: try { try decoder.decodeSingularStringField(value: &_storage._businessText) }() - case 37: try { try decoder.decodeSingularBoolField(value: &_storage._cnyGift) }() - case 38: try { try decoder.decodeSingularInt64Field(value: &_storage._appID) }() - case 39: try { try decoder.decodeSingularInt64Field(value: &_storage._vipLevel) }() - case 40: try { try decoder.decodeSingularBoolField(value: &_storage._isGray) }() - case 41: try { try decoder.decodeSingularStringField(value: &_storage._graySchemeURL) }() - case 42: try { try decoder.decodeSingularInt64Field(value: &_storage._giftScene) }() - case 43: try { try decoder.decodeSingularMessageField(value: &_storage._giftBanner) }() - case 44: try { try decoder.decodeRepeatedStringField(value: &_storage._triggerWords) }() - case 45: try { try decoder.decodeRepeatedMessageField(value: &_storage._giftBuffInfos) }() - case 46: try { try decoder.decodeSingularBoolField(value: &_storage._forFirstRecharge) }() - case 47: try { try decoder.decodeSingularMessageField(value: &_storage._dynamicImgForSelected) }() - case 48: try { try decoder.decodeSingularInt32Field(value: &_storage._afterSendAction) }() - case 49: try { try decoder.decodeSingularInt64Field(value: &_storage._giftOfflineTime) }() - case 50: try { try decoder.decodeSingularStringField(value: &_storage._topBarText) }() - case 51: try { try decoder.decodeSingularMessageField(value: &_storage._topRightAvatar) }() - case 52: try { try decoder.decodeSingularStringField(value: &_storage._bannerSchemeURL) }() - case 53: try { try decoder.decodeSingularBoolField(value: &_storage._isLocked) }() - case 54: try { try decoder.decodeSingularInt64Field(value: &_storage._reqExtraType) }() - case 55: try { try decoder.decodeRepeatedInt64Field(value: &_storage._assetIds) }() - case 56: try { try decoder.decodeSingularMessageField(value: &_storage._giftPreviewInfo) }() - case 57: try { try decoder.decodeSingularMessageField(value: &_storage._giftTip) }() - case 58: try { try decoder.decodeSingularInt32Field(value: &_storage._needSweepLightCount) }() - case 59: try { try decoder.decodeRepeatedMessageField(value: &_storage._groupInfo) }() - default: break - } - } - } + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &_storage._method) }() + case 2: try { try decoder.decodeSingularUInt64Field(value: &_storage._msgID) }() + case 3: try { try decoder.decodeSingularUInt64Field(value: &_storage._roomID) }() + case 4: try { try decoder.decodeSingularUInt64Field(value: &_storage._createTime) }() + case 5: try { try decoder.decodeSingularUInt32Field(value: &_storage._monitor) }() + case 6: try { try decoder.decodeSingularBoolField(value: &_storage._isShowMsg) }() + case 7: try { try decoder.decodeSingularStringField(value: &_storage._describe) }() + case 9: try { try decoder.decodeSingularUInt64Field(value: &_storage._foldType) }() + case 10: try { try decoder.decodeSingularUInt64Field(value: &_storage._anchorFoldType) }() + case 11: try { try decoder.decodeSingularUInt64Field(value: &_storage._priorityScore) }() + case 12: try { try decoder.decodeSingularStringField(value: &_storage._logID) }() + case 13: try { try decoder.decodeSingularStringField(value: &_storage._msgProcessFilterK) }() + case 14: try { try decoder.decodeSingularStringField(value: &_storage._msgProcessFilterV) }() + case 15: try { try decoder.decodeSingularMessageField(value: &_storage._user) }() + case 17: try { try decoder.decodeSingularUInt64Field(value: &_storage._anchorFoldTypeV2) }() + case 18: try { try decoder.decodeSingularUInt64Field(value: &_storage._processAtSeiTimeMs) }() + case 19: try { try decoder.decodeSingularUInt64Field(value: &_storage._randomDispatchMs) }() + case 20: try { try decoder.decodeSingularBoolField(value: &_storage._isDispatch) }() + case 21: try { try decoder.decodeSingularUInt64Field(value: &_storage._channelID) }() + case 22: try { try decoder.decodeSingularUInt64Field(value: &_storage._diffSei2AbsSecond) }() + case 23: try { try decoder.decodeSingularUInt64Field(value: &_storage._anchorFoldDuration) }() + default: break + } + } + } } func traverse(visitor: inout V) throws { - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = _storage._image { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if !_storage._describe.isEmpty { - try visitor.visitSingularStringField(value: _storage._describe, fieldNumber: 2) - } - if _storage._notify != false { - try visitor.visitSingularBoolField(value: _storage._notify, fieldNumber: 3) - } - if _storage._duration != 0 { - try visitor.visitSingularInt64Field(value: _storage._duration, fieldNumber: 4) - } - if _storage._id != 0 { - try visitor.visitSingularInt64Field(value: _storage._id, fieldNumber: 5) - } - try { if let v = _storage._fansclubInfo { - try visitor.visitSingularMessageField(value: v, fieldNumber: 6) - } }() - if _storage._forLinkmic != false { - try visitor.visitSingularBoolField(value: _storage._forLinkmic, fieldNumber: 7) - } - if _storage._doodle != false { - try visitor.visitSingularBoolField(value: _storage._doodle, fieldNumber: 8) - } - if _storage._forFansclub != false { - try visitor.visitSingularBoolField(value: _storage._forFansclub, fieldNumber: 9) - } - if _storage._combo != false { - try visitor.visitSingularBoolField(value: _storage._combo, fieldNumber: 10) - } - if _storage._type != 0 { - try visitor.visitSingularInt32Field(value: _storage._type, fieldNumber: 11) - } - if _storage._diamondCount != 0 { - try visitor.visitSingularInt32Field(value: _storage._diamondCount, fieldNumber: 12) - } - if _storage._isDisplayedOnPanel != 0 { - try visitor.visitSingularInt32Field(value: _storage._isDisplayedOnPanel, fieldNumber: 13) - } - if _storage._primaryEffectID != 0 { - try visitor.visitSingularInt64Field(value: _storage._primaryEffectID, fieldNumber: 14) - } - try { if let v = _storage._giftLabelIcon { - try visitor.visitSingularMessageField(value: v, fieldNumber: 15) - } }() - if !_storage._name.isEmpty { - try visitor.visitSingularStringField(value: _storage._name, fieldNumber: 16) - } - if !_storage._region.isEmpty { - try visitor.visitSingularStringField(value: _storage._region, fieldNumber: 17) - } - if !_storage._manual.isEmpty { - try visitor.visitSingularStringField(value: _storage._manual, fieldNumber: 18) - } - if _storage._forCustom != false { - try visitor.visitSingularBoolField(value: _storage._forCustom, fieldNumber: 19) - } - if !_storage._specialEffects.isEmpty { - try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._specialEffects, fieldNumber: 20) - } - try { if let v = _storage._icon { - try visitor.visitSingularMessageField(value: v, fieldNumber: 21) - } }() - if _storage._actionType != 0 { - try visitor.visitSingularInt32Field(value: _storage._actionType, fieldNumber: 22) - } - if _storage._watermelonSeeds != 0 { - try visitor.visitSingularInt32Field(value: _storage._watermelonSeeds, fieldNumber: 23) - } - if !_storage._goldEffect.isEmpty { - try visitor.visitSingularStringField(value: _storage._goldEffect, fieldNumber: 24) - } - if !_storage._subs.isEmpty { - try visitor.visitRepeatedMessageField(value: _storage._subs, fieldNumber: 25) - } - if _storage._goldenBeans != 0 { - try visitor.visitSingularInt64Field(value: _storage._goldenBeans, fieldNumber: 26) - } - if _storage._honorLevel != 0 { - try visitor.visitSingularInt64Field(value: _storage._honorLevel, fieldNumber: 27) - } - if _storage._itemType != 0 { - try visitor.visitSingularInt32Field(value: _storage._itemType, fieldNumber: 28) - } - if !_storage._schemeURL.isEmpty { - try visitor.visitSingularStringField(value: _storage._schemeURL, fieldNumber: 29) - } - try { if let v = _storage._giftOperation { - try visitor.visitSingularMessageField(value: v, fieldNumber: 30) - } }() - if !_storage._eventName.isEmpty { - try visitor.visitSingularStringField(value: _storage._eventName, fieldNumber: 31) - } - if _storage._nobleLevel != 0 { - try visitor.visitSingularInt64Field(value: _storage._nobleLevel, fieldNumber: 32) - } - if !_storage._guideURL.isEmpty { - try visitor.visitSingularStringField(value: _storage._guideURL, fieldNumber: 33) - } - if _storage._punishMedicine != false { - try visitor.visitSingularBoolField(value: _storage._punishMedicine, fieldNumber: 34) - } - if _storage._forPortal != false { - try visitor.visitSingularBoolField(value: _storage._forPortal, fieldNumber: 35) - } - if !_storage._businessText.isEmpty { - try visitor.visitSingularStringField(value: _storage._businessText, fieldNumber: 36) - } - if _storage._cnyGift != false { - try visitor.visitSingularBoolField(value: _storage._cnyGift, fieldNumber: 37) - } - if _storage._appID != 0 { - try visitor.visitSingularInt64Field(value: _storage._appID, fieldNumber: 38) - } - if _storage._vipLevel != 0 { - try visitor.visitSingularInt64Field(value: _storage._vipLevel, fieldNumber: 39) - } - if _storage._isGray != false { - try visitor.visitSingularBoolField(value: _storage._isGray, fieldNumber: 40) - } - if !_storage._graySchemeURL.isEmpty { - try visitor.visitSingularStringField(value: _storage._graySchemeURL, fieldNumber: 41) - } - if _storage._giftScene != 0 { - try visitor.visitSingularInt64Field(value: _storage._giftScene, fieldNumber: 42) - } - try { if let v = _storage._giftBanner { - try visitor.visitSingularMessageField(value: v, fieldNumber: 43) - } }() - if !_storage._triggerWords.isEmpty { - try visitor.visitRepeatedStringField(value: _storage._triggerWords, fieldNumber: 44) - } - if !_storage._giftBuffInfos.isEmpty { - try visitor.visitRepeatedMessageField(value: _storage._giftBuffInfos, fieldNumber: 45) - } - if _storage._forFirstRecharge != false { - try visitor.visitSingularBoolField(value: _storage._forFirstRecharge, fieldNumber: 46) - } - try { if let v = _storage._dynamicImgForSelected { - try visitor.visitSingularMessageField(value: v, fieldNumber: 47) - } }() - if _storage._afterSendAction != 0 { - try visitor.visitSingularInt32Field(value: _storage._afterSendAction, fieldNumber: 48) - } - if _storage._giftOfflineTime != 0 { - try visitor.visitSingularInt64Field(value: _storage._giftOfflineTime, fieldNumber: 49) - } - if !_storage._topBarText.isEmpty { - try visitor.visitSingularStringField(value: _storage._topBarText, fieldNumber: 50) - } - try { if let v = _storage._topRightAvatar { - try visitor.visitSingularMessageField(value: v, fieldNumber: 51) - } }() - if !_storage._bannerSchemeURL.isEmpty { - try visitor.visitSingularStringField(value: _storage._bannerSchemeURL, fieldNumber: 52) - } - if _storage._isLocked != false { - try visitor.visitSingularBoolField(value: _storage._isLocked, fieldNumber: 53) - } - if _storage._reqExtraType != 0 { - try visitor.visitSingularInt64Field(value: _storage._reqExtraType, fieldNumber: 54) - } - if !_storage._assetIds.isEmpty { - try visitor.visitPackedInt64Field(value: _storage._assetIds, fieldNumber: 55) - } - try { if let v = _storage._giftPreviewInfo { - try visitor.visitSingularMessageField(value: v, fieldNumber: 56) - } }() - try { if let v = _storage._giftTip { - try visitor.visitSingularMessageField(value: v, fieldNumber: 57) - } }() - if _storage._needSweepLightCount != 0 { - try visitor.visitSingularInt32Field(value: _storage._needSweepLightCount, fieldNumber: 58) - } - if !_storage._groupInfo.isEmpty { - try visitor.visitRepeatedMessageField(value: _storage._groupInfo, fieldNumber: 59) - } - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: GiftStruct, rhs: GiftStruct) -> Bool { - if lhs._storage !== rhs._storage { - let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in - let _storage = _args.0 - let rhs_storage = _args.1 - if _storage._image != rhs_storage._image {return false} - if _storage._describe != rhs_storage._describe {return false} - if _storage._notify != rhs_storage._notify {return false} - if _storage._duration != rhs_storage._duration {return false} - if _storage._id != rhs_storage._id {return false} - if _storage._fansclubInfo != rhs_storage._fansclubInfo {return false} - if _storage._forLinkmic != rhs_storage._forLinkmic {return false} - if _storage._doodle != rhs_storage._doodle {return false} - if _storage._forFansclub != rhs_storage._forFansclub {return false} - if _storage._combo != rhs_storage._combo {return false} - if _storage._type != rhs_storage._type {return false} - if _storage._diamondCount != rhs_storage._diamondCount {return false} - if _storage._isDisplayedOnPanel != rhs_storage._isDisplayedOnPanel {return false} - if _storage._primaryEffectID != rhs_storage._primaryEffectID {return false} - if _storage._giftLabelIcon != rhs_storage._giftLabelIcon {return false} - if _storage._name != rhs_storage._name {return false} - if _storage._region != rhs_storage._region {return false} - if _storage._manual != rhs_storage._manual {return false} - if _storage._forCustom != rhs_storage._forCustom {return false} - if _storage._specialEffects != rhs_storage._specialEffects {return false} - if _storage._icon != rhs_storage._icon {return false} - if _storage._actionType != rhs_storage._actionType {return false} - if _storage._watermelonSeeds != rhs_storage._watermelonSeeds {return false} - if _storage._goldEffect != rhs_storage._goldEffect {return false} - if _storage._subs != rhs_storage._subs {return false} - if _storage._goldenBeans != rhs_storage._goldenBeans {return false} - if _storage._honorLevel != rhs_storage._honorLevel {return false} - if _storage._itemType != rhs_storage._itemType {return false} - if _storage._schemeURL != rhs_storage._schemeURL {return false} - if _storage._giftOperation != rhs_storage._giftOperation {return false} - if _storage._eventName != rhs_storage._eventName {return false} - if _storage._nobleLevel != rhs_storage._nobleLevel {return false} - if _storage._guideURL != rhs_storage._guideURL {return false} - if _storage._punishMedicine != rhs_storage._punishMedicine {return false} - if _storage._forPortal != rhs_storage._forPortal {return false} - if _storage._businessText != rhs_storage._businessText {return false} - if _storage._cnyGift != rhs_storage._cnyGift {return false} - if _storage._appID != rhs_storage._appID {return false} - if _storage._vipLevel != rhs_storage._vipLevel {return false} - if _storage._isGray != rhs_storage._isGray {return false} - if _storage._graySchemeURL != rhs_storage._graySchemeURL {return false} - if _storage._giftScene != rhs_storage._giftScene {return false} - if _storage._giftBanner != rhs_storage._giftBanner {return false} - if _storage._triggerWords != rhs_storage._triggerWords {return false} - if _storage._giftBuffInfos != rhs_storage._giftBuffInfos {return false} - if _storage._forFirstRecharge != rhs_storage._forFirstRecharge {return false} - if _storage._dynamicImgForSelected != rhs_storage._dynamicImgForSelected {return false} - if _storage._afterSendAction != rhs_storage._afterSendAction {return false} - if _storage._giftOfflineTime != rhs_storage._giftOfflineTime {return false} - if _storage._topBarText != rhs_storage._topBarText {return false} - if _storage._topRightAvatar != rhs_storage._topRightAvatar {return false} - if _storage._bannerSchemeURL != rhs_storage._bannerSchemeURL {return false} - if _storage._isLocked != rhs_storage._isLocked {return false} - if _storage._reqExtraType != rhs_storage._reqExtraType {return false} - if _storage._assetIds != rhs_storage._assetIds {return false} - if _storage._giftPreviewInfo != rhs_storage._giftPreviewInfo {return false} - if _storage._giftTip != rhs_storage._giftTip {return false} - if _storage._needSweepLightCount != rhs_storage._needSweepLightCount {return false} - if _storage._groupInfo != rhs_storage._groupInfo {return false} - return true - } - if !storagesAreEqual {return false} - } - if lhs.unknownFields != rhs.unknownFields {return false} - return true + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if !_storage._method.isEmpty { + try visitor.visitSingularStringField(value: _storage._method, fieldNumber: 1) + } + if _storage._msgID != 0 { + try visitor.visitSingularUInt64Field(value: _storage._msgID, fieldNumber: 2) + } + if _storage._roomID != 0 { + try visitor.visitSingularUInt64Field(value: _storage._roomID, fieldNumber: 3) + } + if _storage._createTime != 0 { + try visitor.visitSingularUInt64Field(value: _storage._createTime, fieldNumber: 4) + } + if _storage._monitor != 0 { + try visitor.visitSingularUInt32Field(value: _storage._monitor, fieldNumber: 5) + } + if _storage._isShowMsg != false { + try visitor.visitSingularBoolField(value: _storage._isShowMsg, fieldNumber: 6) + } + if !_storage._describe.isEmpty { + try visitor.visitSingularStringField(value: _storage._describe, fieldNumber: 7) + } + if _storage._foldType != 0 { + try visitor.visitSingularUInt64Field(value: _storage._foldType, fieldNumber: 9) + } + if _storage._anchorFoldType != 0 { + try visitor.visitSingularUInt64Field(value: _storage._anchorFoldType, fieldNumber: 10) + } + if _storage._priorityScore != 0 { + try visitor.visitSingularUInt64Field(value: _storage._priorityScore, fieldNumber: 11) + } + if !_storage._logID.isEmpty { + try visitor.visitSingularStringField(value: _storage._logID, fieldNumber: 12) + } + if !_storage._msgProcessFilterK.isEmpty { + try visitor.visitSingularStringField(value: _storage._msgProcessFilterK, fieldNumber: 13) + } + if !_storage._msgProcessFilterV.isEmpty { + try visitor.visitSingularStringField(value: _storage._msgProcessFilterV, fieldNumber: 14) + } + try { if let v = _storage._user { + try visitor.visitSingularMessageField(value: v, fieldNumber: 15) + } }() + if _storage._anchorFoldTypeV2 != 0 { + try visitor.visitSingularUInt64Field(value: _storage._anchorFoldTypeV2, fieldNumber: 17) + } + if _storage._processAtSeiTimeMs != 0 { + try visitor.visitSingularUInt64Field(value: _storage._processAtSeiTimeMs, fieldNumber: 18) + } + if _storage._randomDispatchMs != 0 { + try visitor.visitSingularUInt64Field(value: _storage._randomDispatchMs, fieldNumber: 19) + } + if _storage._isDispatch != false { + try visitor.visitSingularBoolField(value: _storage._isDispatch, fieldNumber: 20) + } + if _storage._channelID != 0 { + try visitor.visitSingularUInt64Field(value: _storage._channelID, fieldNumber: 21) + } + if _storage._diffSei2AbsSecond != 0 { + try visitor.visitSingularUInt64Field(value: _storage._diffSei2AbsSecond, fieldNumber: 22) + } + if _storage._anchorFoldDuration != 0 { + try visitor.visitSingularUInt64Field(value: _storage._anchorFoldDuration, fieldNumber: 23) + } + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Douyin_Common, rhs: Douyin_Common) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._method != rhs_storage._method {return false} + if _storage._msgID != rhs_storage._msgID {return false} + if _storage._roomID != rhs_storage._roomID {return false} + if _storage._createTime != rhs_storage._createTime {return false} + if _storage._monitor != rhs_storage._monitor {return false} + if _storage._isShowMsg != rhs_storage._isShowMsg {return false} + if _storage._describe != rhs_storage._describe {return false} + if _storage._foldType != rhs_storage._foldType {return false} + if _storage._anchorFoldType != rhs_storage._anchorFoldType {return false} + if _storage._priorityScore != rhs_storage._priorityScore {return false} + if _storage._logID != rhs_storage._logID {return false} + if _storage._msgProcessFilterK != rhs_storage._msgProcessFilterK {return false} + if _storage._msgProcessFilterV != rhs_storage._msgProcessFilterV {return false} + if _storage._user != rhs_storage._user {return false} + if _storage._anchorFoldTypeV2 != rhs_storage._anchorFoldTypeV2 {return false} + if _storage._processAtSeiTimeMs != rhs_storage._processAtSeiTimeMs {return false} + if _storage._randomDispatchMs != rhs_storage._randomDispatchMs {return false} + if _storage._isDispatch != rhs_storage._isDispatch {return false} + if _storage._channelID != rhs_storage._channelID {return false} + if _storage._diffSei2AbsSecond != rhs_storage._diffSei2AbsSecond {return false} + if _storage._anchorFoldDuration != rhs_storage._anchorFoldDuration {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } -extension GiftStruct.GiftStructFansClubInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = GiftStruct.protoMessageName + ".GiftStructFansClubInfo" +extension Douyin_User: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".User" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "minLevel"), - 2: .same(proto: "insertPos"), + 1: .same(proto: "id"), + 2: .same(proto: "shortId"), + 3: .same(proto: "nickName"), + 4: .same(proto: "gender"), + 5: .same(proto: "Signature"), + 6: .same(proto: "Level"), + 7: .same(proto: "Birthday"), + 8: .same(proto: "Telephone"), + 9: .same(proto: "AvatarThumb"), + 10: .same(proto: "AvatarMedium"), + 11: .same(proto: "AvatarLarge"), + 12: .same(proto: "Verified"), + 13: .same(proto: "Experience"), + 14: .same(proto: "city"), + 15: .same(proto: "Status"), + 16: .same(proto: "CreateTime"), + 17: .same(proto: "ModifyTime"), + 18: .same(proto: "Secret"), + 19: .same(proto: "ShareQrcodeUri"), + 20: .same(proto: "IncomeSharePercent"), + 21: .same(proto: "BadgeImageList"), + 26: .same(proto: "SpecialId"), + 27: .same(proto: "AvatarBorder"), + 28: .same(proto: "Medal"), + 29: .same(proto: "RealTimeIconsList"), ] - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularInt32Field(value: &self.minLevel) }() - case 2: try { try decoder.decodeSingularInt32Field(value: &self.insertPos) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if self.minLevel != 0 { - try visitor.visitSingularInt32Field(value: self.minLevel, fieldNumber: 1) - } - if self.insertPos != 0 { - try visitor.visitSingularInt32Field(value: self.insertPos, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: GiftStruct.GiftStructFansClubInfo, rhs: GiftStruct.GiftStructFansClubInfo) -> Bool { - if lhs.minLevel != rhs.minLevel {return false} - if lhs.insertPos != rhs.insertPos {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension AssetEffectMixInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = "AssetEffectMixInfo" - static let _protobuf_nameMap = SwiftProtobuf._NameMap() - - mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } - } - - func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: AssetEffectMixInfo, rhs: AssetEffectMixInfo) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension LuckyMoneyGiftMeta: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = "LuckyMoneyGiftMeta" - static let _protobuf_nameMap = SwiftProtobuf._NameMap() - - mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } - } - - func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: LuckyMoneyGiftMeta, rhs: LuckyMoneyGiftMeta) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension GiftPanelOperation: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = "GiftPanelOperation" - static let _protobuf_nameMap = SwiftProtobuf._NameMap() - - mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } - } - - func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) + fileprivate class _StorageClass { + var _id: UInt64 = 0 + var _shortID: UInt64 = 0 + var _nickName: String = String() + var _gender: UInt32 = 0 + var _signature: String = String() + var _level: UInt32 = 0 + var _birthday: UInt64 = 0 + var _telephone: String = String() + var _avatarThumb: Douyin_Image? = nil + var _avatarMedium: Douyin_Image? = nil + var _avatarLarge: Douyin_Image? = nil + var _verified: Bool = false + var _experience: UInt32 = 0 + var _city: String = String() + var _status: Int32 = 0 + var _createTime: UInt64 = 0 + var _modifyTime: UInt64 = 0 + var _secret: UInt32 = 0 + var _shareQrcodeUri: String = String() + var _incomeSharePercent: UInt32 = 0 + var _badgeImageList: [Douyin_Image] = [] + var _specialID: String = String() + var _avatarBorder: Douyin_Image? = nil + var _medal: Douyin_Image? = nil + var _realTimeIconsList: [Douyin_Image] = [] + + #if swift(>=5.10) + // This property is used as the initial default value for new instances of the type. + // The type itself is protecting the reference to its storage via CoW semantics. + // This will force a copy to be made of this reference when the first mutation occurs; + // hence, it is safe to mark this as `nonisolated(unsafe)`. + static nonisolated(unsafe) let defaultInstance = _StorageClass() + #else + static let defaultInstance = _StorageClass() + #endif + + private init() {} + + init(copying source: _StorageClass) { + _id = source._id + _shortID = source._shortID + _nickName = source._nickName + _gender = source._gender + _signature = source._signature + _level = source._level + _birthday = source._birthday + _telephone = source._telephone + _avatarThumb = source._avatarThumb + _avatarMedium = source._avatarMedium + _avatarLarge = source._avatarLarge + _verified = source._verified + _experience = source._experience + _city = source._city + _status = source._status + _createTime = source._createTime + _modifyTime = source._modifyTime + _secret = source._secret + _shareQrcodeUri = source._shareQrcodeUri + _incomeSharePercent = source._incomeSharePercent + _badgeImageList = source._badgeImageList + _specialID = source._specialID + _avatarBorder = source._avatarBorder + _medal = source._medal + _realTimeIconsList = source._realTimeIconsList + } } - static func ==(lhs: GiftPanelOperation, rhs: GiftPanelOperation) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage } -} - -extension GiftBanner: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = "GiftBanner" - static let _protobuf_nameMap = SwiftProtobuf._NameMap() mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularUInt64Field(value: &_storage._id) }() + case 2: try { try decoder.decodeSingularUInt64Field(value: &_storage._shortID) }() + case 3: try { try decoder.decodeSingularStringField(value: &_storage._nickName) }() + case 4: try { try decoder.decodeSingularUInt32Field(value: &_storage._gender) }() + case 5: try { try decoder.decodeSingularStringField(value: &_storage._signature) }() + case 6: try { try decoder.decodeSingularUInt32Field(value: &_storage._level) }() + case 7: try { try decoder.decodeSingularUInt64Field(value: &_storage._birthday) }() + case 8: try { try decoder.decodeSingularStringField(value: &_storage._telephone) }() + case 9: try { try decoder.decodeSingularMessageField(value: &_storage._avatarThumb) }() + case 10: try { try decoder.decodeSingularMessageField(value: &_storage._avatarMedium) }() + case 11: try { try decoder.decodeSingularMessageField(value: &_storage._avatarLarge) }() + case 12: try { try decoder.decodeSingularBoolField(value: &_storage._verified) }() + case 13: try { try decoder.decodeSingularUInt32Field(value: &_storage._experience) }() + case 14: try { try decoder.decodeSingularStringField(value: &_storage._city) }() + case 15: try { try decoder.decodeSingularInt32Field(value: &_storage._status) }() + case 16: try { try decoder.decodeSingularUInt64Field(value: &_storage._createTime) }() + case 17: try { try decoder.decodeSingularUInt64Field(value: &_storage._modifyTime) }() + case 18: try { try decoder.decodeSingularUInt32Field(value: &_storage._secret) }() + case 19: try { try decoder.decodeSingularStringField(value: &_storage._shareQrcodeUri) }() + case 20: try { try decoder.decodeSingularUInt32Field(value: &_storage._incomeSharePercent) }() + case 21: try { try decoder.decodeRepeatedMessageField(value: &_storage._badgeImageList) }() + case 26: try { try decoder.decodeSingularStringField(value: &_storage._specialID) }() + case 27: try { try decoder.decodeSingularMessageField(value: &_storage._avatarBorder) }() + case 28: try { try decoder.decodeSingularMessageField(value: &_storage._medal) }() + case 29: try { try decoder.decodeRepeatedMessageField(value: &_storage._realTimeIconsList) }() + default: break + } + } + } } func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: GiftBanner, rhs: GiftBanner) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if _storage._id != 0 { + try visitor.visitSingularUInt64Field(value: _storage._id, fieldNumber: 1) + } + if _storage._shortID != 0 { + try visitor.visitSingularUInt64Field(value: _storage._shortID, fieldNumber: 2) + } + if !_storage._nickName.isEmpty { + try visitor.visitSingularStringField(value: _storage._nickName, fieldNumber: 3) + } + if _storage._gender != 0 { + try visitor.visitSingularUInt32Field(value: _storage._gender, fieldNumber: 4) + } + if !_storage._signature.isEmpty { + try visitor.visitSingularStringField(value: _storage._signature, fieldNumber: 5) + } + if _storage._level != 0 { + try visitor.visitSingularUInt32Field(value: _storage._level, fieldNumber: 6) + } + if _storage._birthday != 0 { + try visitor.visitSingularUInt64Field(value: _storage._birthday, fieldNumber: 7) + } + if !_storage._telephone.isEmpty { + try visitor.visitSingularStringField(value: _storage._telephone, fieldNumber: 8) + } + try { if let v = _storage._avatarThumb { + try visitor.visitSingularMessageField(value: v, fieldNumber: 9) + } }() + try { if let v = _storage._avatarMedium { + try visitor.visitSingularMessageField(value: v, fieldNumber: 10) + } }() + try { if let v = _storage._avatarLarge { + try visitor.visitSingularMessageField(value: v, fieldNumber: 11) + } }() + if _storage._verified != false { + try visitor.visitSingularBoolField(value: _storage._verified, fieldNumber: 12) + } + if _storage._experience != 0 { + try visitor.visitSingularUInt32Field(value: _storage._experience, fieldNumber: 13) + } + if !_storage._city.isEmpty { + try visitor.visitSingularStringField(value: _storage._city, fieldNumber: 14) + } + if _storage._status != 0 { + try visitor.visitSingularInt32Field(value: _storage._status, fieldNumber: 15) + } + if _storage._createTime != 0 { + try visitor.visitSingularUInt64Field(value: _storage._createTime, fieldNumber: 16) + } + if _storage._modifyTime != 0 { + try visitor.visitSingularUInt64Field(value: _storage._modifyTime, fieldNumber: 17) + } + if _storage._secret != 0 { + try visitor.visitSingularUInt32Field(value: _storage._secret, fieldNumber: 18) + } + if !_storage._shareQrcodeUri.isEmpty { + try visitor.visitSingularStringField(value: _storage._shareQrcodeUri, fieldNumber: 19) + } + if _storage._incomeSharePercent != 0 { + try visitor.visitSingularUInt32Field(value: _storage._incomeSharePercent, fieldNumber: 20) + } + if !_storage._badgeImageList.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._badgeImageList, fieldNumber: 21) + } + if !_storage._specialID.isEmpty { + try visitor.visitSingularStringField(value: _storage._specialID, fieldNumber: 26) + } + try { if let v = _storage._avatarBorder { + try visitor.visitSingularMessageField(value: v, fieldNumber: 27) + } }() + try { if let v = _storage._medal { + try visitor.visitSingularMessageField(value: v, fieldNumber: 28) + } }() + if !_storage._realTimeIconsList.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._realTimeIconsList, fieldNumber: 29) + } + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Douyin_User, rhs: Douyin_User) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._id != rhs_storage._id {return false} + if _storage._shortID != rhs_storage._shortID {return false} + if _storage._nickName != rhs_storage._nickName {return false} + if _storage._gender != rhs_storage._gender {return false} + if _storage._signature != rhs_storage._signature {return false} + if _storage._level != rhs_storage._level {return false} + if _storage._birthday != rhs_storage._birthday {return false} + if _storage._telephone != rhs_storage._telephone {return false} + if _storage._avatarThumb != rhs_storage._avatarThumb {return false} + if _storage._avatarMedium != rhs_storage._avatarMedium {return false} + if _storage._avatarLarge != rhs_storage._avatarLarge {return false} + if _storage._verified != rhs_storage._verified {return false} + if _storage._experience != rhs_storage._experience {return false} + if _storage._city != rhs_storage._city {return false} + if _storage._status != rhs_storage._status {return false} + if _storage._createTime != rhs_storage._createTime {return false} + if _storage._modifyTime != rhs_storage._modifyTime {return false} + if _storage._secret != rhs_storage._secret {return false} + if _storage._shareQrcodeUri != rhs_storage._shareQrcodeUri {return false} + if _storage._incomeSharePercent != rhs_storage._incomeSharePercent {return false} + if _storage._badgeImageList != rhs_storage._badgeImageList {return false} + if _storage._specialID != rhs_storage._specialID {return false} + if _storage._avatarBorder != rhs_storage._avatarBorder {return false} + if _storage._medal != rhs_storage._medal {return false} + if _storage._realTimeIconsList != rhs_storage._realTimeIconsList {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } -extension GiftBuffInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = "GiftBuffInfo" - static let _protobuf_nameMap = SwiftProtobuf._NameMap() +extension Douyin_Image: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Image" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "urlListList"), + 2: .same(proto: "uri"), + 3: .same(proto: "height"), + 4: .same(proto: "width"), + 5: .same(proto: "avgColor"), + 6: .same(proto: "imageType"), + 7: .same(proto: "openWebUrl"), + 8: .same(proto: "content"), + 9: .same(proto: "isAnimated"), + 10: .same(proto: "FlexSettingList"), + 11: .same(proto: "TextSettingList"), + ] mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeRepeatedStringField(value: &self.urlListList) }() + case 2: try { try decoder.decodeSingularStringField(value: &self.uri) }() + case 3: try { try decoder.decodeSingularUInt64Field(value: &self.height) }() + case 4: try { try decoder.decodeSingularUInt64Field(value: &self.width) }() + case 5: try { try decoder.decodeSingularStringField(value: &self.avgColor) }() + case 6: try { try decoder.decodeSingularUInt32Field(value: &self.imageType) }() + case 7: try { try decoder.decodeSingularStringField(value: &self.openWebURL) }() + case 8: try { try decoder.decodeSingularMessageField(value: &self._content) }() + case 9: try { try decoder.decodeSingularBoolField(value: &self.isAnimated) }() + case 10: try { try decoder.decodeSingularMessageField(value: &self._flexSettingList) }() + case 11: try { try decoder.decodeSingularMessageField(value: &self._textSettingList) }() + default: break + } + } } func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: GiftBuffInfo, rhs: GiftBuffInfo) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if !self.urlListList.isEmpty { + try visitor.visitRepeatedStringField(value: self.urlListList, fieldNumber: 1) + } + if !self.uri.isEmpty { + try visitor.visitSingularStringField(value: self.uri, fieldNumber: 2) + } + if self.height != 0 { + try visitor.visitSingularUInt64Field(value: self.height, fieldNumber: 3) + } + if self.width != 0 { + try visitor.visitSingularUInt64Field(value: self.width, fieldNumber: 4) + } + if !self.avgColor.isEmpty { + try visitor.visitSingularStringField(value: self.avgColor, fieldNumber: 5) + } + if self.imageType != 0 { + try visitor.visitSingularUInt32Field(value: self.imageType, fieldNumber: 6) + } + if !self.openWebURL.isEmpty { + try visitor.visitSingularStringField(value: self.openWebURL, fieldNumber: 7) + } + try { if let v = self._content { + try visitor.visitSingularMessageField(value: v, fieldNumber: 8) + } }() + if self.isAnimated != false { + try visitor.visitSingularBoolField(value: self.isAnimated, fieldNumber: 9) + } + try { if let v = self._flexSettingList { + try visitor.visitSingularMessageField(value: v, fieldNumber: 10) + } }() + try { if let v = self._textSettingList { + try visitor.visitSingularMessageField(value: v, fieldNumber: 11) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Douyin_Image, rhs: Douyin_Image) -> Bool { + if lhs.urlListList != rhs.urlListList {return false} + if lhs.uri != rhs.uri {return false} + if lhs.height != rhs.height {return false} + if lhs.width != rhs.width {return false} + if lhs.avgColor != rhs.avgColor {return false} + if lhs.imageType != rhs.imageType {return false} + if lhs.openWebURL != rhs.openWebURL {return false} + if lhs._content != rhs._content {return false} + if lhs.isAnimated != rhs.isAnimated {return false} + if lhs._flexSettingList != rhs._flexSettingList {return false} + if lhs._textSettingList != rhs._textSettingList {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } -extension GiftPreviewInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = "GiftPreviewInfo" - static let _protobuf_nameMap = SwiftProtobuf._NameMap() +extension Douyin_NinePatchSetting: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".NinePatchSetting" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "settingListList"), + ] mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeRepeatedStringField(value: &self.settingListList) }() + default: break + } + } } func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) + if !self.settingListList.isEmpty { + try visitor.visitRepeatedStringField(value: self.settingListList, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: GiftPreviewInfo, rhs: GiftPreviewInfo) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true + static func ==(lhs: Douyin_NinePatchSetting, rhs: Douyin_NinePatchSetting) -> Bool { + if lhs.settingListList != rhs.settingListList {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } -extension GiftTip: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = "GiftTip" - static let _protobuf_nameMap = SwiftProtobuf._NameMap() +extension Douyin_ImageContent: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ImageContent" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "name"), + 2: .same(proto: "fontColor"), + 3: .same(proto: "level"), + 4: .same(proto: "alternativeText"), + ] mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.name) }() + case 2: try { try decoder.decodeSingularStringField(value: &self.fontColor) }() + case 3: try { try decoder.decodeSingularUInt64Field(value: &self.level) }() + case 4: try { try decoder.decodeSingularStringField(value: &self.alternativeText) }() + default: break + } + } } func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: GiftTip, rhs: GiftTip) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true + if !self.name.isEmpty { + try visitor.visitSingularStringField(value: self.name, fieldNumber: 1) + } + if !self.fontColor.isEmpty { + try visitor.visitSingularStringField(value: self.fontColor, fieldNumber: 2) + } + if self.level != 0 { + try visitor.visitSingularUInt64Field(value: self.level, fieldNumber: 3) + } + if !self.alternativeText.isEmpty { + try visitor.visitSingularStringField(value: self.alternativeText, fieldNumber: 4) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Douyin_ImageContent, rhs: Douyin_ImageContent) -> Bool { + if lhs.name != rhs.name {return false} + if lhs.fontColor != rhs.fontColor {return false} + if lhs.level != rhs.level {return false} + if lhs.alternativeText != rhs.alternativeText {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } -extension GiftGroupInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = "GiftGroupInfo" - static let _protobuf_nameMap = SwiftProtobuf._NameMap() +extension Douyin_PushFrame: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PushFrame" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "seqId"), + 2: .same(proto: "logId"), + 3: .same(proto: "service"), + 4: .same(proto: "method"), + 5: .same(proto: "headersList"), + 6: .same(proto: "payloadEncoding"), + 7: .same(proto: "payloadType"), + 8: .same(proto: "payload"), + ] mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularUInt64Field(value: &self.seqID) }() + case 2: try { try decoder.decodeSingularUInt64Field(value: &self.logID) }() + case 3: try { try decoder.decodeSingularUInt64Field(value: &self.service) }() + case 4: try { try decoder.decodeSingularUInt64Field(value: &self.method) }() + case 5: try { try decoder.decodeRepeatedMessageField(value: &self.headersList) }() + case 6: try { try decoder.decodeSingularStringField(value: &self.payloadEncoding) }() + case 7: try { try decoder.decodeSingularStringField(value: &self.payloadType) }() + case 8: try { try decoder.decodeSingularBytesField(value: &self.payload) }() + default: break + } + } } func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: GiftGroupInfo, rhs: GiftGroupInfo) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true + if self.seqID != 0 { + try visitor.visitSingularUInt64Field(value: self.seqID, fieldNumber: 1) + } + if self.logID != 0 { + try visitor.visitSingularUInt64Field(value: self.logID, fieldNumber: 2) + } + if self.service != 0 { + try visitor.visitSingularUInt64Field(value: self.service, fieldNumber: 3) + } + if self.method != 0 { + try visitor.visitSingularUInt64Field(value: self.method, fieldNumber: 4) + } + if !self.headersList.isEmpty { + try visitor.visitRepeatedMessageField(value: self.headersList, fieldNumber: 5) + } + if !self.payloadEncoding.isEmpty { + try visitor.visitSingularStringField(value: self.payloadEncoding, fieldNumber: 6) + } + if !self.payloadType.isEmpty { + try visitor.visitSingularStringField(value: self.payloadType, fieldNumber: 7) + } + if !self.payload.isEmpty { + try visitor.visitSingularBytesField(value: self.payload, fieldNumber: 8) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Douyin_PushFrame, rhs: Douyin_PushFrame) -> Bool { + if lhs.seqID != rhs.seqID {return false} + if lhs.logID != rhs.logID {return false} + if lhs.service != rhs.service {return false} + if lhs.method != rhs.method {return false} + if lhs.headersList != rhs.headersList {return false} + if lhs.payloadEncoding != rhs.payloadEncoding {return false} + if lhs.payloadType != rhs.payloadType {return false} + if lhs.payload != rhs.payload {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } -extension EffectMixImageInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = "EffectMixImageInfo" - static let _protobuf_nameMap = SwiftProtobuf._NameMap() +extension Douyin_HeadersList: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".HeadersList" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "key"), + 2: .same(proto: "value"), + ] mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.key) }() + case 2: try { try decoder.decodeSingularStringField(value: &self.value) }() + default: break + } + } } func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: EffectMixImageInfo, rhs: EffectMixImageInfo) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true + if !self.key.isEmpty { + try visitor.visitSingularStringField(value: self.key, fieldNumber: 1) + } + if !self.value.isEmpty { + try visitor.visitSingularStringField(value: self.value, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Douyin_HeadersList, rhs: Douyin_HeadersList) -> Bool { + if lhs.key != rhs.key {return false} + if lhs.value != rhs.value {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } diff --git a/IINA+/Utils/Extensions/CharacterSetExtension.swift b/IINA+/Utils/Extensions/CharacterSetExtension.swift new file mode 100644 index 00000000..67f73c03 --- /dev/null +++ b/IINA+/Utils/Extensions/CharacterSetExtension.swift @@ -0,0 +1,21 @@ +// +// CharacterSetExtension.swift +// IINA+ +// +// Created by xjbeta on 2024/10/4. +// Copyright © 2024 xjbeta. All rights reserved. +// + +import Cocoa + +extension CharacterSet { + static let urlQueryValueAllowed: CharacterSet = { + let generalDelimitersToEncode = ":#[]@?/" // does not include "?" or "/" due to RFC 3986 - Section 3.4 + let subDelimitersToEncode = "!$&'()*+,;=" + + var allowed = CharacterSet.urlQueryAllowed + allowed.remove(charactersIn: generalDelimitersToEncode + subDelimitersToEncode) + + return allowed + }() +} diff --git a/IINA+/Utils/Extensions/WKWebViewExtension.swift b/IINA+/Utils/Extensions/WKWebViewExtension.swift index 774d5031..e1845cec 100644 --- a/IINA+/Utils/Extensions/WKWebViewExtension.swift +++ b/IINA+/Utils/Extensions/WKWebViewExtension.swift @@ -10,16 +10,15 @@ import Cocoa import WebKit extension WKWebView { - @discardableResult - func evaluateJavaScriptAsync(_ str: String) async throws -> Any? { - return try await withCheckedThrowingContinuation { continuation in + func evaluateJavaScriptAsync(_ str: String, type: T.Type) async throws -> T? where T: Sendable { + try await withCheckedThrowingContinuation { continuation in DispatchQueue.main.async { self.evaluateJavaScript(str) { data, error in if let error = error { continuation.resume(throwing: error) } else { - continuation.resume(returning: data) + continuation.resume(returning: data as? T) } } } diff --git a/IINA+/Utils/HttpServer.swift b/IINA+/Utils/HttpServer.swift index 951e61e8..264c7065 100644 --- a/IINA+/Utils/HttpServer.swift +++ b/IINA+/Utils/HttpServer.swift @@ -26,20 +26,18 @@ enum DanamkuMethod: String, Encodable { } + +@MainActor class HttpServer: NSObject, DanmakuDelegate { private var server = Swifter.HttpServer() - @MainActor private var dash = [String: String]() - @MainActor private var unknownSessions = [WebSocketSession]() - @MainActor var connectedItems = [DanmakuWS]() - @MainActor private var danmakus = [Danmaku]() private var danmukuObservers: [NSObjectProtocol] = [] @@ -402,6 +400,7 @@ struct DanmakuWS { var version = 0 + @MainActor func send(_ event: DanmakuEvent) { switch version { case 0 where event.method == .sendDM: @@ -425,6 +424,7 @@ struct DanmakuWS { } } + @MainActor func loadCustomFont() { let pref = Preferences.shared let font = pref.danmukuFontFamilyName @@ -444,10 +444,12 @@ struct DanmakuWS { send(.init(method: .customFont, text: text)) } + @MainActor func customDMSpeed() { send(.init(method: .dmSpeed, text: "\(Int(Preferences.shared.dmSpeed))")) } + @MainActor func customDMOpdacity() { send(.init(method: .dmOpacity, text: "\(Preferences.shared.dmOpacity)")) } @@ -460,6 +462,7 @@ struct DanmakuWS { // send(.init(method: .dmBlockList, text: types.joined(separator: ", "))) } + @MainActor func loadXMLDM() { send(.init(method: .loadDM, text: id)) } diff --git a/IINA+/Utils/IINAApp.swift b/IINA+/Utils/IINAApp.swift index aedb4b40..3b9ca731 100644 --- a/IINA+/Utils/IINAApp.swift +++ b/IINA+/Utils/IINAApp.swift @@ -8,7 +8,7 @@ import Cocoa -class IINAApp: NSObject { +actor IINAApp { enum PluginState { case ok(String) @@ -40,32 +40,27 @@ class IINAApp: NSObject { } } - let internalPluginVersion = "0.1.12" - let internalPluginBuild = 9 + static let internalPluginVersion = "0.1.12" + static let internalPluginBuild = 9 - let minIINABuild = 135 + static let minIINABuild = 135 var buildVersion: Int = 0 var archiveType: IINAUrlType = .none - override init() { - super.init() - updateIINAState() - } - func updateIINAState() { - buildVersion = getBuildVersion() - archiveType = getArchiveType() + buildVersion = IINAApp.getBuildVersion() + archiveType = IINAApp.getArchiveType() } - func getBuildVersion() -> Int { + static func getBuildVersion() -> Int { let b = Bundle(path: "/Applications/IINA.app") let build = b?.infoDictionary?["CFBundleVersion"] as? String ?? "" return Int(build) ?? 0 } - func getArchiveType() -> IINAUrlType { - let build = buildVersion + static func getArchiveType() -> IINAUrlType { + let build = getBuildVersion() let b = Bundle(path: "/Applications/IINA.app") guard let version = b?.infoDictionary?["CFBundleShortVersionString"] as? String else { @@ -86,7 +81,7 @@ class IINAApp: NSObject { return .normal } - func pluginState() -> PluginState { + static func pluginState() -> PluginState { do { let plugins = try listPlugins() switch plugins.count { @@ -115,7 +110,7 @@ class IINAApp: NSObject { } } - func pluginFolder() throws -> String { + static func pluginFolder() throws -> String { // /Users/xxx/Library/Application Support/com.colliderli.iina/plugins let fm = FileManager.default let url = try fm.url(for: .applicationSupportDirectory, in: .userDomainMask, appropriateFor: nil, create: false) @@ -127,7 +122,7 @@ class IINAApp: NSObject { return path } - func listPlugins() throws -> [PluginInfo] { + static func listPlugins() throws -> [PluginInfo] { let fm = FileManager.default let path = try pluginFolder() return try fm.contentsOfDirectory(atPath: path).filter { @@ -146,7 +141,7 @@ class IINAApp: NSObject { } } - func uninstallPlugins(_ plugins: [PluginInfo]) { + static func uninstallPlugins(_ plugins: [PluginInfo]) { plugins.filter { !$0.isDev }.forEach { @@ -154,7 +149,7 @@ class IINAApp: NSObject { } } - func installPlugin() throws { + static func installPlugin() throws { guard let path = Bundle.main.path(forResource: "iina-plugin-danmaku", ofType: "iinaplgz"), FileManager.default.fileExists(atPath: path) else { throw IINAError.missingPluginFile diff --git a/IINA+/Utils/Log.swift b/IINA+/Utils/Log.swift index 1b21d228..c240cb00 100644 --- a/IINA+/Utils/Log.swift +++ b/IINA+/Utils/Log.swift @@ -8,7 +8,7 @@ import Cocoa -public func Log(_ message: T, file: String = #file, method: String = #function, line: Int = #line) { +public func Log(_ message: T, file: String = #file, method: String = #function, line: Int = #line) { DispatchQueue.main.async { var logStr = "\(URL(fileURLWithPath: file).lastPathComponent)[\(line)], \(method): \(message)" #if DEBUG diff --git a/IINA+/Utils/Processes.swift b/IINA+/Utils/Processes.swift index 09d1f2f2..a8bd0275 100644 --- a/IINA+/Utils/Processes.swift +++ b/IINA+/Utils/Processes.swift @@ -9,8 +9,9 @@ import Foundation import Marshal import Cocoa - -class Processes: NSObject { + +@MainActor +final class Processes: NSObject, Sendable { enum ProcessesError: Error { case openFailed(String) @@ -20,23 +21,16 @@ class Processes: NSObject { static let shared = Processes() let videoDecoder = VideoDecoder() + let iina = IINAApp() + + let httpServer = HttpServer() - let iina = IINAApp() private var decodeTask: Task? fileprivate override init() { - } - - var urlQueryValueAllowed: CharacterSet = { - let generalDelimitersToEncode = ":#[]@?/" // does not include "?" or "/" due to RFC 3986 - Section 3.4 - let subDelimitersToEncode = "!$&'()*+,;=" - var allowed = CharacterSet.urlQueryAllowed - allowed.remove(charactersIn: generalDelimitersToEncode + subDelimitersToEncode) - - return allowed - }() + } func which(_ str: String) -> [String] { // which you-get @@ -87,9 +81,8 @@ class Processes: NSObject { return str.subString(from: "mpv", to: "Copyright").replacingOccurrences(of: " ", with: "") } - func decodeURL(_ url: String) async throws -> YouGetJSON { - decodeTask?.cancel() + decodeTask?.cancel() let task = Task { try await videoDecoder.decodeUrl(url) @@ -109,9 +102,10 @@ class Processes: NSObject { decodeTask?.cancel() } - func openWithPlayer(_ json: YouGetJSON, _ key: String) throws { - let type = iina.archiveType - let buildVersion = iina.buildVersion + func openWithPlayer(_ json: YouGetJSON, _ key: String) async throws { + await iina.updateIINAState() + let type = await iina.archiveType + let buildVersion = await iina.buildVersion let urlScheme = json.iinaURLScheme(key, type: type) @@ -129,19 +123,19 @@ class Processes: NSObject { try openWithURLScheme(urlScheme) case .iina where type == .danmaku && buildVersion < 15: // IINA-Danmaku cli - try openWithProcess(json.videoUrl(key), args: json.mpvOptions, uuid: json.uuid) + try await openWithProcess(json.videoUrl(key), args: json.mpvOptions, uuid: json.uuid) case .iina where type == .normal && buildVersion >= 56: // IINA Official with cli // iinc-cli build 56 - try openWithProcess(json.videoUrl(key, forDash: true), args: json.mpvOptions, uuid: json.uuid) + try await openWithProcess(json.videoUrl(key, forDash: true), args: json.mpvOptions, uuid: json.uuid) case .mpv: - try openWithProcess(json.videoUrl(key), args: json.mpvOptions, uuid: json.uuid) + try await openWithProcess(json.videoUrl(key), args: json.mpvOptions, uuid: json.uuid) default: throw ProcessesError.notSupported } } - private func openWithProcess(_ url: String?, args: [String], uuid: String) throws { + private func openWithProcess(_ url: String?, args: [String], uuid: String) async throws { guard let url, url != "" else { throw ProcessesError.openFailed("Nil url") } @@ -151,7 +145,7 @@ class Processes: NSObject { var args = args if isIINA { - let type = iina.archiveType + let type = await iina.archiveType args = args.map { "--mpv-" + $0 } diff --git a/IINA+/Utils/TokenBucket.swift b/IINA+/Utils/TokenBucket.swift new file mode 100644 index 00000000..010da630 --- /dev/null +++ b/IINA+/Utils/TokenBucket.swift @@ -0,0 +1,62 @@ +//===----------------------------------------------------------------------===// +// +// This source file is part of the Swift open source project +// +// Copyright (c) 2023 Apple Inc. and the Swift project authors +// Licensed under Apache License v2.0 with Runtime Library Exception +// +// See http://swift.org/LICENSE.txt for license information +// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors +// +//===----------------------------------------------------------------------===// + +import _Concurrency +import DequeModule + +/// Type modeled after a "token bucket" pattern, which is similar to a semaphore, but is built with +/// Swift Concurrency primitives. +public actor TokenBucket { + private var tokens: Int + private var waiters: Deque> + + public init(tokens: Int) { + self.tokens = tokens + self.waiters = Deque() + } + + /// Executes an `async` closure immediately when a token is available. + /// Only the same number of closures will be executed concurrently as the number + /// of `tokens` passed to ``TokenBucket/init(tokens:)``, all subsequent + /// invocations of `withToken` will suspend until a "free" token is available. + /// - Parameter body: The closure to invoke when a token is available. + /// - Returns: Resulting value returned by `body`. + public func withToken( + _ body: @Sendable () async throws -> ReturnType + ) async rethrows -> ReturnType { + await self.getToken() + defer { + self.returnToken() + } + + return try await body() + } + + private func getToken() async { + if self.tokens > 0 { + self.tokens -= 1 + return + } + + await withCheckedContinuation { + self.waiters.append($0) + } + } + + private func returnToken() { + if let nextWaiter = self.waiters.popFirst() { + nextWaiter.resume() + } else { + self.tokens += 1 + } + } +} diff --git a/IINA+/Utils/VideoDecoder/Bangumi.swift b/IINA+/Utils/VideoDecoder/Bangumi.swift new file mode 100644 index 00000000..765ef76f --- /dev/null +++ b/IINA+/Utils/VideoDecoder/Bangumi.swift @@ -0,0 +1,366 @@ +// +// Bangumi.swift +// IINA+ +// +// Created by xjbeta on 2024/11/19. +// Copyright © 2024 xjbeta. All rights reserved. +// + +import Foundation +import Alamofire +import Marshal + +actor Bangumi: SupportSiteProtocol { + + let biliShare = BilibiliShare() + + struct BangumiID { + let epId: Int + let seasonId: Int + } + + func liveInfo(_ url: String) async throws -> any LiveInfo { + let list = try await getBangumiList(url) + + guard let ep = list.episodes.first else { throw VideoGetError.notFountData } + + var info = BilibiliInfo() + info.site = .bangumi + info.title = ep.titles() + info.cover = ep.cover + info.isLiving = true + return info + } + + func decodeUrl(_ url: String) async throws -> YouGetJSON { + try await getBangumi(url) + } + + func getBangumi(_ url: String) async throws -> YouGetJSON { + await biliShare.setBilibiliQuality() + + let json = try await bilibiliPrepareID(url) + + return try await biliShare.bilibiliPlayUrl(yougetJson: json, true) + } + + func bilibiliPrepareID(_ url: String) async throws -> YouGetJSON { + guard let bUrl = BilibiliUrl(url: url) else { + throw VideoGetError.invalidLink + } + var json = YouGetJSON(rawUrl: url) + + json.site = .bangumi + let list = try await getBangumiList(url) + var ep: BangumiEpList.BangumiEp? { + if bUrl.id.prefix(2) == "ss" { + return list.episodes.first + } else { + return list.episodes.first(where: { $0.id == Int(bUrl.id.dropFirst(2)) }) + } + } + guard let s = ep else { throw VideoGetError.notFountData } + + json.bvid = s.bvid + json.id = s.cid + if list.episodes.count == 1 { + json.title = list.episodes.first?.title ?? list.episodes.first?.longTitle ?? "" + } else { + let title = [json.title, + s.title, + s.longTitle].filter { + $0 != "" + }.joined(separator: " - ") + json.title = title + } + + json.duration = s.duration + return json + } + + func getBilibiliHTMLDatas(_ url: String, isBangumi: Bool = false) async throws -> (playInfoData: Data, initialStateData: Data, bangumiData: Data) { + let headers = HTTPHeaders(["Referer": "https://www.bilibili.com/", + "User-Agent": biliShare.bangumiUA]) + + let re = try await AF.request(url, headers: headers).serializingString().value + + let playinfoStrig = { + var s = re.subString(from: "window.__playinfo__=", to: "") + if s == "" { + s = re.subString(from: "const playurlSSRData = ", to: "\n") + } + return s + }() + + let playInfoData = playinfoStrig.data(using: .utf8) ?? Data() + let initialStateData = re.subString(from: "window.__INITIAL_STATE__=", to: ";(function()").data(using: .utf8) ?? Data() + let bangumiData = re.subString(from: "").data(using: .utf8) ?? Data() + + return (playInfoData, initialStateData, bangumiData) + } + + + func getBangumiId(_ url: String) async throws -> BangumiID { + let data = try await getBilibiliHTMLDatas(url, isBangumi: true).initialStateData + let json: JSONObject = try JSONParser.JSONObjectWithData(data) + let epid: Int = try json.value(for: "epInfo.ep_id") + let sid: Int = try json.value(for: "mediaInfo.season_id") + return BangumiID(epId: epid, seasonId: sid) + } + + func getBangumiList(_ url: String, ids: BangumiID? = nil) async throws -> BangumiEpList { + var bid: BangumiID! = ids + if bid == nil { + bid = try await getBangumiId(url) + } + + let u = "https://api.bilibili.com/pgc/view/web/ep/list?season_id=\(bid.seasonId)" + let data = try await AF.request(u).serializingData().value + let json: JSONObject = try JSONParser.JSONObjectWithData(data) + let list = try BangumiEpList(object: json) + return list + } +} + +struct BangumiEpList: Unmarshaling { + let episodes: [BangumiEp] + let section: [BangumiSections] + + struct BangumiEp: Unmarshaling { + let id: Int + let aid: Int + let bvid: String + let cid: Int + let title: String + let longTitle: String + let cover: String + let duration: Int + let fullTitle: String + + init(object: MarshaledObject) throws { + id = try object.value(for: "id") + aid = try object.value(for: "aid") + bvid = (try? object.value(for: "bvid")) ?? "" + cid = try object.value(for: "cid") + title = try object.value(for: "title") + longTitle = try object.value(for: "long_title") + let u: String = try object.value(for: "cover") + cover = u.https() + + let d: Int? = try? object.value(for: "duration") + duration = d ?? 0 / 1000 + + fullTitle = try object.value(for: "share_copy") + } + + func titles() -> String { + if fullTitle.isEmpty { + return [title, longTitle].filter({ $0 != "" }).joined(separator: " ") + } else { + return fullTitle + } + } + } + + struct BangumiSections: Unmarshaling { + let id: Int + let title: String + let type: Int + let episodes: [BangumiEp] + + init(object: MarshaledObject) throws { + id = try object.value(for: "id") + title = try object.value(for: "title") + type = try object.value(for: "type") + episodes = try object.value(for: "episodes") + } + } + + init(object: MarshaledObject) throws { + episodes = try object.value(for: "result.episodes") + section = (try? object.value(for: "result.section")) ?? [] + } + + var epVideoSelectors: [BiliVideoSelector] { + get { + var list = episodes.map(BiliVideoSelector.init) + list.enumerated().forEach { + list[$0.offset].index = $0.offset + 1 + } + return list + } + } +} + + + +/* +struct BangumiList: Unmarshaling { + let title: String + let epList: [BangumiInfo.BangumiEp] + let sections: [BangumiInfo.BangumiSections] + + var epVideoSelectors: [BiliVideoSelector] { + get { + var list = epList.map(BiliVideoSelector.init) + list.enumerated().forEach { + list[$0.offset].index = $0.offset + 1 + } + return list + } + } + + var selectionVideoSelectors: [BiliVideoSelector] { + get { + var list = sections.compactMap { + $0.epList.first + }.map(BiliVideoSelector.init) + list.enumerated().forEach { + list[$0.offset].index = $0.offset + 1 + } + return list + } + } + + init(object: MarshaledObject) throws { + epList = try object.value(for: "epList") + sections = try object.value(for: "sections") + title = try object.value(for: "h1Title") + } +} + +struct BangumiPlayInfo: Unmarshaling { + let session: String + let isPreview: Bool + let vipType: Int + let durl: [BangumiPlayDurl] + let format: String + let supportFormats: [BangumiVideoFormat] + let acceptQuality: [Int] + let quality: Int + let hasPaid: Bool + let vipStatus: Int + + init(object: MarshaledObject) throws { + session = try object.value(for: "session") + isPreview = try object.value(for: "data.is_preview") + vipType = try object.value(for: "data.vip_type") + durl = try object.value(for: "data.durl") + format = try object.value(for: "data.format") + supportFormats = try object.value(for: "data.support_formats") + acceptQuality = try object.value(for: "data.accept_quality") + quality = try object.value(for: "data.quality") + hasPaid = try object.value(for: "data.has_paid") + vipStatus = try object.value(for: "data.vip_status") + } + + struct BangumiPlayDurl: Unmarshaling { + let size: Int + let length: Int + let url: String + let backupUrl: [String] + init(object: MarshaledObject) throws { + size = try object.value(for: "size") + length = try object.value(for: "length") + url = try object.value(for: "url") + backupUrl = try object.value(for: "backup_url") + } + } + + struct BangumiVideoFormat: Unmarshaling { + let needLogin: Bool + let format: String + let description: String + let needVip: Bool + let quality: Int + init(object: MarshaledObject) throws { + needLogin = (try? object.value(for: "need_login")) ?? false + format = try object.value(for: "format") + description = try object.value(for: "description") + needVip = (try? object.value(for: "need_vip")) ?? false + quality = try object.value(for: "quality") + } + } +} + +struct BangumiInfo: Unmarshaling { + let title: String + let mediaInfo: BangumiMediaInfo + let epList: [BangumiEp] + let epInfo: BangumiEp + let sections: [BangumiSections] + let isLogin: Bool + + init(object: MarshaledObject) throws { + title = try object.value(for: "mediaInfo.title") +// title = try object.value(for: "h1Title") + mediaInfo = try object.value(for: "mediaInfo") + epList = try object.value(for: "epList") + epInfo = try object.value(for: "epInfo") + sections = try object.value(for: "sections") + isLogin = try object.value(for: "isLogin") + } + + struct BangumiMediaInfo: Unmarshaling { + let id: Int + let ssid: Int? + let title: String + let squareCover: String + let cover: String + + init(object: MarshaledObject) throws { + + id = try object.value(for: "id") + ssid = try? object.value(for: "ssid") + title = try object.value(for: "title") + squareCover = "https:" + (try object.value(for: "squareCover")) + cover = "https:" + (try object.value(for: "cover")) + } + } + + struct BangumiSections: Unmarshaling { + let id: Int + let title: String + let type: Int + let epList: [BangumiEp] + init(object: MarshaledObject) throws { + id = try object.value(for: "id") + title = try object.value(for: "title") + type = try object.value(for: "type") + epList = try object.value(for: "epList") + } + } + + struct BangumiEp: Unmarshaling { + let id: Int +// let badge: String +// let badgeType: Int +// let badgeColor: String + let epStatus: Int + let aid: Int + let bvid: String + let cid: Int + let title: String + let longTitle: String + let cover: String + let duration: Int + + init(object: MarshaledObject) throws { + id = try object.value(for: "id") +// badge = try object.value(for: "badge") +// badgeType = try object.value(for: "badgeType") +// badgeColor = (try? object.value(for: "badgeColor")) ?? "" + epStatus = try object.value(for: "epStatus") + aid = try object.value(for: "aid") + bvid = (try? object.value(for: "bvid")) ?? "" + cid = try object.value(for: "cid") + title = try object.value(for: "title") + longTitle = try object.value(for: "longTitle") + let u: String = try object.value(for: "cover") + cover = "https:" + u + let d: Int? = try? object.value(for: "duration") + duration = d ?? 0 / 1000 + } + } +} +*/ diff --git a/IINA+/Utils/VideoDecoder/BilbiliShare.swift b/IINA+/Utils/VideoDecoder/BilbiliShare.swift new file mode 100644 index 00000000..17c8de5f --- /dev/null +++ b/IINA+/Utils/VideoDecoder/BilbiliShare.swift @@ -0,0 +1,193 @@ +// +// BilbiliShare.swift +// IINA+ +// +// Created by xjbeta on 2024/11/19. +// Copyright © 2024 xjbeta. All rights reserved. +// + +import Foundation +import Alamofire +import Marshal + +actor BilibiliShare { + + let bangumiUA = "Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0 Iceweasel/38.2.1" + let bilibiliUA = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.5.1 Safari/605.1.15" + + enum BilibiliFnval: Int { + case flv = 0 + case mp4 = 1 + case dashH265 = 16 + case hdr = 64 + case dash4K = 128 + case dolbyAudio = 256 + case dolbyVideo = 512 + case dash8K = 1024 + case dashAV1 = 2048 + } + + func setBilibiliQuality() { + // https://github.com/xioxin/biliATV/issues/24 + var cookieProperties = [HTTPCookiePropertyKey: String]() + cookieProperties[HTTPCookiePropertyKey.name] = "CURRENT_QUALITY" as String + cookieProperties[HTTPCookiePropertyKey.value] = "125" as String + cookieProperties[HTTPCookiePropertyKey.domain] = ".bilibili.com" as String + cookieProperties[HTTPCookiePropertyKey.path] = "/" as String + let cookie = HTTPCookie(properties: cookieProperties) + HTTPCookieStorage.shared.setCookie(cookie!) + } + + func bilibiliPlayUrl(yougetJson: YouGetJSON, + _ isBangumi: Bool = false, + _ qn: Int = 132) async throws -> YouGetJSON { + var yougetJson = yougetJson + let cid = yougetJson.id + + let allowFlv = true + let dashSymbol = true + let inner = false + + let fnval = allowFlv ? dashSymbol ? inner ? BilibiliFnval.dashH265.rawValue : BilibiliFnval.dashAV1.rawValue + BilibiliFnval.dash8K.rawValue + BilibiliFnval.dolbyVideo.rawValue + BilibiliFnval.dolbyAudio.rawValue + BilibiliFnval.dash4K.rawValue + BilibiliFnval.hdr.rawValue + BilibiliFnval.dashH265.rawValue : BilibiliFnval.flv.rawValue : BilibiliFnval.mp4.rawValue + + + var u = isBangumi ? + "https://api.bilibili.com/pgc/player/web/playurl?" : + "https://api.bilibili.com/x/player/playurl?" + + u += "cid=\(cid)&bvid=\(yougetJson.bvid)&qn=\(qn)&fnver=0&fnval=\(fnval)&fourk=1" + + let headers = HTTPHeaders(["Referer": "https://www.bilibili.com/", + "User-Agent": isBangumi ? bangumiUA : bilibiliUA]) + + + let data = try await AF.request(u, headers: headers).serializingData().value + + let json: JSONObject = try JSONParser.JSONObjectWithData(data) + + let code: Int = try json.value(for: "code") + if code == -10403 { + throw VideoGetError.needVip + } + + let key = isBangumi ? "result" : "data" + + + do { + let info: BilibiliPlayInfo = try json.value(for: key) + yougetJson = info.write(to: yougetJson) + } catch { + Log("Bilibili fallback simple play info \(error)") + let info: BilibiliSimplePlayInfo = try json.value(for: key) + yougetJson = info.write(to: yougetJson) + } + + return yougetJson + } +} + +struct BilibiliPlayInfo: Unmarshaling { + let dash: BilibiliDash + var qualityDescription = [Int: String]() + + struct Durl: Unmarshaling { + let url: String + let backupUrls: [String] + let length: Int + init(object: MarshaledObject) throws { + url = try object.value(for: "url") + let urls: [String]? = try object.value(for: "backup_url") + backupUrls = urls ?? [] + length = try object.value(for: "length") + } + } + + init(object: MarshaledObject) throws { + dash = try object.value(for: "dash") + + let acceptQuality: [Int] = try object.value(for: "accept_quality") + let acceptDescription: [String] = try object.value(for: "accept_description") + + var descriptionDic = [Int: String]() + acceptQuality.enumerated().forEach { + descriptionDic[$0.element] = acceptDescription[$0.offset] + } + + qualityDescription = descriptionDic + } + + func write(to yougetJson: YouGetJSON) -> YouGetJSON { + var yougetJson = yougetJson + yougetJson.duration = dash.duration + yougetJson.audio = dash.preferAudio()?.url ?? "" + + qualityDescription.forEach { + let id = $0.key + guard let video = dash.preferVideo(id) else { + var s = Stream(url: "") + s.quality = id + yougetJson.streams[$0.value] = s + return + } + + var stream = Stream(url: video.url) + stream.src = video.backupUrl + stream.quality = $0.key + stream.dashContent = dash.dashContent($0.key) + yougetJson.streams[$0.value] = stream + } + + return yougetJson + } +} + +struct BilibiliSimplePlayInfo: Unmarshaling { + let duration: Int + let descriptions: [Int: String] + let quality: Int + let durl: [BilibiliPlayInfo.Durl] + + init(object: MarshaledObject) throws { + let acceptQuality: [Int] = try object.value(for: "accept_quality") + let acceptDescription: [String] = try object.value(for: "accept_description") + + var descriptionDic = [Int: String]() + acceptQuality.enumerated().forEach { + descriptionDic[$0.element] = acceptDescription[$0.offset] + } + descriptions = descriptionDic + + quality = try object.value(for: "quality") + durl = try object.value(for: "durl") + let timelength: Int = try object.value(for: "timelength") + duration = Int(timelength / 1000) + } + + func write(to yougetJson: YouGetJSON) -> YouGetJSON { + var yougetJson = yougetJson + yougetJson.duration = duration + var dic = descriptions + if yougetJson.streams.count == 0 { + dic = dic.filter { + $0.key <= quality + } + } + + dic.forEach { + var stream = yougetJson.streams[$0.value] ?? Stream(url: "") + if $0.key == quality, + let durl = durl.first { + var urls = durl.backupUrls + urls.append(durl.url) + urls = MBGA.update(urls) + + stream.url = urls.removeFirst() + stream.src = urls + } + stream.quality = $0.key + yougetJson.streams[$0.value] = stream + } + + return yougetJson + } +} diff --git a/IINA+/Utils/VideoDecoder/BiliLive.swift b/IINA+/Utils/VideoDecoder/BiliLive.swift index 6501b2a7..c3d7b06c 100644 --- a/IINA+/Utils/VideoDecoder/BiliLive.swift +++ b/IINA+/Utils/VideoDecoder/BiliLive.swift @@ -10,7 +10,7 @@ import Cocoa import Alamofire import Marshal -class BiliLive: NSObject, SupportSiteProtocol { +actor BiliLive: SupportSiteProtocol { enum APIType { case playUrl, roomPlayInfo, html diff --git a/IINA+/Utils/VideoDecoder/Bilibili.swift b/IINA+/Utils/VideoDecoder/Bilibili.swift index bded7af3..667664a1 100644 --- a/IINA+/Utils/VideoDecoder/Bilibili.swift +++ b/IINA+/Utils/VideoDecoder/Bilibili.swift @@ -10,34 +10,16 @@ import Cocoa import Alamofire import Marshal -class Bilibili: NSObject, SupportSiteProtocol { - - let bilibiliUA = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.5.1 Safari/605.1.15" - - let bangumiUA = "Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0 Iceweasel/38.2.1" - - struct BangumiID { - let epId: Int - let seasonId: Int - } +actor Bilibili: SupportSiteProtocol { + let biliShare = BilibiliShare() + let bangumi = Bangumi() + func liveInfo(_ url: String) async throws -> any LiveInfo { let isBangumi = SupportSites(url: url) == .bangumi if isBangumi { - let ids = try await getBangumiId(url) - let list = try await getBangumiList(url, ids: ids) - - guard let ep = list.episodes.first(where: { - $0.id == ids.epId - }) else { throw VideoGetError.notFountData } - - var info = BilibiliInfo() - info.site = .bangumi - info.title = ep.titles() - info.cover = ep.cover - info.isLiving = true - return info + return try await bangumi.liveInfo(url) } else { let data = try await getBilibiliHTMLDatas(url) @@ -57,7 +39,7 @@ class Bilibili: NSObject, SupportSiteProtocol { func decodeUrl(_ url: String) async throws -> YouGetJSON { var re: YouGetJSON! if SupportSites(url: url) == .bangumi { - re = try await getBangumi(url) + re = try await bangumi.decodeUrl(url) } else { re = try await getBilibili(url) } @@ -78,14 +60,15 @@ class Bilibili: NSObject, SupportSiteProtocol { return re } -// MARK: - Bilibili +// MARK: - Bilibili Video func getBilibili(_ url: String) async throws -> YouGetJSON { - setBilibiliQuality() + + await biliShare.setBilibiliQuality() func r1() async throws -> YouGetJSON { let json = try await bilibiliPrepareID(url) - return try await bilibiliPlayUrl(yougetJson: json) + return try await biliShare.bilibiliPlayUrl(yougetJson: json) } func r2() async throws -> YouGetJSON { @@ -106,10 +89,9 @@ class Bilibili: NSObject, SupportSiteProtocol { } } - func getBilibiliHTMLDatas(_ url: String, isBangumi: Bool = false) async throws -> (playInfoData: Data, initialStateData: Data, bangumiData: Data) { - let headers = HTTPHeaders( - ["Referer": "https://www.bilibili.com/", - "User-Agent": isBangumi ? bangumiUA : bilibiliUA]) + func getBilibiliHTMLDatas(_ url: String) async throws -> (playInfoData: Data, initialStateData: Data) { + let headers = HTTPHeaders(["Referer": "https://www.bilibili.com/", + "User-Agent": biliShare.bilibiliUA]) let re = try await AF.request(url, headers: headers).serializingString().value @@ -123,9 +105,8 @@ class Bilibili: NSObject, SupportSiteProtocol { let playInfoData = playinfoStrig.data(using: .utf8) ?? Data() let initialStateData = re.subString(from: "window.__INITIAL_STATE__=", to: ";(function()").data(using: .utf8) ?? Data() - let bangumiData = re.subString(from: "").data(using: .utf8) ?? Data() - return (playInfoData, initialStateData, bangumiData) + return (playInfoData, initialStateData) } func decodeBilibiliDatas(_ url: String, @@ -175,147 +156,32 @@ class Bilibili: NSObject, SupportSiteProtocol { } } - func setBilibiliQuality() { - // https://github.com/xioxin/biliATV/issues/24 - var cookieProperties = [HTTPCookiePropertyKey: String]() - cookieProperties[HTTPCookiePropertyKey.name] = "CURRENT_QUALITY" as String - cookieProperties[HTTPCookiePropertyKey.value] = "125" as String - cookieProperties[HTTPCookiePropertyKey.domain] = ".bilibili.com" as String - cookieProperties[HTTPCookiePropertyKey.path] = "/" as String - let cookie = HTTPCookie(properties: cookieProperties) - HTTPCookieStorage.shared.setCookie(cookie!) - } - - enum BilibiliFnval: Int { - case flv = 0 - case mp4 = 1 - case dashH265 = 16 - case hdr = 64 - case dash4K = 128 - case dolbyAudio = 256 - case dolbyVideo = 512 - case dash8K = 1024 - case dashAV1 = 2048 - } - - func bilibiliPlayUrl(yougetJson: YouGetJSON, - _ isBangumi: Bool = false, - _ qn: Int = 132) async throws -> YouGetJSON { - var yougetJson = yougetJson - let cid = yougetJson.id - - let allowFlv = true - let dashSymbol = true - let inner = false - - let fnval = allowFlv ? dashSymbol ? inner ? BilibiliFnval.dashH265.rawValue : BilibiliFnval.dashAV1.rawValue + BilibiliFnval.dash8K.rawValue + BilibiliFnval.dolbyVideo.rawValue + BilibiliFnval.dolbyAudio.rawValue + BilibiliFnval.dash4K.rawValue + BilibiliFnval.hdr.rawValue + BilibiliFnval.dashH265.rawValue : BilibiliFnval.flv.rawValue : BilibiliFnval.mp4.rawValue - - - var u = isBangumi ? - "https://api.bilibili.com/pgc/player/web/playurl?" : - "https://api.bilibili.com/x/player/playurl?" - - u += "cid=\(cid)&bvid=\(yougetJson.bvid)&qn=\(qn)&fnver=0&fnval=\(fnval)&fourk=1" - - let headers = HTTPHeaders( - ["Referer": "https://www.bilibili.com/", - "User-Agent": isBangumi ? bangumiUA : bilibiliUA]) - - - let data = try await AF.request(u, headers: headers).serializingData().value - - let json: JSONObject = try JSONParser.JSONObjectWithData(data) - - let code: Int = try json.value(for: "code") - if code == -10403 { - throw VideoGetError.needVip - } - - let key = isBangumi ? "result" : "data" - - - do { - let info: BilibiliPlayInfo = try json.value(for: key) - yougetJson = info.write(to: yougetJson) - } catch { - Log("Bilibili fallback simple play info \(error)") - let info: BilibiliSimplePlayInfo = try json.value(for: key) - yougetJson = info.write(to: yougetJson) - } - - return yougetJson - } - - - // MARK: - Bangumi - - func getBangumi(_ url: String) async throws -> YouGetJSON { - setBilibiliQuality() - - let json = try await bilibiliPrepareID(url) - - return try await bilibiliPlayUrl(yougetJson: json, true) - } - func bilibiliPrepareID(_ url: String) async throws -> YouGetJSON { guard let bUrl = BilibiliUrl(url: url) else { throw VideoGetError.invalidLink } var json = YouGetJSON(rawUrl: url) - switch bUrl.urlType { - case .video: - json.site = .bilibili - let eps = try await getVideoList(url) - let list = eps.flatMap({ $0.1 }) - var selector = list.first - if let s = selector, s.isCollection { - selector = list.first(where: { $0.bvid == bUrl.id }) - } else { - selector = list.first(where: { $0.index == bUrl.p }) - } - guard let s = selector else { throw VideoGetError.notFountData } - - json.id = Int(s.id) ?? -1 - json.bvid = s.bvid - json.title = s.title - json.duration = Int(s.duration) - return json - case .bangumi: - json.site = .bangumi - let list = try await getBangumiList(url) - var ep: BangumiEpList.BangumiEp? { - if bUrl.id.prefix(2) == "ss" { - return list.episodes.first - } else { - return list.episodes.first(where: { $0.id == Int(bUrl.id.dropFirst(2)) }) - } - } - guard let s = ep else { throw VideoGetError.notFountData } - - json.bvid = s.bvid - json.id = s.cid - if list.episodes.count == 1 { - json.title = list.episodes.first?.title ?? list.episodes.first?.longTitle ?? "" - } else { - let title = [json.title, - s.title, - s.longTitle].filter { - $0 != "" - }.joined(separator: " - ") - json.title = title - } - - json.duration = s.duration - return json - default: - throw VideoGetError.invalidLink + json.site = .bilibili + let eps = try await getVideoList(url) + let list = eps.flatMap({ $0.1 }) + var selector = list.first + if let s = selector, s.isCollection { + selector = list.first(where: { $0.bvid == bUrl.id }) + } else { + selector = list.first(where: { $0.index == bUrl.p }) } + guard let s = selector else { throw VideoGetError.notFountData } + + json.id = Int(s.id) ?? -1 + json.bvid = s.bvid + json.title = s.title + json.duration = Int(s.duration) + return json } -// MARK: - Other API - +// MARK: - Bilibili Account API enum BilibiliApiError: Error { case biliCSRFNotFound @@ -373,11 +239,9 @@ class Bilibili: NSObject, SupportSiteProtocol { } func getPvideo(_ aid: Int) async throws -> BilibiliPvideo { - let data = try await AF.request("https://api.bilibili.com/pvideo?aid=\(aid)").serializingData().value + let data = try await AF.request("https://api.bilibili.com/x/player/videoshot?aid=\(aid)&index=1").serializingData().value let json: JSONObject = try JSONParser.JSONObjectWithData(data) - var pvideo = try BilibiliPvideo(object: json) - pvideo.cropImages() - return pvideo + return try BilibiliPvideo(object: json) } func getVideoList(_ url: String) async throws -> [(String, [BiliVideoSelector])] { @@ -425,57 +289,22 @@ class Bilibili: NSObject, SupportSiteProtocol { return [("", infos)] } } - - func getBangumiId(_ url: String) async throws -> BangumiID { - let data = try await getBilibiliHTMLDatas(url, isBangumi: true).playInfoData - let json: JSONObject = try JSONParser.JSONObjectWithData(data) - let epid: Int = try json.value(for: "result.play_view_business_info.episode_info.ep_id") - let sid: Int = try json.value(for: "result.play_view_business_info.season_info.season_id") - return BangumiID(epId: epid, seasonId: sid) - } - - func getBangumiList(_ url: String, ids: BangumiID? = nil) async throws -> BangumiEpList { - - let ids = try await { - if let ids { - ids - } else { - try await getBangumiId(url) - } - }() - - let u = "https://api.bilibili.com/pgc/view/web/ep/list?season_id=\(ids.seasonId)" - let data = try await AF.request(u).serializingData().value - - let json: JSONObject = try JSONParser.JSONObjectWithData(data) - let list = try BangumiEpList(object: json) - return list - } } - -@objc(BilibiliCard) -class BilibiliCard: NSObject, Unmarshaling { +struct BilibiliCard: Unmarshaling, Sendable, Hashable { var aid: Int = 0 var bvid: String = "" var dynamicId: Int = 0 - @objc var title: String = "" - @objc var pic: NSImage? - @objc var picUrl: String = "" - @objc var name: String = "" - @objc var duration: TimeInterval = 0 - @objc var views: Int = 0 - @objc var videos: Int = 0 -// var pubdate = 1533581945 - - - override init() { - super.init() - } - - required init(object: MarshaledObject) throws { + var title: String = "" + var picUrl: String = "" + var name: String = "" + var duration: TimeInterval = 0 + var views: Int = 0 + var videos: Int = 0 + + init(object: any Marshal.MarshaledObject) throws { dynamicId = try object.value(for: "desc.dynamic_id") bvid = try object.value(for: "desc.bvid") let jsonStr: String = try object.value(for: "card") @@ -484,7 +313,7 @@ class BilibiliCard: NSObject, Unmarshaling { aid = try json.value(for: "aid") title = try json.value(for: "title") let picUrl: String = try json.value(for: "pic") - self.picUrl = picUrl.https() + self.picUrl = picUrl.https() duration = try json.value(for: "duration") name = try json.value(for: "owner.name") views = try json.value(for: "stat.view") @@ -497,9 +326,8 @@ enum BilibiliDynamicAction { case init😅, new, history } -struct BilibiliPvideo: Unmarshaling { - var images: [NSImage] = [] - var pImages: [NSImage] = [] +struct BilibiliPvideo: Unmarshaling, Sendable, Hashable { + var images: [String] = [] var xLen: Int = 0 var yLen: Int = 0 var xSize: Int = 0 @@ -512,13 +340,7 @@ struct BilibiliPvideo: Unmarshaling { init(object: MarshaledObject) throws { let imageStrs: [String] = try object.value(for: "data.image") -// images = imageStrs.compactMap { str -> NSImage? in -// if let url = URL(string: str.https()) { -// return NSImage(contentsOf: url) -// } else { -// return nil -// } -// } + let indexs: [Int] = try object.value(for: "data.index") imagesCount = indexs.count // limit image count for performance @@ -527,10 +349,9 @@ struct BilibiliPvideo: Unmarshaling { } else if imagesCount == 0 { throw CropImagesError.zeroImagesCount } - if let iamgeStr = imageStrs.first, - let url = URL(string: "https:" + iamgeStr), - let image = NSImage(contentsOf: url) { - images = [image] + + if let imageStr = imageStrs.first { + images = ["https:" + imageStr] } xLen = try object.value(for: "data.img_x_len") @@ -538,46 +359,6 @@ struct BilibiliPvideo: Unmarshaling { xSize = try object.value(for: "data.img_x_size") ySize = try object.value(for: "data.img_y_size") } - - mutating func cropImages() { - var pImages: [NSImage] = [] - var limitCount = 0 - images.forEach { image in - var xIndex = 0 - var yIndex = 0 - - if limitCount < imagesCount { - while yIndex < yLen { - while xIndex < xLen { - let rect = NSRect(x: xIndex * xSize, y: yIndex * ySize, width: xSize, height: ySize) - - if let croppedImage = crop(image, with: rect) { - pImages.append(croppedImage) - } - limitCount += 1 - if limitCount == imagesCount { - xIndex = 10 - yIndex = 10 - } - xIndex += 1 - if xIndex == xLen { - xIndex = 0 - yIndex += 1 - } - } - } - } - } - self.pImages = pImages - } - - func crop(_ image: NSImage, with rect: NSRect) -> NSImage? { - guard let croppedImage = image.cgImage(forProposedRect: nil, context: nil, hints: nil)?.cropping(to: rect) else { - return nil - } - let reImage = NSImage(cgImage: croppedImage, size: rect.size) - return reImage - } } protocol BilibiliVideoSelector: VideoSelector { @@ -753,351 +534,3 @@ struct BilibiliUrl { } } - - -struct BilibiliPlayInfo: Unmarshaling { - let dash: BilibiliDash - var qualityDescription = [Int: String]() - - struct Durl: Unmarshaling { - let url: String - let backupUrls: [String] - let length: Int - init(object: MarshaledObject) throws { - url = try object.value(for: "url") - let urls: [String]? = try object.value(for: "backup_url") - backupUrls = urls ?? [] - length = try object.value(for: "length") - } - } - - init(object: MarshaledObject) throws { - dash = try object.value(for: "dash") - - let acceptQuality: [Int] = try object.value(for: "accept_quality") - let acceptDescription: [String] = try object.value(for: "accept_description") - - var descriptionDic = [Int: String]() - acceptQuality.enumerated().forEach { - descriptionDic[$0.element] = acceptDescription[$0.offset] - } - - qualityDescription = descriptionDic - } - - func write(to yougetJson: YouGetJSON) -> YouGetJSON { - var yougetJson = yougetJson - yougetJson.duration = dash.duration - yougetJson.audio = dash.preferAudio()?.url ?? "" - - qualityDescription.forEach { - let id = $0.key - guard let video = dash.preferVideo(id) else { - var s = Stream(url: "") - s.quality = id - yougetJson.streams[$0.value] = s - return - } - - var stream = Stream(url: video.url) - stream.src = video.backupUrl - stream.quality = $0.key - stream.dashContent = dash.dashContent($0.key) - yougetJson.streams[$0.value] = stream - } - - return yougetJson - } -} - -struct BilibiliSimplePlayInfo: Unmarshaling { - let duration: Int - let descriptions: [Int: String] - let quality: Int - let durl: [BilibiliPlayInfo.Durl] - - init(object: MarshaledObject) throws { - let acceptQuality: [Int] = try object.value(for: "accept_quality") - let acceptDescription: [String] = try object.value(for: "accept_description") - - var descriptionDic = [Int: String]() - acceptQuality.enumerated().forEach { - descriptionDic[$0.element] = acceptDescription[$0.offset] - } - descriptions = descriptionDic - - quality = try object.value(for: "quality") - durl = try object.value(for: "durl") - let timelength: Int = try object.value(for: "timelength") - duration = Int(timelength / 1000) - } - - func write(to yougetJson: YouGetJSON) -> YouGetJSON { - var yougetJson = yougetJson - yougetJson.duration = duration - var dic = descriptions - if yougetJson.streams.count == 0 { - dic = dic.filter { - $0.key <= quality - } - } - - dic.forEach { - var stream = yougetJson.streams[$0.value] ?? Stream(url: "") - if $0.key == quality, - let durl = durl.first { - var urls = durl.backupUrls - urls.append(durl.url) - urls = MBGA.update(urls) - - stream.url = urls.removeFirst() - stream.src = urls - } - stream.quality = $0.key - yougetJson.streams[$0.value] = stream - } - - return yougetJson - } -} - -struct BangumiEpList: Unmarshaling { - let episodes: [BangumiEp] - let section: [BangumiSections] - - struct BangumiEp: Unmarshaling { - let id: Int - let aid: Int - let bvid: String - let cid: Int - let title: String - let longTitle: String - let cover: String - let duration: Int - let fullTitle: String - - init(object: MarshaledObject) throws { - id = try object.value(for: "id") - aid = try object.value(for: "aid") - bvid = (try? object.value(for: "bvid")) ?? "" - cid = try object.value(for: "cid") - title = try object.value(for: "title") - longTitle = try object.value(for: "long_title") - let u: String = try object.value(for: "cover") - cover = u.https() - - let d: Int? = try? object.value(for: "duration") - duration = d ?? 0 / 1000 - - fullTitle = try object.value(for: "share_copy") - } - - func titles() -> String { - if fullTitle.isEmpty { - return [title, longTitle].filter({ $0 != "" }).joined(separator: " ") - } else { - return fullTitle - } - } - } - - struct BangumiSections: Unmarshaling { - let id: Int - let title: String - let type: Int - let episodes: [BangumiEp] - - init(object: MarshaledObject) throws { - id = try object.value(for: "id") - title = try object.value(for: "title") - type = try object.value(for: "type") - episodes = try object.value(for: "episodes") - } - } - - init(object: MarshaledObject) throws { - episodes = try object.value(for: "result.episodes") - section = try object.value(for: "result.section") - } - - var epVideoSelectors: [BiliVideoSelector] { - get { - var list = episodes.map(BiliVideoSelector.init) - list.enumerated().forEach { - list[$0.offset].index = $0.offset + 1 - } - return list - } - } -} - -/* -struct BangumiList: Unmarshaling { - let title: String - let epList: [BangumiInfo.BangumiEp] - let sections: [BangumiInfo.BangumiSections] - - var epVideoSelectors: [BiliVideoSelector] { - get { - var list = epList.map(BiliVideoSelector.init) - list.enumerated().forEach { - list[$0.offset].index = $0.offset + 1 - } - return list - } - } - - var selectionVideoSelectors: [BiliVideoSelector] { - get { - var list = sections.compactMap { - $0.epList.first - }.map(BiliVideoSelector.init) - list.enumerated().forEach { - list[$0.offset].index = $0.offset + 1 - } - return list - } - } - - init(object: MarshaledObject) throws { - epList = try object.value(for: "epList") - sections = try object.value(for: "sections") - title = try object.value(for: "h1Title") - } -} - -struct BangumiPlayInfo: Unmarshaling { - let session: String - let isPreview: Bool - let vipType: Int - let durl: [BangumiPlayDurl] - let format: String - let supportFormats: [BangumiVideoFormat] - let acceptQuality: [Int] - let quality: Int - let hasPaid: Bool - let vipStatus: Int - - init(object: MarshaledObject) throws { - session = try object.value(for: "session") - isPreview = try object.value(for: "data.is_preview") - vipType = try object.value(for: "data.vip_type") - durl = try object.value(for: "data.durl") - format = try object.value(for: "data.format") - supportFormats = try object.value(for: "data.support_formats") - acceptQuality = try object.value(for: "data.accept_quality") - quality = try object.value(for: "data.quality") - hasPaid = try object.value(for: "data.has_paid") - vipStatus = try object.value(for: "data.vip_status") - } - - struct BangumiPlayDurl: Unmarshaling { - let size: Int - let length: Int - let url: String - let backupUrl: [String] - init(object: MarshaledObject) throws { - size = try object.value(for: "size") - length = try object.value(for: "length") - url = try object.value(for: "url") - backupUrl = try object.value(for: "backup_url") - } - } - - struct BangumiVideoFormat: Unmarshaling { - let needLogin: Bool - let format: String - let description: String - let needVip: Bool - let quality: Int - init(object: MarshaledObject) throws { - needLogin = (try? object.value(for: "need_login")) ?? false - format = try object.value(for: "format") - description = try object.value(for: "description") - needVip = (try? object.value(for: "need_vip")) ?? false - quality = try object.value(for: "quality") - } - } -} - -struct BangumiInfo: Unmarshaling { - let title: String - let mediaInfo: BangumiMediaInfo - let epList: [BangumiEp] - let epInfo: BangumiEp - let sections: [BangumiSections] - let isLogin: Bool - - init(object: MarshaledObject) throws { - title = try object.value(for: "mediaInfo.title") -// title = try object.value(for: "h1Title") - mediaInfo = try object.value(for: "mediaInfo") - epList = try object.value(for: "epList") - epInfo = try object.value(for: "epInfo") - sections = try object.value(for: "sections") - isLogin = try object.value(for: "isLogin") - } - - struct BangumiMediaInfo: Unmarshaling { - let id: Int - let ssid: Int? - let title: String - let squareCover: String - let cover: String - - init(object: MarshaledObject) throws { - - id = try object.value(for: "id") - ssid = try? object.value(for: "ssid") - title = try object.value(for: "title") - squareCover = "https:" + (try object.value(for: "squareCover")) - cover = "https:" + (try object.value(for: "cover")) - } - } - - struct BangumiSections: Unmarshaling { - let id: Int - let title: String - let type: Int - let epList: [BangumiEp] - init(object: MarshaledObject) throws { - id = try object.value(for: "id") - title = try object.value(for: "title") - type = try object.value(for: "type") - epList = try object.value(for: "epList") - } - } - - struct BangumiEp: Unmarshaling { - let id: Int -// let badge: String -// let badgeType: Int -// let badgeColor: String - let epStatus: Int - let aid: Int - let bvid: String - let cid: Int - let title: String - let longTitle: String - let cover: String - let duration: Int - - init(object: MarshaledObject) throws { - id = try object.value(for: "id") -// badge = try object.value(for: "badge") -// badgeType = try object.value(for: "badgeType") -// badgeColor = (try? object.value(for: "badgeColor")) ?? "" - epStatus = try object.value(for: "epStatus") - aid = try object.value(for: "aid") - bvid = (try? object.value(for: "bvid")) ?? "" - cid = try object.value(for: "cid") - title = try object.value(for: "title") - longTitle = try object.value(for: "longTitle") - let u: String = try object.value(for: "cover") - cover = "https:" + u - let d: Int? = try? object.value(for: "duration") - duration = d ?? 0 / 1000 - } - } -} -*/ diff --git a/IINA+/Utils/VideoDecoder/CC163.swift b/IINA+/Utils/VideoDecoder/CC163.swift index e67fb71d..5fdd8374 100644 --- a/IINA+/Utils/VideoDecoder/CC163.swift +++ b/IINA+/Utils/VideoDecoder/CC163.swift @@ -11,7 +11,7 @@ import Alamofire import Marshal import SwiftSoup -class CC163: NSObject, SupportSiteProtocol { +actor CC163: SupportSiteProtocol { func liveInfo(_ url: String) async throws -> any LiveInfo { if url.pathComponents.count == 4, url.pathComponents[2] == "ccid" { @@ -55,7 +55,7 @@ class CC163: NSObject, SupportSiteProtocol { } let jsonObj: JSONObject = try JSONParser.JSONObjectWithData(jsonData) - if let domain: String = try? jsonObj.value(for: "query.domain") { + if let _: String = try? jsonObj.value(for: "query.domain") { let list = try self.getCC163ZtRoomList(jsonObj) guard list.count > 0 else { throw VideoGetError.notFountData diff --git a/IINA+/Utils/VideoDecoder/DouYin.swift b/IINA+/Utils/VideoDecoder/DouYin.swift index 1571c416..23d2bbd5 100644 --- a/IINA+/Utils/VideoDecoder/DouYin.swift +++ b/IINA+/Utils/VideoDecoder/DouYin.swift @@ -12,10 +12,11 @@ import SwiftSoup import Alamofire import Marshal -class DouYin: NSObject, SupportSiteProtocol { +actor DouYin: SupportSiteProtocol { // MARK: - DY Init + @MainActor lazy var cookiesManager = DouyinCookiesManager() func liveInfo(_ url: String) async throws -> any LiveInfo { @@ -50,9 +51,9 @@ class DouYin: NSObject, SupportSiteProtocol { } let rid = try { - if let i = Int(pc[1]) { + if let _ = Int(pc[1]) { return pc[1] - } else if pc.count >= 4, pc[2] == "live", let i = Int(pc[3]) { + } else if pc.count >= 4, pc[2] == "live", let _ = Int(pc[3]) { return pc[3] } else { throw VideoGetError.invalidLink diff --git a/IINA+/Utils/VideoDecoder/DouyinCookiesManager.swift b/IINA+/Utils/VideoDecoder/DouyinCookiesManager.swift index 87068df2..0eb2194e 100644 --- a/IINA+/Utils/VideoDecoder/DouyinCookiesManager.swift +++ b/IINA+/Utils/VideoDecoder/DouyinCookiesManager.swift @@ -9,8 +9,8 @@ import Cocoa import WebKit import Alamofire -import Semaphore +@MainActor class DouyinCookiesManager: NSObject { private var webView: WKWebView? @@ -53,13 +53,9 @@ addXMLRequestCallback(function (xhr) { private var douyinWebcastUpdated: (() -> Void)? - @MainActor - private let semaphore = AsyncSemaphore(value: 1) - - @MainActor + private let tokenBucket = TokenBucket(tokens: 1) private var _cookies = [String: String]() - @MainActor private var shouldRetry = false enum DYState { @@ -98,25 +94,28 @@ addXMLRequestCallback(function (xhr) { }.joined(separator: ";") } - @MainActor + func douyinUA() async -> String { douyinUA } - - func cookies() async throws -> [String: String] { - await semaphore.wait() - defer { semaphore.signal() } - - if await shouldRetry { + + func cookies() async throws -> [String: String] { + try await tokenBucket.withToken { + try await internelCookies() + } + } + + func internelCookies() async throws -> [String: String] { + if shouldRetry { Log("retry 60s") - await updateInternalCookies([:]) + updateInternalCookies([:]) try await Task.sleep(seconds: 60) - await updateRetry(false) + updateRetry(false) } - if await _cookies.count > 0 { + if _cookies.count > 0 { // Log("cached cookies") - return await _cookies + return _cookies } do { @@ -137,23 +136,23 @@ addXMLRequestCallback(function (xhr) { return cookies } catch { Log("should retry, catch \(error)") - await updateRetry(true) - await deinitWebViewAsync() + updateRetry(true) + deinitWebViewAsync() throw error } } - @MainActor + func updateInternalCookies(_ cookies: [String: String]) { _cookies = cookies } - @MainActor + func updateRetry(_ retry: Bool) { self.shouldRetry = retry } - @MainActor + func prepareCookies() async throws -> [String: String] { Log("start") deleteDouYinCookies() @@ -185,7 +184,7 @@ addXMLRequestCallback(function (xhr) { // Log("time") let isLoading = webView.isLoading guard !isLoading, - let title = try await webView.evaluateJavaScriptAsync("document.title") as? String else { + let title = try await webView.evaluateJavaScriptAsync("document.title", type: String.self) else { continue } @@ -213,7 +212,7 @@ addXMLRequestCallback(function (xhr) { return cookies } - @MainActor + func loadCookies() async throws -> [String: String] { guard let webview = webView else { throw VideoGetError.douyuSignError @@ -231,22 +230,22 @@ addXMLRequestCallback(function (xhr) { cookies[$0.name] = $0.value } - let re1 = try await webview.evaluateJavaScriptAsync("localStorage.\(cid)") - let re2 = try await webview.evaluateJavaScriptAsync("window.navigator.userAgent") + let re1 = try await webview.evaluateJavaScriptAsync("localStorage.\(cid)", type: String.self) + let re2 = try await webview.evaluateJavaScriptAsync("window.navigator.userAgent", type: String.self) - cookies[cid] = re1 as? String + cookies[cid] = re1 Log("cid \(re1 ?? ""), ua \(re2 ?? "")") - guard let ua = re2 as? String else { + guard let ua = re2 else { Log("nil userAgent") throw CookiesError.invalid } - let re = try await webview.evaluateJavaScriptAsync("localStorage.\(self.privateKeys[0].base64Decode()) + ',' + localStorage.\(self.privateKeys[1].base64Decode())") + let re = try await webview.evaluateJavaScriptAsync("localStorage.\(self.privateKeys[0].base64Decode()) + ',' + localStorage.\(self.privateKeys[1].base64Decode())", type: String.self) Log("privateKeys") - guard let values = (re as? String)?.split(separator: ",", maxSplits: 1).map(String.init) else { + guard let values = re?.split(separator: ",", maxSplits: 1).map(String.init) else { throw VideoGetError.douyuSignError } @@ -270,7 +269,7 @@ addXMLRequestCallback(function (xhr) { "\($0.key)=\($0.value)" }.joined(separator: ";") - var headers = HTTPHeaders([ + let headers = HTTPHeaders([ "User-Agent": ua, "Cookie": cookie ]) @@ -282,7 +281,7 @@ addXMLRequestCallback(function (xhr) { } catch { switch error { case AFError.responseSerializationFailed(reason: .inputDataNilOrZeroLength): - await updateRetry(true) + updateRetry(true) throw CookiesError.invalid default: Log(error) @@ -290,15 +289,14 @@ addXMLRequestCallback(function (xhr) { } } - @MainActor + func deleteCookies() async { let cookies = await getAllWKCookies() - await withTaskGroup(of: Int.self) { group in + await withTaskGroup(of: Void.self) { group in cookies.forEach { c in group.addTask { await self.deleteWKCookie(c) - return 0 } } } @@ -306,25 +304,25 @@ addXMLRequestCallback(function (xhr) { deleteDouYinCookies() } - @MainActor + func deleteDouYinCookies() { HTTPCookieStorage.shared.cookies?.filter { $0.domain.contains("douyin") }.forEach(HTTPCookieStorage.shared.deleteCookie) } - @MainActor + func getAllWKCookies() async -> [HTTPCookie] { let all = await WKWebsiteDataStore.default().httpCookieStore.allCookies() return all.filter({ $0.domain.contains("douyin") }) } - @MainActor + func deleteWKCookie(_ cookie: HTTPCookie) async { await WKWebsiteDataStore.default().httpCookieStore.deleteCookie(cookie) } - @MainActor + func deinitWebViewAsync() { deinitWebView() } @@ -336,10 +334,6 @@ addXMLRequestCallback(function (xhr) { webView?.removeFromSuperview() webView = nil } - - deinit { - deinitWebView() - } } extension DouyinCookiesManager: WKScriptMessageHandler { diff --git a/IINA+/Utils/VideoDecoder/Douyu.swift b/IINA+/Utils/VideoDecoder/Douyu.swift index e43db1cf..cd9b3e79 100644 --- a/IINA+/Utils/VideoDecoder/Douyu.swift +++ b/IINA+/Utils/VideoDecoder/Douyu.swift @@ -12,7 +12,7 @@ import JavaScriptCore import Marshal import CryptoSwift -class Douyu: NSObject, SupportSiteProtocol { +actor Douyu: SupportSiteProtocol { func liveInfo(_ url: String) async throws -> any LiveInfo { let rid = try await getDouyuHtml(url).roomId let id = Int(rid) ?? -1 @@ -144,13 +144,13 @@ class Douyu: NSObject, SupportSiteProtocol { let pars = ["v": v, "did": didStr, - "tt": time, + "tt": "\(time)", "sign": sign.subString(from: "sign="), "cdn": "ali-h5", "rate": "\(rate)", "ver": "Douyu_221111905", "iar": "0", - "ive": "0"] as [String : Any] + "ive": "0"] let url = "https://www.douyu.com/lapi/live/getH5Play/\(roomID)" let data = try await AF.request(url, method: .post, parameters: pars).serializingData().value diff --git a/IINA+/Utils/VideoDecoder/Huya.swift b/IINA+/Utils/VideoDecoder/Huya.swift index 88949253..cca80768 100644 --- a/IINA+/Utils/VideoDecoder/Huya.swift +++ b/IINA+/Utils/VideoDecoder/Huya.swift @@ -11,7 +11,7 @@ import Alamofire import Marshal import SwiftSoup -class Huya: NSObject, SupportSiteProtocol { +actor Huya: SupportSiteProtocol { lazy var pSession: Session = { let configuration = URLSessionConfiguration.af.default @@ -78,7 +78,7 @@ class Huya: NSObject, SupportSiteProtocol { func getHuyaVideos(_ url: String) async throws -> YouGetJSON { let obj = try await getPlayerConfig(url) let info = try HuyaStream(object: obj) - var yougetJson = YouGetJSON(rawUrl: url) + let yougetJson = YouGetJSON(rawUrl: url) return info.write(to: yougetJson, uid: huyaUid) } @@ -395,11 +395,11 @@ struct HuyaInfoM: Unmarshaling, LiveInfo { } func write(to yougetJson: YouGetJSON, uid: Int) -> YouGetJSON { - var yougetJson = yougetJson + let yougetJson = yougetJson // HuyaUrl.format not work for m return yougetJson - + /* let urls = streamInfos.sorted { i1, i2 -> Bool in i1.sCdnType == defaultCDN }.sorted { i1, i2 -> Bool in @@ -431,6 +431,7 @@ struct HuyaInfoM: Unmarshaling, LiveInfo { } return yougetJson + */ } } diff --git a/IINA+/Utils/VideoDecoder/MBGA.swift b/IINA+/Utils/VideoDecoder/MBGA.swift index 547e902c..533147d6 100644 --- a/IINA+/Utils/VideoDecoder/MBGA.swift +++ b/IINA+/Utils/VideoDecoder/MBGA.swift @@ -25,7 +25,7 @@ class MBGA: NSObject { } static func update(_ urls: [String]) -> [String] { - var urls: [String] = Array(Set(urls)) + let urls: [String] = Array(Set(urls)) return urls.sorted { u1, u2 in cdnLevel(for: u1).rawValue < cdnLevel(for: u2).rawValue diff --git a/IINA+/Utils/VideoDecoder/QQLive.swift b/IINA+/Utils/VideoDecoder/QQLive.swift index 12222ac3..de9dd5be 100644 --- a/IINA+/Utils/VideoDecoder/QQLive.swift +++ b/IINA+/Utils/VideoDecoder/QQLive.swift @@ -10,7 +10,7 @@ import Cocoa import Alamofire import Marshal -class QQLive: NSObject, SupportSiteProtocol { +actor QQLive: SupportSiteProtocol { lazy var pSession: Session = { let configuration = URLSessionConfiguration.af.default let ua = "Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Mobile/15E148 Safari/604.1" diff --git a/IINA+/Utils/VideoDecoder/VideoDecoder.swift b/IINA+/Utils/VideoDecoder/VideoDecoder.swift index 881af03d..985a0ee6 100644 --- a/IINA+/Utils/VideoDecoder/VideoDecoder.swift +++ b/IINA+/Utils/VideoDecoder/VideoDecoder.swift @@ -10,11 +10,10 @@ import Cocoa import Alamofire import Marshal import CommonCrypto -import JavaScriptCore -import WebKit +@preconcurrency import JavaScriptCore import SwiftSoup -class VideoDecoder: NSObject { +actor VideoDecoder { lazy var douyin = DouYin() lazy var huya = Huya() lazy var douyu = Douyu() @@ -96,7 +95,7 @@ class VideoDecoder: NSObject { func prepareDanmakuFile(yougetJSON: YouGetJSON, id: String) async throws { let pref = Preferences.shared - guard Processes.shared.iina.archiveType != .normal, + guard await Processes.shared.iina.archiveType != .normal, pref.enableDanmaku, pref.livePlayer == .iina, [.bilibili, .bangumi, .local].contains(yougetJSON.site), @@ -138,7 +137,7 @@ class VideoDecoder: NSObject { } let qn = stream.quality - let json = try await bilibili.bilibiliPlayUrl(yougetJson: json, json.site == .bangumi, qn) + let json = try await bilibili.biliShare.bilibiliPlayUrl(yougetJson: json, json.site == .bangumi, qn) return await registerDash(json) case .biliLive: guard let stream = json.streams[key], @@ -207,7 +206,7 @@ extension VideoDecoder { // MARK: - Bilibili Danmaku func downloadDMFile(_ cid: Int, id: String) async throws { let data = try await AF.request("https://comment.bilibili.com/\(cid).xml").serializingData().value - await saveDMFile(data, with: id) + VideoDecoder.saveDMFile(data, with: id) } @@ -225,9 +224,9 @@ extension VideoDecoder { } let dms = try await withThrowingTaskGroup(of: [DanmakuElem].self) { group in - s.forEach { i in + for i in s { group.addTask { - return try await self.getDanmakuContent(cid: cid, index: i) + try await self.getDanmakuContent(cid: cid, index: i) } } @@ -272,12 +271,11 @@ extension VideoDecoder { } } - await self.saveDMFile(doc.xmlData, with: id) + VideoDecoder.saveDMFile(doc.xmlData, with: id) } - @MainActor - func saveDMFile(_ data: Data?, with id: String) { - guard let path = dmPath(id) else { return } + static func saveDMFile(_ data: Data?, with id: String) { + guard let path = VideoDecoder.dmPath(id) else { return } var p = path p.deleteLastPathComponent() try? FileManager.default.createDirectory(atPath: p, withIntermediateDirectories: true) @@ -285,7 +283,7 @@ extension VideoDecoder { Log("Saved DM in \(path)") } - func dmPath(_ id: String) -> String? { + static func dmPath(_ id: String) -> String? { guard let bundleIdentifier = Bundle.main.bundleIdentifier, var filesURL = try? FileManager.default.url(for: .applicationSupportDirectory, in: .userDomainMask, appropriateFor: nil, create: true) else { return nil @@ -304,7 +302,7 @@ extension VideoDecoder { let u = "https://api.bilibili.com/x/v2/dm/web/seg.so?type=1&oid=\(cid)&segment_index=\(index)" let data = try await AF.request(u).serializingData().value - return try DmSegMobileReply(serializedData: data).elems + return try DmSegMobileReply(serializedBytes: data).elems } } diff --git a/IINA+/Utils/VideoDecoder/VideoGetStructs.swift b/IINA+/Utils/VideoDecoder/VideoGetStructs.swift index 16dde477..d6143e49 100644 --- a/IINA+/Utils/VideoDecoder/VideoGetStructs.swift +++ b/IINA+/Utils/VideoDecoder/VideoGetStructs.swift @@ -9,7 +9,7 @@ import Cocoa import Marshal -protocol LiveInfo { +protocol LiveInfo: Sendable { var title: String { get } var name: String { get } var avatar: String { get } diff --git a/IINA+/Utils/YouGetJSON.swift b/IINA+/Utils/YouGetJSON.swift index d4de5d9d..81015aa2 100644 --- a/IINA+/Utils/YouGetJSON.swift +++ b/IINA+/Utils/YouGetJSON.swift @@ -199,7 +199,7 @@ struct YouGetJSON: Unmarshaling, Codable { return kvs } - guard let v = kv[1].addingPercentEncoding(withAllowedCharacters: Processes.shared.urlQueryValueAllowed) else { return nil } + guard let v = kv[1].addingPercentEncoding(withAllowedCharacters: .urlQueryValueAllowed) else { return nil } let k = kv[0] return "\(k)=\(v)" } @@ -227,7 +227,7 @@ struct YouGetJSON: Unmarshaling, Codable { return kvs } - guard let v = kv[1].addingPercentEncoding(withAllowedCharacters: Processes.shared.urlQueryValueAllowed) else { return nil } + guard let v = kv[1].addingPercentEncoding(withAllowedCharacters: .urlQueryValueAllowed) else { return nil } let k = kv[0] return "\(k)=\(v)" } @@ -286,8 +286,8 @@ struct YouGetJSON: Unmarshaling, Codable { if Preferences.shared.enableDanmaku { opts.type = PluginOptionsType.ws.rawValue } - - if let dmPath = VideoDecoder().dmPath(uuid), + + if let dmPath = VideoDecoder.dmPath(uuid), FileManager.default.fileExists(atPath: dmPath) { opts.type = PluginOptionsType.xmlFile.rawValue opts.xmlPath = dmPath diff --git a/IINA+/Views/Base.lproj/Main.storyboard b/IINA+/Views/Base.lproj/Main.storyboard index c9328965..42ab061b 100644 --- a/IINA+/Views/Base.lproj/Main.storyboard +++ b/IINA+/Views/Base.lproj/Main.storyboard @@ -1,8 +1,8 @@ - + - + @@ -319,23 +319,23 @@ - + - + - + - + - + @@ -428,32 +428,32 @@ - - + + - - + + - + - + - + - + - + @@ -466,11 +466,11 @@ - + - - + + @@ -490,8 +490,8 @@ - - + + @@ -515,7 +515,7 @@ - + @@ -526,7 +526,7 @@ - + @@ -537,7 +537,7 @@ - + @@ -590,7 +590,7 @@ - + @@ -611,8 +611,8 @@ - - @@ -1161,12 +1147,6 @@ - - - - - - @@ -1184,7 +1164,7 @@ - + @@ -1220,7 +1200,7 @@ Gw - + diff --git a/IINA+/Views/JSPlayer/Base.lproj/JSPlayer.storyboard b/IINA+/Views/JSPlayer/Base.lproj/JSPlayer.storyboard index 41d673e5..a1248567 100644 --- a/IINA+/Views/JSPlayer/Base.lproj/JSPlayer.storyboard +++ b/IINA+/Views/JSPlayer/Base.lproj/JSPlayer.storyboard @@ -1,8 +1,8 @@ - + - + @@ -38,7 +38,7 @@ - + @@ -129,7 +129,7 @@ - + @@ -166,17 +166,17 @@ - + - + - + @@ -197,7 +197,7 @@ - + @@ -238,7 +238,7 @@ - +