File: pokerth.proto

package info (click to toggle)
pokerth 1.1.2-1
  • links: PTS
  • area: main
  • in suites: buster, sid
  • size: 57,920 kB
  • sloc: ansic: 83,615; cpp: 64,151; java: 3,135; xml: 596; sh: 221; makefile: 7
file content (921 lines) | stat: -rw-r--r-- 27,623 bytes parent folder | download
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
/*****************************************************************************
 * PokerTH - The open source texas holdem engine                             *
 * Copyright (C) 2006-2013 Felix Hammer, Florian Thauer, Lothar May          *
 *                                                                           *
 * This program is free software: you can redistribute it and/or modify      *
 * it under the terms of the GNU Affero General Public License as            *
 * published by the Free Software Foundation, either version 3 of the        *
 * License, or (at your option) any later version.                           *
 *                                                                           *
 * This program is distributed in the hope that it will be useful,           *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of            *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             *
 * GNU Affero General Public License for more details.                       *
 *                                                                           *
 * You should have received a copy of the GNU Affero General Public License  *
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.     *
 *                                                                           *
 *                                                                           *
 * Additional permission under GNU AGPL version 3 section 7                  *
 *                                                                           *
 * If you modify this program, or any covered work, by linking or            *
 * combining it with the OpenSSL project's OpenSSL library (or a             *
 * modified version of that library), containing parts covered by the        *
 * terms of the OpenSSL or SSLeay licenses, the authors of PokerTH           *
 * (Felix Hammer, Florian Thauer, Lothar May) grant you additional           *
 * permission to convey the resulting work.                                  *
 * Corresponding Source for a non-source form of such a combination          *
 * shall include the source code for the parts of OpenSSL used as well       *
 * as that of the covered work.                                              *
 *****************************************************************************/

option java_package = "de.pokerth.protocol";
option java_outer_classname = "ProtoBuf";
option optimize_for = LITE_RUNTIME;

// Enumerations used by several messages.

enum NetGameMode {
	netGameCreated = 1;
	netGameStarted = 2;
	netGameClosed = 3;
}

enum NetGameState {
	netStatePreflop = 0;
	netStateFlop = 1;
	netStateTurn = 2;
	netStateRiver = 3;
	netStatePreflopSmallBlind = 4;
	netStatePreflopBigBlind = 5;
}

enum NetPlayerAction {
	netActionNone = 0;
	netActionFold = 1;
	netActionCheck = 2;
	netActionCall = 3;
	netActionBet = 4;
	netActionRaise = 5;
	netActionAllIn = 6;
}

enum NetPlayerState {
	netPlayerStateNormal = 0;
	netPlayerStateSessionInactive = 1;
	netPlayerStateNoMoney = 2;
}

enum NetPlayerInfoRights {
	netPlayerRightsGuest = 1;
	netPlayerRightsNormal = 2;
	netPlayerRightsAdmin = 3;
}

enum NetAvatarType {
	netAvatarImagePng = 1;
	netAvatarImageJpg = 2;
	netAvatarImageGif = 3;
}

// Message part containing game information.

message NetGameInfo {
	required	string			gameName = 1;
	enum NetGameType {
		normalGame = 1;
		registeredOnlyGame = 2;
		inviteOnlyGame = 3;
		rankingGame = 4;
	}
	required	NetGameType		netGameType = 2;
	required	uint32			maxNumPlayers = 3;
	enum RaiseIntervalMode {
		raiseOnHandNum = 1;
		raiseOnMinutes = 2;
	}
	required	RaiseIntervalMode	raiseIntervalMode = 4;
	optional	uint32			raiseEveryHands = 5;
	optional	uint32			raiseEveryMinutes = 6;
	enum EndRaiseMode {
		doubleBlinds = 1;
		raiseByEndValue = 2;
		keepLastBlind = 3;
	}
	required	EndRaiseMode	endRaiseMode = 7;
	optional	uint32			endRaiseSmallBlindValue = 8;
	required	uint32			proposedGuiSpeed = 9;
	required	uint32			delayBetweenHands = 10; // These are seconds
	required	uint32			playerActionTimeout = 11; // These are seconds
	required	uint32			firstSmallBlind = 12;
	required	uint32			startMoney = 13;
	repeated	uint32			manualBlinds = 14 [packed = true];
	optional	bool			allowSpectators = 15 [default = true];
}

