Skip to content

Commit

Permalink
merge from version1
Browse files Browse the repository at this point in the history
  • Loading branch information
hellodudu committed Oct 23, 2019
2 parents b339411 + 731d27a commit b22baf5
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
27 changes: 27 additions & 0 deletions game-service/world/world_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package world

import (
"encoding/binary"
"fmt"
"testing"

"github.com/gogo/protobuf/proto"
pb "github.com/hellodudu/Ultimate/proto"
)

func init() {

}

func TestUnmarshalRequestRank(t *testing.T) {

data := []byte{163, 2, 0, 0, 214, 57, 201, 199, 163, 2, 0, 0, 34, 0, 119, 111, 114, 108, 100, 95, 109, 101, 115, 115, 97, 103, 101, 46, 77, 85, 87, 95, 82, 101, 113, 117, 101, 115, 116, 65, 114, 101, 110, 97, 82, 97, 110, 107, 8, 146, 130, 128, 128, 160, 128, 192, 204, 19, 16, 4, 24, 6, 32, 238, 35, 40, 212, 134, 178, 237, 5, 50, 54, 8, 254, 131, 128, 128, 160, 128, 192, 164, 16, 18, 8, 230, 169, 153, 232, 156, 156, 194, 176, 26, 15, 83, 49, 45, 228, 184, 128, 230, 176, 148, 228, 184, 137, 230, 184, 133, 32, 206, 1, 40, 250, 212, 204, 136, 3, 48, 158, 1, 56, 124, 64, 172, 32, 50, 66, 8, 139, 136, 128, 128, 160, 128, 128, 182, 20, 18, 17, 233, 184, 162, 232, 175, 173, 230, 133, 149, 229, 144, 155, 229, 185, 180, 194, 176, 26, 17, 83, 49, 54, 49, 45, 229, 191, 131, 230, 131, 179, 228, 186, 139, 230, 136, 144, 32, 200, 1, 40, 133, 211, 133, 250, 2, 48, 247, 1, 56, 128, 1, 64, 172, 32, 50, 55, 8, 156, 135, 128, 128, 160, 128, 128, 234, 7, 18, 9, 231, 177, 179, 229, 164, 156, 231, 153, 189, 26, 15, 83, 49, 45, 228, 184, 137, 230, 184, 133, 230, 152, 190, 229, 140, 150, 32, 211, 1, 40, 183, 204, 188, 225, 2, 48, 151, 2, 56, 124, 64, 162, 32, 50, 60, 8, 195, 131, 128, 128, 160, 128, 192, 232, 16, 18, 12, 232, 130, 135, 228, 186, 139, 233, 128, 131, 233, 128, 184, 26, 17, 83, 49, 54, 49, 45, 233, 165, 174, 233, 169, 172, 230, 177, 159, 229, 141, 151, 32, 200, 1, 40, 142, 204, 182, 199, 2, 48, 155, 2, 56, 125, 64, 142, 32, 50, 63, 8, 149, 182, 128, 128, 160, 128, 128, 149, 16, 18, 15, 229, 166, 131, 228, 186, 166, 229, 144, 155, 230, 137, 128, 229, 177, 158, 26, 16, 83, 57, 55, 45, 229, 138, 159, 231, 155, 150, 229, 141, 131, 231, 167, 139, 32, 205, 1, 40, 154, 203, 153, 196, 2, 48, 158, 1, 56, 128, 1, 64, 250, 31, 50, 50, 8, 194, 140, 128, 128, 160, 128, 192, 182, 20, 18, 2, 206, 169, 26, 17, 83, 49, 54, 49, 45, 229, 191, 131, 230, 131, 179, 228, 186, 139, 230, 136, 144, 32, 200, 1, 40, 200, 196, 135, 183, 2, 48, 147, 1, 56, 89, 64, 250, 31, 50, 54, 8, 246, 137, 128, 128, 160, 128, 192, 224, 20, 18, 6, 232, 130, 165, 233, 184, 159, 26, 16, 83, 49, 55, 45, 231, 142, 137, 231, 190, 189, 229, 164, 169, 231, 169, 185, 32, 193, 1, 40, 233, 221, 214, 242, 2, 48, 148, 2, 56, 129, 1, 64, 250, 31, 50, 63, 8, 199, 182, 129, 128, 160, 128, 128, 240, 15, 18, 15, 230, 181, 129, 229, 185, 180, 230, 180, 151, 231, 155, 184, 230, 128, 157, 26, 16, 83, 51, 51, 45, 230, 184, 133, 233, 163, 142, 230, 152, 142, 230, 156, 136, 32, 209, 1, 40, 135, 222, 150, 251, 2, 48, 158, 2, 56, 128, 1, 64, 240, 31, 50, 62, 8, 143, 209, 128, 128, 160, 128, 192, 244, 7, 18, 15, 229, 134, 172, 229, 164, 169, 231, 154, 132, 229, 143, 182, 229, 173, 144, 26, 16, 83, 49, 55, 45, 233, 163, 142, 231, 148, 159, 230, 176, 180, 232, 181, 183, 32, 208, 1, 40, 137, 161, 234, 240, 2, 48, 206, 1, 56, 1, 64, 230, 31, 50, 61, 8, 173, 151, 128, 128, 160, 128, 128, 160, 16, 18, 15, 233, 154, 143, 229, 164, 156, 226, 152, 133, 232, 128, 140, 229, 174, 137, 26, 15, 83, 49, 45, 228, 184, 128, 230, 176, 148, 228, 184, 137, 230, 184, 133, 32, 205, 1, 40, 230, 177, 170, 232, 2, 48, 154, 2, 56, 118, 64, 230, 31}

newProto := &pb.MUW_RequestArenaRank{}
nameLen := binary.LittleEndian.Uint16(data[12 : 12+2])
if err := proto.Unmarshal(data[14+nameLen:], newProto); err != nil {
t.Error("Failed to parse MUW_RequestArenaRank", err)
}

fmt.Println("success unmarshal MUW_RequestArenaRank:", newProto)
}
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ require (
github.com/denisenkom/go-mssqldb v0.0.0-20190715232110-2b613d287457 // indirect
github.com/gammazero/workerpool v0.0.0-20190608213748-0ed5e40ec55e
github.com/go-ini/ini v1.44.0

github.com/golang/protobuf v1.3.2
github.com/google/go-cmp v0.3.1 // indirect
github.com/hellodudu/Ultimate/arena-service v0.0.0-20190924062254-b2fc9d6cf412 // indirect
Expand All @@ -32,7 +33,7 @@ require (
golang.org/x/sys v0.0.0-20190910064555-bbd175535a8b // indirect
google.golang.org/appengine v1.6.2 // indirect
google.golang.org/genproto v0.0.0-20190905072037-92dd089d5514 // indirect
google.golang.org/grpc v1.23.0 // indirect
google.golang.org/grpc v1.23.0
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
gopkg.in/ini.v1 v1.45.0 // indirect
gopkg.in/ldap.v2 v2.5.1 // indirect
Expand Down
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7a
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE=
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g=
Expand Down

0 comments on commit b22baf5

Please sign in to comment.