feat(friend): 添加好友系统功能实现 完善好友管理功能,包括添加好友、回复好友请求、删除好友等操作, 同时优化了相关数据结构和接口定义。 BREAKING CHANGE: 调整了黑名单数据结构,将BlackInfo从结构体改为uint32数组 ```
54 lines
1.8 KiB
Go
54 lines
1.8 KiB
Go
package friend
|
||
|
||
import "blazing/logic/service/common"
|
||
|
||
// 基地查看好友列表
|
||
type SeeOnlineInboundInfo struct {
|
||
Head common.TomeeHeader `cmd:"2157" struc:"skip"`
|
||
|
||
UserIdsLen uint32 `json:"userIdsLen" struc:"sizeof=UserIds"`
|
||
UserIds []uint32 `json:"userIds" `
|
||
}
|
||
|
||
type OnlineInfo struct {
|
||
UserId uint32 `json:"userId" `
|
||
ServerId uint32 `json:"serverId" `
|
||
MapType uint32 `json:"mapType" `
|
||
MapId uint32 `json:"mapId" `
|
||
}
|
||
type SeeOnlineOutboundInfo struct {
|
||
FriendsLen uint32 `json:"friendsLen" struc:"sizeof=Friends"`
|
||
Friends []OnlineInfo `json:"friends" fieldDescription:"好友在线列表" `
|
||
}
|
||
|
||
// 添加好友请求
|
||
type FriendAddInboundInfo struct {
|
||
Head common.TomeeHeader `cmd:"2151" struc:"skip"`
|
||
UserID uint32 `json:"userID"` // 添加人的玩家id
|
||
}
|
||
|
||
// 回复好友请求
|
||
type FriendAnswerInboundInfo struct {
|
||
Head common.TomeeHeader `cmd:"2152" struc:"skip"`
|
||
UserID uint32 `json:"userID"` // 添加人的玩家id
|
||
Flag uint32 `json:"flag"` // 1为同意添加好友 0为拒绝
|
||
}
|
||
|
||
// 删除好友请求
|
||
type FriendRemoveInboundInfo struct {
|
||
Head common.TomeeHeader `cmd:"2153" struc:"skip"`
|
||
UserID uint32 `json:"userID"` // 删除的玩家id
|
||
}
|
||
|
||
// 通知消息结构 - 服务器主动发送给前端
|
||
type InformMessage struct {
|
||
Type uint32 `json:"type"` // cmdid,如2151(添加好友)、2152(回复好友)
|
||
UserID uint32 `json:"userID"` // 对方的userid
|
||
Nick string `struc:"[16]byte"`
|
||
Accept uint32 `json:"accept"` // 是否接受: 1为接受,0为拒绝
|
||
ServerID uint32 `json:"serverID"` // 对方服务器ID
|
||
MapType uint32 `json:"mapType"` // 对方地图类型
|
||
MapID uint32 `json:"mapID"` // 对方地图ID
|
||
MapName string `struc:"[64]byte"` // 对方的地图名称,64字节UTF8
|
||
}
|