// Message Part containing player result.

message PlayerResult {
	required	uint32			playerId = 1;
	required	uint32			resultCard1 = 2;
	required	uint32			resultCard2 = 3;
	repeated	uint32			bestHandPosition = 4 [packed = true];
	required	uint32			moneyWon = 5;
	required	uint32			playerMoney = 6;
	optional	uint32			cardsValue = 7;
}


// All messages used in the network protocol.

message AnnounceMessage {
	message Version {
		required	uint32		majorVersion = 1;
		required	uint32		minorVersion = 2;
	}
	required	Version			protocolVersion = 1;
	required	Version			latestGameVersion = 2;
	required	uint32			latestBetaRevision = 3;
	enum ServerType {
		serverTypeLAN = 0;
		serverTypeInternetNoAuth = 1;
		serverTypeInternetAuth = 2;
	}
	required	ServerType		serverType = 4;
	required	uint32			numPlayersOnServer = 5;
}

// buildId contains a constant build id (specific for Windows/Linux/Mac builds)
message InitMessage {
	required	AnnounceMessage.Version		requestedVersion = 1;
	required	uint32			buildId = 2;
	optional	bytes			myLastSessionId = 3;
	optional	string			authServerPassword = 4;
	enum LoginType {
		guestLogin = 0;
		authenticatedLogin = 1;
		unauthenticatedLogin = 2;
	}
	required	LoginType		login = 5;
	// Only used for guest login or unauthenticated login.
	optional	string			nickName = 6;
	// Authenticated login data is according to SCRAM SHA-1
	optional	bytes			clientUserData = 7;
	// Ignored for guest login.
	optional	bytes			avatarHash = 8;
}

message AuthServerChallengeMessage {
	required	bytes			serverChallenge = 1;
}

message AuthClientResponseMessage {
	required	bytes			clientResponse = 1;
}

message AuthServerVerificationMessage {
	required	bytes			serverVerification = 1;
}

message InitAckMessage {
	required	bytes			yourSessionId = 1;
	required	uint32			yourPlayerId = 2;
	optional	bytes			yourAvatarHash = 3;
	optional	uint32			rejoinGameId = 4;
}

message AvatarRequestMessage {
	required	uint32			requestId = 1;
	required	bytes			avatarHash = 2;
}

message AvatarHeaderMessage {
	required	uint32			requestId = 1;
	required	NetAvatarType	avatarType = 2;
	required	uint32			avatarSize = 3;
}

message AvatarDataMessage {
	required	uint32			requestId = 1;
	required	bytes			avatarBlock = 2;
}

message AvatarEndMessage {
	required	uint32			requestId = 1;
}

message UnknownAvatarMessage {
	required	uint32			requestId = 1;
}

message PlayerListMessage {
	required	uint32			playerId = 1;
	enum PlayerListNotification {
		playerListNew = 0;
		playerListLeft = 1;
	}
	required	PlayerListNotification	playerListNotification = 2;
}

message GameListNewMessage {
	required	uint32			gameId = 1;
	required	NetGameMode		gameMode = 2;
	required	bool			isPrivate = 3;
	repeated	uint32			playerIds = 4 [packed = true];
	required	uint32			adminPlayerId = 5;
	required	NetGameInfo		gameInfo = 6;
	repeated	uint32			spectatorIds = 7 [packed = true];
}

message GameListUpdateMessage {
	required	uint32			gameId = 1;
	required	NetGameMode		gameMode = 2;
}

message GameListPlayerJoinedMessage {
	required	uint32			gameId = 1;
	required	uint32			playerId = 2;
}

message GameListPlayerLeftMessage {
	required	uint32			gameId = 1;
	required	uint32			playerId = 2;
}

message GameListSpectatorJoinedMessage {
	required	uint32			gameId = 1;
	required	uint32			playerId = 2;
}

message GameListSpectatorLeftMessage {
	required	uint32			gameId = 1;
	required	uint32			playerId = 2;
}

message GameListAdminChangedMessage {
	required	uint32			gameId = 1;
	required	uint32			newAdminPlayerId = 2;
}

