summaryrefslogtreecommitdiff
path: root/proto.txt
blob: 9ec09db950147f8b1632d8fb97cb70fa3d85dcc4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
baitv-daemon Protocol Specification
===================================
The baitv-daemon protocol is a simple command-based, single-line, plain-text
chat protocol. It works with WebSockets over the port 6969 by default
and optionally over SSL/TLS.

Commands are separated in client commands (commands sent by the client to the
server), server commands (commands sent by the server to the client) and
server responses (response commands sent by the server to reply to a client
command).

Commands support arguments and they are separated by a colon (:) character.

The maximum length of a command is 128 characters.


Client commands
---------------
Command
    MSG  
Arguments
    Color.......Arbitrary number to identify the message color.
    Message.....The message contents.
Explanation
    Sends a message to the chat room.
Example
    MSG:2:Hello how are you everybody!

Command
    LOGIN
Arguments
    Password....Admin password string.
Explanation
    Logs in as an administrator in order to run admin commands and information.
Example
    LOGIN:mypassword

Command
    LOGOUT
Explanation
    Closes the administrator session.
Example:
    LOGOUT

Command
    NOTICE
Arguments
    Show Name...Indicates if streamer's name should be shown (0 or 1).
    Message.....The message contents.
Explanation
    Shows a special message which special emphasis. Only can be sent by logged in users.
Example
    NOTICE:1:Please be warned!

Command
    KICK
Arguments
    User ID.....User ID to kick.
Explanation
    Kicks a specified user. Only can be sent by logged in users.
Example
    KICK:4fc2a

Command
    BAN
Arguments
    User ID.....User ID to ban.
Explanation
    Bans a specified user permanently. Only can be sent by logged in users.
Example
    BAN:4fc2a

Command
    SETTITLE
Arguments
    Title.......Stream title to set
Explanation
    Sets a new stream title. Only can be sent by logged in users.
Example
    SETTITLE:Testing stream

Command
    SETSOURCE
Arguments
    New source...Source string to set
Explanation
    Sets a new source. Only can be sent by logged in users.
Example
    SOURCE:HLS



Server Commands
---------------
Command
    WELCOME
Arguments
    Version.....The current version of the server
Explanation
    This is the first command sent by the server when a connection is made in
    order to signal to the client that it is free to start sending commands.
Example
    WELCOME:v0.0.1

Command
    COUNT
Arguments
    Count       Number of users online
Explanation
    This informs the client of the total number of users in the chat room.
    It is sent when the user is connected or when any client enters or leaves
    the room.
Example
    COUNT:13

Command
    MSG
Arguments
    Color       Number that identifies the message color.
    Message     Contents of the message.
Explanation
    Sent when someone has said something in the chat room.
Example:
    MSG:1:We're fine, what about you?

Command
    FMSG
Arguments
    ID          Short hash of the sender of the message.
    Color       Number that identifies the message color.
    Message     Contents of the message.
Explanation
    Same as MSG but with extended information about the sender.
    Sent only when the peer has admin privileges (LOGIN).
Example
    FMSG:adbibi:0:Are you there?

Command
    KICKED
Explanation
    Sent when a user in the chatroom has been kicked.
Example
    KICKED

Command
    NOTICE
Arguments
    Author      Author of the notice.
    Message     Contents of the message.
Explanation
    Sent when there's a new notice.
Example
    NOTICE:Streamer:Stream will start in 1 minute.

Command
    TITLE
Arguments
    Title       New title.
Explanation
    Sent when the stream title has changed.
Example
    TITLE:Stream test

Command
    SOURCE
Arguments
    Source      New title.
    Timestamp   Timestamp of the source change.
Explanation
    Sent when the stream source has changed.
Example
    SOURCE:HLS:1583973816


Server Responses
----------------
Command         Reply to    Explanation

WHAT            *           Command unrecognized.
INVALID         *           The command is malformed.
BADPASS         LOGIN       Wrong password.
LOGIN_OK        LOGIN       Login successful.
LOGOUT_OK       LOGOUT      Logout successful.
KICK_OK         KICK        User kicked.
KICK_NO         KICK        No one was kicked.
FORBIDDEN       *           Not enough privileges.
FUCKOFF         *           Command too long.