feat(friend): 添加好友系统功能实现

完善好友管理功能,包括添加好友、回复好友请求、删除好友等操作,
同时优化了相关数据结构和接口定义。

BREAKING CHANGE: 调整了黑名单数据结构,将BlackInfo从结构体改为uint32数组
```
This commit is contained in:
昔念
2026-01-20 06:15:55 +08:00
parent fcb55d3a46
commit 07d25b3e96
15 changed files with 255 additions and 82 deletions

View File

@@ -73,7 +73,7 @@ type CommendSvrInfo struct {
FriendInfoLen uint32 `struc:"sizeof=FriendInfo"`
FriendInfo []FriendInfo // 好友id
BlackInfoLen uint32 `struc:"sizeof=BlackInfo"`
BlackInfo []BlackInfo // 黑名单id
BlackInfo []uint32 // 黑名单id
}
// NewInInfo 创建并返回一个新的 commendSvrInfo 结构体实例
@@ -87,7 +87,7 @@ func NewInInfo() *CommendSvrInfo {
ServerInfoLen: 0,
ServerList: make([]ServerInfo, 0),
FriendInfo: make([]FriendInfo, 0),
BlackInfo: make([]BlackInfo, 0),
//Reversed: 0,
}
}
@@ -120,15 +120,10 @@ func newServerInfo() *ServerInfo {
}
type FriendInfo struct {
BlackInfo
Userid uint32
TimePoke uint32
}
type BlackInfo struct {
Userid uint32
//TimePoke uint32
}
// func Refurh() {
// l.Lock()
// defer l.Unlock()