scene.proto 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. //版本
  2. syntax = "proto3";
  3. package scene;
  4. option java_multiple_files = true;
  5. // grpc插件生成的类的报名,随便写
  6. option java_package = "com.fdkk.fdkkmeta.grpc";
  7. // grpc的方法
  8. service SceneGrpcService {
  9. // rpc testMethod (SceneRequest) returns (SceneReply){}
  10. rpc getRoute (RouteRequest) returns (RouteReply){}
  11. rpc init (InitRequest) returns (NormalReply){}
  12. rpc rotate (RotateRequest) returns (NormalReply){}
  13. rpc move (MoveRequest) returns (MoveReply){}
  14. rpc getBreakPoint (BreakPointRequest) returns (BreakPointReply){}
  15. rpc joystick (JoystickRequest) returns (NormalReply){} //操作杆
  16. }
  17. // 全局对象
  18. message Point {
  19. string x=1; //应该换成double
  20. string y=2;
  21. string z=3;
  22. }
  23. // 全局对象
  24. message AngleUe4 {
  25. int32 pitch=1;
  26. int32 yaw=2;
  27. int32 roll=3;
  28. }
  29. // 全局对象
  30. message RouteArray{
  31. int32 id=1;
  32. Point location=2;
  33. }
  34. // getRoute入参对象
  35. message RouteRequest {
  36. Point s_location=1;
  37. Point e_location=2;
  38. string sceneCode=3;
  39. }
  40. // getRoute出参对象
  41. message RouteReply{
  42. repeated RouteArray in=1;
  43. }
  44. // // 入参对象
  45. // message SceneRequest {
  46. // string id=1;
  47. // string name=2;
  48. // }
  49. // // 出参对象
  50. // message SceneReply {
  51. // string res=1;
  52. // }
  53. /***********************************************************/
  54. message Space {
  55. Point position=1;
  56. AngleUe4 angle=2;
  57. }
  58. message State {
  59. string roomTypeId=1;
  60. int32 person=2;
  61. string avatarId=3;
  62. string skinId=4;
  63. string roomId=5;
  64. bool isHost=6;
  65. bool isFollowHost=7;
  66. string skinDataVersion=8;
  67. string avatarComponents=9;
  68. string nickName=10;
  69. int32 movingMode=11;
  70. string attitude=12;
  71. string areaName=13;
  72. string pathName=14;
  73. string pathId=15;
  74. int32 avatarSize=16;
  75. string extra=17;
  76. bool prioritySync=18;
  77. Space player=19;
  78. Space camera=20;
  79. Point cameraCenter=21;
  80. }
  81. message RenderInfo{
  82. int32 renderType=1;
  83. string videoFrame=2;
  84. int32 cameraStateType=3;
  85. int32 isMoving=4;
  86. int32 needIfr=5;
  87. int32 isVideo=6;
  88. int32 stillFrame=7;
  89. int32 isRotating=8;
  90. int32 isFollowing=9;
  91. repeated string clientPanoTitlesBitmap=10;
  92. string clientPanoTreceId=11;
  93. string prefetchVideoId=12;
  94. bool noMedia=13;
  95. }
  96. message Event{
  97. string id=1;
  98. int32 type =2;
  99. repeated Point points=3;
  100. string rotateEvent=4;
  101. string removeVisitorEvent=5;
  102. }
  103. message UserState{
  104. string userId=1;
  105. State playerState=2;
  106. RenderInfo renderInfo=3;
  107. Event event=4;
  108. int32 relation=5;
  109. }
  110. /***********************************************************/
  111. // init入参对象
  112. message InitRequest {
  113. string user_id=1;
  114. string nick_name=2;
  115. string skin_id=3;
  116. string avatar_id=4;
  117. string room_id=5;
  118. string app_id=6;
  119. }
  120. /**********************************************************/
  121. //全局对象,旋转的参数
  122. message rotation_action{
  123. int32 vertical_move=1;
  124. double horizontal_move=2;
  125. }
  126. // rotate入参对象
  127. message RotateRequest {
  128. int32 action_type=1;
  129. string rotation_action=2;
  130. string trace_id=3;
  131. string user_id=4;
  132. }
  133. /**********************************************************/
  134. //正常的反馈
  135. message NormalReply {
  136. repeated string traceIds=1;
  137. string vehicle=2;
  138. repeated UserState newUserStates=3;
  139. repeated int32 actionResponses=4;
  140. int32 getStateType=5;
  141. int32 code=6;
  142. string msg=7;
  143. string frameSrc=8; //视频路径
  144. }
  145. /**********************************************************/
  146. //
  147. message ClickingAction {
  148. Point clicking_point=1;
  149. int32 clicking_type=2;
  150. string extra=3;
  151. string attitude=4;
  152. }
  153. message MoveRequest {
  154. int32 action_type=1;
  155. ClickingAction clicking_action=2;
  156. State clicking_state=3;
  157. string trace_id=4;
  158. string user_id=5;
  159. }
  160. // 开始请求漫游
  161. message StartMoveRequest {
  162. int32 action_type=1;
  163. ClickingAction clicking_action=2;
  164. State clicking_state=3;
  165. string trace_id=4;
  166. string user_id=5;
  167. }
  168. // 请求移动下一段
  169. message MoveNextNeighborRequest {
  170. int32 user_id=1;
  171. string trace_id=2;
  172. bool next=3;
  173. }
  174. // 结束移动下一段(一般是有新的请求)
  175. message EndMoveNextNeighborRequest {
  176. int32 user_id=1;
  177. string trace_id=2;
  178. bool next=3;
  179. }
  180. // move出参对象
  181. // 这需要自定义
  182. message MoveReply {
  183. repeated string traceIds=1;
  184. string vehicle=2;
  185. repeated UserState newUserStates=3; //自己的话,不要有player,camera和cameraCenter。自己对应的这三个属性在8,9,10上,到webrtc服务器上组装
  186. repeated int32 actionResponses=4;
  187. int32 getStateType=5;
  188. int32 code=6;
  189. string msg=7;
  190. //每一段的人物和相机坐标,第一段可能还有初始旋转
  191. repeated Space player=8;
  192. repeated Space camera=9;
  193. repeated Point cameraCenter=10;
  194. bool isEnd=11; //false表示可以继续移动,true表示这次移动已经结束
  195. }
  196. /**********************************************************/
  197. /**********************************************************/
  198. message DirAction{
  199. int32 move_angle=1;
  200. int32 speed_level=2;
  201. }
  202. //控制杆移动
  203. message JoystickRequest {
  204. int32 action_type=1;
  205. DirAction dir_action=2;
  206. string trace_id=3;
  207. string user_id=4;
  208. string packet_id=5;
  209. }
  210. /**********************************************************/
  211. /**********************************************************/
  212. message NeighborPointsAction{
  213. Point point=1;
  214. int32 level=2;
  215. bool containSelf=3;
  216. int32 searchRange=4;
  217. }
  218. // move入参对象
  219. message BreakPointRequest{
  220. int32 action_type=1;
  221. NeighborPointsAction get_neighbor_points_action=2;
  222. string trace_id=3;
  223. string user_id=4;
  224. }
  225. // move出参对象
  226. message BreakPointReply {
  227. int32 actionType=1;
  228. int32 pointType=2;
  229. string extra=3;
  230. string traceId=4;
  231. string packetId=5;
  232. repeated Point nps=6;
  233. int32 peopleNum=7;
  234. string zoneId=8;
  235. string echoMsg=9;
  236. string reserveDetail=10;
  237. repeated string userWithAvatarList=11;
  238. repeated UserState newUserStates=12;
  239. int32 code=13;
  240. string msg=14;
  241. }
  242. /**********************************************************/