1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-06-28 15:27:43 +00:00

Split bunched command list out to own array

This commit is contained in:
Kane York 2017-09-25 14:37:48 -07:00
parent bdd5b5416d
commit 75e1a67e9a

View file

@ -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