reply

package
v0.5.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2021 License: MIT Imports: 32 Imported by: 0

README


目录释义

目录 说明
./ 接收的数据处理区
json/ json的golang struct表述
ws_msg/ 弹幕服务器传回的Msg类型json的golang struct表述
0Init.go 最初始载入配置
F.go 附加功能
flvDecode.go 直播流转局域网直播流
Heartbeat.go 人气数据分派
Msg.go 消息数据分派
Reply.go 分派数据处理
gtk.go gtk弹幕窗模块
tts.go TTS语音模块

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ShowRev_old   float64
	ShowRev_start bool
)

功能区 ShowRev 显示h营收

View Source
var (
	Ass_height = 720  //字幕高度
	Ass_width  = 1280 //字幕宽度
	Ass_font   = 50   //字幕字体大小
	Ass_T      = 7    //单条字幕显示时间
	Ass_loc    = 7    //字幕位置 小键盘对应的位置
)
View Source
var Danmu_mq = mq.New(10)
View Source
var Heart_map = map[string]func(replyF, int){
	"heartbeat": replyF.heartbeat,
}
View Source
var Msg_map = map[string]func(replyF, string){
	`STOP_LIVE_ROOM_LIST`:           nil,
	`PK_LOTTERY_START`:              replyF.pk_lottery_start,
	`PK_BATTLE_PRE_NEW`:             nil,
	`PK_BATTLE_START_NEW`:           nil,
	`PK_BATTLE_PROCESS_NEW`:         replyF.pk_battle_process_new,
	`VTR_GIFT_LOTTERY`:              replyF.vtr_gift_lottery,
	`ENTRY_EFFECT_MUST_RECEIVE`:     nil,
	`GIFT_BAG_DOT`:                  nil,
	`LITTLE_MESSAGE_BOX`:            replyF.little_message_box,
	`MESSAGEBOX_USER_MEDAL_CHANGE`:  replyF.messagebox_user_medal_change,
	`HOT_RANK_SETTLEMENT`:           replyF.hot_rank_settlement,
	`HOT_RANK_CHANGED`:              replyF.hot_rank_changed,
	`CARD_MSG`:                      nil,
	`WIDGET_BANNER`:                 nil,
	`ROOM_ADMINS`:                   nil,
	`ONLINE_RANK_TOP3`:              nil,
	`ONLINE_RANK_COUNT`:             nil,
	`ONLINE_RANK_V2`:                nil,
	"TRADING_SCORE":                 nil,
	"MATCH_ROOM_CONF":               nil,
	"HOT_ROOM_NOTIFY":               nil,
	"MATCH_TEAM_GIFT_RANK":          nil,
	"ACTIVITY_MATCH_GIFT":           nil,
	"PK_BATTLE_PRE":                 nil,
	"PK_BATTLE_START":               nil,
	"PK_BATTLE_PROCESS":             nil,
	"PK_BATTLE_END":                 nil,
	"PK_BATTLE_RANK_CHANGE":         nil,
	"PK_BATTLE_SETTLE_USER":         nil,
	"PK_BATTLE_SETTLE_V2":           nil,
	"PK_BATTLE_SETTLE":              nil,
	"SYS_MSG":                       nil,
	"ROOM_SKIN_MSG":                 nil,
	"GUARD_ACHIEVEMENT_ROOM":        nil,
	"ANCHOR_LOT_START":              replyF.anchor_lot_start,
	"ANCHOR_LOT_CHECKSTATUS":        nil,
	"ANCHOR_LOT_END":                nil,
	"ANCHOR_LOT_AWARD":              replyF.anchor_lot_award,
	"COMBO_SEND":                    nil,
	"INTERACT_WORD":                 replyF.interact_word,
	"ACTIVITY_BANNER_UPDATE_V2":     nil,
	"NOTICE_MSG":                    nil,
	"ROOM_BANNER":                   nil,
	"ONLINERANK":                    nil,
	"WELCOME":                       nil,
	"HOUR_RANK_AWARDS":              nil,
	"ROOM_RANK":                     nil,
	"ROOM_SHIELD":                   nil,
	"USER_TOAST_MSG":                replyF.user_toast_msg,
	"WIN_ACTIVITY":                  replyF.win_activity,
	"SPECIAL_GIFT":                  replyF.special_gift,
	"GUARD_BUY":                     nil,
	"WELCOME_GUARD":                 nil,
	"DANMU_MSG":                     replyF.danmu,
	"ROOM_CHANGE":                   replyF.room_change,
	"ROOM_SILENT_OFF":               replyF.roomsilent,
	"ROOM_SILENT_ON":                replyF.roomsilent,
	"SEND_GIFT":                     replyF.send_gift,
	"ROOM_BLOCK_MSG":                replyF.room_block_msg,
	"PREPARING":                     replyF.preparing,
	"LIVE":                          replyF.live,
	"SUPER_CHAT_ENTRANCE":           nil,
	"SUPER_CHAT_MESSAGE_DELETE":     nil,
	"SUPER_CHAT_MESSAGE":            nil,
	"SUPER_CHAT_MESSAGE_JPN":        replyF.super_chat_message,
	"PANEL":                         nil,
	"ENTRY_EFFECT":                  replyF.entry_effect,
	"ROOM_REAL_TIME_MESSAGE_UPDATE": nil,
}

