feat(cafegame): 自 go-hua 迁入网咖游戏识别与运行记录框架
- 游戏来源常量/按目录特征识别(云更新/网维大师/易乐游)/RunAppRecord 上报框架 - 网吧业务专用包, 附测试、examples/cafegame 例程与包 README
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
package cafegame
|
||||
|
||||
// 游戏运行状态
|
||||
const GameStatusStart = 1 // 开始运行
|
||||
const GameStatusStop = 0 // 停止运行
|
||||
|
||||
const SourceYGX = 1 // 云更新
|
||||
const SourceWWDS = 2 // 网维大师
|
||||
const SourceYLY = 3 // 易乐游
|
||||
const SourceMTGX = 4 // 马蹄更新
|
||||
const SourceStory = 11 // 蘑菇
|
||||
const SourceGoodGame = 12 // 盖伦
|
||||
const SourceHaoSiJi = 13 // 好司机
|
||||
const SourceFast = 14 // 火箭
|
||||
const SourceWfGame = 15 // WF游戏
|
||||
// GetSourceAll 返回所有已支持的游戏来源 ID 列表
|
||||
func GetSourceAll() []int {
|
||||
return []int{SourceYGX, SourceWWDS, SourceYLY, SourceMTGX, SourceStory, SourceGoodGame, SourceHaoSiJi, SourceFast, SourceWfGame}
|
||||
}
|
||||
|
||||
// SourceToName 返回来源 ID 对应的名称,未知来源返回空字符串
|
||||
func SourceToName(id int) string {
|
||||
switch id {
|
||||
case SourceYGX:
|
||||
return "云更新"
|
||||
case SourceWWDS:
|
||||
return "网维大师"
|
||||
case SourceYLY:
|
||||
return "易乐游"
|
||||
case SourceMTGX:
|
||||
return "马蹄更新"
|
||||
case SourceStory:
|
||||
return "蘑菇"
|
||||
case SourceGoodGame:
|
||||
return "盖伦"
|
||||
case SourceHaoSiJi:
|
||||
return "好司机"
|
||||
case SourceFast:
|
||||
return "火箭"
|
||||
case SourceWfGame:
|
||||
return "WF游戏"
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// 游戏监控事件类型
|
||||
const (
|
||||
Error = iota
|
||||
GameStart
|
||||
GameStop
|
||||
GameAdd
|
||||
GameDelete
|
||||
GameUpdate
|
||||
GameExist
|
||||
GameStartIntervalSmall
|
||||
ProcessExit
|
||||
ProcessIgnore
|
||||
ProcessSourceNotMatch
|
||||
ProcessExist
|
||||
ProcessChange
|
||||
ProcessPathDifferent
|
||||
ForegroundWindow
|
||||
)
|
||||
Reference in New Issue
Block a user