Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // this value is just docs right now
- var ServerInitiatedCommands = map[string]PushCommandCacheInfo{
- /// Global updates & notices
- "update_news": {CacheTypeTimestamps, MsgTargetTypeGlobal}, // timecache:global
- "message": {CacheTypeTimestamps, MsgTargetTypeGlobal}, // timecache:global
- "reload_ff": {CacheTypeTimestamps, MsgTargetTypeGlobal}, // timecache:global
- /// Emote updates
- "reload_badges": {CacheTypeTimestamps, MsgTargetTypeGlobal}, // timecache:global
- "set_badge": {CacheTypeTimestamps, MsgTargetTypeMultichat}, // timecache:multichat
- "reload_set": {CacheTypeTimestamps, MsgTargetTypeMultichat}, // timecache:multichat
- "load_set": {}, // TODO what are the semantics of this?
- /// User auth
- "do_authorize": {CacheTypeNever, MsgTargetTypeSingle}, // nocache:single
- /// Channel data
- // follow_sets: extra emote sets included in the chat
- // follow_buttons: extra follow buttons below the stream
- "follow_sets": {CacheTypePersistent, MsgTargetTypeChat}, // mustcache:chat
- "follow_buttons": {CacheTypePersistent, MsgTargetTypeWatching}, // mustcache:watching
- "srl_race": {CacheTypeLastOnly, MsgTargetTypeWatching}, // cachelast:watching
- /// Chatter/viewer counts
- "chatters": {CacheTypeLastOnly, MsgTargetTypeWatching}, // cachelast:watching
- "viewers": {CacheTypeLastOnly, MsgTargetTypeWatching}, // cachelast:watching
- }
- type BacklogCacheType int
- const (
- // This is not a cache type.
- CacheTypeInvalid BacklogCacheType = iota
- // This message cannot be cached.
- CacheTypeNever
- // Save the last 24 hours of this message.
- // If a client indicates that it has reconnected, replay the messages sent after the disconnect.
- CacheTypeTimestamps
- // Save only the last copy of this message, and always send it when the backlog is requested.
- CacheTypeLastOnly
- // Save this backlog data to disk with its timestamp.
- // Send it when the backlog is requested, or after a reconnect if it was updated.
- CacheTypePersistent
- )
- type MessageTargetType int
- const (
- // This is not a message target.
- MsgTargetTypeInvalid MessageTargetType = iota
- // This message is targeted to a single TODO(user or connection)
- MsgTargetTypeSingle
- // This message is targeted to all users in a chat
- MsgTargetTypeChat
- // This message is targeted to all users in multiple chats
- MsgTargetTypeMultichat
- // This message is targeted to all users watching a stream
- MsgTargetTypeWatching
- // This message is sent to all FFZ users.
- MsgTargetTypeGlobal
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement