예제 #1
0
파일: login.go 프로젝트: dulumao/gsgo
func (this *Login_Req) DecodePacket() bool {
	if this.IsDecoded() {
		return true
	}
	packet.DecoderReadValue(this.Packet, &this.UserName)

	packet.DecoderReadValue(this.Packet, &this.PWD)

	packet.DecoderReadEntity(this.Packet, &this.e)

	arrLen := packet.DecoderReadArrayLength(this.Packet)
	for i := 0; i < arrLen; i++ {
		e := &Entity{}
		packet.DecoderReadEntity(this.Packet, e)
		this.eList = append(this.eList, *e)
	}
	this.PackDecoded = true
	return true
}
예제 #2
0
파일: login.go 프로젝트: colefan/gsgo-hgame
func (this *RoleListResp) DecodePacket() bool {
	if this.IsDecoded() {
		return true
	}
	arrLen := packet.DecoderReadArrayLength(this.Packet)
	for i := 0; i < arrLen; i++ {
		e := &LoginRoleEntity{}
		packet.DecoderReadEntity(this.Packet, e)
		this.RoleList = append(this.RoleList, *e)
	}
	this.PackDecoded = true
	return true
}