Skip to content

Commit

Permalink
[fix] fix fatal impl error in py code: PeekOpCode()
Browse files Browse the repository at this point in the history
- fix PeekOpCode in python code.
- update bmmo protocol.
  • Loading branch information
yyc12345 committed Aug 13, 2023
1 parent 65cc91a commit 4e9b325
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions examples/bmmo.bp
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,10 @@ natural reliable msg player_disconnected_msg {
gnsid connection_id;
}

narrow struct chat_body {
narrow reliable msg chat_msg {
gnsid player_id;
string chat_content;
}
narrow reliable msg chat_msg {
chat_body data;
}

// ============= v3.1 anti-cheat update chapter

Expand Down
2 changes: 1 addition & 1 deletion snippets/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def ReadOpCode(_ss: io.BytesIO) -> OpCode:
return _opcode
def PeekOpCode(_ss: io.BytesIO) -> OpCode:
(_opcode, ) = _opcode_packer.unpack(_ss.read(_opcode_packer.size))
_ss.seek(_opcode_packer.size, os.SEEK_CUR)
_ss.seek(-(_opcode_packer.size), os.SEEK_CUR)
return _opcode
def WriteOpCode(_opcode: OpCode, _ss: io.BytesIO):
_ss.write(_opcode_packer.pack(_opcode))
Expand Down

0 comments on commit 4e9b325

Please sign in to comment.