Skip to content

Commit

Permalink
fix: remove clientVer, add key, buvid in WSOptions (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
ddiu8081 authored Dec 18, 2023
1 parent e3cfff9 commit c1b4244
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/base/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,12 @@ export class LiveClient<E extends Record<EventKey, any>> extends EventEmitter<Me

this.firstMessage = {
roomid: room,
clientver: options.clientVer,
protover: options.protover,
uid: options.uid,
platform: options.platform,
type: options.type,
key: options.key,
buvid: options.buvid,
}

if (options.key)
Expand Down
11 changes: 6 additions & 5 deletions src/base/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,23 +125,24 @@ export interface ConnectionOptions {

export interface WSOptions extends BaseOptions, AuthOptions, ConnectionOptions {
ssl?: boolean
clientVer?: `${number}.${number}.${number}` | `${number}.${number}.${number}.${number}`
platform?: 'web'
platform?: 'web' | string
protover?: 1 | 2 | 3
uid?: number
type?: number
key?: string
buvid?: string
}

export interface TCPOptions extends WSOptions {}

export interface LiveHelloMessage {
clientver?: `${number}.${number}.${number}` | `${number}.${number}.${number}.${number}`
platform?: 'web'
platform?: 'web' | string
protover?: 1 | 2 | 3
roomid: number
uid?: number
type?: number
key?: any
key?: string
buvid?: string
}

export interface MessageMeta extends ProtocolHeader {}
Expand Down

0 comments on commit c1b4244

Please sign in to comment.