gate

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServer

func NewServer(provider transport.GateProvider, opts *server.Options) (*server.Server, error)

func WaitChData

func WaitChData(packet *tcp.ReplyPacket, reply proto.Message) error

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(cc *tcp.Client) *Client

func (*Client) Bind

func (c *Client) Bind(ctx context.Context, cid, uid int64) (miss bool, err error)

Bind 绑定用户与连接

func (*Client) BlockConn

func (c *Client) BlockConn(ctx context.Context, onid string, nnid string, target uint64) (err error)

func (*Client) Broadcast

func (c *Client) Broadcast(ctx context.Context, kind session.Kind, message *transport.Message) (total int64, err error)

Broadcast 推送广播消息

func (*Client) Disconnect

func (c *Client) Disconnect(ctx context.Context, kind session.Kind, target int64, isForce bool) (miss bool, err error)

func (*Client) GetID

func (c *Client) GetID(ctx context.Context, kind session.Kind, target int64) (id int64, err error)

func (*Client) GetIP

func (c *Client) GetIP(ctx context.Context, kind session.Kind, target int64) (ip string, miss bool, err error)

func (*Client) IsOnline

func (c *Client) IsOnline(ctx context.Context, kind session.Kind, target int64) (isOnline, miss bool, err error)

func (*Client) Multicast

func (c *Client) Multicast(ctx context.Context, kind session.Kind, targets []int64, message *transport.Message) (total int64, err error)

Multicast 推送组播消息

func (*Client) Ping

func (c *Client) Ping(ctx context.Context, message string) (replyMessage string, err error)

func (*Client) Push

func (c *Client) Push(ctx context.Context, kind session.Kind, target int64, message *transport.Message) (miss bool, err error)

Push 推送消息

func (*Client) Stat

func (c *Client) Stat(ctx context.Context, kind session.Kind) (total int64, miss bool, err error)

func (*Client) Trigger

func (c *Client) Trigger(ctx context.Context, args *transport.TriggerArgs) (miss bool, err error)

Trigger 触发事件

func (*Client) Unbind

func (c *Client) Unbind(ctx context.Context, uid int64) (miss bool, err error)

Unbind 解绑用户与连接

Jump to

Keyboard shortcuts

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