connectbase-client 0.6.10 → 0.6.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/dist/connect-base.umd.js +2 -2
- package/dist/index.d.mts +216 -4
- package/dist/index.d.ts +216 -4
- package/dist/index.js +500 -23
- package/dist/index.mjs +500 -23
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -3388,12 +3388,40 @@ interface GameRoomInfo {
|
|
|
3388
3388
|
type GameServerMessageType = 'room_created' | 'room_joined' | 'room_left' | 'state' | 'delta' | 'player_event' | 'chat' | 'pong' | 'room_list' | 'error';
|
|
3389
3389
|
/**
|
|
3390
3390
|
* 게임 서버 메시지
|
|
3391
|
+
* 서버는 모든 필드를 최상위에 보냄 (data 래퍼 없음)
|
|
3391
3392
|
*/
|
|
3392
|
-
interface GameServerMessage
|
|
3393
|
+
interface GameServerMessage {
|
|
3393
3394
|
type: GameServerMessageType;
|
|
3394
|
-
data: T;
|
|
3395
|
-
serverTime: number;
|
|
3396
3395
|
msg_id?: string;
|
|
3396
|
+
room_id?: string;
|
|
3397
|
+
server_time?: number;
|
|
3398
|
+
delta?: {
|
|
3399
|
+
from_version: number;
|
|
3400
|
+
to_version: number;
|
|
3401
|
+
changes: {
|
|
3402
|
+
path: string;
|
|
3403
|
+
operation: string;
|
|
3404
|
+
value?: unknown;
|
|
3405
|
+
old_value?: unknown;
|
|
3406
|
+
}[];
|
|
3407
|
+
tick: number;
|
|
3408
|
+
};
|
|
3409
|
+
tick?: number;
|
|
3410
|
+
event?: string;
|
|
3411
|
+
player?: {
|
|
3412
|
+
client_id: string;
|
|
3413
|
+
user_id?: string;
|
|
3414
|
+
joined_at: number;
|
|
3415
|
+
metadata?: Record<string, string>;
|
|
3416
|
+
};
|
|
3417
|
+
client_id?: string;
|
|
3418
|
+
user_id?: string;
|
|
3419
|
+
message?: string;
|
|
3420
|
+
data?: unknown;
|
|
3421
|
+
code?: string;
|
|
3422
|
+
timestamp?: number;
|
|
3423
|
+
client_timestamp?: number;
|
|
3424
|
+
server_timestamp?: number;
|
|
3397
3425
|
}
|
|
3398
3426
|
/**
|
|
3399
3427
|
* 플레이어 이벤트
|
|
@@ -3437,6 +3465,12 @@ interface GameEventHandlers {
|
|
|
3437
3465
|
onError?: (error: Event | ErrorMessage) => void;
|
|
3438
3466
|
onStateUpdate?: (state: GameState) => void;
|
|
3439
3467
|
onDelta?: (delta: GameDelta) => void;
|
|
3468
|
+
onAction?: (action: {
|
|
3469
|
+
type: string;
|
|
3470
|
+
clientId: string;
|
|
3471
|
+
data?: unknown;
|
|
3472
|
+
timestamp: number;
|
|
3473
|
+
}) => void;
|
|
3440
3474
|
onPlayerJoined?: (player: GamePlayer) => void;
|
|
3441
3475
|
onPlayerLeft?: (player: GamePlayer) => void;
|
|
3442
3476
|
onChat?: (message: ChatMessage) => void;
|
|
@@ -3480,6 +3514,107 @@ interface GameConnectionState {
|
|
|
3480
3514
|
reconnectAttempt?: number;
|
|
3481
3515
|
lastError?: Error;
|
|
3482
3516
|
}
|
|
3517
|
+
/**
|
|
3518
|
+
* 매치메이킹 큐 참가 요청
|
|
3519
|
+
*/
|
|
3520
|
+
interface JoinQueueRequest {
|
|
3521
|
+
gameType: string;
|
|
3522
|
+
playerId: string;
|
|
3523
|
+
rating?: number;
|
|
3524
|
+
region?: string;
|
|
3525
|
+
mode?: 'ranked' | 'quick_play' | 'custom';
|
|
3526
|
+
partyMembers?: string[];
|
|
3527
|
+
metadata?: Record<string, string>;
|
|
3528
|
+
}
|
|
3529
|
+
/**
|
|
3530
|
+
* 매치메이킹 티켓
|
|
3531
|
+
*/
|
|
3532
|
+
interface MatchmakingTicket {
|
|
3533
|
+
ticketId: string;
|
|
3534
|
+
gameType: string;
|
|
3535
|
+
playerId: string;
|
|
3536
|
+
status: string;
|
|
3537
|
+
createdAt: string;
|
|
3538
|
+
waitTime?: number;
|
|
3539
|
+
matchId?: string;
|
|
3540
|
+
roomId?: string;
|
|
3541
|
+
}
|
|
3542
|
+
/**
|
|
3543
|
+
* 로비 가시성
|
|
3544
|
+
*/
|
|
3545
|
+
type LobbyVisibility = 'public' | 'private' | 'friends_only';
|
|
3546
|
+
/**
|
|
3547
|
+
* 로비 생성 요청
|
|
3548
|
+
*/
|
|
3549
|
+
interface CreateLobbyRequest {
|
|
3550
|
+
playerId: string;
|
|
3551
|
+
displayName?: string;
|
|
3552
|
+
name: string;
|
|
3553
|
+
gameType?: string;
|
|
3554
|
+
password?: string;
|
|
3555
|
+
maxPlayers?: number;
|
|
3556
|
+
visibility?: LobbyVisibility;
|
|
3557
|
+
region?: string;
|
|
3558
|
+
settings?: Record<string, unknown>;
|
|
3559
|
+
tags?: string[];
|
|
3560
|
+
}
|
|
3561
|
+
/**
|
|
3562
|
+
* 로비 멤버
|
|
3563
|
+
*/
|
|
3564
|
+
interface LobbyMember {
|
|
3565
|
+
playerId: string;
|
|
3566
|
+
displayName: string;
|
|
3567
|
+
role: string;
|
|
3568
|
+
team: string;
|
|
3569
|
+
ready: boolean;
|
|
3570
|
+
slot: number;
|
|
3571
|
+
joinedAt: string;
|
|
3572
|
+
}
|
|
3573
|
+
/**
|
|
3574
|
+
* 로비 정보
|
|
3575
|
+
*/
|
|
3576
|
+
interface LobbyInfo {
|
|
3577
|
+
id: string;
|
|
3578
|
+
name: string;
|
|
3579
|
+
hostId: string;
|
|
3580
|
+
gameType: string;
|
|
3581
|
+
playerCount: number;
|
|
3582
|
+
maxPlayers: number;
|
|
3583
|
+
hasPassword: boolean;
|
|
3584
|
+
visibility: LobbyVisibility;
|
|
3585
|
+
region: string;
|
|
3586
|
+
settings?: Record<string, unknown>;
|
|
3587
|
+
tags?: string[];
|
|
3588
|
+
status: string;
|
|
3589
|
+
roomId?: string;
|
|
3590
|
+
members?: LobbyMember[];
|
|
3591
|
+
createdAt: string;
|
|
3592
|
+
}
|
|
3593
|
+
/**
|
|
3594
|
+
* 로비 업데이트 요청
|
|
3595
|
+
*/
|
|
3596
|
+
interface UpdateLobbyRequest {
|
|
3597
|
+
hostId: string;
|
|
3598
|
+
name?: string;
|
|
3599
|
+
maxPlayers?: number;
|
|
3600
|
+
visibility?: LobbyVisibility;
|
|
3601
|
+
password?: string;
|
|
3602
|
+
settings?: Record<string, unknown>;
|
|
3603
|
+
tags?: string[];
|
|
3604
|
+
}
|
|
3605
|
+
/**
|
|
3606
|
+
* 로비 초대 정보
|
|
3607
|
+
*/
|
|
3608
|
+
interface LobbyInvite {
|
|
3609
|
+
inviteId: string;
|
|
3610
|
+
lobbyId: string;
|
|
3611
|
+
lobbyName: string;
|
|
3612
|
+
inviterId: string;
|
|
3613
|
+
inviteeId: string;
|
|
3614
|
+
status: string;
|
|
3615
|
+
createdAt: string;
|
|
3616
|
+
expiresAt: string;
|
|
3617
|
+
}
|
|
3483
3618
|
|
|
3484
3619
|
/**
|
|
3485
3620
|
* 게임 룸 클라이언트
|
|
@@ -3594,6 +3729,83 @@ declare class GameAPI {
|
|
|
3594
3729
|
* 룸 삭제 (HTTP)
|
|
3595
3730
|
*/
|
|
3596
3731
|
deleteRoom(roomId: string): Promise<void>;
|
|
3732
|
+
/**
|
|
3733
|
+
* 매치메이킹 큐에 참가
|
|
3734
|
+
*/
|
|
3735
|
+
joinQueue(req: JoinQueueRequest): Promise<MatchmakingTicket>;
|
|
3736
|
+
/**
|
|
3737
|
+
* 매치메이킹 큐에서 탈퇴
|
|
3738
|
+
*/
|
|
3739
|
+
leaveQueue(ticketId: string): Promise<void>;
|
|
3740
|
+
/**
|
|
3741
|
+
* 매치메이킹 상태 조회
|
|
3742
|
+
*/
|
|
3743
|
+
getMatchStatus(params: {
|
|
3744
|
+
ticketId?: string;
|
|
3745
|
+
playerId?: string;
|
|
3746
|
+
}): Promise<MatchmakingTicket>;
|
|
3747
|
+
/**
|
|
3748
|
+
* 로비 목록 조회
|
|
3749
|
+
*/
|
|
3750
|
+
listLobbies(): Promise<LobbyInfo[]>;
|
|
3751
|
+
/**
|
|
3752
|
+
* 로비 생성
|
|
3753
|
+
*/
|
|
3754
|
+
createLobby(req: CreateLobbyRequest): Promise<LobbyInfo>;
|
|
3755
|
+
/**
|
|
3756
|
+
* 로비 상세 조회
|
|
3757
|
+
*/
|
|
3758
|
+
getLobby(lobbyId: string): Promise<LobbyInfo>;
|
|
3759
|
+
/**
|
|
3760
|
+
* 로비 참가
|
|
3761
|
+
*/
|
|
3762
|
+
joinLobby(lobbyId: string, playerId: string, displayName?: string, password?: string): Promise<{
|
|
3763
|
+
lobbyId: string;
|
|
3764
|
+
}>;
|
|
3765
|
+
/**
|
|
3766
|
+
* 로비 퇴장
|
|
3767
|
+
*/
|
|
3768
|
+
leaveLobby(lobbyId: string, playerId: string): Promise<void>;
|
|
3769
|
+
/**
|
|
3770
|
+
* 레디 상태 토글
|
|
3771
|
+
*/
|
|
3772
|
+
toggleReady(lobbyId: string, playerId: string, ready: boolean): Promise<void>;
|
|
3773
|
+
/**
|
|
3774
|
+
* 게임 시작 (호스트만)
|
|
3775
|
+
*/
|
|
3776
|
+
startGame(lobbyId: string, hostId: string): Promise<{
|
|
3777
|
+
roomId: string;
|
|
3778
|
+
}>;
|
|
3779
|
+
/**
|
|
3780
|
+
* 플레이어 추방 (호스트만)
|
|
3781
|
+
*/
|
|
3782
|
+
kickPlayer(lobbyId: string, hostId: string, targetPlayerId: string): Promise<void>;
|
|
3783
|
+
/**
|
|
3784
|
+
* 로비 설정 업데이트 (호스트만)
|
|
3785
|
+
*/
|
|
3786
|
+
updateLobby(lobbyId: string, req: UpdateLobbyRequest): Promise<LobbyInfo>;
|
|
3787
|
+
/**
|
|
3788
|
+
* 로비 채팅 전송
|
|
3789
|
+
*/
|
|
3790
|
+
sendLobbyChat(lobbyId: string, playerId: string, message: string): Promise<void>;
|
|
3791
|
+
/**
|
|
3792
|
+
* 플레이어 초대
|
|
3793
|
+
*/
|
|
3794
|
+
invitePlayer(lobbyId: string, inviterId: string, inviteeId: string): Promise<LobbyInvite>;
|
|
3795
|
+
/**
|
|
3796
|
+
* 초대 수락
|
|
3797
|
+
*/
|
|
3798
|
+
acceptInvite(inviteId: string, playerId: string, displayName?: string): Promise<{
|
|
3799
|
+
lobbyId: string;
|
|
3800
|
+
}>;
|
|
3801
|
+
/**
|
|
3802
|
+
* 초대 거절
|
|
3803
|
+
*/
|
|
3804
|
+
declineInvite(inviteId: string, playerId: string): Promise<void>;
|
|
3805
|
+
/**
|
|
3806
|
+
* 플레이어의 받은 초대 목록
|
|
3807
|
+
*/
|
|
3808
|
+
getPlayerInvites(playerId: string): Promise<LobbyInvite[]>;
|
|
3597
3809
|
private getHeaders;
|
|
3598
3810
|
}
|
|
3599
3811
|
|
|
@@ -4025,4 +4237,4 @@ declare class ConnectBase {
|
|
|
4025
4237
|
updateConfig(config: Partial<ConnectBaseConfig>): void;
|
|
4026
4238
|
}
|
|
4027
4239
|
|
|
4028
|
-
export { type AdReportResponse, type AdReportSummary, AdsAPI, type AggregateResult, type AggregateStage, ApiError, type ApiKeyItem, type AppStatsResponse, type AtomicOperator, type AtomicOperatorType, AuthError, type AuthSettingsResponse, type BackupInfo, type BatchOperation, type BatchSetPageMetaRequest, type BillingCycle, type BillingKeyResponse, type BulkCreateResponse, type BulkError, type CancelPaymentRequest, type CancelPaymentResponse, type CancelSubscriptionRequest, type CategoryInfo, type Channel, type ChannelMembership, type ChargeWithBillingKeyRequest, type ChargeWithBillingKeyResponse, type ChatMessage, type ClientMessage, type ColumnSchema, type CommentListResponse, type ConfirmBillingKeyRequest, type ConfirmPaymentRequest, type ConfirmPaymentResponse, ConnectBase, type ConnectBaseConfig, type ConnectedData, type ConnectionState, type CreateApiKeyRequest, type CreateApiKeyResponse, type CreateBackupRequest, type CreateChannelRequest, type CreateColumnRequest, type CreateDataRequest, type CreateFolderRequest, type CreateFolderResponse, type CreateIndexRequest, type CreatePlaylistRequest, type CreateRelationRequest, type CreateSecurityRuleRequest, type CreateSubscriptionRequest, type CreateTableRequest, type CreateTriggerRequest, type DailyReport, type DataItem, type DataType, type DeleteWhereResponse, type DeviceInfo, type EnabledProviderInfo, type EnabledProvidersResponse, type ErrorHandler, type ErrorMessage, type ErrorReport, type ErrorTrackerConfig, type ErrorType, type FetchApiKeysResponse, type FetchDataResponse, type FetchFilesResponse, type FileItem, GameAPI, type GameAction, type GameClientConfig, type GameConnectionState, type GameConnectionStatus, type GameDelta, type GameEventHandlers, type GamePlayer, GameRoom, type GameRoomConfig, type GameRoomInfo, GameRoomTransport, type GameServerMessage, type GameServerMessageType, type GameState, type GameTransportConfig, type GeoNear, type GeoPoint, type GeoPolygon, type GeoQuery, type GeoResponse, type GeoResult, type GeoWithin, type GetAuthorizationURLResponse, type GetFileByPathResponse, type GoogleConnectionStatus, type GuestMemberSignInResponse, type HistoryResponse, type ICEServer, type ICEServersResponse, type IndexAnalysis, type IndexRecommendation, type InitUploadResponse, type InvokeFunctionRequest, type InvokeFunctionResponse, type IssueBillingKeyRequest, type IssueBillingKeyResponse, type JoinRoomRequest, type JoinRoomResponse, type ListBillingKeysResponse, type ListPageMetasResponse, type ListSubscriptionPaymentsRequest, type ListSubscriptionPaymentsResponse, type ListSubscriptionsRequest, type ListSubscriptionsResponse, type MemberSignInRequest, type MemberSignInResponse, type MemberSignUpRequest, type MemberSignUpResponse, type MembershipTier, type MessageHandler, type MoveFileRequest, type OAuthCallbackResponse, type OAuthProvider, type PageMetaResponse, type PauseSubscriptionRequest, type PaymentDetail, type PaymentStatus, type PeerInfo, type PlayerEvent, type Playlist, type PlaylistItem, type PongMessage, type PopulateOption, type PreparePaymentRequest, type PreparePaymentResponse, type PushPlatform, type QualityProgress, type QueryOptions, type RealtimeConnectOptions, type RealtimeMessage, type RegisterDeviceRequest, type RelationType, type RenameFileRequest, type RenameFileResponse, type RetentionPolicy, type RoomInfo, type RoomStats, type RoomsResponse, type SearchOptions, type SearchResponse, type SearchResult, type SecurityRule, type SendOptions, type ServerMessage, type SetPageMetaRequest, type Shorts, type ShortsListResponse, type SignalingMessage, type SignalingMessageType, type SlowQueryInfo, type StateChange, type StateChangeHandler, type StreamDoneCallback, type StreamDoneData, type StreamErrorCallback, type StreamHandlers, type StreamMessage, type StreamOptions, type StreamSession, type StreamTokenCallback, type StreamURLResponse, type SubscribeOptions, type SubscribeTopicRequest, type SubscribedData, type Subscription, type SubscriptionPaymentResponse, type SubscriptionPaymentStatus, type SubscriptionResponse, type SubscriptionStatus, type SuperChat, type TTLConfig, type TableIndex, type TableRelation, type TableSchema, type TransactionRead, type TransactionWrite, type TranscodeStatus, type TransportType, type Trigger, type TriggerEvent, type TriggerHandlerType, type UpdateApiKeyRequest, type UpdateApiKeyResponse, type UpdateBillingKeyRequest, type UpdateChannelRequest, type UpdateColumnRequest, type UpdateDataRequest, type UpdateSecurityRuleRequest, type UpdateSubscriptionRequest, type UpdateTriggerRequest, type UpdateVideoRequest, type UploadByPathOptions, type UploadFileResponse, type UploadOptions, type UploadProgress, type VAPIDPublicKeyResponse, type ValidateResponse, type Video, type VideoComment, type VideoListOptions, type VideoListResponse, VideoProcessingError, type VideoQuality, type VideoStatus, type VideoVisibility, type WaitOptions, type WatchHistoryItem, type WebPushSubscription, type WebRTCConnectOptions, type WebRTCConnectionState, type WebRTCMode, type WhereCondition, type WhereOperator, ConnectBase as default, isWebTransportSupported };
|
|
4240
|
+
export { type AdReportResponse, type AdReportSummary, AdsAPI, type AggregateResult, type AggregateStage, ApiError, type ApiKeyItem, type AppStatsResponse, type AtomicOperator, type AtomicOperatorType, AuthError, type AuthSettingsResponse, type BackupInfo, type BatchOperation, type BatchSetPageMetaRequest, type BillingCycle, type BillingKeyResponse, type BulkCreateResponse, type BulkError, type CancelPaymentRequest, type CancelPaymentResponse, type CancelSubscriptionRequest, type CategoryInfo, type Channel, type ChannelMembership, type ChargeWithBillingKeyRequest, type ChargeWithBillingKeyResponse, type ChatMessage, type ClientMessage, type ColumnSchema, type CommentListResponse, type ConfirmBillingKeyRequest, type ConfirmPaymentRequest, type ConfirmPaymentResponse, ConnectBase, type ConnectBaseConfig, type ConnectedData, type ConnectionState, type CreateApiKeyRequest, type CreateApiKeyResponse, type CreateBackupRequest, type CreateChannelRequest, type CreateColumnRequest, type CreateDataRequest, type CreateFolderRequest, type CreateFolderResponse, type CreateIndexRequest, type CreateLobbyRequest, type CreatePlaylistRequest, type CreateRelationRequest, type CreateSecurityRuleRequest, type CreateSubscriptionRequest, type CreateTableRequest, type CreateTriggerRequest, type DailyReport, type DataItem, type DataType, type DeleteWhereResponse, type DeviceInfo, type EnabledProviderInfo, type EnabledProvidersResponse, type ErrorHandler, type ErrorMessage, type ErrorReport, type ErrorTrackerConfig, type ErrorType, type FetchApiKeysResponse, type FetchDataResponse, type FetchFilesResponse, type FileItem, GameAPI, type GameAction, type GameClientConfig, type GameConnectionState, type GameConnectionStatus, type GameDelta, type GameEventHandlers, type GamePlayer, GameRoom, type GameRoomConfig, type GameRoomInfo, GameRoomTransport, type GameServerMessage, type GameServerMessageType, type GameState, type GameTransportConfig, type GeoNear, type GeoPoint, type GeoPolygon, type GeoQuery, type GeoResponse, type GeoResult, type GeoWithin, type GetAuthorizationURLResponse, type GetFileByPathResponse, type GoogleConnectionStatus, type GuestMemberSignInResponse, type HistoryResponse, type ICEServer, type ICEServersResponse, type IndexAnalysis, type IndexRecommendation, type InitUploadResponse, type InvokeFunctionRequest, type InvokeFunctionResponse, type IssueBillingKeyRequest, type IssueBillingKeyResponse, type JoinQueueRequest, type JoinRoomRequest, type JoinRoomResponse, type ListBillingKeysResponse, type ListPageMetasResponse, type ListSubscriptionPaymentsRequest, type ListSubscriptionPaymentsResponse, type ListSubscriptionsRequest, type ListSubscriptionsResponse, type LobbyInfo, type LobbyInvite, type LobbyMember, type LobbyVisibility, type MatchmakingTicket, type MemberSignInRequest, type MemberSignInResponse, type MemberSignUpRequest, type MemberSignUpResponse, type MembershipTier, type MessageHandler, type MoveFileRequest, type OAuthCallbackResponse, type OAuthProvider, type PageMetaResponse, type PauseSubscriptionRequest, type PaymentDetail, type PaymentStatus, type PeerInfo, type PlayerEvent, type Playlist, type PlaylistItem, type PongMessage, type PopulateOption, type PreparePaymentRequest, type PreparePaymentResponse, type PushPlatform, type QualityProgress, type QueryOptions, type RealtimeConnectOptions, type RealtimeMessage, type RegisterDeviceRequest, type RelationType, type RenameFileRequest, type RenameFileResponse, type RetentionPolicy, type RoomInfo, type RoomStats, type RoomsResponse, type SearchOptions, type SearchResponse, type SearchResult, type SecurityRule, type SendOptions, type ServerMessage, type SetPageMetaRequest, type Shorts, type ShortsListResponse, type SignalingMessage, type SignalingMessageType, type SlowQueryInfo, type StateChange, type StateChangeHandler, type StreamDoneCallback, type StreamDoneData, type StreamErrorCallback, type StreamHandlers, type StreamMessage, type StreamOptions, type StreamSession, type StreamTokenCallback, type StreamURLResponse, type SubscribeOptions, type SubscribeTopicRequest, type SubscribedData, type Subscription, type SubscriptionPaymentResponse, type SubscriptionPaymentStatus, type SubscriptionResponse, type SubscriptionStatus, type SuperChat, type TTLConfig, type TableIndex, type TableRelation, type TableSchema, type TransactionRead, type TransactionWrite, type TranscodeStatus, type TransportType, type Trigger, type TriggerEvent, type TriggerHandlerType, type UpdateApiKeyRequest, type UpdateApiKeyResponse, type UpdateBillingKeyRequest, type UpdateChannelRequest, type UpdateColumnRequest, type UpdateDataRequest, type UpdateLobbyRequest, type UpdateSecurityRuleRequest, type UpdateSubscriptionRequest, type UpdateTriggerRequest, type UpdateVideoRequest, type UploadByPathOptions, type UploadFileResponse, type UploadOptions, type UploadProgress, type VAPIDPublicKeyResponse, type ValidateResponse, type Video, type VideoComment, type VideoListOptions, type VideoListResponse, VideoProcessingError, type VideoQuality, type VideoStatus, type VideoVisibility, type WaitOptions, type WatchHistoryItem, type WebPushSubscription, type WebRTCConnectOptions, type WebRTCConnectionState, type WebRTCMode, type WhereCondition, type WhereOperator, ConnectBase as default, isWebTransportSupported };
|
package/dist/index.d.ts
CHANGED
|
@@ -3388,12 +3388,40 @@ interface GameRoomInfo {
|
|
|
3388
3388
|
type GameServerMessageType = 'room_created' | 'room_joined' | 'room_left' | 'state' | 'delta' | 'player_event' | 'chat' | 'pong' | 'room_list' | 'error';
|
|
3389
3389
|
/**
|
|
3390
3390
|
* 게임 서버 메시지
|
|
3391
|
+
* 서버는 모든 필드를 최상위에 보냄 (data 래퍼 없음)
|
|
3391
3392
|
*/
|
|
3392
|
-
interface GameServerMessage
|
|
3393
|
+
interface GameServerMessage {
|
|
3393
3394
|
type: GameServerMessageType;
|
|
3394
|
-
data: T;
|
|
3395
|
-
serverTime: number;
|
|
3396
3395
|
msg_id?: string;
|
|
3396
|
+
room_id?: string;
|
|
3397
|
+
server_time?: number;
|
|
3398
|
+
delta?: {
|
|
3399
|
+
from_version: number;
|
|
3400
|
+
to_version: number;
|
|
3401
|
+
changes: {
|
|
3402
|
+
path: string;
|
|
3403
|
+
operation: string;
|
|
3404
|
+
value?: unknown;
|
|
3405
|
+
old_value?: unknown;
|
|
3406
|
+
}[];
|
|
3407
|
+
tick: number;
|
|
3408
|
+
};
|
|
3409
|
+
tick?: number;
|
|
3410
|
+
event?: string;
|
|
3411
|
+
player?: {
|
|
3412
|
+
client_id: string;
|
|
3413
|
+
user_id?: string;
|
|
3414
|
+
joined_at: number;
|
|
3415
|
+
metadata?: Record<string, string>;
|
|
3416
|
+
};
|
|
3417
|
+
client_id?: string;
|
|
3418
|
+
user_id?: string;
|
|
3419
|
+
message?: string;
|
|
3420
|
+
data?: unknown;
|
|
3421
|
+
code?: string;
|
|
3422
|
+
timestamp?: number;
|
|
3423
|
+
client_timestamp?: number;
|
|
3424
|
+
server_timestamp?: number;
|
|
3397
3425
|
}
|
|
3398
3426
|
/**
|
|
3399
3427
|
* 플레이어 이벤트
|
|
@@ -3437,6 +3465,12 @@ interface GameEventHandlers {
|
|
|
3437
3465
|
onError?: (error: Event | ErrorMessage) => void;
|
|
3438
3466
|
onStateUpdate?: (state: GameState) => void;
|
|
3439
3467
|
onDelta?: (delta: GameDelta) => void;
|
|
3468
|
+
onAction?: (action: {
|
|
3469
|
+
type: string;
|
|
3470
|
+
clientId: string;
|
|
3471
|
+
data?: unknown;
|
|
3472
|
+
timestamp: number;
|
|
3473
|
+
}) => void;
|
|
3440
3474
|
onPlayerJoined?: (player: GamePlayer) => void;
|
|
3441
3475
|
onPlayerLeft?: (player: GamePlayer) => void;
|
|
3442
3476
|
onChat?: (message: ChatMessage) => void;
|
|
@@ -3480,6 +3514,107 @@ interface GameConnectionState {
|
|
|
3480
3514
|
reconnectAttempt?: number;
|
|
3481
3515
|
lastError?: Error;
|
|
3482
3516
|
}
|
|
3517
|
+
/**
|
|
3518
|
+
* 매치메이킹 큐 참가 요청
|
|
3519
|
+
*/
|
|
3520
|
+
interface JoinQueueRequest {
|
|
3521
|
+
gameType: string;
|
|
3522
|
+
playerId: string;
|
|
3523
|
+
rating?: number;
|
|
3524
|
+
region?: string;
|
|
3525
|
+
mode?: 'ranked' | 'quick_play' | 'custom';
|
|
3526
|
+
partyMembers?: string[];
|
|
3527
|
+
metadata?: Record<string, string>;
|
|
3528
|
+
}
|
|
3529
|
+
/**
|
|
3530
|
+
* 매치메이킹 티켓
|
|
3531
|
+
*/
|
|
3532
|
+
interface MatchmakingTicket {
|
|
3533
|
+
ticketId: string;
|
|
3534
|
+
gameType: string;
|
|
3535
|
+
playerId: string;
|
|
3536
|
+
status: string;
|
|
3537
|
+
createdAt: string;
|
|
3538
|
+
waitTime?: number;
|
|
3539
|
+
matchId?: string;
|
|
3540
|
+
roomId?: string;
|
|
3541
|
+
}
|
|
3542
|
+
/**
|
|
3543
|
+
* 로비 가시성
|
|
3544
|
+
*/
|
|
3545
|
+
type LobbyVisibility = 'public' | 'private' | 'friends_only';
|
|
3546
|
+
/**
|
|
3547
|
+
* 로비 생성 요청
|
|
3548
|
+
*/
|
|
3549
|
+
interface CreateLobbyRequest {
|
|
3550
|
+
playerId: string;
|
|
3551
|
+
displayName?: string;
|
|
3552
|
+
name: string;
|
|
3553
|
+
gameType?: string;
|
|
3554
|
+
password?: string;
|
|
3555
|
+
maxPlayers?: number;
|
|
3556
|
+
visibility?: LobbyVisibility;
|
|
3557
|
+
region?: string;
|
|
3558
|
+
settings?: Record<string, unknown>;
|
|
3559
|
+
tags?: string[];
|
|
3560
|
+
}
|
|
3561
|
+
/**
|
|
3562
|
+
* 로비 멤버
|
|
3563
|
+
*/
|
|
3564
|
+
interface LobbyMember {
|
|
3565
|
+
playerId: string;
|
|
3566
|
+
displayName: string;
|
|
3567
|
+
role: string;
|
|
3568
|
+
team: string;
|
|
3569
|
+
ready: boolean;
|
|
3570
|
+
slot: number;
|
|
3571
|
+
joinedAt: string;
|
|
3572
|
+
}
|
|
3573
|
+
/**
|
|
3574
|
+
* 로비 정보
|
|
3575
|
+
*/
|
|
3576
|
+
interface LobbyInfo {
|
|
3577
|
+
id: string;
|
|
3578
|
+
name: string;
|
|
3579
|
+
hostId: string;
|
|
3580
|
+
gameType: string;
|
|
3581
|
+
playerCount: number;
|
|
3582
|
+
maxPlayers: number;
|
|
3583
|
+
hasPassword: boolean;
|
|
3584
|
+
visibility: LobbyVisibility;
|
|
3585
|
+
region: string;
|
|
3586
|
+
settings?: Record<string, unknown>;
|
|
3587
|
+
tags?: string[];
|
|
3588
|
+
status: string;
|
|
3589
|
+
roomId?: string;
|
|
3590
|
+
members?: LobbyMember[];
|
|
3591
|
+
createdAt: string;
|
|
3592
|
+
}
|
|
3593
|
+
/**
|
|
3594
|
+
* 로비 업데이트 요청
|
|
3595
|
+
*/
|
|
3596
|
+
interface UpdateLobbyRequest {
|
|
3597
|
+
hostId: string;
|
|
3598
|
+
name?: string;
|
|
3599
|
+
maxPlayers?: number;
|
|
3600
|
+
visibility?: LobbyVisibility;
|
|
3601
|
+
password?: string;
|
|
3602
|
+
settings?: Record<string, unknown>;
|
|
3603
|
+
tags?: string[];
|
|
3604
|
+
}
|
|
3605
|
+
/**
|
|
3606
|
+
* 로비 초대 정보
|
|
3607
|
+
*/
|
|
3608
|
+
interface LobbyInvite {
|
|
3609
|
+
inviteId: string;
|
|
3610
|
+
lobbyId: string;
|
|
3611
|
+
lobbyName: string;
|
|
3612
|
+
inviterId: string;
|
|
3613
|
+
inviteeId: string;
|
|
3614
|
+
status: string;
|
|
3615
|
+
createdAt: string;
|
|
3616
|
+
expiresAt: string;
|
|
3617
|
+
}
|
|
3483
3618
|
|
|
3484
3619
|
/**
|
|
3485
3620
|
* 게임 룸 클라이언트
|
|
@@ -3594,6 +3729,83 @@ declare class GameAPI {
|
|
|
3594
3729
|
* 룸 삭제 (HTTP)
|
|
3595
3730
|
*/
|
|
3596
3731
|
deleteRoom(roomId: string): Promise<void>;
|
|
3732
|
+
/**
|
|
3733
|
+
* 매치메이킹 큐에 참가
|
|
3734
|
+
*/
|
|
3735
|
+
joinQueue(req: JoinQueueRequest): Promise<MatchmakingTicket>;
|
|
3736
|
+
/**
|
|
3737
|
+
* 매치메이킹 큐에서 탈퇴
|
|
3738
|
+
*/
|
|
3739
|
+
leaveQueue(ticketId: string): Promise<void>;
|
|
3740
|
+
/**
|
|
3741
|
+
* 매치메이킹 상태 조회
|
|
3742
|
+
*/
|
|
3743
|
+
getMatchStatus(params: {
|
|
3744
|
+
ticketId?: string;
|
|
3745
|
+
playerId?: string;
|
|
3746
|
+
}): Promise<MatchmakingTicket>;
|
|
3747
|
+
/**
|
|
3748
|
+
* 로비 목록 조회
|
|
3749
|
+
*/
|
|
3750
|
+
listLobbies(): Promise<LobbyInfo[]>;
|
|
3751
|
+
/**
|
|
3752
|
+
* 로비 생성
|
|
3753
|
+
*/
|
|
3754
|
+
createLobby(req: CreateLobbyRequest): Promise<LobbyInfo>;
|
|
3755
|
+
/**
|
|
3756
|
+
* 로비 상세 조회
|
|
3757
|
+
*/
|
|
3758
|
+
getLobby(lobbyId: string): Promise<LobbyInfo>;
|
|
3759
|
+
/**
|
|
3760
|
+
* 로비 참가
|
|
3761
|
+
*/
|
|
3762
|
+
joinLobby(lobbyId: string, playerId: string, displayName?: string, password?: string): Promise<{
|
|
3763
|
+
lobbyId: string;
|
|
3764
|
+
}>;
|
|
3765
|
+
/**
|
|
3766
|
+
* 로비 퇴장
|
|
3767
|
+
*/
|
|
3768
|
+
leaveLobby(lobbyId: string, playerId: string): Promise<void>;
|
|
3769
|
+
/**
|
|
3770
|
+
* 레디 상태 토글
|
|
3771
|
+
*/
|
|
3772
|
+
toggleReady(lobbyId: string, playerId: string, ready: boolean): Promise<void>;
|
|
3773
|
+
/**
|
|
3774
|
+
* 게임 시작 (호스트만)
|
|
3775
|
+
*/
|
|
3776
|
+
startGame(lobbyId: string, hostId: string): Promise<{
|
|
3777
|
+
roomId: string;
|
|
3778
|
+
}>;
|
|
3779
|
+
/**
|
|
3780
|
+
* 플레이어 추방 (호스트만)
|
|
3781
|
+
*/
|
|
3782
|
+
kickPlayer(lobbyId: string, hostId: string, targetPlayerId: string): Promise<void>;
|
|
3783
|
+
/**
|
|
3784
|
+
* 로비 설정 업데이트 (호스트만)
|
|
3785
|
+
*/
|
|
3786
|
+
updateLobby(lobbyId: string, req: UpdateLobbyRequest): Promise<LobbyInfo>;
|
|
3787
|
+
/**
|
|
3788
|
+
* 로비 채팅 전송
|
|
3789
|
+
*/
|
|
3790
|
+
sendLobbyChat(lobbyId: string, playerId: string, message: string): Promise<void>;
|
|
3791
|
+
/**
|
|
3792
|
+
* 플레이어 초대
|
|
3793
|
+
*/
|
|
3794
|
+
invitePlayer(lobbyId: string, inviterId: string, inviteeId: string): Promise<LobbyInvite>;
|
|
3795
|
+
/**
|
|
3796
|
+
* 초대 수락
|
|
3797
|
+
*/
|
|
3798
|
+
acceptInvite(inviteId: string, playerId: string, displayName?: string): Promise<{
|
|
3799
|
+
lobbyId: string;
|
|
3800
|
+
}>;
|
|
3801
|
+
/**
|
|
3802
|
+
* 초대 거절
|
|
3803
|
+
*/
|
|
3804
|
+
declineInvite(inviteId: string, playerId: string): Promise<void>;
|
|
3805
|
+
/**
|
|
3806
|
+
* 플레이어의 받은 초대 목록
|
|
3807
|
+
*/
|
|
3808
|
+
getPlayerInvites(playerId: string): Promise<LobbyInvite[]>;
|
|
3597
3809
|
private getHeaders;
|
|
3598
3810
|
}
|
|
3599
3811
|
|
|
@@ -4025,4 +4237,4 @@ declare class ConnectBase {
|
|
|
4025
4237
|
updateConfig(config: Partial<ConnectBaseConfig>): void;
|
|
4026
4238
|
}
|
|
4027
4239
|
|
|
4028
|
-
export { type AdReportResponse, type AdReportSummary, AdsAPI, type AggregateResult, type AggregateStage, ApiError, type ApiKeyItem, type AppStatsResponse, type AtomicOperator, type AtomicOperatorType, AuthError, type AuthSettingsResponse, type BackupInfo, type BatchOperation, type BatchSetPageMetaRequest, type BillingCycle, type BillingKeyResponse, type BulkCreateResponse, type BulkError, type CancelPaymentRequest, type CancelPaymentResponse, type CancelSubscriptionRequest, type CategoryInfo, type Channel, type ChannelMembership, type ChargeWithBillingKeyRequest, type ChargeWithBillingKeyResponse, type ChatMessage, type ClientMessage, type ColumnSchema, type CommentListResponse, type ConfirmBillingKeyRequest, type ConfirmPaymentRequest, type ConfirmPaymentResponse, ConnectBase, type ConnectBaseConfig, type ConnectedData, type ConnectionState, type CreateApiKeyRequest, type CreateApiKeyResponse, type CreateBackupRequest, type CreateChannelRequest, type CreateColumnRequest, type CreateDataRequest, type CreateFolderRequest, type CreateFolderResponse, type CreateIndexRequest, type CreatePlaylistRequest, type CreateRelationRequest, type CreateSecurityRuleRequest, type CreateSubscriptionRequest, type CreateTableRequest, type CreateTriggerRequest, type DailyReport, type DataItem, type DataType, type DeleteWhereResponse, type DeviceInfo, type EnabledProviderInfo, type EnabledProvidersResponse, type ErrorHandler, type ErrorMessage, type ErrorReport, type ErrorTrackerConfig, type ErrorType, type FetchApiKeysResponse, type FetchDataResponse, type FetchFilesResponse, type FileItem, GameAPI, type GameAction, type GameClientConfig, type GameConnectionState, type GameConnectionStatus, type GameDelta, type GameEventHandlers, type GamePlayer, GameRoom, type GameRoomConfig, type GameRoomInfo, GameRoomTransport, type GameServerMessage, type GameServerMessageType, type GameState, type GameTransportConfig, type GeoNear, type GeoPoint, type GeoPolygon, type GeoQuery, type GeoResponse, type GeoResult, type GeoWithin, type GetAuthorizationURLResponse, type GetFileByPathResponse, type GoogleConnectionStatus, type GuestMemberSignInResponse, type HistoryResponse, type ICEServer, type ICEServersResponse, type IndexAnalysis, type IndexRecommendation, type InitUploadResponse, type InvokeFunctionRequest, type InvokeFunctionResponse, type IssueBillingKeyRequest, type IssueBillingKeyResponse, type JoinRoomRequest, type JoinRoomResponse, type ListBillingKeysResponse, type ListPageMetasResponse, type ListSubscriptionPaymentsRequest, type ListSubscriptionPaymentsResponse, type ListSubscriptionsRequest, type ListSubscriptionsResponse, type MemberSignInRequest, type MemberSignInResponse, type MemberSignUpRequest, type MemberSignUpResponse, type MembershipTier, type MessageHandler, type MoveFileRequest, type OAuthCallbackResponse, type OAuthProvider, type PageMetaResponse, type PauseSubscriptionRequest, type PaymentDetail, type PaymentStatus, type PeerInfo, type PlayerEvent, type Playlist, type PlaylistItem, type PongMessage, type PopulateOption, type PreparePaymentRequest, type PreparePaymentResponse, type PushPlatform, type QualityProgress, type QueryOptions, type RealtimeConnectOptions, type RealtimeMessage, type RegisterDeviceRequest, type RelationType, type RenameFileRequest, type RenameFileResponse, type RetentionPolicy, type RoomInfo, type RoomStats, type RoomsResponse, type SearchOptions, type SearchResponse, type SearchResult, type SecurityRule, type SendOptions, type ServerMessage, type SetPageMetaRequest, type Shorts, type ShortsListResponse, type SignalingMessage, type SignalingMessageType, type SlowQueryInfo, type StateChange, type StateChangeHandler, type StreamDoneCallback, type StreamDoneData, type StreamErrorCallback, type StreamHandlers, type StreamMessage, type StreamOptions, type StreamSession, type StreamTokenCallback, type StreamURLResponse, type SubscribeOptions, type SubscribeTopicRequest, type SubscribedData, type Subscription, type SubscriptionPaymentResponse, type SubscriptionPaymentStatus, type SubscriptionResponse, type SubscriptionStatus, type SuperChat, type TTLConfig, type TableIndex, type TableRelation, type TableSchema, type TransactionRead, type TransactionWrite, type TranscodeStatus, type TransportType, type Trigger, type TriggerEvent, type TriggerHandlerType, type UpdateApiKeyRequest, type UpdateApiKeyResponse, type UpdateBillingKeyRequest, type UpdateChannelRequest, type UpdateColumnRequest, type UpdateDataRequest, type UpdateSecurityRuleRequest, type UpdateSubscriptionRequest, type UpdateTriggerRequest, type UpdateVideoRequest, type UploadByPathOptions, type UploadFileResponse, type UploadOptions, type UploadProgress, type VAPIDPublicKeyResponse, type ValidateResponse, type Video, type VideoComment, type VideoListOptions, type VideoListResponse, VideoProcessingError, type VideoQuality, type VideoStatus, type VideoVisibility, type WaitOptions, type WatchHistoryItem, type WebPushSubscription, type WebRTCConnectOptions, type WebRTCConnectionState, type WebRTCMode, type WhereCondition, type WhereOperator, ConnectBase as default, isWebTransportSupported };
|
|
4240
|
+
export { type AdReportResponse, type AdReportSummary, AdsAPI, type AggregateResult, type AggregateStage, ApiError, type ApiKeyItem, type AppStatsResponse, type AtomicOperator, type AtomicOperatorType, AuthError, type AuthSettingsResponse, type BackupInfo, type BatchOperation, type BatchSetPageMetaRequest, type BillingCycle, type BillingKeyResponse, type BulkCreateResponse, type BulkError, type CancelPaymentRequest, type CancelPaymentResponse, type CancelSubscriptionRequest, type CategoryInfo, type Channel, type ChannelMembership, type ChargeWithBillingKeyRequest, type ChargeWithBillingKeyResponse, type ChatMessage, type ClientMessage, type ColumnSchema, type CommentListResponse, type ConfirmBillingKeyRequest, type ConfirmPaymentRequest, type ConfirmPaymentResponse, ConnectBase, type ConnectBaseConfig, type ConnectedData, type ConnectionState, type CreateApiKeyRequest, type CreateApiKeyResponse, type CreateBackupRequest, type CreateChannelRequest, type CreateColumnRequest, type CreateDataRequest, type CreateFolderRequest, type CreateFolderResponse, type CreateIndexRequest, type CreateLobbyRequest, type CreatePlaylistRequest, type CreateRelationRequest, type CreateSecurityRuleRequest, type CreateSubscriptionRequest, type CreateTableRequest, type CreateTriggerRequest, type DailyReport, type DataItem, type DataType, type DeleteWhereResponse, type DeviceInfo, type EnabledProviderInfo, type EnabledProvidersResponse, type ErrorHandler, type ErrorMessage, type ErrorReport, type ErrorTrackerConfig, type ErrorType, type FetchApiKeysResponse, type FetchDataResponse, type FetchFilesResponse, type FileItem, GameAPI, type GameAction, type GameClientConfig, type GameConnectionState, type GameConnectionStatus, type GameDelta, type GameEventHandlers, type GamePlayer, GameRoom, type GameRoomConfig, type GameRoomInfo, GameRoomTransport, type GameServerMessage, type GameServerMessageType, type GameState, type GameTransportConfig, type GeoNear, type GeoPoint, type GeoPolygon, type GeoQuery, type GeoResponse, type GeoResult, type GeoWithin, type GetAuthorizationURLResponse, type GetFileByPathResponse, type GoogleConnectionStatus, type GuestMemberSignInResponse, type HistoryResponse, type ICEServer, type ICEServersResponse, type IndexAnalysis, type IndexRecommendation, type InitUploadResponse, type InvokeFunctionRequest, type InvokeFunctionResponse, type IssueBillingKeyRequest, type IssueBillingKeyResponse, type JoinQueueRequest, type JoinRoomRequest, type JoinRoomResponse, type ListBillingKeysResponse, type ListPageMetasResponse, type ListSubscriptionPaymentsRequest, type ListSubscriptionPaymentsResponse, type ListSubscriptionsRequest, type ListSubscriptionsResponse, type LobbyInfo, type LobbyInvite, type LobbyMember, type LobbyVisibility, type MatchmakingTicket, type MemberSignInRequest, type MemberSignInResponse, type MemberSignUpRequest, type MemberSignUpResponse, type MembershipTier, type MessageHandler, type MoveFileRequest, type OAuthCallbackResponse, type OAuthProvider, type PageMetaResponse, type PauseSubscriptionRequest, type PaymentDetail, type PaymentStatus, type PeerInfo, type PlayerEvent, type Playlist, type PlaylistItem, type PongMessage, type PopulateOption, type PreparePaymentRequest, type PreparePaymentResponse, type PushPlatform, type QualityProgress, type QueryOptions, type RealtimeConnectOptions, type RealtimeMessage, type RegisterDeviceRequest, type RelationType, type RenameFileRequest, type RenameFileResponse, type RetentionPolicy, type RoomInfo, type RoomStats, type RoomsResponse, type SearchOptions, type SearchResponse, type SearchResult, type SecurityRule, type SendOptions, type ServerMessage, type SetPageMetaRequest, type Shorts, type ShortsListResponse, type SignalingMessage, type SignalingMessageType, type SlowQueryInfo, type StateChange, type StateChangeHandler, type StreamDoneCallback, type StreamDoneData, type StreamErrorCallback, type StreamHandlers, type StreamMessage, type StreamOptions, type StreamSession, type StreamTokenCallback, type StreamURLResponse, type SubscribeOptions, type SubscribeTopicRequest, type SubscribedData, type Subscription, type SubscriptionPaymentResponse, type SubscriptionPaymentStatus, type SubscriptionResponse, type SubscriptionStatus, type SuperChat, type TTLConfig, type TableIndex, type TableRelation, type TableSchema, type TransactionRead, type TransactionWrite, type TranscodeStatus, type TransportType, type Trigger, type TriggerEvent, type TriggerHandlerType, type UpdateApiKeyRequest, type UpdateApiKeyResponse, type UpdateBillingKeyRequest, type UpdateChannelRequest, type UpdateColumnRequest, type UpdateDataRequest, type UpdateLobbyRequest, type UpdateSecurityRuleRequest, type UpdateSubscriptionRequest, type UpdateTriggerRequest, type UpdateVideoRequest, type UploadByPathOptions, type UploadFileResponse, type UploadOptions, type UploadProgress, type VAPIDPublicKeyResponse, type ValidateResponse, type Video, type VideoComment, type VideoListOptions, type VideoListResponse, VideoProcessingError, type VideoQuality, type VideoStatus, type VideoVisibility, type WaitOptions, type WatchHistoryItem, type WebPushSubscription, type WebRTCConnectOptions, type WebRTCConnectionState, type WebRTCMode, type WhereCondition, type WhereOperator, ConnectBase as default, isWebTransportSupported };
|