mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-06-27 21:05:53 +00:00
Split bunched command list out to own array
This commit is contained in:
parent
bdd5b5416d
commit
75e1a67e9a
1 changed files with 16 additions and 7 deletions
|
@ -32,14 +32,17 @@ var commandHandlers = map[Command]CommandHandler{
|
||||||
"track_follow": C2STrackFollow,
|
"track_follow": C2STrackFollow,
|
||||||
"emoticon_uses": C2SEmoticonUses,
|
"emoticon_uses": C2SEmoticonUses,
|
||||||
"survey": C2SSurvey,
|
"survey": C2SSurvey,
|
||||||
|
}
|
||||||
|
|
||||||
"twitch_emote": C2SHandleBunchedCommand,
|
var bunchedCommands = []string{
|
||||||
"get_link": C2SHandleBunchedCommand,
|
"get_display_name",
|
||||||
"get_display_name": C2SHandleBunchedCommand,
|
"get_emote",
|
||||||
"get_emote": C2SHandleBunchedCommand,
|
"get_emote_set",
|
||||||
"get_emote_set": C2SHandleBunchedCommand,
|
"get_link",
|
||||||
"has_logs": C2SHandleBunchedCommand,
|
"get_itad_plain",
|
||||||
"update_follow_buttons": C2SHandleRemoteCommand,
|
"get_itad_prices",
|
||||||
|
"get_name_history",
|
||||||
|
"has_logs",
|
||||||
}
|
}
|
||||||
|
|
||||||
func setupInterning() {
|
func setupInterning() {
|
||||||
|
@ -71,6 +74,12 @@ func DispatchC2SCommand(conn *websocket.Conn, client *ClientInfo, msg ClientMess
|
||||||
handler, ok := commandHandlers[msg.Command]
|
handler, ok := commandHandlers[msg.Command]
|
||||||
if !ok {
|
if !ok {
|
||||||
handler = C2SHandleRemoteCommand
|
handler = C2SHandleRemoteCommand
|
||||||
|
|
||||||
|
for _, v := range bunchedCommands {
|
||||||
|
if msg.Command == v {
|
||||||
|
handler = C2SHandleBunchedCommand
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CommandCounter <- msg.Command
|
CommandCounter <- msg.Command
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue