Documentation ¶
Index ¶
- Constants
- func DecodeMsg(data []byte, pmsg *GeneralMsg) error
- func EncodeMsg(pmsg *GeneralMsg) ([]byte, error)
- func Proto2Msg(proto_id int) (interface{}, error)
- type CSLoginReq
- type CSLoginRsp
- type CSLogoutReq
- type CSLogoutRsp
- type CSPingReq
- type CSPingRsp
- type CSRegReq
- type CSRegRsp
- type GeneralMsg
- type Item
- type ProtoHead
- type UserBasic
- type UserDepot
- type UserDetail
Constants ¶
View Source
const ( //proto start CS_PROTO_START = 0 CS_PROTO_PING_REQ = 1 CS_PROTO_PING_RSP = 2 CS_PROTO_LOGIN_REQ = 3 CS_PROTO_LOGIN_RSP = 4 CS_PROTO_LOGOUT_REQ = 5 CS_PROTO_LOGOUT_RSP = 6 CS_PROTO_REG_REQ = 7 CS_PROTO_REG_RSP = 8 //PS:new proto added should modify 'Proto2Msg' function //proto end = last + 1 CS_PROTO_END = 9 )
CS PROTO ID
Variables ¶
This section is empty.
Functions ¶
func EncodeMsg ¶
func EncodeMsg(pmsg *GeneralMsg) ([]byte, error)
* Encode GeneralMsg * @return encoded_bytes , error
Types ¶
type CSLoginReq ¶
type CSLoginRsp ¶
type CSLoginRsp struct { Result int `json:"result"` Name string `json:"name"` Basic UserBasic `json:"basic"` Detail UserDetail `json:"user_detail"` }
type CSLogoutReq ¶
type CSLogoutReq struct {
Uid int64 `json:"uid"`
}
type CSLogoutRsp ¶
type GeneralMsg ¶
type GeneralMsg struct { ProtoId int `json:"proto"` SubMsg interface{} `json:"sub"` }
* GeneralMsg
type UserDetail ¶
Click to show internal directories.
Click to hide internal directories.