This repository has been archived by the owner on Mar 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 259
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding built protobuf stuff and related helpers etc.
- Loading branch information
1 parent
c74fec9
commit 6e35535
Showing
7 changed files
with
1,955 additions
and
17 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export interface BaseMessage { | ||
type: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { IMessageType } from "@protobuf-ts/runtime"; | ||
import { BaseMessage } from './base_message'; | ||
|
||
export function createMessage(messageType: IMessageType<BaseMessage>, params?: any) { | ||
const message = messageType.create(); | ||
message.type = messageType.typeName; | ||
if (params) { | ||
messageType.mergePartial(message, params); | ||
} | ||
return message; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { IMessageType } from "@protobuf-ts/runtime"; | ||
import * as Messages from './signalling_messages'; | ||
import { BaseMessage } from './base_message'; | ||
|
||
export const MessageRegistry: Record<string, IMessageType<BaseMessage>> = { | ||
'answer': Messages.answer, | ||
'config': Messages.config, | ||
'dataChannelRequest': Messages.dataChannelRequest, | ||
'disconnectPlayer': Messages.disconnectPlayer, | ||
'endpointId': Messages.endpointId, | ||
'iceCandidate': Messages.iceCandidate, | ||
'identify': Messages.identify, | ||
'layerPreference': Messages.layerPreference, | ||
'listStreamers': Messages.listStreamers, | ||
'offer': Messages.offer, | ||
'peerDataChannelsReady': Messages.peerDataChannelsReady, | ||
'ping': Messages.ping, | ||
'playerConnected': Messages.playerConnected, | ||
'playerCount': Messages.playerCount, | ||
'playerDisconnected': Messages.playerDisconnected, | ||
'pong': Messages.pong, | ||
'stats': Messages.stats, | ||
'streamerDataChannels': Messages.streamerDataChannels, | ||
'streamerDisconnected': Messages.streamerDisconnected, | ||
'streamerList': Messages.streamerList, | ||
'subscribe': Messages.subscribe, | ||
'unsubscribe': Messages.unsubscribe, | ||
} |
Oops, something went wrong.