aboutsummaryrefslogtreecommitdiff
path: root/msg.go
diff options
context:
space:
mode:
Diffstat (limited to 'msg.go')
-rw-r--r--msg.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/msg.go b/msg.go
index 0e3434e..d1ee1bb 100644
--- a/msg.go
+++ b/msg.go
@@ -43,3 +43,13 @@ func (self Msg) GetPayloadByMove() DataStream {
func (self Msg) GetOpcode() Opcode {
return Opcode(C.msg_get_opcode(self.inner))
}
+
+// Get the magic number.
+func (self Msg) GetMagic() uint32 {
+ return uint32(C.msg_get_magic(self.inner))
+}
+
+// Set the magic number (the default value is 0x0).
+func (self Msg) SetMagic(magic uint32) {
+ C.msg_set_magic(self.inner, C.uint32_t(magic))
+}