Spaces:
Sleeping
Sleeping
Create sockets.md
Browse files- sockets.md +54 -0
sockets.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Sockets
|
| 2 |
+
|
| 3 |
+
Considering how f*cken cool websockets and socketio is for realtime, I'm gonna use it. However, if I'm going to use it, some conventions, rules, tips, and definitions are needed.
|
| 4 |
+
|
| 5 |
+
### Conventions
|
| 6 |
+
|
| 7 |
+
- **Chat**
|
| 8 |
+
- Room name format
|
| 9 |
+
- {server name}/{channel name}
|
| 10 |
+
- Ex - main/general
|
| 11 |
+
- Presences (who is connected, and where)
|
| 12 |
+
- Sent to
|
| 13 |
+
- Admin pages
|
| 14 |
+
- Users in the same channel
|
| 15 |
+
- Online when
|
| 16 |
+
- Socket is connected
|
| 17 |
+
- **Admin**
|
| 18 |
+
- Room name format
|
| 19 |
+
- {purpose/data}
|
| 20 |
+
- Ex - online_users
|
| 21 |
+
- Presences
|
| 22 |
+
- None
|
| 23 |
+
|
| 24 |
+
- **DM**
|
| 25 |
+
|
| 26 |
+
- Room name format
|
| 27 |
+
|
| 28 |
+
- {user id (lower)}-{user id (higher))}
|
| 29 |
+
- Ex - 1-2
|
| 30 |
+
- Presences
|
| 31 |
+
- not used
|
| 32 |
+
|
| 33 |
+
- **Group DM**
|
| 34 |
+
|
| 35 |
+
- **NIY** (Not Implemented Yet)
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
### Definitions
|
| 39 |
+
|
| 40 |
+
- **Namespaces**
|
| 41 |
+
- Chat
|
| 42 |
+
- Used for the main chatting and yapping. Follows the server/channel format, and handles all events for clients speaking in public and private servers
|
| 43 |
+
- Admin
|
| 44 |
+
- Used to collect necessary performance data, and up-to-date reports for bugs and others
|
| 45 |
+
- DM
|
| 46 |
+
- Used to handle messages traveling between two users.
|
| 47 |
+
- **Events**
|
| 48 |
+
- Chat
|
| 49 |
+
- 'login'
|
| 50 |
+
-
|
| 51 |
+
- move
|
| 52 |
+
- logout
|
| 53 |
+
- typing
|
| 54 |
+
|