goworld: github.com/xiaonanln/goworld/components/dispatcher/dispatcherclient Index | Files

package dispatcherclient

import "github.com/xiaonanln/goworld/components/dispatcher/dispatcherclient"

Index

Package Files

DispatcherClient.go conn_mgr.go

func Initialize Uses

func Initialize(delegate IDispatcherClientDelegate, autoFlush bool)

Initialize the dispatcher client, only called by engine

type DispatcherClient Uses

type DispatcherClient struct {
    *proto.GoWorldConnection
}

DispatcherClient is a client connection to the dispatcher

func GetDispatcherClientForSend Uses

func GetDispatcherClientForSend() *DispatcherClient

GetDispatcherClientForSend returns the current dispatcher client for sending messages

func (*DispatcherClient) Close Uses

func (dc *DispatcherClient) Close() error

Close the dispatcher client

type IDispatcherClientDelegate Uses

type IDispatcherClientDelegate interface {
    OnDispatcherClientConnect(dispatcherClient *DispatcherClient, isReconnect bool)
    HandleDispatcherClientPacket(msgtype proto.MsgType, packet *netutil.Packet)
    HandleDispatcherClientDisconnect()
    HandleDispatcherClientBeforeFlush()
}

IDispatcherClientDelegate defines functions that should be implemented by dispatcher clients

Package dispatcherclient imports 12 packages (graph) and is imported by 3 packages. Updated 2017-11-06. Refresh now. Tools for package owners.