message PlayerInfoRequestMessage {
	repeated	uint32			playerId = 1 [packed = true];
}

message PlayerInfoReplyMessage {
	required	uint32			playerId = 1;
	message PlayerInfoData {
		required	string			playerName = 1;
		required	bool			isHuman = 2;
		required	NetPlayerInfoRights	playerRights = 3;
		optional	string			countryCode = 4;
		message AvatarData {
			required	NetAvatarType	avatarType = 1;
			required	bytes			avatarHash = 2;
		}
		optional	AvatarData		avatarData = 5;
	}
	optional	PlayerInfoData	playerInfoData = 2;
}

// The following request will not be confirmed by the server. It is used,
// optionally, to reduce server traffic. The server might ignore it.
message SubscriptionRequestMessage {
	enum SubscriptionAction {
		unsubscribeGameList = 1;
		resubscribeGameList = 2;
	}
	required	SubscriptionAction	subscriptionAction = 1;
}

message JoinExistingGameMessage {
	required	uint32			gameId = 1;
	optional	string			password = 2;
	optional	bool			autoLeave = 3 [default = false];
	optional	bool			spectateOnly = 4 [default = false];
}

message JoinNewGameMessage {
	required	NetGameInfo		gameInfo = 1;
	optional	string			password = 2;
	optional	bool			autoLeave = 3;
}

message RejoinExistingGameMessage {
	required	uint32			gameId = 1;
	optional	bool			autoLeave = 2;
}

message JoinGameAckMessage {
	required	uint32			gameId = 1;
	required	bool			areYouGameAdmin = 2;
	required	NetGameInfo		gameInfo = 3;
	optional	bool			spectateOnly = 4;
}

message JoinGameFailedMessage {
	required	uint32			gameId = 1;
	enum JoinGameFailureReason {
		invalidGame = 1;
		gameIsFull = 2;
		gameIsRunning = 3;
		invalidPassword = 4;
		notAllowedAsGuest = 5;
		notInvited = 6;
		gameNameInUse = 7;
		badGameName = 8;
		invalidSettings = 9;
		ipAddressBlocked = 10;
		rejoinFailed = 11;
		noSpectatorsAllowed = 12;
	}
	required	JoinGameFailureReason	joinGameFailureReason = 2;
}

message GamePlayerJoinedMessage {
	required	uint32			gameId = 1;
	required	uint32			playerId = 2;
	required	bool			isGameAdmin = 3;
}

message GamePlayerLeftMessage {
	required	uint32			gameId = 1;
	required	uint32			playerId = 2;
	enum GamePlayerLeftReason {
		leftOnRequest = 0;
		leftKicked = 1;
		leftError = 2;
	}
	required	GamePlayerLeftReason	gamePlayerLeftReason = 3;
}

message GameSpectatorJoinedMessage {
	required	uint32			gameId = 1;
	required	uint32			playerId = 2;
}

message GameSpectatorLeftMessage {
	required	uint32			gameId = 1;
	required	uint32			playerId = 2;
	required	GamePlayerLeftMessage.GamePlayerLeftReason	gameSpectatorLeftReason = 3;
}

message GameAdminChangedMessage {
	required	uint32			gameId = 1;
	required	uint32			newAdminPlayerId = 2;
}

message RemovedFromGameMessage {
	required	uint32			gameId = 1;
	enum RemovedFromGameReason {
		removedOnRequest = 0; // No error, client wished to leave.
		kickedFromGame = 1;
		gameIsFull = 2;
		gameIsRunning = 3;
		gameTimeout = 4;
		removedStartFailed = 5;
		gameClosed = 6;
	}
	required	RemovedFromGameReason	removedFromGameReason = 2;
}

message KickPlayerRequestMessage {
	required	uint32			gameId = 1;
	required	uint32			playerId = 2;
}

message LeaveGameRequestMessage {
	required	uint32			gameId = 1;
}

message InvitePlayerToGameMessage {
	required	uint32			gameId = 1;
	required	uint32			playerId = 2;
}

message InviteNotifyMessage {
	required	uint32			gameId = 1;
	required	uint32			playerIdWho = 2;
	required	uint32			playerIdByWhom = 3;
}

