24 lines
689 B
Go
24 lines
689 B
Go
package app
|
|
|
|
import (
|
|
"ArmedPolice/app/event"
|
|
"ArmedPolice/app/service"
|
|
"ArmedPolice/config"
|
|
"ArmedPolice/utils"
|
|
)
|
|
|
|
func Init() {
|
|
// 启动SocketHub
|
|
go utils.TryCatch(func() {
|
|
service.NewHub().Run()
|
|
})
|
|
// 载入数据配置
|
|
utils.LoadConfig("./json/area.json", &config.SettingAreaInfo)
|
|
// RedisHash存储/移除监听
|
|
service.Subscribe(config.EventForRedisHashProduce, event.NewRedisHashProduce())
|
|
service.Subscribe(config.EventForRedisHashDestroy, event.NewRedisHashDestroy())
|
|
// RedisList存储/移除监听
|
|
service.Subscribe(config.EventForRedisListProduce, event.NewRedisListProduce())
|
|
service.Subscribe(config.EventForRedisListDestroy, event.NewRedisListDestroy())
|
|
}
|