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
+5 -55
View File
@@ -7,56 +7,6 @@
#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[] = {
{ ATF_NOFLAGS, 0, offsetof(struct EndOfHandHideCards, playerId),
(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),
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
0,
&asn_DEF_NativeInteger,
memb_moneyWon_constraint_1,
&asn_DEF_AmountOfMoney,
0, /* Defer constraints checking to the member type */
0, /* PER is not compiled, use -gen-PER */
0,
"moneyWon"
@@ -79,8 +29,8 @@ static asn_TYPE_member_t asn_MBR_EndOfHandHideCards_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct EndOfHandHideCards, playerMoney),
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
0,
&asn_DEF_NativeInteger,
memb_playerMoney_constraint_1,
&asn_DEF_AmountOfMoney,
0, /* Defer constraints checking to the member type */
0, /* PER is not compiled, use -gen-PER */
0,
"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[] = {
{ (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)), 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 = {
sizeof(struct EndOfHandHideCards),
+3 -3
View File
@@ -13,7 +13,7 @@
/* Including external dependencies */
#include "NonZeroId.h"
#include <NativeInteger.h>
#include "AmountOfMoney.h"
#include <constr_SEQUENCE.h>
#ifdef __cplusplus
@@ -23,8 +23,8 @@ extern "C" {
/* EndOfHandHideCards */
typedef struct EndOfHandHideCards {
NonZeroId_t playerId;
long moneyWon;
long playerMoney;
AmountOfMoney_t moneyWon;
AmountOfMoney_t playerMoney;
/*
* This type is extensible,
* possible extensions are below.
+3 -28
View File
@@ -7,31 +7,6 @@
#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[] = {
{ ATF_NOFLAGS, 0, offsetof(struct MyActionRequestMessage, gameId),
(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),
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
0,
&asn_DEF_NativeInteger,
memb_myRelativeBet_constraint_1,
&asn_DEF_AmountOfMoney,
0, /* Defer constraints checking to the member type */
0, /* PER is not compiled, use -gen-PER */
0,
"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[] = {
{ (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)), 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)), 3, -1, 0 } /* myAction at 492 */
};
+2 -2
View File
@@ -15,7 +15,7 @@
#include "NonZeroId.h"
#include "NetGameState.h"
#include "NetPlayerAction.h"
#include <NativeInteger.h>
#include "AmountOfMoney.h"
#include <constr_SEQUENCE.h>
#ifdef __cplusplus
@@ -28,7 +28,7 @@ extern "C" {
NonZeroId_t handNum;
NetGameState_t gameState;
NetPlayerAction_t myAction;
long myRelativeBet;
AmountOfMoney_t myRelativeBet;
/*
* This type is extensible,
* 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);
}
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
memb_gameName_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
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
memb_manualBlinds_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
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,
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
0,
&asn_DEF_NativeInteger,
memb_NativeInteger_constraint_23,
&asn_DEF_InitialNonZeroAmountOfMoney,
0, /* Defer constraints checking to the member type */
0, /* PER is not compiled, use -gen-PER */
0,
""
@@ -741,8 +666,8 @@ static asn_TYPE_member_t asn_MBR_NetGameInfo_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct NetGameInfo, endRaiseSmallBlindValue),
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
0,
&asn_DEF_NativeInteger,
memb_endRaiseSmallBlindValue_constraint_1,
&asn_DEF_InitialAmountOfMoney,
0, /* Defer constraints checking to the member type */
0, /* PER is not compiled, use -gen-PER */
0,
"endRaiseSmallBlindValue"
@@ -750,8 +675,8 @@ static asn_TYPE_member_t asn_MBR_NetGameInfo_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct NetGameInfo, startMoney),
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
0,
&asn_DEF_NativeInteger,
memb_startMoney_constraint_1,
&asn_DEF_InitialNonZeroAmountOfMoney,
0, /* Defer constraints checking to the member type */
0, /* PER is not compiled, use -gen-PER */
0,
"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)), 4, -1, 0 }, /* endRaiseMode at 345 */
{ (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 | (1 << 2)), 3, 0, 0 } /* raiseEveryMinutes at 342 */
};
+5 -3
View File
@@ -15,6 +15,8 @@
#include <UTF8String.h>
#include <NativeEnumerated.h>
#include <NativeInteger.h>
#include "InitialAmountOfMoney.h"
#include "InitialNonZeroAmountOfMoney.h"
#include <constr_CHOICE.h>
#include <asn_SEQUENCE_OF.h>
#include <constr_SEQUENCE_OF.h>
@@ -69,10 +71,10 @@ extern "C" {
long delayBetweenHands;
long playerActionTimeout;
long firstSmallBlind;
long endRaiseSmallBlindValue;
long startMoney;
InitialAmountOfMoney_t endRaiseSmallBlindValue;
InitialNonZeroAmountOfMoney_t startMoney;
struct manualBlinds {
A_SEQUENCE_OF(long) list;
A_SEQUENCE_OF(InitialNonZeroAmountOfMoney_t) list;
/* Context for parsing across buffer boundaries */
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[] = {
{ ATF_POINTER, 0, 0,
(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),
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
0,
&asn_DEF_NativeInteger,
memb_moneyWon_constraint_1,
&asn_DEF_AmountOfMoney,
0, /* Defer constraints checking to the member type */
0, /* PER is not compiled, use -gen-PER */
0,
"moneyWon"
@@ -185,8 +135,8 @@ static asn_TYPE_member_t asn_MBR_PlayerResult_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct PlayerResult, playerMoney),
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
0,
&asn_DEF_NativeInteger,
memb_playerMoney_constraint_1,
&asn_DEF_AmountOfMoney,
0, /* Defer constraints checking to the member type */
0, /* PER is not compiled, use -gen-PER */
0,
"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)), 4, -3, 2 }, /* cardsValue at 564 */
{ (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 */
};
static asn_SEQUENCE_specifics_t asn_SPC_PlayerResult_specs_1 = {
+3 -2
View File
@@ -15,6 +15,7 @@
#include "NonZeroId.h"
#include "Card.h"
#include <NativeInteger.h>
#include "AmountOfMoney.h"
#include <asn_SEQUENCE_OF.h>
#include <constr_SEQUENCE_OF.h>
#include <constr_SEQUENCE.h>
@@ -35,8 +36,8 @@ extern "C" {
asn_struct_ctx_t _asn_ctx;
} bestHandPosition;
long cardsValue;
long moneyWon;
long playerMoney;
AmountOfMoney_t moneyWon;
AmountOfMoney_t playerMoney;
/*
* This type is extensible,
* possible extensions are below.
+9 -109
View File
@@ -7,106 +7,6 @@
#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[] = {
{ ATF_NOFLAGS, 0, offsetof(struct PlayersActionDoneMessage, gameId),
(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),
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
0,
&asn_DEF_NativeInteger,
memb_totalPlayerBet_constraint_1,
&asn_DEF_AmountOfMoney,
0, /* Defer constraints checking to the member type */
0, /* PER is not compiled, use -gen-PER */
0,
"totalPlayerBet"
@@ -156,8 +56,8 @@ static asn_TYPE_member_t asn_MBR_PlayersActionDoneMessage_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct PlayersActionDoneMessage, playerMoney),
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
0,
&asn_DEF_NativeInteger,
memb_playerMoney_constraint_1,
&asn_DEF_AmountOfMoney,
0, /* Defer constraints checking to the member type */
0, /* PER is not compiled, use -gen-PER */
0,
"playerMoney"
@@ -165,8 +65,8 @@ static asn_TYPE_member_t asn_MBR_PlayersActionDoneMessage_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct PlayersActionDoneMessage, highestSet),
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
0,
&asn_DEF_NativeInteger,
memb_highestSet_constraint_1,
&asn_DEF_AmountOfMoney,
0, /* Defer constraints checking to the member type */
0, /* PER is not compiled, use -gen-PER */
0,
"highestSet"
@@ -174,8 +74,8 @@ static asn_TYPE_member_t asn_MBR_PlayersActionDoneMessage_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct PlayersActionDoneMessage, minimumRaise),
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
0,
&asn_DEF_NativeInteger,
memb_minimumRaise_constraint_1,
&asn_DEF_AmountOfMoney,
0, /* Defer constraints checking to the member type */
0, /* PER is not compiled, use -gen-PER */
0,
"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)), 5, -3, 2 }, /* playerMoney at 514 */
{ (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)), 3, -1, 0 } /* playerAction at 512 */
};
+5 -5
View File
@@ -15,7 +15,7 @@
#include "NonZeroId.h"
#include "NetGameState.h"
#include "NetPlayerAction.h"
#include <NativeInteger.h>
#include "AmountOfMoney.h"
#include <constr_SEQUENCE.h>
#ifdef __cplusplus
@@ -28,10 +28,10 @@ extern "C" {
NonZeroId_t playerId;
NetGameState_t gameState;
NetPlayerAction_t playerAction;
long totalPlayerBet;
long playerMoney;
long highestSet;
long minimumRaise;
AmountOfMoney_t totalPlayerBet;
AmountOfMoney_t playerMoney;
AmountOfMoney_t highestSet;
AmountOfMoney_t minimumRaise;
/*
* This type is extensible,
* possible extensions are below.
+3 -28
View File
@@ -7,31 +7,6 @@
#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[] = {
{ ATF_NOFLAGS, 0, offsetof(struct RejoinPlayerData, playerId),
(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),
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
0,
&asn_DEF_NativeInteger,
memb_playerMoney_constraint_1,
&asn_DEF_AmountOfMoney,
0, /* Defer constraints checking to the member type */
0, /* PER is not compiled, use -gen-PER */
0,
"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[] = {
{ (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 = {
sizeof(struct RejoinPlayerData),
+2 -2
View File
@@ -13,7 +13,7 @@
/* Including external dependencies */
#include "NonZeroId.h"
#include <NativeInteger.h>
#include "AmountOfMoney.h"
#include <constr_SEQUENCE.h>
#ifdef __cplusplus
@@ -23,7 +23,7 @@ extern "C" {
/* RejoinPlayerData */
typedef struct RejoinPlayerData {
NonZeroId_t playerId;
long playerMoney;
AmountOfMoney_t playerMoney;
/*
* This type is extensible,
* 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);
}
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[] = {
{ 1, 24, "rejectedInvalidGameState" },
{ 2, 19, "rejectedNotYourTurn" },
@@ -182,8 +157,8 @@ static asn_TYPE_member_t asn_MBR_YourActionRejectedMessage_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct YourActionRejectedMessage, yourRelativeBet),
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
0,
&asn_DEF_NativeInteger,
memb_yourRelativeBet_constraint_1,
&asn_DEF_AmountOfMoney,
0, /* Defer constraints checking to the member type */
0, /* PER is not compiled, use -gen-PER */
0,
"yourRelativeBet"
+2 -2
View File
@@ -15,7 +15,7 @@
#include "NonZeroId.h"
#include "NetGameState.h"
#include "NetPlayerAction.h"
#include <NativeInteger.h>
#include "AmountOfMoney.h"
#include <NativeEnumerated.h>
#include <constr_SEQUENCE.h>
@@ -36,7 +36,7 @@ extern "C" {
NonZeroId_t gameId;
NetGameState_t gameState;
NetPlayerAction_t yourAction;
long yourRelativeBet;
AmountOfMoney_t yourRelativeBet;
long rejectionReason;
/*
* This type is extensible,