Versions in this module Expand all Collapse all v1 v1.0.1 Nov 6, 2019 Changes in this version + const ERRCODE_ALREADY_EXISTS + const ERRCODE_CREATE_ENTITY_FAILED + const ERRCODE_ERR_LOGIN + const ERRCODE_ERR_PASSWORD + const ERRCODE_ERR_REDIS + const ERRCODE_NONE + const ERRCODE_NOT_LOGIN + const ERRCODE_TOKEN_NOT_EXISTS + const HeaderSize + const MaxSize + const MsgId_ClientMsg + const MsgId_CreateEntity + const MsgId_EntityMsg + const MsgId_EntityRPCMsg + const MsgId_Error + const MsgId_Login + const MsgId_LoginRet + const MsgId_NewClientPeer + const MsgId_PublicEntityMsg + const MsgId_PublicEntityRPCMsg + const MsgId_RemoteCall + const MsgId_RemoveEntity + const MsgId_ServerInfo + const MsgId_SetClientPeerId + const MsgId_SrvMsg + const MsgId_SyncEntity + const MsgId_Tick + var EtypeVerifyMap map[uint16]uint16 + var MidVerifyMap map[uint16]uint16 + func DecryptData(buf []byte) []byte + func EncryptData(buf []byte) []byte + func PackMsg(msgid byte, flag byte, databuff []byte) []byte + func PutRecvStream(sm Stream) + func PutSendStream(sm Stream) + func PutStream(sm Stream) + func ReadMsg(reader io.Reader) (uint16, byte, byte, uint64, []byte, []byte, error) + func WriteMsgHeader(msgid byte, flag byte, fid uint64, bs *stream.ByteStream) + type IEntity interface + ID func() uint64 + Marshal func(bs *SendStream) error + ProcessRpc func(bs *RecvStream) error + RegisterMethodId func(id uint16, processer func(bs *RecvStream) error) + Unmarshal func(bs *RecvStream) error + type LoginRetMsg struct + Account string + Eid uint64 + ErrorCode uint16 + ErrorDesc string + PeerId uint64 + SrvAddr string + SrvPeerId uint64 + SrvPeerType byte + Token string + Uid uint64 + type MsgObj struct + Id uint64 + MsgId byte + MsgSize int16 + SerializeFunc func(*SendStream) + func GetMsgObj(msgid byte, msgsize uint16) *MsgObj + type RecvStream struct + func GetRecvStream(size uint16) *RecvStream + func (rs *RecvStream) DataSize() uint16 + func (rs *RecvStream) Decode() error + func (rs *RecvStream) DecompressAndDecrypt() error + func (rs *RecvStream) Decrypt() error + func (rs *RecvStream) DestPeer() byte + func (rs *RecvStream) Eid() uint64 + func (rs *RecvStream) Etype() uint16 + func (rs *RecvStream) Flag() byte + func (rs *RecvStream) GetBuff() []byte + func (rs *RecvStream) GetHeader() (destpeer byte, mid uint16, etype uint16, eid uint64) + func (rs *RecvStream) Mid() uint16 + func (rs *RecvStream) ReadBool() (bool, error) + func (rs *RecvStream) ReadByte() (byte, error) + func (rs *RecvStream) ReadBytes() ([]byte, error) + func (rs *RecvStream) ReadFloat32() (float32, error) + func (rs *RecvStream) ReadFloat64() (float64, error) + func (rs *RecvStream) ReadInt16() (int16, error) + func (rs *RecvStream) ReadInt32() (int32, error) + func (rs *RecvStream) ReadInt64() (int64, error) + func (rs *RecvStream) ReadInt8() (int8, error) + func (rs *RecvStream) ReadString() (string, error) + func (rs *RecvStream) ReadUint16() (uint16, error) + func (rs *RecvStream) ReadUint32() (uint32, error) + func (rs *RecvStream) ReadUint64() (uint64, error) + func (rs *RecvStream) ReadUint64s() ([]uint64, error) + func (rs *RecvStream) Recv(r io.Reader) error + func (rs *RecvStream) Reset() + func (rs *RecvStream) SetHeader(destpeer byte, mid uint16, etype uint16, eid uint64) + func (rs *RecvStream) String() string + func (rs *RecvStream) UnSerializeArgs(funcref reflect.Value) ([]reflect.Value, error) + type SendStream struct + func GetDefaultSendStream() *SendStream + func GetSendStream(size uint16) *SendStream + func (ss *SendStream) Clone() *SendStream + func (ss *SendStream) CompressAndEncrypt() uint16 + func (ss *SendStream) Encode() error + func (ss *SendStream) Encrypt() error + func (ss *SendStream) GetBuff() []byte + func (ss *SendStream) SerializeArgs(args ...interface{}) error + func (ss *SendStream) SetDataSize(size uint16) + func (ss *SendStream) SetDestPeer(destpeer byte) + func (ss *SendStream) SetEid(eid uint64) + func (ss *SendStream) SetEtype(etype uint16) + func (ss *SendStream) SetFlag(flag byte) + func (ss *SendStream) SetHeader(destpeer byte, mid, etype uint16, eid uint64) + func (ss *SendStream) SetMid(msgid uint16) + func (ss *SendStream) String() string + func (ss *SendStream) WriteBool(v bool) error + func (ss *SendStream) WriteByte(v byte) error + func (ss *SendStream) WriteBytes(v []byte) error + func (ss *SendStream) WriteFloat32(f float32) error + func (ss *SendStream) WriteFloat64(f float64) error + func (ss *SendStream) WriteInt16(v int16) error + func (ss *SendStream) WriteInt32(v int32) error + func (ss *SendStream) WriteInt64(v int64) error + func (ss *SendStream) WriteInt8(v int8) error + func (ss *SendStream) WriteString(v string) error + func (ss *SendStream) WriteUint16(v uint16) error + func (ss *SendStream) WriteUint32(v uint32) error + func (ss *SendStream) WriteUint64(v uint64) error + func (ss *SendStream) WriteUint64s(v []uint64) error + func (ss *SendStream) WriteUint8(v uint8) error + type Stream interface + GetBuff func() []byte + type UserTokenInfo struct + Account string + Addr string + Eid uint64 + PeerId uint64 + SrvPeerId uint64 + SrvPeerType byte + Token string + Uid uint64 v1.0.0-alpha Nov 6, 2019