Beispiel #1
0
func (this *Protocol) Deal1000(client *Client, bufferIn *tbs.ByteArray) {
	client.playerVo.Nickname, _ = bufferIn.ReadUTF()

	buffer := tbs.CreateByteArray([]byte{})

	buffer.WriteBool(true)
	buffer.WriteInt32(int32(client.id))

	client.SendPack(1000, buffer.Bytes())
}
Beispiel #2
0
func (this *Protocol) Deal1100(client *Client, bufferIn *tbs.ByteArray) {
	bufferIn.SetReadPos(8)
	x, _ := bufferIn.ReadInt32()
	y, _ := bufferIn.ReadInt32()
	client.playerVo.X = x
	client.playerVo.Y = y

	bufferIn.SetWriteEnd()
	bufferIn.WriteInt32(int32(client.playerVo.Id))

	bufferIn.SetReadPos(4)

	client.Broadcast(1100, bufferIn.BytesAvailable())
}