message RejectGameInvitationMessage {
	required	uint32			gameId = 1;
	enum RejectGameInvReason {
		rejectReasonNo = 0;
		rejectReasonBusy = 1;
	}
	required	RejectGameInvReason	myRejectReason = 2;
}

message RejectInvNotifyMessage {
	required	uint32			gameId = 1;
	required	uint32			playerId = 2;
	required	RejectGameInvitationMessage.RejectGameInvReason	playerRejectReason = 3;
}

message StartEventMessage {
	required	uint32			gameId = 1;
	enum StartEventType {
		startEvent = 0;
		rejoinEvent = 1;
	}
	required	StartEventType	startEventType = 2;
	optional	bool			fillWithComputerPlayers = 3;
}

message StartEventAckMessage {
	required	uint32			gameId = 1;
}

message GameStartInitialMessage {
	required	uint32			gameId = 1;
	required	uint32			startDealerPlayerId = 2;
	repeated	uint32			playerSeats = 3 [packed = true];
}

message GameStartRejoinMessage {
	required	uint32			gameId = 1;
	required	uint32			startDealerPlayerId = 2;
	required	uint32			handNum = 3;
	message RejoinPlayerData {
		required	uint32			playerId = 1;
		required	uint32			playerMoney = 2;
	}
	repeated	RejoinPlayerData	rejoinPlayerData = 4;
}

message HandStartMessage {
	required	uint32			gameId = 1;
	message PlainCards {
		required	uint32			plainCard1 = 1;
		required	uint32			plainCard2 = 2;
	}
	optional	PlainCards		plainCards = 2;
	optional	bytes			encryptedCards = 3;
	required	uint32			smallBlind = 4;
	repeated	NetPlayerState	seatStates = 5;
	optional	uint32			dealerPlayerId = 6;
}

message PlayersTurnMessage {
	required	uint32			gameId = 1;
	required	uint32			playerId = 2;
	required	NetGameState	gameState = 3;
}

message MyActionRequestMessage {
	required	uint32			gameId = 1;
	required	uint32			handNum = 2;
	required	NetGameState	gameState = 3;
	required	NetPlayerAction	myAction = 4;
	required	uint32			myRelativeBet = 5;
}

message YourActionRejectedMessage {
	required	uint32			gameId = 1;
	required	NetGameState	gameState = 2;
	required	NetPlayerAction	yourAction = 3;
	required	uint32			yourRelativeBet = 4;
	enum RejectionReason {
		rejectedInvalidGameState = 1;
		rejectedNotYourTurn = 2;
		rejectedActionNotAllowed = 3;
	}
	required	RejectionReason	rejectionReason = 5;
}

message PlayersActionDoneMessage {
	required	uint32			gameId = 1;
	required	uint32			playerId = 2;
	required	NetGameState	gameState = 3;
	required	NetPlayerAction	playerAction = 4;
	required	uint32			totalPlayerBet = 5;
	required	uint32			playerMoney = 6;
	required	uint32			highestSet = 7;
	required	uint32			minimumRaise = 8;
}

message DealFlopCardsMessage {
	required	uint32			gameId = 1;
	required	uint32			flopCard1 = 2;
	required	uint32			flopCard2 = 3;
	required	uint32			flopCard3 = 4;
}

message DealTurnCardMessage {
	required	uint32			gameId = 1;
	required	uint32			turnCard = 2;
}

message DealRiverCardMessage {
	required	uint32			gameId = 1;
	required	uint32			riverCard = 2;
}

message AllInShowCardsMessage {
	required	uint32			gameId = 1;
	message PlayerAllIn {
		required	uint32			playerId = 1;
		required	uint32			allInCard1 = 2;
		required	uint32			allInCard2 = 3;
	}
	repeated	PlayerAllIn		playersAllIn = 2;
}

message EndOfHandShowCardsMessage {
	required	uint32			gameId = 1;
	repeated	PlayerResult	playerResults = 2;
}

message EndOfHandHideCardsMessage {
	required	uint32			gameId = 1;
	required	uint32			playerId = 2;
	required	uint32			moneyWon = 3;
	required	uint32			playerMoney = 4;
}

message ShowMyCardsRequestMessage {
}

