core

package
v0.0.0-...-f914275 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 24, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

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

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 NewNotify

func NewNotify() *Notify

func (*Notify) ConnNums

func (n *Notify) ConnNums() int

func (*Notify) DelNotifyByID

func (n *Notify) DelNotifyByID(Id uint64)

func (*Notify) GetNotifyByID

func (n *Notify) GetNotifyByID(Id uint64) (ziface.IConnection, error)

func (*Notify) HasIdConn

func (n *Notify) HasIdConn(Id uint64) bool

func (*Notify) NotifyAll

func (n *Notify) NotifyAll(MsgId uint32, data []byte) error

func (*Notify) NotifyBuffAll

func (n *Notify) NotifyBuffAll(MsgId uint32, data []byte) error

func (*Notify) NotifyBuffAllAuto

func (n *Notify) NotifyBuffAllAuto(dataProto []byte, dataJson []byte) error

func (*Notify) NotifyBuffToConnByID

func (n *Notify) NotifyBuffToConnByID(Id uint64, MsgId uint32, data []byte) error

func (*Notify) NotifyBuffToConnByIDAuto

func (n *Notify) NotifyBuffToConnByIDAuto(Id uint64, dataJson []byte, dataProto []byte) error

func (*Notify) NotifyToConnByID

func (n *Notify) NotifyToConnByID(Id uint64, MsgId uint32, data []byte) error

func (*Notify) SetNotifyID

func (n *Notify) SetNotifyID(Id uint64, conn ziface.IConnection)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL