/
server.pb.go
1666 lines (1471 loc) · 54.1 KB
/
server.pb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.23.0
// protoc v3.19.4
// source: server.proto
package proto
import (
context "context"
proto "github.com/golang/protobuf/proto"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
type GameSnapshot_State int32
const (
// The game is waiting for all players be connected. There is a configurable time limit to wait for players. After
// this limit expires, the match is considered over.
GameSnapshot_WAITING GameSnapshot_State = 0
// The game resets the players position to start the match or to restart the match after a goal.
GameSnapshot_GET_READY GameSnapshot_State = 1
// The game is waiting for players orders. There is a configurable time window for this phase. After the time
// limit expires, the server will ignore the missing orders and process the ones it got.
// (when running on dev mode, the server may allow different behaviours)
GameSnapshot_LISTENING GameSnapshot_State = 2
// The game is executing the players' orders in the same sequence they were gotten.
// If the ball is NOT been holden, its velocity will be processed first. Otherwise, it position will be updated
// when the ball holder movement be processed.
// If there is no movement orders from a player, but it has speed greater than 0, it will be processed after
// all its orders are processed.
// Each player orders will be processed in the same sequence they were included in the message (e.g. first move,
// than kick)
// The ball kick is processed immediately after the order (the ball position is updated as its new velocity
// after the kick)
GameSnapshot_PLAYING GameSnapshot_State = 3
// The game interrupt the match to shift the ball possession. It happens only when the shot time is over (see
// shot_clock property). The ball will be given to the goalkeeper of the defense team, and the next state will
// "listening", so the bots will not have time to rearrange before the next turn.
GameSnapshot_SHIFTING GameSnapshot_State = 4
// The game may be over after any phase.
// It can be over after Waiting if there is no players connected after the time limit for connections
// It can be over after GetReady or Listening if there is no enough players (e.g. connection lost)
// And it also can be over after Playing state if that was the last turn of the match.
GameSnapshot_OVER GameSnapshot_State = 99
)
// Enum value maps for GameSnapshot_State.
var (
GameSnapshot_State_name = map[int32]string{
0: "WAITING",
1: "GET_READY",
2: "LISTENING",
3: "PLAYING",
4: "SHIFTING",
99: "OVER",
}
GameSnapshot_State_value = map[string]int32{
"WAITING": 0,
"GET_READY": 1,
"LISTENING": 2,
"PLAYING": 3,
"SHIFTING": 4,
"OVER": 99,
}
)
func (x GameSnapshot_State) Enum() *GameSnapshot_State {
p := new(GameSnapshot_State)
*p = x
return p
}
func (x GameSnapshot_State) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (GameSnapshot_State) Descriptor() protoreflect.EnumDescriptor {
return file_server_proto_enumTypes[0].Descriptor()
}
func (GameSnapshot_State) Type() protoreflect.EnumType {
return &file_server_proto_enumTypes[0]
}
func (x GameSnapshot_State) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use GameSnapshot_State.Descriptor instead.
func (GameSnapshot_State) EnumDescriptor() ([]byte, []int) {
return file_server_proto_rawDescGZIP(), []int{1, 0}
}
type Team_Side int32
const (
// Team playing on the left side of field
Team_HOME Team_Side = 0
// Team playing on the right side of the field
Team_AWAY Team_Side = 1
)
// Enum value maps for Team_Side.
var (
Team_Side_name = map[int32]string{
0: "HOME",
1: "AWAY",
}
Team_Side_value = map[string]int32{
"HOME": 0,
"AWAY": 1,
}
)
func (x Team_Side) Enum() *Team_Side {
p := new(Team_Side)
*p = x
return p
}
func (x Team_Side) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (Team_Side) Descriptor() protoreflect.EnumDescriptor {
return file_server_proto_enumTypes[1].Descriptor()
}
func (Team_Side) Type() protoreflect.EnumType {
return &file_server_proto_enumTypes[1]
}
func (x Team_Side) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use Team_Side.Descriptor instead.
func (Team_Side) EnumDescriptor() ([]byte, []int) {
return file_server_proto_rawDescGZIP(), []int{2, 0}
}
type OrderResponse_StatusCode int32
const (
OrderResponse_SUCCESS OrderResponse_StatusCode = 0
OrderResponse_UNKNOWN_PLAYER OrderResponse_StatusCode = 1
OrderResponse_NOT_LISTENING OrderResponse_StatusCode = 2
OrderResponse_WRONG_TURN OrderResponse_StatusCode = 3
OrderResponse_OTHER OrderResponse_StatusCode = 99
)
// Enum value maps for OrderResponse_StatusCode.
var (
OrderResponse_StatusCode_name = map[int32]string{
0: "SUCCESS",
1: "UNKNOWN_PLAYER",
2: "NOT_LISTENING",
3: "WRONG_TURN",
99: "OTHER",
}
OrderResponse_StatusCode_value = map[string]int32{
"SUCCESS": 0,
"UNKNOWN_PLAYER": 1,
"NOT_LISTENING": 2,
"WRONG_TURN": 3,
"OTHER": 99,
}
)
func (x OrderResponse_StatusCode) Enum() *OrderResponse_StatusCode {
p := new(OrderResponse_StatusCode)
*p = x
return p
}
func (x OrderResponse_StatusCode) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (OrderResponse_StatusCode) Descriptor() protoreflect.EnumDescriptor {
return file_server_proto_enumTypes[2].Descriptor()
}
func (OrderResponse_StatusCode) Type() protoreflect.EnumType {
return &file_server_proto_enumTypes[2]
}
func (x OrderResponse_StatusCode) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use OrderResponse_StatusCode.Descriptor instead.
func (OrderResponse_StatusCode) EnumDescriptor() ([]byte, []int) {
return file_server_proto_rawDescGZIP(), []int{6, 0}
}
// JoinRequest define the player configuration to the game.
type JoinRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Only used in official matches to guarantee that only one process will assume that player position (team and number).
// The bot process will receive this token as an argument, and must send it to the server in this message.
Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
// Identifies the protocol version of the bot.
ProtocolVersion string `protobuf:"bytes,2,opt,name=protocol_version,json=protocolVersion,proto3" json:"protocol_version,omitempty"`
// Identify the bot's team side (Team_Home or Team_Away)
TeamSide Team_Side `protobuf:"varint,3,opt,name=team_side,json=teamSide,proto3,enum=lugo.Team_Side" json:"team_side,omitempty"`
// Player's number 1-11
Number uint32 `protobuf:"varint,4,opt,name=number,proto3" json:"number,omitempty"`
// Position where the player must be set at "GetReady" state (at beginning of the match or after a goal)
InitPosition *Point `protobuf:"bytes,5,opt,name=init_position,json=initPosition,proto3" json:"init_position,omitempty"`
}
func (x *JoinRequest) Reset() {
*x = JoinRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_server_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *JoinRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*JoinRequest) ProtoMessage() {}
func (x *JoinRequest) ProtoReflect() protoreflect.Message {
mi := &file_server_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use JoinRequest.ProtoReflect.Descriptor instead.
func (*JoinRequest) Descriptor() ([]byte, []int) {
return file_server_proto_rawDescGZIP(), []int{0}
}
func (x *JoinRequest) GetToken() string {
if x != nil {
return x.Token
}
return ""
}
func (x *JoinRequest) GetProtocolVersion() string {
if x != nil {
return x.ProtocolVersion
}
return ""
}
func (x *JoinRequest) GetTeamSide() Team_Side {
if x != nil {
return x.TeamSide
}
return Team_HOME
}
func (x *JoinRequest) GetNumber() uint32 {
if x != nil {
return x.Number
}
return 0
}
func (x *JoinRequest) GetInitPosition() *Point {
if x != nil {
return x.InitPosition
}
return nil
}
// GameSnapshot stores all game elements data.
type GameSnapshot struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The game state defines which phase the game is. The phase determine what the server is doing, are going to do, or
// what it is waiting for.
State GameSnapshot_State `protobuf:"varint,1,opt,name=state,proto3,enum=lugo.GameSnapshot_State" json:"state,omitempty"`
// Turns counter. It starts from 1, but before the match starts, it may be zero.
Turn uint32 `protobuf:"varint,2,opt,name=turn,proto3" json:"turn,omitempty"`
// Store the home team elements.
HomeTeam *Team `protobuf:"bytes,3,opt,name=home_team,json=homeTeam,proto3" json:"home_team,omitempty"`
// Store the away team elements.
AwayTeam *Team `protobuf:"bytes,4,opt,name=away_team,json=awayTeam,proto3" json:"away_team,omitempty"`
// Store the ball element.
Ball *Ball `protobuf:"bytes,5,opt,name=ball,proto3" json:"ball,omitempty"`
// number of turns the ball is in a goal zone
TurnsBallInGoalZone uint32 `protobuf:"varint,6,opt,name=turns_ball_in_goal_zone,json=turnsBallInGoalZone,proto3" json:"turns_ball_in_goal_zone,omitempty"`
// Store the shot clock to control ball possession limit
ShotClock *ShotClock `protobuf:"bytes,7,opt,name=shot_clock,json=shotClock,proto3" json:"shot_clock,omitempty"`
}
func (x *GameSnapshot) Reset() {
*x = GameSnapshot{}
if protoimpl.UnsafeEnabled {
mi := &file_server_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GameSnapshot) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GameSnapshot) ProtoMessage() {}
func (x *GameSnapshot) ProtoReflect() protoreflect.Message {
mi := &file_server_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GameSnapshot.ProtoReflect.Descriptor instead.
func (*GameSnapshot) Descriptor() ([]byte, []int) {
return file_server_proto_rawDescGZIP(), []int{1}
}
func (x *GameSnapshot) GetState() GameSnapshot_State {
if x != nil {
return x.State
}
return GameSnapshot_WAITING
}
func (x *GameSnapshot) GetTurn() uint32 {
if x != nil {
return x.Turn
}
return 0
}
func (x *GameSnapshot) GetHomeTeam() *Team {
if x != nil {
return x.HomeTeam
}
return nil
}
func (x *GameSnapshot) GetAwayTeam() *Team {
if x != nil {
return x.AwayTeam
}
return nil
}
func (x *GameSnapshot) GetBall() *Ball {
if x != nil {
return x.Ball
}
return nil
}
func (x *GameSnapshot) GetTurnsBallInGoalZone() uint32 {
if x != nil {
return x.TurnsBallInGoalZone
}
return 0
}
func (x *GameSnapshot) GetShotClock() *ShotClock {
if x != nil {
return x.ShotClock
}
return nil
}
// Stores all team elements and data.
type Team struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// List of player in the team
Players []*Player `protobuf:"bytes,1,rep,name=players,proto3" json:"players,omitempty"`
// Team name
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
// Team score in the present turn
Score uint32 `protobuf:"varint,3,opt,name=score,proto3" json:"score,omitempty"`
// Side which the team is playing on.
Side Team_Side `protobuf:"varint,4,opt,name=side,proto3,enum=lugo.Team_Side" json:"side,omitempty"`
}
func (x *Team) Reset() {
*x = Team{}
if protoimpl.UnsafeEnabled {
mi := &file_server_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Team) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Team) ProtoMessage() {}
func (x *Team) ProtoReflect() protoreflect.Message {
mi := &file_server_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Team.ProtoReflect.Descriptor instead.
func (*Team) Descriptor() ([]byte, []int) {
return file_server_proto_rawDescGZIP(), []int{2}
}
func (x *Team) GetPlayers() []*Player {
if x != nil {
return x.Players
}
return nil
}
func (x *Team) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *Team) GetScore() uint32 {
if x != nil {
return x.Score
}
return 0
}
func (x *Team) GetSide() Team_Side {
if x != nil {
return x.Side
}
return Team_HOME
}
// Stores the side of the team in attack and the time remaining holding the ball.
// The team side is changed as soon a bot of the defense team catch the ball.
type ShotClock struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Team side of the team in attack.
TeamSide Team_Side `protobuf:"varint,6,opt,name=team_side,json=teamSide,proto3,enum=lugo.Team_Side" json:"team_side,omitempty"`
// Remaining turns the attack team may hold the ball
RemainingTurns uint32 `protobuf:"varint,7,opt,name=remaining_turns,json=remainingTurns,proto3" json:"remaining_turns,omitempty"`
}
func (x *ShotClock) Reset() {
*x = ShotClock{}
if protoimpl.UnsafeEnabled {
mi := &file_server_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ShotClock) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ShotClock) ProtoMessage() {}
func (x *ShotClock) ProtoReflect() protoreflect.Message {
mi := &file_server_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ShotClock.ProtoReflect.Descriptor instead.
func (*ShotClock) Descriptor() ([]byte, []int) {
return file_server_proto_rawDescGZIP(), []int{3}
}
func (x *ShotClock) GetTeamSide() Team_Side {
if x != nil {
return x.TeamSide
}
return Team_HOME
}
func (x *ShotClock) GetRemainingTurns() uint32 {
if x != nil {
return x.RemainingTurns
}
return 0
}
// Stores all player attributes
type Player struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Number of this player in its team (1-11)
Number uint32 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"`
// Current player position
Position *Point `protobuf:"bytes,2,opt,name=position,proto3" json:"position,omitempty"`
// Current player velocity
Velocity *Velocity `protobuf:"bytes,3,opt,name=velocity,proto3" json:"velocity,omitempty"`
// Team side which its playing in (it's used to speed up some readings since the player element will be in a list
// of players of a team)
TeamSide Team_Side `protobuf:"varint,4,opt,name=team_side,json=teamSide,proto3,enum=lugo.Team_Side" json:"team_side,omitempty"`
// Default position when it's position is reset
InitPosition *Point `protobuf:"bytes,5,opt,name=init_position,json=initPosition,proto3" json:"init_position,omitempty"`
}
func (x *Player) Reset() {
*x = Player{}
if protoimpl.UnsafeEnabled {
mi := &file_server_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Player) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Player) ProtoMessage() {}
func (x *Player) ProtoReflect() protoreflect.Message {
mi := &file_server_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Player.ProtoReflect.Descriptor instead.
func (*Player) Descriptor() ([]byte, []int) {
return file_server_proto_rawDescGZIP(), []int{4}
}
func (x *Player) GetNumber() uint32 {
if x != nil {
return x.Number
}
return 0
}
func (x *Player) GetPosition() *Point {
if x != nil {
return x.Position
}
return nil
}
func (x *Player) GetVelocity() *Velocity {
if x != nil {
return x.Velocity
}
return nil
}
func (x *Player) GetTeamSide() Team_Side {
if x != nil {
return x.TeamSide
}
return Team_HOME
}
func (x *Player) GetInitPosition() *Point {
if x != nil {
return x.InitPosition
}
return nil
}
// Stores all ball attributes
type Ball struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Current position
Position *Point `protobuf:"bytes,1,opt,name=position,proto3" json:"position,omitempty"`
// Current velocity. It will be the exactly same velocity as the ball holder when a player is holding it.
Velocity *Velocity `protobuf:"bytes,2,opt,name=velocity,proto3" json:"velocity,omitempty"`
// Player that is currently holding the ball. Null if the ball is not holden.
Holder *Player `protobuf:"bytes,3,opt,name=holder,proto3" json:"holder,omitempty"`
}
func (x *Ball) Reset() {
*x = Ball{}
if protoimpl.UnsafeEnabled {
mi := &file_server_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Ball) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Ball) ProtoMessage() {}
func (x *Ball) ProtoReflect() protoreflect.Message {
mi := &file_server_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Ball.ProtoReflect.Descriptor instead.
func (*Ball) Descriptor() ([]byte, []int) {
return file_server_proto_rawDescGZIP(), []int{5}
}
func (x *Ball) GetPosition() *Point {
if x != nil {
return x.Position
}
return nil
}
func (x *Ball) GetVelocity() *Velocity {
if x != nil {
return x.Velocity
}
return nil
}
func (x *Ball) GetHolder() *Player {
if x != nil {
return x.Holder
}
return nil
}
// Message sent to the player as a response after sending a order set to the the server.
type OrderResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Define if the order will be correctly processed.
Code OrderResponse_StatusCode `protobuf:"varint,1,opt,name=code,proto3,enum=lugo.OrderResponse_StatusCode" json:"code,omitempty"`
// String message used for debugging proposes.
Details string `protobuf:"bytes,2,opt,name=details,proto3" json:"details,omitempty"`
}
func (x *OrderResponse) Reset() {
*x = OrderResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_server_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *OrderResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*OrderResponse) ProtoMessage() {}
func (x *OrderResponse) ProtoReflect() protoreflect.Message {
mi := &file_server_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use OrderResponse.ProtoReflect.Descriptor instead.
func (*OrderResponse) Descriptor() ([]byte, []int) {
return file_server_proto_rawDescGZIP(), []int{6}
}
func (x *OrderResponse) GetCode() OrderResponse_StatusCode {
if x != nil {
return x.Code
}
return OrderResponse_SUCCESS
}
func (x *OrderResponse) GetDetails() string {
if x != nil {
return x.Details
}
return ""
}
// Message containing the orders the player want to send to the server in that turn.
type OrderSet struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Turn which this order set should be processed at.
Turn uint32 `protobuf:"varint,1,opt,name=turn,proto3" json:"turn,omitempty"`
// List of orders in the expected order of execution
Orders []*Order `protobuf:"bytes,2,rep,name=orders,proto3" json:"orders,omitempty"`
// String message used for debugging proposes.
DebugMessage string `protobuf:"bytes,3,opt,name=debug_message,json=debugMessage,proto3" json:"debug_message,omitempty"`
}
func (x *OrderSet) Reset() {
*x = OrderSet{}
if protoimpl.UnsafeEnabled {
mi := &file_server_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *OrderSet) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*OrderSet) ProtoMessage() {}
func (x *OrderSet) ProtoReflect() protoreflect.Message {
mi := &file_server_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use OrderSet.ProtoReflect.Descriptor instead.
func (*OrderSet) Descriptor() ([]byte, []int) {
return file_server_proto_rawDescGZIP(), []int{7}
}
func (x *OrderSet) GetTurn() uint32 {
if x != nil {
return x.Turn
}
return 0
}
func (x *OrderSet) GetOrders() []*Order {
if x != nil {
return x.Orders
}
return nil
}
func (x *OrderSet) GetDebugMessage() string {
if x != nil {
return x.DebugMessage
}
return ""
}
// Order to the game server. To be sent by players during the Listening phase.
type Order struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Types that are assignable to Action:
// *Order_Move
// *Order_Catch
// *Order_Kick
// *Order_Jump
Action isOrder_Action `protobuf_oneof:"action"`
}
func (x *Order) Reset() {
*x = Order{}
if protoimpl.UnsafeEnabled {
mi := &file_server_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Order) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Order) ProtoMessage() {}
func (x *Order) ProtoReflect() protoreflect.Message {
mi := &file_server_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Order.ProtoReflect.Descriptor instead.
func (*Order) Descriptor() ([]byte, []int) {
return file_server_proto_rawDescGZIP(), []int{8}
}
func (m *Order) GetAction() isOrder_Action {
if m != nil {
return m.Action
}
return nil
}
func (x *Order) GetMove() *Move {
if x, ok := x.GetAction().(*Order_Move); ok {
return x.Move
}
return nil
}
func (x *Order) GetCatch() *Catch {
if x, ok := x.GetAction().(*Order_Catch); ok {
return x.Catch
}
return nil
}
func (x *Order) GetKick() *Kick {
if x, ok := x.GetAction().(*Order_Kick); ok {
return x.Kick
}
return nil
}
func (x *Order) GetJump() *Jump {
if x, ok := x.GetAction().(*Order_Jump); ok {
return x.Jump
}
return nil
}
type isOrder_Action interface {
isOrder_Action()
}
type Order_Move struct {
Move *Move `protobuf:"bytes,1,opt,name=move,proto3,oneof"`
}
type Order_Catch struct {
Catch *Catch `protobuf:"bytes,2,opt,name=catch,proto3,oneof"`
}
type Order_Kick struct {
Kick *Kick `protobuf:"bytes,3,opt,name=kick,proto3,oneof"`
}
type Order_Jump struct {
Jump *Jump `protobuf:"bytes,4,opt,name=jump,proto3,oneof"`
}
func (*Order_Move) isOrder_Action() {}
func (*Order_Catch) isOrder_Action() {}
func (*Order_Kick) isOrder_Action() {}
func (*Order_Jump) isOrder_Action() {}
// Order to ask the server to change the player velocity (direction and speed).
// This order replaces the current player velocity, and the new velocity attribute will be immediately processed
// in that turn. There is a limit speed to the player. The server will cap the velocity if the request is higher than
// the limit.
type Move struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The nex Velocity
Velocity *Velocity `protobuf:"bytes,1,opt,name=velocity,proto3" json:"velocity,omitempty"`
}
func (x *Move) Reset() {
*x = Move{}
if protoimpl.UnsafeEnabled {
mi := &file_server_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Move) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Move) ProtoMessage() {}
func (x *Move) ProtoReflect() protoreflect.Message {
mi := &file_server_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Move.ProtoReflect.Descriptor instead.
func (*Move) Descriptor() ([]byte, []int) {
return file_server_proto_rawDescGZIP(), []int{9}
}
func (x *Move) GetVelocity() *Velocity {
if x != nil {
return x.Velocity
}
return nil
}
// Order to try to catch the ball. The player can only catch the ball when the player is touching the ball.
// Only one catching order can be executed in a turn. So, if more than one player try to catch the ball in the same
// turn, the first processed catch order will succeed, and the next ones will fail.
type Catch struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *Catch) Reset() {
*x = Catch{}
if protoimpl.UnsafeEnabled {
mi := &file_server_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Catch) String() string {
return protoimpl.X.MessageStringOf(x)
}