message AfterHandShowCardsMessage {
	required	PlayerResult	playerResult = 1;
}

message EndOfGameMessage {
	required	uint32			gameId = 1;
	required	uint32			winnerPlayerId = 2;
}

message PlayerIdChangedMessage {
	required	uint32			oldPlayerId = 1;
	required	uint32			newPlayerId = 2;
}

message AskKickPlayerMessage {
	required	uint32			gameId = 1;
	required	uint32			playerId = 2;
}

message AskKickDeniedMessage {
	required	uint32			gameId = 1;
	required	uint32			playerId = 2;
	enum KickDeniedReason {
		kickDeniedInvalidGameState = 0;
		kickDeniedNotPossible = 1;
		kickDeniedTryAgainLater = 2;
		kickDeniedAlreadyInProgress = 3;
		kickDeniedInvalidPlayerId = 4;
	}
	required	KickDeniedReason	kickDeniedReason = 3;
}

message StartKickPetitionMessage {
	required	uint32			gameId = 1;
	required	uint32			petitionId = 2;
	required	uint32			proposingPlayerId = 3;
	required	uint32			kickPlayerId = 4;
	required	uint32			kickTimeoutSec = 5;
	required	uint32			numVotesNeededToKick = 6;
}

message VoteKickRequestMessage {
	required	uint32			gameId = 1;
	required	uint32			petitionId = 2;
	required	bool			voteKick = 3;
}

message VoteKickReplyMessage {
	required	uint32			gameId = 1;
	required	uint32			petitionId = 2;
	enum VoteKickReplyType {
		voteKickAck = 0;
		voteKickDeniedInvalid = 1;
		voteKickDeniedAlreadyVoted = 2;
	}
	required	VoteKickReplyType	voteKickReplyType = 3;
}

message KickPetitionUpdateMessage {
	required	uint32			gameId = 1;
	required	uint32			petitionId = 2;
	required	uint32			numVotesAgainstKicking = 3;
	required	uint32			numVotesInFavourOfKicking = 4;
	required	uint32			numVotesNeededToKick = 5;
}

message EndKickPetitionMessage {
	required	uint32			gameId = 1;
	required	uint32			petitionId = 2;
	required	uint32			numVotesAgainstKicking = 3;
	required	uint32			numVotesInFavourOfKicking = 4;
	required	uint32			resultPlayerKicked = 5;
	enum PetitionEndReason {
		petitionEndEnoughVotes = 0;
		petitionEndTooFewPlayers = 1;
		petitionEndPlayerLeft = 2;
		petitionEndTimeout = 3;
	}
	required	PetitionEndReason	petitionEndReason = 6;
}

message StatisticsMessage {
	message StatisticsData {
		enum StatisticsType {
			statNumberOfPlayers = 1;
		}
		required	StatisticsType	statisticsType = 1;
		required	uint32			statisticsValue = 2;
	}
	repeated	StatisticsData	statisticsData = 1;
}

message ChatRequestMessage {
	optional	uint32			targetGameId = 1;
	optional	uint32			targetPlayerId = 2;
	required	string			chatText = 3;
}

message ChatMessage {
	optional	uint32			gameId = 1;
	optional	uint32			playerId = 2;
	enum ChatType {
		chatTypeLobby = 0;
		chatTypeGame = 1;
		chatTypeBot = 2;
		chatTypeBroadcast = 3;
		chatTypePrivate = 4;
	}
	required	ChatType		chatType = 3;
	required	string			chatText = 4;
}

message ChatRejectMessage {
	required	string			chatText = 1;
}

message DialogMessage {
	required	string			notificationText = 1;
}

message TimeoutWarningMessage {
	enum TimeoutReason {
		timeoutNoDataReceived = 0;
		timeoutInactiveGame = 1;
		timeoutKickAfterAutofold = 2;
	}
	required	TimeoutReason	timeoutReason = 1;
	required	uint32			remainingSeconds = 2;
}

message ResetTimeoutMessage {
}

message ReportAvatarMessage {
	required	uint32			reportedPlayerId = 1;
	required	bytes			reportedAvatarHash = 2;
}

