aboutsummaryrefslogtreecommitdiffstats
path: root/client/quake/move.go
blob: 600c1fdc57437e9e57640a0b7a92adc509e8dbf9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package quake

import (
	"github.com/osm/quake/packet/command/deltausercommand"
	"github.com/osm/quake/packet/command/move"
	"github.com/osm/quake/protocol"
)

func (c *Client) getMove(seq uint32) *move.Command {
	mov := move.Command{
		Null: &deltausercommand.Command{
			ProtocolVersion: c.ctx.GetProtocolVersion(),
			Bits:            protocol.CMForward | protocol.CMSide | protocol.CMUp | protocol.CMButtons,
			CMForward16:     0,
			CMSide16:        0,
			CMUp16:          0,
			CMButtons:       0,
			CMMsec:          13, // ~72hz
		},
		Old: &deltausercommand.Command{
			ProtocolVersion: c.ctx.GetProtocolVersion(),
		},
		New: &deltausercommand.Command{
			ProtocolVersion: c.ctx.GetProtocolVersion(),
		},
	}

	mov.Checksum = mov.GetChecksum(seq - 1)
	return &mov
}