evt_online添加渠道信息
This commit is contained in:
parent
aa3a713699
commit
ec635783c4
|
@ -9,16 +9,8 @@ import (
|
|||
|
||||
// GenerateOnline 在线统计
|
||||
func GenerateOnline(online map[string]map[string]int) *RabbitMQData {
|
||||
m := map[string]map[int]int{} // 渠道:平台:真人数
|
||||
for k, v := range online {
|
||||
m[k] = map[int]int{}
|
||||
for k1, v1 := range v {
|
||||
pf, _ := strconv.Atoi(k1)
|
||||
m[k][pf] = v1
|
||||
}
|
||||
}
|
||||
params := make(map[string]interface{})
|
||||
params["Online"] = m
|
||||
params["Online"] = online
|
||||
params["Time"] = time.Now().Unix()
|
||||
return NewRabbitMQData(mq.BackOnline, params)
|
||||
}
|
||||
|
|
|
@ -32,12 +32,12 @@ func (p *PlayerOnlineEvent) Update() {
|
|||
onlineCh := map[string]map[string]int{}
|
||||
for _, player := range PlayerMgrSington.sidMap {
|
||||
if player != nil && !player.IsRob && player.IsOnLine() {
|
||||
info, ok := onlineCh[player.Channel]
|
||||
info, ok := onlineCh[player.Platform]
|
||||
if !ok {
|
||||
onlineCh[player.Channel] = map[string]int{}
|
||||
info = onlineCh[player.Channel]
|
||||
onlineCh[player.Platform] = map[string]int{}
|
||||
info = onlineCh[player.Platform]
|
||||
}
|
||||
info[player.Platform] += 1
|
||||
info[player.Channel] += 1
|
||||
}
|
||||
}
|
||||
if len(onlineCh) == len(p.OnlineCh) {
|
||||
|
|
Loading…
Reference in New Issue