logic

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const TokenLen = 30

Variables

This section is empty.

Functions

func ClearUserStatus

func ClearUserStatus(broker string)

func CreateBrokerClient

func CreateBrokerClient(broker string) (pb.BrokerClient, error)

func RandStringBytes

func RandStringBytes(n int) string

func SendPartnerMsg

func SendPartnerMsg(msgId, senderId, receiverId, sessionId uint64, content string)

Types

type BrokerChecker

type BrokerChecker struct {
	RunningFlag *wm.AtomicBool // 是否运行 true:运行 false:停止
	ExitedFlag  chan struct{}  //  已经退出的标识
	ExitChan    chan struct{}
	// contains filtered or unexported fields
}

确保broker都在线 如果broker已经掉线,就将与broker连接的用户全部下线

func NewBrokerChecker

func NewBrokerChecker() *BrokerChecker

func (*BrokerChecker) Start

func (worker *BrokerChecker) Start()

func (*BrokerChecker) Stop

func (worker *BrokerChecker) Stop()

type LogicGrpcWorker

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

func NewLogicGrpcWorker

func NewLogicGrpcWorker() *LogicGrpcWorker

func (*LogicGrpcWorker) Start

func (w *LogicGrpcWorker) Start()

func (*LogicGrpcWorker) Stop

func (w *LogicGrpcWorker) Stop()

type LogicServer

type LogicServer struct{}

func (*LogicServer) CreateAccount

func (*LogicServer) Logout

func (s *LogicServer) Logout(ctx context.Context, req *pb.LogoutRequest) (*pb.LogoutResponse, error)

func (*LogicServer) Match

func (s *LogicServer) Match(ctx context.Context, req *pb.MatchRequest) (*pb.MatchResponse, error)

func (*LogicServer) Reconnect

func (*LogicServer) SendMsg

func (s *LogicServer) SendMsg(ctx context.Context, req *pb.SendMsgRequest) (*pb.SendMsgResponse, error)

func (*LogicServer) ViewedAck

type PumpDialogueLoopWorker

type PumpDialogueLoopWorker struct {
	//RunningFlag bool // is running? true:running false:stoped
	ExitedFlag chan struct{}
	ExitChan   chan struct{}
	// contains filtered or unexported fields
}

func NewPumpDialogueLoopWorker

func NewPumpDialogueLoopWorker(minCount, maxCount int) *PumpDialogueLoopWorker

func (*PumpDialogueLoopWorker) PumpDialogueLoop

func (w *PumpDialogueLoopWorker) PumpDialogueLoop()

func (*PumpDialogueLoopWorker) Start

func (w *PumpDialogueLoopWorker) Start()

func (*PumpDialogueLoopWorker) Stop

func (w *PumpDialogueLoopWorker) Stop()

type PumpSignalLoopWorker

type PumpSignalLoopWorker struct {
	RunningFlag *wm.AtomicBool // is running? true:running false:stoped
	ExitedFlag  chan struct{}  //  已经退出的标识
	ExitChan    chan struct{}
}

func NewPumpSignalLoopWorker

func NewPumpSignalLoopWorker() *PumpSignalLoopWorker

func (*PumpSignalLoopWorker) PumpSignalLoop

func (w *PumpSignalLoopWorker) PumpSignalLoop()

func (*PumpSignalLoopWorker) Start

func (w *PumpSignalLoopWorker) Start()

func (*PumpSignalLoopWorker) Stop

func (w *PumpSignalLoopWorker) Stop()

Jump to

Keyboard shortcuts

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