message ReportAvatarAckMessage {
	required	uint32			reportedPlayerId = 1;
	enum ReportAvatarResult {
		avatarReportAccepted = 0;
		avatarReportDuplicate = 1;
		avatarReportInvalid = 2;
	}
	required	ReportAvatarResult	reportAvatarResult = 2;
}

message ReportGameMessage {
	required	uint32			reportedGameId = 1;
}

message ReportGameAckMessage {
	required	uint32			reportedGameId = 1;
	enum ReportGameResult {
		gameReportAccepted = 0;
		gameReportDuplicate = 1;
		gameReportInvalid = 2;
	}
	required	ReportGameResult	reportGameResult = 2;
}

message ErrorMessage {
	enum ErrorReason {
		custReserved = 0;
		initVersionNotSupported = 1;
		initServerFull = 2;
		initAuthFailure = 3;
		initPlayerNameInUse = 4;
		initInvalidPlayerName = 5;
		initServerMaintenance = 6;
		initBlocked = 7;
		avatarTooLarge = 8;
		invalidPacket = 9;
		invalidState = 10;
		kickedFromServer = 11;
		bannedFromServer = 12;
		blockedByServer = 13;
		sessionTimeout = 14;
	}
	required	ErrorReason		errorReason = 1;
}

message AdminRemoveGameMessage {
	required	uint32			removeGameId = 1;
}

message AdminRemoveGameAckMessage {
	required	uint32			removeGameId = 1;
	enum AdminRemoveGameResult {
		gameRemoveAccepted = 0;
		gameRemoveInvalid = 1;
	}
	required	AdminRemoveGameResult	removeGameResult = 2;
}

message AdminBanPlayerMessage {
	required	uint32			banPlayerId = 1;
}

message AdminBanPlayerAckMessage {
	required	uint32			banPlayerId = 1;
	enum AdminBanPlayerResult {
		banPlayerAccepted = 0;
		banPlayerPending = 1;
		banPlayerNoDB = 2;
		banPlayerDBError = 3;
		banPlayerInvalid = 4;
	}
	required	AdminBanPlayerResult	banPlayerResult = 2;
}

// The main message type (it is prefixed by 4 bytes length of the message).

