aboutsummaryrefslogtreecommitdiffstats
path: root/client/quake/move.go
diff options
context:
space:
mode:
Diffstat (limited to 'client/quake/move.go')
-rw-r--r--client/quake/move.go30
1 files changed, 30 insertions, 0 deletions
diff --git a/client/quake/move.go b/client/quake/move.go
new file mode 100644
index 0000000..600c1fd
--- /dev/null
+++ b/client/quake/move.go
@@ -0,0 +1,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
+}