Msg类型数据处理方法map

Functions

func Ass_f

func Ass_f(file string, st time.Time)

设定字幕文件名,为""时停止输出

func Assf

func Assf(s string)

传入要显示的单条字幕

func AutoSend_silver_gift added in v0.5.8

func AutoSend_silver_gift()

自动发送即将过期的银瓜子礼物

func Autobanf

func Autobanf(s string) bool

func Autoskipf

func Autoskipf(s string) uint

func Danmuji_auto

func Danmuji_auto()

func Danmujif

func Danmujif(s string)

func Entry_danmu added in v0.5.8

func Entry_danmu()

进入房间发送弹幕

func Gui_show

func Gui_show(m ...string)

func Heart

func Heart(b []byte)

HeartBeat类型,将人气4位byte转为字符串,并送到上述map指定的方法

func IsOn

func IsOn(s string) bool

功能开关选取函数

func Itos

func Itos(i []interface{}) string

func Jiezouf

func Jiezouf(s []string) bool

func Keep_medal_light added in v0.5.8

func Keep_medal_light()

保持所有牌子点亮

func Keyframe_timebase added in v0.5.9

func Keyframe_timebase(buf [][]byte, last_keyframe_timestamp int) (keyframe_timestamp int, err error)

func Lessdanmuf

func Lessdanmuf(s string) (show bool)

func Merge_stream added in v0.5.9

func Merge_stream(keyframe_lists [][][]byte, last_keyframe_timestramp int) (keyframe_timestamp int, merge_buf []byte, merged int)

this fuction merge two stream and return the merge buffer,which has the newest frame. once len(merge_buf) isn't 0,old_buf can be drop and new_buf can be used from now on.or it's still need to keep buf until find the same tag.

func Msg

func Msg(b []byte)

Msg类型数据处理方法挑选 识别cmd字段类型,查找上述map中设置的方法,并将json转为字符串型传入

func Msg_senddanmu

func Msg_senddanmu(msg string)

弹幕发送 传入字符串即可发送 需要cookie

func Msg_showdanmu

func Msg_showdanmu(auth interface{}, m ...string)

弹幕显示 由于额外功能有些需要显示,为了统一管理,使用此方法进行处理

func Obs_R

func Obs_R(on bool)

func Obsf

func Obsf(on bool)

func Reply

func Reply(b []byte)

返回数据分派 传入接受到的ws数据 判断进行解压,并对每个json对象进行分派

func Save_to_json added in v0.5.8

func Save_to_json(Loc int, Context []interface{})

func Savestream_wait added in v0.5.9

func Savestream_wait()

已func形式调用,将会停止保存直播流

func Savestreamf added in v0.5.9

func Savestreamf()

已go func形式调用,将会获取直播流

func Seach_keyframe_tag added in v0.5.9

func Seach_keyframe_tag(buf []byte) (front_buf []byte, keyframe [][]byte, err error)

same as Seach_stream_tag but faster

func Seach_stream_tag added in v0.5.9

func Seach_stream_tag(buf []byte) (front_buf []byte, keyframe [][]byte, err error)

this fuction read []byte and return flv header and all complete keyframe if possible. complete keyframe means the video and audio tags between two video key frames tag

func Shortdanmuf

func Shortdanmuf(s string) string

func ShowRevf

func ShowRevf()

func Stream added in v0.5.9

func Stream(path string, front_buf *[]byte, streamChan chan []byte, cancel chan struct{}) error

func TTS added in v0.5.6

func TTS(uid, msg string)

func TimeStramp_Check added in v0.5.9

func TimeStramp_Check(path string) error

Types

type Ass

type Ass struct {
	// contains filtered or unexported fields
}

Ass 弹幕转字幕

type Autoban

type Autoban struct {
	Banbuf []string
	// contains filtered or unexported fields
}

type Autoskip

type Autoskip struct {
	sync.Mutex
	// contains filtered or unexported fields
}

type Autoskip_item added in v0.5.6

type Autoskip_item struct {
	Exprie uint
	Num    uint
}

type Danmu_mq_t

type Danmu_mq_t struct {
	// contains filtered or unexported fields
}

type Danmuji

type Danmuji struct {
	Buf        map[string]string
	Inuse_auto bool
	// contains filtered or unexported fields
}

type Jiezou

type Jiezou struct {
	sync.Mutex
	// contains filtered or unexported fields
}

type Lessdanmu

type Lessdanmu struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

type Obs

type Obs struct {
	Prog string //程序路径
	// contains filtered or unexported fields
}

type Savestream added in v0.5.9

type Savestream struct {
	// contains filtered or unexported fields
}

直播流保存

type Shortdanmu

type Shortdanmu struct {
	// contains filtered or unexported fields
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL