Documentation ¶
Overview ¶
好用的kcp 爱 来自 hk4e-go
Index ¶
- Constants
- Variables
- func Close() error
- func DecodeBinToPayload(data []byte, kcpMsgList *[]*KcpMsg, xorKey []byte)
- func DecodeGmPayloadToProto(g *Game.Game, msg *GmMsg) (protoObj pb.Message)
- func DecodeLoop(data []byte, kcpMsgList *[]*KcpMsg)
- func DecodePayloadToProto(g *Game.Game, msg *KcpMsg) (protoObj pb.Message)
- func EncodePayloadToBin(kcpMsg *KcpMsg, xorKey []byte) (bin []byte)
- func GmToGs(uid uint32, gmMsg *GmMsg) bool
- func HandlePlayerGetTokenCsReq(g *Game.Game, payloadMsg []byte)
- func NewGame(kcpConn *kcp.UDPSession) *Game.Game
- func Run() error
- type GmMsg
- type KcpConnManager
- type KcpEvent
- type KcpMsg
- type ProtoMessage
- type ProtoMsg
Constants ¶
View Source
const ( PacketMaxLen = 343 * 1024 // 最大应用层包长度 KcpConnAddrChangeNotify = "KcpConnAddrChangeNotify" )
Variables ¶
View Source
var CLIENT_CONN_NUM int32 = 0 // 当前客户端连接数
Functions ¶
func DecodeBinToPayload ¶
func DecodeGmPayloadToProto ¶
func DecodeLoop ¶
func DecodePayloadToProto ¶
TODO 由于 req 大部分缺失,所以不预处理数据
func EncodePayloadToBin ¶
Types ¶
type KcpConnManager ¶
type KcpConnManager struct {
// contains filtered or unexported fields
}
var KCPCONNMANAGER *KcpConnManager
func (*KcpConnManager) SendHandle ¶
发送事件处理
type KcpMsg ¶
func EncodeProtoToPayload ¶
type ProtoMessage ¶
type ProtoMessage struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.