From 6870eefd2ca075552433fdc50553e38dfa8d422a Mon Sep 17 00:00:00 2001 From: Alessandro Maggi Date: Tue, 6 Sep 2022 23:59:37 +0200 Subject: [PATCH 1/3] Fix semantics README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 985f7fa..269f673 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ -gogs is an simple, fast and lightweight game server framewrok written in golang. It is designed to be easy to use and easy to extend. It will generate logic code from protobuf files, and you can use it to develop your game server. It is also a good choice for you to learn golang. It support websocket and webrtc datachannel. +gogs is an simple, fast and lightweight game server framewrok written in golang. It is designed to be easy to use and easy to extend. It will generate logic code from protobuf files, and you can use it to develop your game server. It's also a good starting point for you to learn golang. It supports websocket and webrtc datachannel. --- From f61f3bdfb8b29c0d9cc5d55602c5ecc267cdb120 Mon Sep 17 00:00:00 2001 From: Alessandro Maggi Date: Wed, 7 Sep 2022 00:00:34 +0200 Subject: [PATCH 2/3] Fix typos and semantics README.md Section encode/decode --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 269f673..bf463aa 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ main.go ## How to encode/decode the message ### Packet Protocol -gogs use 8 bytes as the protocol header +gogs uses 8 bytes as the protocol header protocol header = flag + version + action index + message data length ``` @@ -122,7 +122,7 @@ BindUser action index = packetType <<22 | component <<16 | action = 2 << 22 | 1 BindSuccess action index = packetType <<22 | component <<16 | action = 2 << 22 | 1 << 16 | 2 = 0x810002 ### Packet encode & decode -gogs have three encode&decode type - ecodeType in protocol header +gogs has three encode&decode types - encodeType in protocol header - 0 json encode&decode without protocol header - 1 json encode&decode with protocol header - 2 protobuf encode&decode with protocol header @@ -133,7 +133,7 @@ gogs have three encode&decode type - ecodeType in protocol header message = **JSON binary data** -`gogs get the action index from message, then get the filed type and decode the message, then call the logic function. the json message without protocol header should add a filed named action, the value is the filed name` +`gogs retrieves the action index from the message, then gets the filed type and decodes the message, finally it calls the logic function. The json message without protocol header should add a filed named action, the value is the filed name` ```json { From 667b9e6083dd35a6061689b37090072ddbbec7df Mon Sep 17 00:00:00 2001 From: Alessandro Maggi Date: Wed, 7 Sep 2022 00:15:30 +0200 Subject: [PATCH 3/3] Fix typos README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bf463aa..0940906 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ -gogs is an simple, fast and lightweight game server framewrok written in golang. It is designed to be easy to use and easy to extend. It will generate logic code from protobuf files, and you can use it to develop your game server. It's also a good starting point for you to learn golang. It supports websocket and webrtc datachannel. +gogs is a simple, fast and lightweight game server framework written in golang. It is designed to be easy to use and easy to extend. It will generate logic code from protobuf files, and you can use it to develop your game server. It's also a good starting point for you to learn golang. It supports websocket and webrtc datachannel. ---