avallef commited on
Commit
86cdfc6
·
1 Parent(s): 2b43822

Changed endpoint stuff

Browse files
Files changed (1) hide show
  1. server/README.md +9 -23
server/README.md CHANGED
@@ -48,33 +48,26 @@ Room messages are sent to everyone in a room
48
  }
49
  ```
50
 
51
- ### Enter Room
52
 
53
  **Type:** `client -> server`
54
- **Description:** Used to enter a room. Join an existing room by including roomId.
55
  **Payload:**
56
 
57
  ```typescript
58
  {
59
- "route": "enter_room",
60
  "roomId"?: string; // Room Id, optional
61
  }
62
  ```
63
 
64
  **Type:** `server -> client <private>`
65
- **Payload:**
66
 
67
  ```typescript
68
  {
69
- "message": "enter_room_response"
70
- "roomId": string,
71
- "users": []{
72
- username: string,
73
- id: string,
74
- online: boolean,
75
- lastOnline: number, // ms epoch time
76
- },
77
- "status": "joined" | "created" | "failed"; // Failed likely means room doesn't exist
78
  }
79
  ```
80
 
@@ -86,7 +79,7 @@ Room messages are sent to everyone in a room
86
 
87
  ```typescript
88
  {
89
- "route": "enter_room",
90
  "roomId": string; // Room Id, optional
91
  }
92
  ```
@@ -96,15 +89,8 @@ Room messages are sent to everyone in a room
96
 
97
  ```typescript
98
  {
99
- "route": "enter_room_response"
100
- "roomId": string,
101
- "users": []{
102
- username: string,
103
- id: string,
104
- online: boolean,
105
- lastOnline: number, // ms epoch time
106
- },
107
- "status": "joined" | "created" | "failed"; // Failed likely means room doesn't exist
108
  }
109
  ```
110
 
 
48
  }
49
  ```
50
 
51
+ ### Join Room
52
 
53
  **Type:** `client -> server`
54
+ **Description:** Used to enter a room. Join an existing room by including roomId, or if room doesn't exist, create one with that roomId
55
  **Payload:**
56
 
57
  ```typescript
58
  {
59
+ "route": "join_room",
60
  "roomId"?: string; // Room Id, optional
61
  }
62
  ```
63
 
64
  **Type:** `server -> client <private>`
65
+ **Payload (If error):**
66
 
67
  ```typescript
68
  {
69
+ "message": "enter_room_response",
70
+ "status": string,
 
 
 
 
 
 
 
71
  }
72
  ```
73
 
 
79
 
80
  ```typescript
81
  {
82
+ "route": "leave_room",
83
  "roomId": string; // Room Id, optional
84
  }
85
  ```
 
89
 
90
  ```typescript
91
  {
92
+ "route": "leave_room_response",
93
+ "status": string,
 
 
 
 
 
 
 
94
  }
95
  ```
96