mirror of
https://github.com/MercuryWorkshop/adrift.git
synced 2025-05-16 15:40:01 -04:00
refactor to share protocol
This commit is contained in:
parent
51ae252748
commit
2022a4cee8
2 changed files with 23 additions and 28 deletions
17
protocol/index.ts
Normal file
17
protocol/index.ts
Normal file
|
@ -0,0 +1,17 @@
|
|||
export type ObjectValues<T> = T[keyof T];
|
||||
export const C2SRequestTypes = {
|
||||
HTTPRequest: 0,
|
||||
WSOpen: 1,
|
||||
WSClose: 2,
|
||||
WSSendText: 3,
|
||||
WSSendBinary: 4,
|
||||
} as const;
|
||||
export type C2SRequestType = ObjectValues<typeof C2SRequestTypes>;
|
||||
|
||||
export const S2CRequestTypes = {
|
||||
HTTPResponse: 0,
|
||||
WSOpen: 1,
|
||||
WSDataText: 2,
|
||||
WSDataBinary: 3,
|
||||
} as const;
|
||||
export type S2CRequestType = ObjectValues<typeof S2CRequestTypes>;
|
Loading…
Add table
Add a link
Reference in a new issue