好友离线信息聚合
This commit is contained in:
parent
49b6a6a928
commit
dff655484e
@ -624,8 +624,8 @@ func ReqGmCommand_(player *Player, Command string) error {
|
||||
PlayerBaseMod := player.GetPlayerBaseMod()
|
||||
SevenMod.ZeroUpdate(PlayerBaseMod.GetSevenLoginAdd(), PlayerBaseMod.GetLastLoginTime())
|
||||
case "debugLogoutMsg":
|
||||
Uid, _ := strconv.Atoi(arg[1])
|
||||
uidList, err := db.GetDebugPlayer(Uid)
|
||||
ToUid, _ := strconv.Atoi(arg[1])
|
||||
uidList, err := db.GetDebugPlayer(ToUid)
|
||||
if err != nil {
|
||||
log.Error("GetDebugPlayer err:%s", err.Error())
|
||||
return err
|
||||
@ -635,13 +635,13 @@ func ReqGmCommand_(player *Player, Command string) error {
|
||||
Type: MsgMod.HANDLE_TYPE_APPLY,
|
||||
SendT: GoUtil.Now(),
|
||||
From: uid,
|
||||
To: Uid,
|
||||
To: ToUid,
|
||||
})
|
||||
FriendMgrSend(&MsgMod.Msg{
|
||||
Type: MsgMod.HANDLE_TYPE_HANDBOOK_COLLECTION,
|
||||
SendT: GoUtil.Now(),
|
||||
From: Uid,
|
||||
To: uid,
|
||||
From: uid,
|
||||
To: ToUid,
|
||||
})
|
||||
}
|
||||
default:
|
||||
|
||||
@ -529,7 +529,7 @@ func (p *Player) handle(m *msg.Msg) error {
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
applyUids, ok := info["applyUids"].([]int64)
|
||||
applyUids, ok := info["apply_uids"].([]int64)
|
||||
if ok && len(applyUids) > 0 {
|
||||
var faceList []int
|
||||
var name string
|
||||
@ -546,7 +546,7 @@ func (p *Player) handle(m *msg.Msg) error {
|
||||
Count: GoUtil.Int32(info["apply_count"]),
|
||||
})
|
||||
}
|
||||
otherUids, ok := info["otherUids"].([]int64)
|
||||
otherUids, ok := info["other_uids"].([]int64)
|
||||
if ok && len(otherUids) > 0 {
|
||||
var faceList []int
|
||||
var name string
|
||||
|
||||
17
src/server/test/README.MD
Normal file
17
src/server/test/README.MD
Normal file
@ -0,0 +1,17 @@
|
||||
# 单元调试
|
||||
|
||||
## 好友模块
|
||||
|
||||
### 随机好友推荐
|
||||
|
||||
```golang
|
||||
test function TestFriendRecommendList 2026-3-12
|
||||
ok server/test 1.033s
|
||||
```
|
||||
|
||||
### 好友离线消息聚合
|
||||
|
||||
```golang
|
||||
3625212 | 100001
|
||||
3714321 | 100002
|
||||
```
|
||||
@ -1,6 +1,7 @@
|
||||
package test
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"server/game"
|
||||
"testing"
|
||||
)
|
||||
@ -23,3 +24,10 @@ func TestFriendApply(t *testing.T) {
|
||||
t.Error("FriendMod AddFriendApply failed")
|
||||
}
|
||||
}
|
||||
|
||||
func TestFriendRecommendList(t *testing.T) {
|
||||
p1 := new(game.Player)
|
||||
p1.InitPlayer("3625212")
|
||||
l1 := game.GetRecommendPlayer(p1, 3)
|
||||
fmt.Printf("Recommend List: %v\n", l1)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user