Protocol updates for more flexibility and better testing.

This commit is contained in:
lotodore
2011-07-17 14:12:10 +00:00
parent d14d1d4a2b
commit d8ccf015d3
16 changed files with 80 additions and 418 deletions
+18 -15
View File
@@ -268,7 +268,6 @@ PlayerInfoData ::= SEQUENCE {
UnknownPlayerInfo ::= SEQUENCE { UnknownPlayerInfo ::= SEQUENCE {
} }
-- The following request will not be confirmed by the server. It is used, -- The following request will not be confirmed by the server. It is used,
-- optionally, to reduce server traffic. The server might ignore it. -- optionally, to reduce server traffic. The server might ignore it.
SubscriptionRequestMessage ::= [APPLICATION 10] SEQUENCE { SubscriptionRequestMessage ::= [APPLICATION 10] SEQUENCE {
@@ -351,9 +350,9 @@ NetGameInfo ::= SEQUENCE {
delayBetweenHands INTEGER(5..20), -- These are seconds delayBetweenHands INTEGER(5..20), -- These are seconds
playerActionTimeout INTEGER(0..60), -- These are seconds playerActionTimeout INTEGER(0..60), -- These are seconds
firstSmallBlind INTEGER(1..20000), firstSmallBlind INTEGER(1..20000),
endRaiseSmallBlindValue INTEGER(0..1000000), endRaiseSmallBlindValue InitialAmountOfMoney,
startMoney INTEGER(1..1000000), startMoney InitialNonZeroAmountOfMoney,
manualBlinds SEQUENCE SIZE(0..30) OF INTEGER(1..1000000) manualBlinds SEQUENCE SIZE(0..30) OF InitialNonZeroAmountOfMoney
} }
GamePlayerMessage ::= [APPLICATION 13] SEQUENCE { GamePlayerMessage ::= [APPLICATION 13] SEQUENCE {
@@ -442,7 +441,7 @@ StartEventAckMessage ::= [APPLICATION 21] SEQUENCE {
RejoinPlayerData ::= SEQUENCE { RejoinPlayerData ::= SEQUENCE {
playerId NonZeroId, playerId NonZeroId,
playerMoney INTEGER(0..10000000) playerMoney AmountOfMoney
} }
GameStartModeInitial ::= SEQUENCE { GameStartModeInitial ::= SEQUENCE {
@@ -491,14 +490,14 @@ MyActionRequestMessage ::= [APPLICATION 25] SEQUENCE {
handNum NonZeroId, handNum NonZeroId,
gameState NetGameState, gameState NetGameState,
myAction NetPlayerAction, myAction NetPlayerAction,
myRelativeBet INTEGER(0..10000000) myRelativeBet AmountOfMoney
} }
YourActionRejectedMessage ::= [APPLICATION 26] SEQUENCE { YourActionRejectedMessage ::= [APPLICATION 26] SEQUENCE {
gameId NonZeroId, gameId NonZeroId,
gameState NetGameState, gameState NetGameState,
yourAction NetPlayerAction, yourAction NetPlayerAction,
yourRelativeBet INTEGER(0..10000000), yourRelativeBet AmountOfMoney,
rejectionReason ENUMERATED { rejectionReason ENUMERATED {
rejectedInvalidGameState (1), rejectedInvalidGameState (1),
rejectedNotYourTurn (2), rejectedNotYourTurn (2),
@@ -511,10 +510,10 @@ PlayersActionDoneMessage ::= [APPLICATION 27] SEQUENCE {
playerId NonZeroId, playerId NonZeroId,
gameState NetGameState, gameState NetGameState,
playerAction NetPlayerAction, playerAction NetPlayerAction,
totalPlayerBet INTEGER(0..10000000), totalPlayerBet AmountOfMoney,
playerMoney INTEGER(0..10000000), playerMoney AmountOfMoney,
highestSet INTEGER(0..10000000), highestSet AmountOfMoney,
minimumRaise INTEGER(0..10000000) -- TODO minimumRaise AmountOfMoney
} }
DealFlopCardsMessage ::= [APPLICATION 28] SEQUENCE { DealFlopCardsMessage ::= [APPLICATION 28] SEQUENCE {
@@ -563,14 +562,14 @@ PlayerResult ::= SEQUENCE {
resultCard2 Card, resultCard2 Card,
bestHandPosition SEQUENCE SIZE(5) OF INTEGER, -- TODO size restrictions bestHandPosition SEQUENCE SIZE(5) OF INTEGER, -- TODO size restrictions
cardsValue INTEGER, cardsValue INTEGER,
moneyWon INTEGER(0..10000000), moneyWon AmountOfMoney,
playerMoney INTEGER(0..10000000) playerMoney AmountOfMoney
} }
EndOfHandHideCards ::= SEQUENCE { EndOfHandHideCards ::= SEQUENCE {
playerId NonZeroId, playerId NonZeroId,
moneyWon INTEGER(0..10000000), moneyWon AmountOfMoney,
playerMoney INTEGER(0..10000000) playerMoney AmountOfMoney
} }
ShowMyCardsRequestMessage ::= [APPLICATION 33] SEQUENCE { ShowMyCardsRequestMessage ::= [APPLICATION 33] SEQUENCE {
@@ -803,4 +802,8 @@ Guid ::= OCTET STRING (SIZE(16))
Card ::= INTEGER(0..51) Card ::= INTEGER(0..51)
AmountOfMoney ::= INTEGER(0..10000000)
InitialAmountOfMoney ::= INTEGER(0..1000000)
InitialNonZeroAmountOfMoney ::= INTEGER(1..1000000)
END END
+6
View File
@@ -32,6 +32,9 @@ HEADERS += src/third_party/asn1/AllInShowCardsMessage.h \
src/third_party/asn1/CleanerChatRequestMessage.h \ src/third_party/asn1/CleanerChatRequestMessage.h \
src/third_party/asn1/CleanerChatReplyMessage.h \ src/third_party/asn1/CleanerChatReplyMessage.h \
src/third_party/asn1/GuestLogin.h \ src/third_party/asn1/GuestLogin.h \
src/third_party/asn1/AmountOfMoney.h \
src/third_party/asn1/InitialAmountOfMoney.h \
src/third_party/asn1/InitialNonZeroAmountOfMoney.h \
src/third_party/asn1/AskKickDeniedMessage.h \ src/third_party/asn1/AskKickDeniedMessage.h \
src/third_party/asn1/AskKickPlayerMessage.h \ src/third_party/asn1/AskKickPlayerMessage.h \
src/third_party/asn1/AuthMessage.h \ src/third_party/asn1/AuthMessage.h \
@@ -183,6 +186,9 @@ SOURCES += src/third_party/asn1/ChatCleanerMessage.c \
src/third_party/asn1/CleanerInitAckMessage.c \ src/third_party/asn1/CleanerInitAckMessage.c \
src/third_party/asn1/CleanerChatRequestMessage.c \ src/third_party/asn1/CleanerChatRequestMessage.c \
src/third_party/asn1/CleanerChatReplyMessage.c \ src/third_party/asn1/CleanerChatReplyMessage.c \
src/third_party/asn1/AmountOfMoney.c \
src/third_party/asn1/InitialAmountOfMoney.c \
src/third_party/asn1/InitialNonZeroAmountOfMoney.c \
src/third_party/asn1/AuthMessage.c \ src/third_party/asn1/AuthMessage.c \
src/third_party/asn1/AuthClientResponse.c \ src/third_party/asn1/AuthClientResponse.c \
src/third_party/asn1/AuthServerChallenge.c \ src/third_party/asn1/AuthServerChallenge.c \
+5 -55
View File
@@ -7,56 +7,6 @@
#include "EndOfHandHideCards.h" #include "EndOfHandHideCards.h"
static int
memb_moneyWon_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
long value;
if(!sptr) {
_ASN_CTFAIL(app_key, td, sptr,
"%s: value not given (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
value = *(const long *)sptr;
if((value >= 0 && value <= 10000000)) {
/* Constraint check succeeded */
return 0;
} else {
_ASN_CTFAIL(app_key, td, sptr,
"%s: constraint failed (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
}
static int
memb_playerMoney_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
long value;
if(!sptr) {
_ASN_CTFAIL(app_key, td, sptr,
"%s: value not given (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
value = *(const long *)sptr;
if((value >= 0 && value <= 10000000)) {
/* Constraint check succeeded */
return 0;
} else {
_ASN_CTFAIL(app_key, td, sptr,
"%s: constraint failed (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
}
static asn_TYPE_member_t asn_MBR_EndOfHandHideCards_1[] = { static asn_TYPE_member_t asn_MBR_EndOfHandHideCards_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct EndOfHandHideCards, playerId), { ATF_NOFLAGS, 0, offsetof(struct EndOfHandHideCards, playerId),
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
@@ -70,8 +20,8 @@ static asn_TYPE_member_t asn_MBR_EndOfHandHideCards_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct EndOfHandHideCards, moneyWon), { ATF_NOFLAGS, 0, offsetof(struct EndOfHandHideCards, moneyWon),
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
0, 0,
&asn_DEF_NativeInteger, &asn_DEF_AmountOfMoney,
memb_moneyWon_constraint_1, 0, /* Defer constraints checking to the member type */
0, /* PER is not compiled, use -gen-PER */ 0, /* PER is not compiled, use -gen-PER */
0, 0,
"moneyWon" "moneyWon"
@@ -79,8 +29,8 @@ static asn_TYPE_member_t asn_MBR_EndOfHandHideCards_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct EndOfHandHideCards, playerMoney), { ATF_NOFLAGS, 0, offsetof(struct EndOfHandHideCards, playerMoney),
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
0, 0,
&asn_DEF_NativeInteger, &asn_DEF_AmountOfMoney,
memb_playerMoney_constraint_1, 0, /* Defer constraints checking to the member type */
0, /* PER is not compiled, use -gen-PER */ 0, /* PER is not compiled, use -gen-PER */
0, 0,
"playerMoney" "playerMoney"
@@ -92,7 +42,7 @@ static ber_tlv_tag_t asn_DEF_EndOfHandHideCards_tags_1[] = {
static asn_TYPE_tag2member_t asn_MAP_EndOfHandHideCards_tag2el_1[] = { static asn_TYPE_tag2member_t asn_MAP_EndOfHandHideCards_tag2el_1[] = {
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 2 }, /* playerId at 570 */ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 2 }, /* playerId at 570 */
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 1 }, /* moneyWon at 571 */ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 1 }, /* moneyWon at 571 */
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -2, 0 } /* playerMoney at 572 */ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -2, 0 } /* playerMoney at 573 */
}; };
static asn_SEQUENCE_specifics_t asn_SPC_EndOfHandHideCards_specs_1 = { static asn_SEQUENCE_specifics_t asn_SPC_EndOfHandHideCards_specs_1 = {
sizeof(struct EndOfHandHideCards), sizeof(struct EndOfHandHideCards),
+3 -3
View File
@@ -13,7 +13,7 @@
/* Including external dependencies */ /* Including external dependencies */
#include "NonZeroId.h" #include "NonZeroId.h"
#include <NativeInteger.h> #include "AmountOfMoney.h"
#include <constr_SEQUENCE.h> #include <constr_SEQUENCE.h>
#ifdef __cplusplus #ifdef __cplusplus
@@ -23,8 +23,8 @@ extern "C" {
/* EndOfHandHideCards */ /* EndOfHandHideCards */
typedef struct EndOfHandHideCards { typedef struct EndOfHandHideCards {
NonZeroId_t playerId; NonZeroId_t playerId;
long moneyWon; AmountOfMoney_t moneyWon;
long playerMoney; AmountOfMoney_t playerMoney;
/* /*
* This type is extensible, * This type is extensible,
* possible extensions are below. * possible extensions are below.
+3 -28
View File
@@ -7,31 +7,6 @@
#include "MyActionRequestMessage.h" #include "MyActionRequestMessage.h"
static int
memb_myRelativeBet_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
long value;
if(!sptr) {
_ASN_CTFAIL(app_key, td, sptr,
"%s: value not given (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
value = *(const long *)sptr;
if((value >= 0 && value <= 10000000)) {
/* Constraint check succeeded */
return 0;
} else {
_ASN_CTFAIL(app_key, td, sptr,
"%s: constraint failed (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
}
static asn_TYPE_member_t asn_MBR_MyActionRequestMessage_1[] = { static asn_TYPE_member_t asn_MBR_MyActionRequestMessage_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct MyActionRequestMessage, gameId), { ATF_NOFLAGS, 0, offsetof(struct MyActionRequestMessage, gameId),
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
@@ -72,8 +47,8 @@ static asn_TYPE_member_t asn_MBR_MyActionRequestMessage_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct MyActionRequestMessage, myRelativeBet), { ATF_NOFLAGS, 0, offsetof(struct MyActionRequestMessage, myRelativeBet),
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
0, 0,
&asn_DEF_NativeInteger, &asn_DEF_AmountOfMoney,
memb_myRelativeBet_constraint_1, 0, /* Defer constraints checking to the member type */
0, /* PER is not compiled, use -gen-PER */ 0, /* PER is not compiled, use -gen-PER */
0, 0,
"myRelativeBet" "myRelativeBet"
@@ -86,7 +61,7 @@ static ber_tlv_tag_t asn_DEF_MyActionRequestMessage_tags_1[] = {
static asn_TYPE_tag2member_t asn_MAP_MyActionRequestMessage_tag2el_1[] = { static asn_TYPE_tag2member_t asn_MAP_MyActionRequestMessage_tag2el_1[] = {
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 2 }, /* gameId at 489 */ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 2 }, /* gameId at 489 */
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 1 }, /* handNum at 490 */ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 1 }, /* handNum at 490 */
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 4, -2, 0 }, /* myRelativeBet at 493 */ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 4, -2, 0 }, /* myRelativeBet at 494 */
{ (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 2, 0, 1 }, /* gameState at 491 */ { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 2, 0, 1 }, /* gameState at 491 */
{ (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 3, -1, 0 } /* myAction at 492 */ { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 3, -1, 0 } /* myAction at 492 */
}; };
+2 -2
View File
@@ -15,7 +15,7 @@
#include "NonZeroId.h" #include "NonZeroId.h"
#include "NetGameState.h" #include "NetGameState.h"
#include "NetPlayerAction.h" #include "NetPlayerAction.h"
#include <NativeInteger.h> #include "AmountOfMoney.h"
#include <constr_SEQUENCE.h> #include <constr_SEQUENCE.h>
#ifdef __cplusplus #ifdef __cplusplus
@@ -28,7 +28,7 @@ extern "C" {
NonZeroId_t handNum; NonZeroId_t handNum;
NetGameState_t gameState; NetGameState_t gameState;
NetPlayerAction_t myAction; NetPlayerAction_t myAction;
long myRelativeBet; AmountOfMoney_t myRelativeBet;
/* /*
* This type is extensible, * This type is extensible,
* possible extensions are below. * possible extensions are below.
+7 -82
View File
@@ -203,31 +203,6 @@ endRaiseMode_13_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
} }
static int
memb_NativeInteger_constraint_23(asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
long value;
if(!sptr) {
_ASN_CTFAIL(app_key, td, sptr,
"%s: value not given (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
value = *(const long *)sptr;
if((value >= 1 && value <= 1000000)) {
/* Constraint check succeeded */
return 0;
} else {
_ASN_CTFAIL(app_key, td, sptr,
"%s: constraint failed (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
}
static int static int
memb_gameName_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, memb_gameName_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) { asn_app_constraint_failed_f *ctfailcb, void *app_key) {
@@ -385,56 +360,6 @@ memb_firstSmallBlind_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
} }
} }
static int
memb_endRaiseSmallBlindValue_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
long value;
if(!sptr) {
_ASN_CTFAIL(app_key, td, sptr,
"%s: value not given (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
value = *(const long *)sptr;
if((value >= 0 && value <= 1000000)) {
/* Constraint check succeeded */
return 0;
} else {
_ASN_CTFAIL(app_key, td, sptr,
"%s: constraint failed (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
}
static int
memb_startMoney_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
long value;
if(!sptr) {
_ASN_CTFAIL(app_key, td, sptr,
"%s: value not given (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
value = *(const long *)sptr;
if((value >= 1 && value <= 1000000)) {
/* Constraint check succeeded */
return 0;
} else {
_ASN_CTFAIL(app_key, td, sptr,
"%s: constraint failed (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
}
static int static int
memb_manualBlinds_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, memb_manualBlinds_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) { asn_app_constraint_failed_f *ctfailcb, void *app_key) {
@@ -616,8 +541,8 @@ static asn_TYPE_member_t asn_MBR_manualBlinds_23[] = {
{ ATF_POINTER, 0, 0, { ATF_POINTER, 0, 0,
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
0, 0,
&asn_DEF_NativeInteger, &asn_DEF_InitialNonZeroAmountOfMoney,
memb_NativeInteger_constraint_23, 0, /* Defer constraints checking to the member type */
0, /* PER is not compiled, use -gen-PER */ 0, /* PER is not compiled, use -gen-PER */
0, 0,
"" ""
@@ -741,8 +666,8 @@ static asn_TYPE_member_t asn_MBR_NetGameInfo_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct NetGameInfo, endRaiseSmallBlindValue), { ATF_NOFLAGS, 0, offsetof(struct NetGameInfo, endRaiseSmallBlindValue),
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
0, 0,
&asn_DEF_NativeInteger, &asn_DEF_InitialAmountOfMoney,
memb_endRaiseSmallBlindValue_constraint_1, 0, /* Defer constraints checking to the member type */
0, /* PER is not compiled, use -gen-PER */ 0, /* PER is not compiled, use -gen-PER */
0, 0,
"endRaiseSmallBlindValue" "endRaiseSmallBlindValue"
@@ -750,8 +675,8 @@ static asn_TYPE_member_t asn_MBR_NetGameInfo_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct NetGameInfo, startMoney), { ATF_NOFLAGS, 0, offsetof(struct NetGameInfo, startMoney),
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
0, 0,
&asn_DEF_NativeInteger, &asn_DEF_InitialNonZeroAmountOfMoney,
memb_startMoney_constraint_1, 0, /* Defer constraints checking to the member type */
0, /* PER is not compiled, use -gen-PER */ 0, /* PER is not compiled, use -gen-PER */
0, 0,
"startMoney" "startMoney"
@@ -780,7 +705,7 @@ static asn_TYPE_tag2member_t asn_MAP_NetGameInfo_tag2el_1[] = {
{ (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 1 }, /* netGameType at 334 */ { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 1 }, /* netGameType at 334 */
{ (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 4, -1, 0 }, /* endRaiseMode at 345 */ { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 4, -1, 0 }, /* endRaiseMode at 345 */
{ (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 0, 0, 0 }, /* gameName at 332 */ { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 0, 0, 0 }, /* gameName at 332 */
{ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 11, 0, 0 }, /* manualBlinds at 355 */ { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 11, 0, 0 }, /* manualBlinds at 356 */
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 3, 0, 0 }, /* raiseEveryHands at 341 */ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 3, 0, 0 }, /* raiseEveryHands at 341 */
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 3, 0, 0 } /* raiseEveryMinutes at 342 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 3, 0, 0 } /* raiseEveryMinutes at 342 */
}; };
+5 -3
View File
@@ -15,6 +15,8 @@
#include <UTF8String.h> #include <UTF8String.h>
#include <NativeEnumerated.h> #include <NativeEnumerated.h>
#include <NativeInteger.h> #include <NativeInteger.h>
#include "InitialAmountOfMoney.h"
#include "InitialNonZeroAmountOfMoney.h"
#include <constr_CHOICE.h> #include <constr_CHOICE.h>
#include <asn_SEQUENCE_OF.h> #include <asn_SEQUENCE_OF.h>
#include <constr_SEQUENCE_OF.h> #include <constr_SEQUENCE_OF.h>
@@ -69,10 +71,10 @@ extern "C" {
long delayBetweenHands; long delayBetweenHands;
long playerActionTimeout; long playerActionTimeout;
long firstSmallBlind; long firstSmallBlind;
long endRaiseSmallBlindValue; InitialAmountOfMoney_t endRaiseSmallBlindValue;
long startMoney; InitialNonZeroAmountOfMoney_t startMoney;
struct manualBlinds { struct manualBlinds {
A_SEQUENCE_OF(long) list; A_SEQUENCE_OF(InitialNonZeroAmountOfMoney_t) list;
/* Context for parsing across buffer boundaries */ /* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx; asn_struct_ctx_t _asn_ctx;
+5 -55
View File
@@ -33,56 +33,6 @@ memb_bestHandPosition_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
} }
} }
static int
memb_moneyWon_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
long value;
if(!sptr) {
_ASN_CTFAIL(app_key, td, sptr,
"%s: value not given (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
value = *(const long *)sptr;
if((value >= 0 && value <= 10000000)) {
/* Constraint check succeeded */
return 0;
} else {
_ASN_CTFAIL(app_key, td, sptr,
"%s: constraint failed (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
}
static int
memb_playerMoney_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
long value;
if(!sptr) {
_ASN_CTFAIL(app_key, td, sptr,
"%s: value not given (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
value = *(const long *)sptr;
if((value >= 0 && value <= 10000000)) {
/* Constraint check succeeded */
return 0;
} else {
_ASN_CTFAIL(app_key, td, sptr,
"%s: constraint failed (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
}
static asn_TYPE_member_t asn_MBR_bestHandPosition_5[] = { static asn_TYPE_member_t asn_MBR_bestHandPosition_5[] = {
{ ATF_POINTER, 0, 0, { ATF_POINTER, 0, 0,
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
@@ -176,8 +126,8 @@ static asn_TYPE_member_t asn_MBR_PlayerResult_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct PlayerResult, moneyWon), { ATF_NOFLAGS, 0, offsetof(struct PlayerResult, moneyWon),
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
0, 0,
&asn_DEF_NativeInteger, &asn_DEF_AmountOfMoney,
memb_moneyWon_constraint_1, 0, /* Defer constraints checking to the member type */
0, /* PER is not compiled, use -gen-PER */ 0, /* PER is not compiled, use -gen-PER */
0, 0,
"moneyWon" "moneyWon"
@@ -185,8 +135,8 @@ static asn_TYPE_member_t asn_MBR_PlayerResult_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct PlayerResult, playerMoney), { ATF_NOFLAGS, 0, offsetof(struct PlayerResult, playerMoney),
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
0, 0,
&asn_DEF_NativeInteger, &asn_DEF_AmountOfMoney,
memb_playerMoney_constraint_1, 0, /* Defer constraints checking to the member type */
0, /* PER is not compiled, use -gen-PER */ 0, /* PER is not compiled, use -gen-PER */
0, 0,
"playerMoney" "playerMoney"
@@ -201,7 +151,7 @@ static asn_TYPE_tag2member_t asn_MAP_PlayerResult_tag2el_1[] = {
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -2, 3 }, /* resultCard2 at 562 */ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -2, 3 }, /* resultCard2 at 562 */
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 4, -3, 2 }, /* cardsValue at 564 */ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 4, -3, 2 }, /* cardsValue at 564 */
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 5, -4, 1 }, /* moneyWon at 565 */ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 5, -4, 1 }, /* moneyWon at 565 */
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 6, -5, 0 }, /* playerMoney at 566 */ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 6, -5, 0 }, /* playerMoney at 567 */
{ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 3, 0, 0 } /* bestHandPosition at 563 */ { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 3, 0, 0 } /* bestHandPosition at 563 */
}; };
static asn_SEQUENCE_specifics_t asn_SPC_PlayerResult_specs_1 = { static asn_SEQUENCE_specifics_t asn_SPC_PlayerResult_specs_1 = {
+3 -2
View File
@@ -15,6 +15,7 @@
#include "NonZeroId.h" #include "NonZeroId.h"
#include "Card.h" #include "Card.h"
#include <NativeInteger.h> #include <NativeInteger.h>
#include "AmountOfMoney.h"
#include <asn_SEQUENCE_OF.h> #include <asn_SEQUENCE_OF.h>
#include <constr_SEQUENCE_OF.h> #include <constr_SEQUENCE_OF.h>
#include <constr_SEQUENCE.h> #include <constr_SEQUENCE.h>
@@ -35,8 +36,8 @@ extern "C" {
asn_struct_ctx_t _asn_ctx; asn_struct_ctx_t _asn_ctx;
} bestHandPosition; } bestHandPosition;
long cardsValue; long cardsValue;
long moneyWon; AmountOfMoney_t moneyWon;
long playerMoney; AmountOfMoney_t playerMoney;
/* /*
* This type is extensible, * This type is extensible,
* possible extensions are below. * possible extensions are below.
+9 -109
View File
@@ -7,106 +7,6 @@
#include "PlayersActionDoneMessage.h" #include "PlayersActionDoneMessage.h"
static int
memb_totalPlayerBet_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
long value;
if(!sptr) {
_ASN_CTFAIL(app_key, td, sptr,
"%s: value not given (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
value = *(const long *)sptr;
if((value >= 0 && value <= 10000000)) {
/* Constraint check succeeded */
return 0;
} else {
_ASN_CTFAIL(app_key, td, sptr,
"%s: constraint failed (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
}
static int
memb_playerMoney_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
long value;
if(!sptr) {
_ASN_CTFAIL(app_key, td, sptr,
"%s: value not given (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
value = *(const long *)sptr;
if((value >= 0 && value <= 10000000)) {
/* Constraint check succeeded */
return 0;
} else {
_ASN_CTFAIL(app_key, td, sptr,
"%s: constraint failed (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
}
static int
memb_highestSet_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
long value;
if(!sptr) {
_ASN_CTFAIL(app_key, td, sptr,
"%s: value not given (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
value = *(const long *)sptr;
if((value >= 0 && value <= 10000000)) {
/* Constraint check succeeded */
return 0;
} else {
_ASN_CTFAIL(app_key, td, sptr,
"%s: constraint failed (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
}
static int
memb_minimumRaise_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
long value;
if(!sptr) {
_ASN_CTFAIL(app_key, td, sptr,
"%s: value not given (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
value = *(const long *)sptr;
if((value >= 0 && value <= 10000000)) {
/* Constraint check succeeded */
return 0;
} else {
_ASN_CTFAIL(app_key, td, sptr,
"%s: constraint failed (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
}
static asn_TYPE_member_t asn_MBR_PlayersActionDoneMessage_1[] = { static asn_TYPE_member_t asn_MBR_PlayersActionDoneMessage_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct PlayersActionDoneMessage, gameId), { ATF_NOFLAGS, 0, offsetof(struct PlayersActionDoneMessage, gameId),
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
@@ -147,8 +47,8 @@ static asn_TYPE_member_t asn_MBR_PlayersActionDoneMessage_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct PlayersActionDoneMessage, totalPlayerBet), { ATF_NOFLAGS, 0, offsetof(struct PlayersActionDoneMessage, totalPlayerBet),
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
0, 0,
&asn_DEF_NativeInteger, &asn_DEF_AmountOfMoney,
memb_totalPlayerBet_constraint_1, 0, /* Defer constraints checking to the member type */
0, /* PER is not compiled, use -gen-PER */ 0, /* PER is not compiled, use -gen-PER */
0, 0,
"totalPlayerBet" "totalPlayerBet"
@@ -156,8 +56,8 @@ static asn_TYPE_member_t asn_MBR_PlayersActionDoneMessage_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct PlayersActionDoneMessage, playerMoney), { ATF_NOFLAGS, 0, offsetof(struct PlayersActionDoneMessage, playerMoney),
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
0, 0,
&asn_DEF_NativeInteger, &asn_DEF_AmountOfMoney,
memb_playerMoney_constraint_1, 0, /* Defer constraints checking to the member type */
0, /* PER is not compiled, use -gen-PER */ 0, /* PER is not compiled, use -gen-PER */
0, 0,
"playerMoney" "playerMoney"
@@ -165,8 +65,8 @@ static asn_TYPE_member_t asn_MBR_PlayersActionDoneMessage_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct PlayersActionDoneMessage, highestSet), { ATF_NOFLAGS, 0, offsetof(struct PlayersActionDoneMessage, highestSet),
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
0, 0,
&asn_DEF_NativeInteger, &asn_DEF_AmountOfMoney,
memb_highestSet_constraint_1, 0, /* Defer constraints checking to the member type */
0, /* PER is not compiled, use -gen-PER */ 0, /* PER is not compiled, use -gen-PER */
0, 0,
"highestSet" "highestSet"
@@ -174,8 +74,8 @@ static asn_TYPE_member_t asn_MBR_PlayersActionDoneMessage_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct PlayersActionDoneMessage, minimumRaise), { ATF_NOFLAGS, 0, offsetof(struct PlayersActionDoneMessage, minimumRaise),
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
0, 0,
&asn_DEF_NativeInteger, &asn_DEF_AmountOfMoney,
memb_minimumRaise_constraint_1, 0, /* Defer constraints checking to the member type */
0, /* PER is not compiled, use -gen-PER */ 0, /* PER is not compiled, use -gen-PER */
0, 0,
"minimumRaise" "minimumRaise"
@@ -191,7 +91,7 @@ static asn_TYPE_tag2member_t asn_MAP_PlayersActionDoneMessage_tag2el_1[] = {
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 4, -2, 3 }, /* totalPlayerBet at 513 */ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 4, -2, 3 }, /* totalPlayerBet at 513 */
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 5, -3, 2 }, /* playerMoney at 514 */ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 5, -3, 2 }, /* playerMoney at 514 */
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 6, -4, 1 }, /* highestSet at 515 */ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 6, -4, 1 }, /* highestSet at 515 */
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 7, -5, 0 }, /* minimumRaise at 516 */ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 7, -5, 0 }, /* minimumRaise at 517 */
{ (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 2, 0, 1 }, /* gameState at 511 */ { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 2, 0, 1 }, /* gameState at 511 */
{ (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 3, -1, 0 } /* playerAction at 512 */ { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 3, -1, 0 } /* playerAction at 512 */
}; };
+5 -5
View File
@@ -15,7 +15,7 @@
#include "NonZeroId.h" #include "NonZeroId.h"
#include "NetGameState.h" #include "NetGameState.h"
#include "NetPlayerAction.h" #include "NetPlayerAction.h"
#include <NativeInteger.h> #include "AmountOfMoney.h"
#include <constr_SEQUENCE.h> #include <constr_SEQUENCE.h>
#ifdef __cplusplus #ifdef __cplusplus
@@ -28,10 +28,10 @@ extern "C" {
NonZeroId_t playerId; NonZeroId_t playerId;
NetGameState_t gameState; NetGameState_t gameState;
NetPlayerAction_t playerAction; NetPlayerAction_t playerAction;
long totalPlayerBet; AmountOfMoney_t totalPlayerBet;
long playerMoney; AmountOfMoney_t playerMoney;
long highestSet; AmountOfMoney_t highestSet;
long minimumRaise; AmountOfMoney_t minimumRaise;
/* /*
* This type is extensible, * This type is extensible,
* possible extensions are below. * possible extensions are below.
+3 -28
View File
@@ -7,31 +7,6 @@
#include "RejoinPlayerData.h" #include "RejoinPlayerData.h"
static int
memb_playerMoney_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
long value;
if(!sptr) {
_ASN_CTFAIL(app_key, td, sptr,
"%s: value not given (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
value = *(const long *)sptr;
if((value >= 0 && value <= 10000000)) {
/* Constraint check succeeded */
return 0;
} else {
_ASN_CTFAIL(app_key, td, sptr,
"%s: constraint failed (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
}
static asn_TYPE_member_t asn_MBR_RejoinPlayerData_1[] = { static asn_TYPE_member_t asn_MBR_RejoinPlayerData_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct RejoinPlayerData, playerId), { ATF_NOFLAGS, 0, offsetof(struct RejoinPlayerData, playerId),
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
@@ -45,8 +20,8 @@ static asn_TYPE_member_t asn_MBR_RejoinPlayerData_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct RejoinPlayerData, playerMoney), { ATF_NOFLAGS, 0, offsetof(struct RejoinPlayerData, playerMoney),
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
0, 0,
&asn_DEF_NativeInteger, &asn_DEF_AmountOfMoney,
memb_playerMoney_constraint_1, 0, /* Defer constraints checking to the member type */
0, /* PER is not compiled, use -gen-PER */ 0, /* PER is not compiled, use -gen-PER */
0, 0,
"playerMoney" "playerMoney"
@@ -57,7 +32,7 @@ static ber_tlv_tag_t asn_DEF_RejoinPlayerData_tags_1[] = {
}; };
static asn_TYPE_tag2member_t asn_MAP_RejoinPlayerData_tag2el_1[] = { static asn_TYPE_tag2member_t asn_MAP_RejoinPlayerData_tag2el_1[] = {
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* playerId at 443 */ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* playerId at 443 */
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* playerMoney at 444 */ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* playerMoney at 445 */
}; };
static asn_SEQUENCE_specifics_t asn_SPC_RejoinPlayerData_specs_1 = { static asn_SEQUENCE_specifics_t asn_SPC_RejoinPlayerData_specs_1 = {
sizeof(struct RejoinPlayerData), sizeof(struct RejoinPlayerData),
+2 -2
View File
@@ -13,7 +13,7 @@
/* Including external dependencies */ /* Including external dependencies */
#include "NonZeroId.h" #include "NonZeroId.h"
#include <NativeInteger.h> #include "AmountOfMoney.h"
#include <constr_SEQUENCE.h> #include <constr_SEQUENCE.h>
#ifdef __cplusplus #ifdef __cplusplus
@@ -23,7 +23,7 @@ extern "C" {
/* RejoinPlayerData */ /* RejoinPlayerData */
typedef struct RejoinPlayerData { typedef struct RejoinPlayerData {
NonZeroId_t playerId; NonZeroId_t playerId;
long playerMoney; AmountOfMoney_t playerMoney;
/* /*
* This type is extensible, * This type is extensible,
* possible extensions are below. * possible extensions are below.
+2 -27
View File
@@ -80,31 +80,6 @@ rejectionReason_6_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
} }
static int
memb_yourRelativeBet_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
long value;
if(!sptr) {
_ASN_CTFAIL(app_key, td, sptr,
"%s: value not given (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
value = *(const long *)sptr;
if((value >= 0 && value <= 10000000)) {
/* Constraint check succeeded */
return 0;
} else {
_ASN_CTFAIL(app_key, td, sptr,
"%s: constraint failed (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
}
static asn_INTEGER_enum_map_t asn_MAP_rejectionReason_value2enum_6[] = { static asn_INTEGER_enum_map_t asn_MAP_rejectionReason_value2enum_6[] = {
{ 1, 24, "rejectedInvalidGameState" }, { 1, 24, "rejectedInvalidGameState" },
{ 2, 19, "rejectedNotYourTurn" }, { 2, 19, "rejectedNotYourTurn" },
@@ -182,8 +157,8 @@ static asn_TYPE_member_t asn_MBR_YourActionRejectedMessage_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct YourActionRejectedMessage, yourRelativeBet), { ATF_NOFLAGS, 0, offsetof(struct YourActionRejectedMessage, yourRelativeBet),
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
0, 0,
&asn_DEF_NativeInteger, &asn_DEF_AmountOfMoney,
memb_yourRelativeBet_constraint_1, 0, /* Defer constraints checking to the member type */
0, /* PER is not compiled, use -gen-PER */ 0, /* PER is not compiled, use -gen-PER */
0, 0,
"yourRelativeBet" "yourRelativeBet"
+2 -2
View File
@@ -15,7 +15,7 @@
#include "NonZeroId.h" #include "NonZeroId.h"
#include "NetGameState.h" #include "NetGameState.h"
#include "NetPlayerAction.h" #include "NetPlayerAction.h"
#include <NativeInteger.h> #include "AmountOfMoney.h"
#include <NativeEnumerated.h> #include <NativeEnumerated.h>
#include <constr_SEQUENCE.h> #include <constr_SEQUENCE.h>
@@ -36,7 +36,7 @@ extern "C" {
NonZeroId_t gameId; NonZeroId_t gameId;
NetGameState_t gameState; NetGameState_t gameState;
NetPlayerAction_t yourAction; NetPlayerAction_t yourAction;
long yourRelativeBet; AmountOfMoney_t yourRelativeBet;
long rejectionReason; long rejectionReason;
/* /*
* This type is extensible, * This type is extensible,