Beispiel #1
0
func (this *AckRoleLoginOk) Encode() []byte {
	pack := packet.NewWriteBuff(64)

	pack.WriteString(this.uname)

	return pack.Encode(P_ACK_ROLE_LOGIN_OK)
}
Beispiel #2
0
func (this *AckSceneEnter) Encode() []byte {
	pack := packet.NewWriteBuff(64)

	pack.WriteBytes(this.player.Encode())

	return pack.Encode(P_ACK_SCENE_ENTER)
}
Beispiel #3
0
func (this *MsgTestPhp) Encode() []byte {
	pack := packet.NewWriteBuff(64)

	pack.WriteUint16(this.u16)

	return pack.ReadBytes()
}
Beispiel #4
0
func (this *AckSceneExit) Encode() []byte {
	pack := packet.NewWriteBuff(64)

	pack.WriteUint32(this.uid)

	return pack.Encode(P_ACK_SCENE_EXIT)
}
Beispiel #5
0
func (this *ReqChatGm) Encode() []byte {
	pack := packet.NewWriteBuff(64)

	pack.WriteString(this.content)

	return pack.Encode(P_REQ_CHAT_GM)
}
func (this *AckRoleRandNameOk) Encode() []byte {
	pack := packet.NewWriteBuff(64)

	pack.WriteString(this.uname)

	return pack.Encode(P_ACK_ROLE_RAND_NAME_OK)
}
Beispiel #7
0
func (this *ReqSceneEnterFly) Encode() []byte {
	pack := packet.NewWriteBuff(64)

	pack.WriteUint32(this.mapId)

	return pack.Encode(P_REQ_SCENE_ENTER_FLY)
}
Beispiel #8
0
func (this *MsgScenePlayer) Encode() []byte {
	pack := packet.NewWriteBuff(64)

	pack.WriteUint32(this.uid)
	pack.WriteBytes(this.sceneRotPos.Encode())

	return pack.ReadBytes()
}
Beispiel #9
0
func (this *MsgFriendBaseAdd) Encode() []byte {
	pack := packet.NewWriteBuff(64)

	pack.WriteUint32(this.uid)
	pack.WriteString(this.uname)

	return pack.ReadBytes()
}
Beispiel #10
0
func (this *ReqChatSend) Encode() []byte {
	pack := packet.NewWriteBuff(64)

	pack.WriteUint8(this.channel)
	pack.WriteUint32(this.destUid)
	pack.WriteString(this.content)

	return pack.Encode(P_REQ_CHAT_SEND)
}
Beispiel #11
0
func (this *MsgSceneVector3) Encode() []byte {
	pack := packet.NewWriteBuff(64)

	pack.WriteInt16(this.x)
	pack.WriteInt16(this.y)
	pack.WriteInt16(this.z)

	return pack.ReadBytes()
}
Beispiel #12
0
func (this *ReqSceneMove) Encode() []byte {
	pack := packet.NewWriteBuff(64)

	pack.WriteBytes(this.sceneRotPos.Encode())
	pack.WriteBytes(this.forward.Encode())
	pack.WriteString(this.aniName)
	pack.WriteInt16(this.xAxis)

	return pack.Encode(P_REQ_SCENE_MOVE)
}
Beispiel #13
0
func (this *AckChatSendOk) Encode() []byte {
	pack := packet.NewWriteBuff(64)

	pack.WriteUint8(this.channel)
	pack.WriteUint32(this.uid)
	pack.WriteString(this.uname)
	pack.WriteString(this.content)

	return pack.Encode(P_ACK_CHAT_SEND_OK)
}
Beispiel #14
0
func (this *AckScenePlayers) Encode() []byte {
	pack := packet.NewWriteBuff(64)

	playersCount := uint16(len(this.players))
	pack.WriteUint16(playersCount)
	for i := uint16(0); i < playersCount; i++ {
		pack.WriteBytes(this.players[i].Encode())
	}

	return pack.Encode(P_ACK_SCENE_PLAYERS)
}
Beispiel #15
0
func (this *MsgSceneRotPos) Encode() []byte {
	pack := packet.NewWriteBuff(64)

	pack.WriteInt16(this.rotX)
	pack.WriteInt16(this.rotY)
	pack.WriteInt16(this.rotZ)
	pack.WriteInt16(this.posX)
	pack.WriteInt16(this.posY)
	pack.WriteInt16(this.posZ)

	return pack.ReadBytes()
}
Beispiel #16
0
func (this *ReqRoleCreate) Encode() []byte {
	pack := packet.NewWriteBuff(64)

	pack.WriteUint32(this.uid)
	pack.WriteUint32(this.uuid)
	pack.WriteUint16(this.sid)
	pack.WriteUint16(this.cid)
	pack.WriteString(this.os)
	pack.WriteString(this.version)
	pack.WriteString(this.uname)
	pack.WriteString(this.source)
	pack.WriteString(this.sourceSub)
	pack.WriteUint32(this.loginTime)

	return pack.Encode(P_REQ_ROLE_CREATE)
}
Beispiel #17
0
func (this *ReqRoleLogin) Encode() []byte {
	pack := packet.NewWriteBuff(64)

	pack.WriteUint32(this.uid)
	pack.WriteUint32(this.uuid)
	pack.WriteUint16(this.sid)
	pack.WriteUint16(this.cid)
	pack.WriteUint32(this.loginTime)
	pack.WriteString(this.pwd)
	pack.WriteUint8(this.relink)
	pack.WriteUint8(this.debug)
	pack.WriteString(this.os)
	pack.WriteString(this.version)

	return pack.Encode(P_REQ_ROLE_LOGIN)
}
Beispiel #18
0
func (this *MsgTestXX) Encode() []byte {
	pack := packet.NewWriteBuff(64)

	pack.WriteUint8(this.idU8)
	idF32Count := uint16(len(this.idF32))
	pack.WriteUint16(idF32Count)
	for i := uint16(0); i < idF32Count; i++ {
		pack.WriteFloat32(this.idF32[i])
	}
	pack.WriteUint8(this.idOpU8Flag)
	if this.idOpU8Flag == 1 {
		pack.WriteUint8(this.idOpU8)
	}

	return pack.ReadBytes()
}
Beispiel #19
0
func (this *ReqTestXX) Encode() []byte {
	pack := packet.NewWriteBuff(64)

	pack.WriteUint8(this.idU8)
	pack.WriteUint16(this.idU16)
	pack.WriteUint32(this.idU32)
	repeatIdU8Count := uint16(len(this.repeatIdU8))
	pack.WriteUint16(repeatIdU8Count)
	for i := uint16(0); i < repeatIdU8Count; i++ {
		pack.WriteUint8(this.repeatIdU8[i])
	}
	pack.WriteUint8(this.optionalIdU8Flag)
	if this.optionalIdU8Flag == 1 {
		pack.WriteUint8(this.optionalIdU8)
	}

	return pack.Encode(P_REQ_TEST_X_X)
}
Beispiel #20
0
func (this *AckTestPhpOk) Encode() []byte {
	pack := packet.NewWriteBuff(64)

	pack.WriteUint64(this.u64)
	pack.WriteString(this.strxx)
	pack.WriteBytes(this.msgReq.Encode())
	pack.WriteUint8(this.msgOptFlag)
	if this.msgOptFlag == 1 {
		pack.WriteBytes(this.msgOpt.Encode())
	}
	msgRepCount := uint16(len(this.msgRep))
	pack.WriteUint16(msgRepCount)
	for i := uint16(0); i < msgRepCount; i++ {
		pack.WriteBytes(this.msgRep[i].Encode())
	}

	return pack.Encode(P_ACK_TEST_PHP_OK)
}
Beispiel #21
0
func (this *AckTestSendOk) Encode() []byte {
	pack := packet.NewWriteBuff(64)

	pack.WriteUint8(this.idU8)
	pack.WriteBytes(this.roleBase.Encode())
	idF32Count := uint16(len(this.idF32))
	pack.WriteUint16(idF32Count)
	for i := uint16(0); i < idF32Count; i++ {
		pack.WriteFloat32(this.idF32[i])
	}
	pack.WriteUint8(this.idOpU8Flag)
	if this.idOpU8Flag == 1 {
		pack.WriteUint8(this.idOpU8)
	}
	pack.WriteUint8(this.opRoleBaseFlag)
	if this.opRoleBaseFlag == 1 {
		pack.WriteBytes(this.opRoleBase.Encode())
	}

	return pack.Encode(P_ACK_TEST_SEND_OK)
}
func (this *AckRoleLoginOkNoRole) Encode() []byte {
	pack := packet.NewWriteBuff(64)

	return pack.Encode(P_ACK_ROLE_LOGIN_OK_NO_ROLE)
}
Beispiel #23
0
func (this *ReqRoleRandName) Encode() []byte {
	pack := packet.NewWriteBuff(64)

	return pack.Encode(P_REQ_ROLE_RAND_NAME)
}
Beispiel #24
0
func (this *ReqSceneReqPlayers) Encode() []byte {
	pack := packet.NewWriteBuff(64)

	return pack.Encode(P_REQ_SCENE_REQ_PLAYERS)
}