Documentation
¶
Overview ¶
@Title @Description @Author Wangwengang 2023/12/22 13:11 @Update Wangwengang 2023/12/22 13:11
@Title @Description @Author Wangwengang 2024/2/6 11:02 @Update Wangwengang 2024/2/6 11:02
@Title @Description @Author Wangwengang 2023/12/22 20:55 @Update Wangwengang 2023/12/22 20:55
Index ¶
- func MyHeartBeatMsg(conn ziface.IConnection) []byte
- func MyOnRemoteNotAlive(conn ziface.IConnection)
- func NewGlobalMgr(serverId int64)
- type GlobalManager
- type MyHeartBeatRouter
- type Notify
- func (n *Notify) ConnNums() int
- func (n *Notify) DelNotifyByID(Id uint64)
- func (n *Notify) GetNotifyByID(Id uint64) (ziface.IConnection, error)
- func (n *Notify) HasIdConn(Id uint64) bool
- func (n *Notify) NotifyAll(MsgId uint32, data []byte) error
- func (n *Notify) NotifyBuffAll(MsgId uint32, data []byte) error
- func (n *Notify) NotifyBuffAllAuto(dataProto []byte, dataJson []byte) error
- func (n *Notify) NotifyBuffToConnByID(Id uint64, MsgId uint32, data []byte) error
- func (n *Notify) NotifyBuffToConnByIDAuto(Id uint64, dataJson []byte, dataProto []byte) error
- func (n *Notify) NotifyToConnByID(Id uint64, MsgId uint32, data []byte) error
- func (n *Notify) SetNotifyID(Id uint64, conn ziface.IConnection)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MyHeartBeatMsg ¶
func MyHeartBeatMsg(conn ziface.IConnection) []byte
User-defined heartbeat message processing method 用户自定义的心跳检测消息处理方法
func MyOnRemoteNotAlive ¶
func MyOnRemoteNotAlive(conn ziface.IConnection)
User-defined handling method for remote connection not alive. 用户自定义的远程连接不存活时的处理方法
func NewGlobalMgr ¶
func NewGlobalMgr(serverId int64)
Types ¶
type GlobalManager ¶
type GlobalManager struct { ServerId int64 IDWorker *zutils.IDWorker // contains filtered or unexported fields }
var GlobalMgr *GlobalManager
func (*GlobalManager) ConnectionEnterFirst ¶
func (g *GlobalManager) ConnectionEnterFirst(conn ziface.IConnection)
func (*GlobalManager) ConnectionLost ¶
func (g *GlobalManager) ConnectionLost(conn ziface.IConnection)
func (*GlobalManager) SendMsgToAll ¶
func (g *GlobalManager) SendMsgToAll(dataJson []byte, dataProto []byte)
广播消息 发给所有用户
func (*GlobalManager) SendMsgToConn ¶
func (g *GlobalManager) SendMsgToConn(cID uint64, dataJson []byte, dataProto []byte)
消息发给指定连接
type MyHeartBeatRouter ¶
type MyHeartBeatRouter struct {
znet.BaseRouter
}
User-defined method for handling heartbeat messages (用户自定义的心跳检测消息处理方法)
func (*MyHeartBeatRouter) Handle ¶
func (r *MyHeartBeatRouter) Handle(request ziface.IRequest)
type Notify ¶
type Notify struct {
// contains filtered or unexported fields
}
func (*Notify) DelNotifyByID ¶
func (*Notify) GetNotifyByID ¶
func (n *Notify) GetNotifyByID(Id uint64) (ziface.IConnection, error)
func (*Notify) NotifyBuffAllAuto ¶
func (*Notify) NotifyBuffToConnByID ¶
func (*Notify) NotifyBuffToConnByIDAuto ¶
func (*Notify) NotifyToConnByID ¶
func (*Notify) SetNotifyID ¶
func (n *Notify) SetNotifyID(Id uint64, conn ziface.IConnection)
Click to show internal directories.
Click to hide internal directories.