protobuf 按照最新文档更新
							parent
							
								
									7aa4aee2b9
								
							
						
					
					
						commit
						0335c9b918
					
				|  | @ -0,0 +1,40 @@ | ||||||
|  | # Copyright 2017 Google LLC All Rights Reserved. | ||||||
|  | # | ||||||
|  | # Licensed under the Apache License, Version 2.0 (the "License"); | ||||||
|  | # you may not use this file except in compliance with the License. | ||||||
|  | # You may obtain a copy of the License at | ||||||
|  | # | ||||||
|  | #     http://www.apache.org/licenses/LICENSE-2.0 | ||||||
|  | # | ||||||
|  | # Unless required by applicable law or agreed to in writing, software | ||||||
|  | # distributed under the License is distributed on an "AS IS" BASIS, | ||||||
|  | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||||
|  | # See the License for the specific language governing permissions and | ||||||
|  | # limitations under the License. | ||||||
|  | 
 | ||||||
|  | .idea | ||||||
|  | !.gitignore | ||||||
|  | !.helmignore | ||||||
|  | !.gitattributes | ||||||
|  | !.dockerignore | ||||||
|  | !.golangci.yml | ||||||
|  | !.gcloudignore | ||||||
|  | !.eslintrc.* | ||||||
|  | !.nycrc | ||||||
|  | !.clang-format | ||||||
|  | !.github | ||||||
|  | *.iml | ||||||
|  | bin | ||||||
|  | *.o | ||||||
|  | tmp | ||||||
|  | terraform.tfvars | ||||||
|  | terraform.tfstate* | ||||||
|  | kubeconfig | ||||||
|  | build/local-includes/* | ||||||
|  | build/allocation | ||||||
|  | !build/local-includes/README.md | ||||||
|  | /release | ||||||
|  | debug.test | ||||||
|  | obj | ||||||
|  | test/sdk/cpp/sdk/ | ||||||
|  | 
 | ||||||
|  | @ -0,0 +1,8 @@ | ||||||
|  | version: v1 | ||||||
|  | deps: | ||||||
|  | breaking: | ||||||
|  |   use: | ||||||
|  |     - FILE | ||||||
|  | lint: | ||||||
|  |   use: | ||||||
|  |     - DEFAULT | ||||||
|  | @ -0,0 +1,2 @@ | ||||||
|  | dof-gen: | ||||||
|  | 	buf generate messages.proto | ||||||
|  | @ -0,0 +1,5 @@ | ||||||
|  | # dof-gve 玩法数据交互 protobuf  | ||||||
|  | 
 | ||||||
|  | 参考文档: | ||||||
|  | 
 | ||||||
|  | https://docs.google.com/document/d/1HqIjaiMRcVs-JIzqhluMm2eLnmQ2FCs1MCw5s9nEkjs | ||||||
|  | @ -0,0 +1,4 @@ | ||||||
|  | version: v1 | ||||||
|  | plugins: | ||||||
|  |   - plugin: buf.build/protocolbuffers/go | ||||||
|  |     out: go | ||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										1225
									
								
								dof/messages.pb.go
								
								
								
								
							
							
						
						
									
										1225
									
								
								dof/messages.pb.go
								
								
								
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							|  | @ -1,78 +1,62 @@ | ||||||
|   |  | ||||||
| // Copyright 2019 Google LLC |  | ||||||
| // |  | ||||||
| // Licensed under the Apache License, Version 2.0 (the "License"); |  | ||||||
| // you may not use this file except in compliance with the License. |  | ||||||
| // You may obtain a copy of the License at |  | ||||||
| // |  | ||||||
| //     http://www.apache.org/licenses/LICENSE-2.0 |  | ||||||
| // |  | ||||||
| // Unless required by applicable law or agreed to in writing, software |  | ||||||
| // distributed under the License is distributed on an "AS IS" BASIS, |  | ||||||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |  | ||||||
| // See the License for the specific language governing permissions and |  | ||||||
| // limitations under the License. |  | ||||||
| 
 |  | ||||||
| syntax = "proto3"; | syntax = "proto3"; | ||||||
| package dofagon; | package dof; | ||||||
| option go_package = "github.com/castbox/guru-proto/dof/pb"; | option go_package = "./;pb"; | ||||||
| 
 | 
 | ||||||
|  | // ClientInitialize 服务端接收到 PlayerEnter 消息后发还给客户端的回执 | ||||||
| message ClientInitialize { | message ClientInitialize { | ||||||
|   int64 cid = 1; |   int64 cid = 1; | ||||||
|   string uid = 2; |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| message Memos { | // ClientMessage 客户端发送给服务端的消息类型 | ||||||
|   repeated Memo memos = 1; | message ClientMessage { | ||||||
| } |  | ||||||
| 
 |  | ||||||
| message Memo { |  | ||||||
|   oneof recipient { |  | ||||||
|     int64 to = 1; |  | ||||||
|     int64 everyone_but = 2; |  | ||||||
|     bool everyone = 3; |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
|   oneof actual { |   oneof actual { | ||||||
|     PlayerEnter player_enter = 10; |     PlayerEnter player_enter = 1; | ||||||
|     DownloadResource download_resource = 11; |     LevelPrepared level_prepared = 2; | ||||||
|     LevelPrepared level_prepared = 12; |     PointFound point_found = 3; | ||||||
|     GameStart game_start = 13; |     LevelEnd level_end = 4; | ||||||
|     PointFound point_found = 14; |     AllLevelEnd all_level_end = 5; | ||||||
|     LevelEnd level_end = 15; |     PlayerLeave player_leave = 6; | ||||||
|     AllLevelEnd all_level_end = 16; |  | ||||||
|     ScoreSettlement score_settlement = 17; |  | ||||||
|     PlayerLeave player_leave = 18; |  | ||||||
|   } |   } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| // 客户端发送给服务器的消息 | // ServerMessage 服务端发送给客户端的消息类型 | ||||||
|  | message ServerMessage { | ||||||
|  |   oneof actual { | ||||||
|  |     GameStart game_start = 1; | ||||||
|  |     LevalStart leval_start = 2; | ||||||
|  |     PointFound point_found = 3; | ||||||
|  |     GameFinish game_finish = 4; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | // PlayerEnter 客户端进入房间 | ||||||
| message PlayerEnter { | message PlayerEnter { | ||||||
|   int64 cid = 1;   |   string room_id = 1; | ||||||
|   string nick_name = 2; |   string uid = 2; | ||||||
|   string country = 3; |   string nick_name = 3; | ||||||
|  |   string country = 4; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| message LevelResource { | message LevelResource { | ||||||
|   string level = 1; |   string level = 1; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| message DownloadResource { | message GameStart { | ||||||
|   repeated LevelResource level_resource = 1; |   repeated LevelResource level_resource = 1; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| message LevelPrepared {   | message LevelPrepared { | ||||||
|   int64 cid = 1;   |   int64 cid = 1; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| message GameStart { | message LevalStart { | ||||||
|   int64 cid = 1;   |   string level = 1; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| message PointFound { | message PointFound { | ||||||
|   int64 cid = 1; |   int64 cid = 1; | ||||||
|   int64 point_id = 2; |   string level = 2; | ||||||
|   string level = 3; |   int64 point_id = 3; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| message LevelEnd { | message LevelEnd { | ||||||
|  | @ -84,13 +68,15 @@ message AllLevelEnd { | ||||||
|   int64 cid = 1; |   int64 cid = 1; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| // 结算,翻译成英文是settlement | message GameScore { | ||||||
| message ScoreSettlement { |   string uid = 1; | ||||||
|   int64 cid = 1; |  | ||||||
|   int64 score = 2; |   int64 score = 2; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | message GameFinish { | ||||||
|  |   repeated GameScore scores = 1; | ||||||
|  | } | ||||||
| 
 | 
 | ||||||
| message PlayerLeave { | message PlayerLeave { | ||||||
|   int64 cid = 1; |   int64 cid = 1; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -0,0 +1,5 @@ | ||||||
|  | module github.com/guru-proto | ||||||
|  | 
 | ||||||
|  | go 1.20 | ||||||
|  | 
 | ||||||
|  | require google.golang.org/protobuf v1.31.0 // indirect | ||||||
|  | @ -0,0 +1,6 @@ | ||||||
|  | github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= | ||||||
|  | github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= | ||||||
|  | golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= | ||||||
|  | google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= | ||||||
|  | google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= | ||||||
|  | google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= | ||||||
		Loading…
	
		Reference in New Issue