message PokerTHMessage {
	enum PokerTHMessageType {
		Type_AnnounceMessage = 1;
		Type_InitMessage = 2;
		Type_AuthServerChallengeMessage = 3;
		Type_AuthClientResponseMessage = 4;
		Type_AuthServerVerificationMessage = 5;
		Type_InitAckMessage = 6;
		Type_AvatarRequestMessage = 7;
		Type_AvatarHeaderMessage = 8;
		Type_AvatarDataMessage = 9;
		Type_AvatarEndMessage = 10;
		Type_UnknownAvatarMessage = 11;
		Type_PlayerListMessage = 12;
		Type_GameListNewMessage = 13;
		Type_GameListUpdateMessage = 14;
		Type_GameListPlayerJoinedMessage = 15;
		Type_GameListPlayerLeftMessage = 16;
		Type_GameListAdminChangedMessage = 17;
		Type_PlayerInfoRequestMessage = 18;
		Type_PlayerInfoReplyMessage = 19;
		Type_SubscriptionRequestMessage = 20;
		Type_JoinExistingGameMessage = 21;
		Type_JoinNewGameMessage = 22;
		Type_RejoinExistingGameMessage = 23;
		Type_JoinGameAckMessage = 24;
		Type_JoinGameFailedMessage = 25;
		Type_GamePlayerJoinedMessage = 26;
		Type_GamePlayerLeftMessage = 27;
		Type_GameAdminChangedMessage = 28;
		Type_RemovedFromGameMessage = 29;
		Type_KickPlayerRequestMessage = 30;
		Type_LeaveGameRequestMessage = 31;
		Type_InvitePlayerToGameMessage = 32;
		Type_InviteNotifyMessage = 33;
		Type_RejectGameInvitationMessage = 34;
		Type_RejectInvNotifyMessage = 35;
		Type_StartEventMessage = 36;
		Type_StartEventAckMessage = 37;
		Type_GameStartInitialMessage = 38;
		Type_GameStartRejoinMessage = 39;
		Type_HandStartMessage = 40;
		Type_PlayersTurnMessage = 41;
		Type_MyActionRequestMessage = 42;
		Type_YourActionRejectedMessage = 43;
		Type_PlayersActionDoneMessage = 44;
		Type_DealFlopCardsMessage = 45;
		Type_DealTurnCardMessage = 46;
		Type_DealRiverCardMessage = 47;
		Type_AllInShowCardsMessage = 48;
		Type_EndOfHandShowCardsMessage = 49;
		Type_EndOfHandHideCardsMessage = 50;
		Type_ShowMyCardsRequestMessage = 51;
		Type_AfterHandShowCardsMessage = 52;
		Type_EndOfGameMessage = 53;
		Type_PlayerIdChangedMessage = 54;
		Type_AskKickPlayerMessage = 55;
		Type_AskKickDeniedMessage = 56;
		Type_StartKickPetitionMessage = 57;
		Type_VoteKickRequestMessage = 58;
		Type_VoteKickReplyMessage = 59;
		Type_KickPetitionUpdateMessage = 60;
		Type_EndKickPetitionMessage = 61;
		Type_StatisticsMessage = 62;
		Type_ChatRequestMessage = 63;
		Type_ChatMessage = 64;
		Type_ChatRejectMessage = 65;
		Type_DialogMessage = 66;
		Type_TimeoutWarningMessage = 67;
		Type_ResetTimeoutMessage = 68;
		Type_ReportAvatarMessage = 69;
		Type_ReportAvatarAckMessage = 70;
		Type_ReportGameMessage = 71;
		Type_ReportGameAckMessage = 72;
		Type_ErrorMessage = 73;
		Type_AdminRemoveGameMessage = 74;
		Type_AdminRemoveGameAckMessage = 75;
		Type_AdminBanPlayerMessage = 76;
		Type_AdminBanPlayerAckMessage = 77;
		Type_GameListSpectatorJoinedMessage = 78;
		Type_GameListSpectatorLeftMessage = 79;
		Type_GameSpectatorJoinedMessage = 80;
		Type_GameSpectatorLeftMessage = 81;
	}
	required	PokerTHMessageType				messageType = 1;

	optional	AnnounceMessage					announceMessage = 2;
	optional	InitMessage						initMessage = 3;
	optional	AuthServerChallengeMessage		authServerChallengeMessage = 4;
	optional	AuthClientResponseMessage		authClientResponseMessage = 5;
	optional	AuthServerVerificationMessage	authServerVerificationMessage = 6;
	optional	InitAckMessage					initAckMessage = 7;
	optional	AvatarRequestMessage			avatarRequestMessage = 8;
	optional	AvatarHeaderMessage				avatarHeaderMessage = 9;
	optional	AvatarDataMessage				avatarDataMessage = 10;
	optional	AvatarEndMessage				avatarEndMessage = 11;
	optional	UnknownAvatarMessage			unknownAvatarMessage = 12;
	optional	PlayerListMessage				playerListMessage = 13;
	optional	GameListNewMessage				gameListNewMessage = 14;
	optional	GameListUpdateMessage			gameListUpdateMessage = 15;
	optional	GameListPlayerJoinedMessage		gameListPlayerJoinedMessage = 16;
	optional	GameListPlayerLeftMessage		gameListPlayerLeftMessage = 17;
	optional	GameListAdminChangedMessage		gameListAdminChangedMessage = 18;
	optional	PlayerInfoRequestMessage		playerInfoRequestMessage = 19;
	optional	PlayerInfoReplyMessage			playerInfoReplyMessage = 20;
	optional	SubscriptionRequestMessage		subscriptionRequestMessage = 21;
	optional	JoinExistingGameMessage			joinExistingGameMessage = 22;
	optional	JoinNewGameMessage				joinNewGameMessage = 23;
	optional	RejoinExistingGameMessage		rejoinExistingGameMessage = 24;
	optional	JoinGameAckMessage				joinGameAckMessage = 25;
	optional	JoinGameFailedMessage			joinGameFailedMessage = 26;
	optional	GamePlayerJoinedMessage			gamePlayerJoinedMessage = 27;
	optional	GamePlayerLeftMessage			gamePlayerLeftMessage = 28;
	optional	GameAdminChangedMessage			gameAdminChangedMessage = 29;
	optional	RemovedFromGameMessage			removedFromGameMessage = 30;
	optional	KickPlayerRequestMessage		kickPlayerRequestMessage = 31;
	optional	LeaveGameRequestMessage			leaveGameRequestMessage = 32;
	optional	InvitePlayerToGameMessage		invitePlayerToGameMessage = 33;
	optional	InviteNotifyMessage				inviteNotifyMessage = 34;
	optional	RejectGameInvitationMessage		rejectGameInvitationMessage = 35;
	optional	RejectInvNotifyMessage			rejectInvNotifyMessage = 36;
	optional	StartEventMessage				startEventMessage = 37;
	optional	StartEventAckMessage			startEventAckMessage = 38;
	optional	GameStartInitialMessage			gameStartInitialMessage = 39;
	optional	GameStartRejoinMessage			gameStartRejoinMessage = 40;
	optional	HandStartMessage				handStartMessage = 41;
	optional	PlayersTurnMessage				playersTurnMessage = 42;
	optional	MyActionRequestMessage			myActionRequestMessage = 43;
	optional	YourActionRejectedMessage		yourActionRejectedMessage = 44;
	optional	PlayersActionDoneMessage		playersActionDoneMessage = 45;
	optional	DealFlopCardsMessage			dealFlopCardsMessage = 46;
	optional	DealTurnCardMessage				dealTurnCardMessage = 47;
	optional	DealRiverCardMessage			dealRiverCardMessage = 48;
	optional	AllInShowCardsMessage			allInShowCardsMessage = 49;
	optional	EndOfHandShowCardsMessage		endOfHandShowCardsMessage = 50;
	optional	EndOfHandHideCardsMessage		endOfHandHideCardsMessage = 51;
	optional	ShowMyCardsRequestMessage		showMyCardsRequestMessage = 52;
	optional	AfterHandShowCardsMessage		afterHandShowCardsMessage = 53;
	optional	EndOfGameMessage				endOfGameMessage = 54;
	optional	PlayerIdChangedMessage			playerIdChangedMessage = 55;
	optional	AskKickPlayerMessage			askKickPlayerMessage = 56;
	optional	AskKickDeniedMessage			askKickDeniedMessage = 57;
	optional	StartKickPetitionMessage		startKickPetitionMessage = 58;
	optional	VoteKickRequestMessage			voteKickRequestMessage = 59;
	optional	VoteKickReplyMessage			voteKickReplyMessage = 60;
	optional	KickPetitionUpdateMessage		kickPetitionUpdateMessage = 61;
	optional	EndKickPetitionMessage			endKickPetitionMessage = 62;
	optional	StatisticsMessage				statisticsMessage = 63;
	optional	ChatRequestMessage				chatRequestMessage = 64;
	optional	ChatMessage						chatMessage = 65;
	optional	ChatRejectMessage				chatRejectMessage = 66;
	optional	DialogMessage					dialogMessage = 67;
	optional	TimeoutWarningMessage			timeoutWarningMessage = 68;
	optional	ResetTimeoutMessage				resetTimeoutMessage = 69;
	optional	ReportAvatarMessage				reportAvatarMessage = 70;
	optional	ReportAvatarAckMessage			reportAvatarAckMessage = 71;
	optional	ReportGameMessage				reportGameMessage = 72;
	optional	ReportGameAckMessage			reportGameAckMessage = 73;
	optional	ErrorMessage					errorMessage = 74;
	optional	AdminRemoveGameMessage			adminRemoveGameMessage = 75;
	optional	AdminRemoveGameAckMessage		adminRemoveGameAckMessage = 76;
	optional	AdminBanPlayerMessage			adminBanPlayerMessage = 77;
	optional	AdminBanPlayerAckMessage		adminBanPlayerAckMessage = 78;
	optional	GameListSpectatorJoinedMessage	gameListSpectatorJoinedMessage = 79;
	optional	GameListSpectatorLeftMessage	gameListSpectatorLeftMessage = 80;
	optional	GameSpectatorJoinedMessage		gameSpectatorJoinedMessage = 81;
	optional	GameSpectatorLeftMessage		gameSpectatorLeftMessage = 82;
}