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
+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),