logic

package
v0.0.0-...-d9ad550 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Logic Server struct

func NewServer

func NewServer(c *conf.Config) (l *Server)

New server

func (*Server) Close

func (l *Server) Close()

Close close resources.

func (*Server) Connect

func (l *Server) Connect(c context.Context, server, serverKey, cookie string, token []byte) (mid int64, key, roomID string, paltform string, accepts []int32, err error)

Connect connected a conn.

func (*Server) Disconnect

func (l *Server) Disconnect(c context.Context, mid int64, key, server string) (has bool, err error)

Disconnect disconnect a conn.

func (*Server) Heartbeat

func (l *Server) Heartbeat(c context.Context, mid int64, key, server string) (err error)

Heartbeat heartbeat a conn.

func (*Server) OnlineRoom

func (l *Server) OnlineRoom(c context.Context, rooms []string) (res map[string]int32, err error)

OnlineRoom get rooms online.

func (*Server) OnlineTop

func (l *Server) OnlineTop(c context.Context, typeStr string, n int64) (addrs []string, err error)

OnlineTop get the top online address.

func (*Server) Ping

func (l *Server) Ping(c context.Context) (err error)

Ping ping resources is ok.

func (*Server) PushAll

func (l *Server) PushAll(c context.Context, op, speed int32, platform string, msg []byte) (err error)

PushAll push a message to all.

func (*Server) PushKeys

func (l *Server) PushKeys(c context.Context, op int32, keys []string, msg []byte) (err error)

PushKeys push a message by keys.

func (*Server) PushMids

func (l *Server) PushMids(c context.Context, op int32, mids []int64, msg []byte) (err error)

PushMids push a message by mid.

func (*Server) PushRoom

func (l *Server) PushRoom(c context.Context, op int32, room string, msg []byte) (err error)

PushRoom push a message by room.

func (*Server) Receive

func (l *Server) Receive(c context.Context, mid int64, room string, op int32, msg []byte) (err error)

Receive receive a message.

func (*Server) RenewOnline

func (l *Server) RenewOnline(c context.Context, server string, roomCount map[string]int32) (allRoomCount map[string]int32, err error)

RenewOnline renew a server online.

Directories

Path Synopsis
g

Jump to

Keyboard shortcuts

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