Preparing use of boost Uuids for unique ids which can be used to rejoin a game (Ticket #5). This requires boost 1.42 or later.
This commit is contained in:
@@ -10,9 +10,7 @@ Linux:
|
|||||||
- gnutls (e.g. version 2.2.2) --> http://www.gnu.org/software/gnutls/
|
- gnutls (e.g. version 2.2.2) --> http://www.gnu.org/software/gnutls/
|
||||||
- libboost_thread, libboost_filesystem, libboost_datetime, libboost_program_options,
|
- libboost_thread, libboost_filesystem, libboost_datetime, libboost_program_options,
|
||||||
libboost_iostreams, libboost_asio, libboost_regex
|
libboost_iostreams, libboost_asio, libboost_regex
|
||||||
(version >= 1.36, 1.45.0 recommended) --> http://www.boost.org/
|
(version >= 1.42, latest always recommended) --> http://www.boost.org/
|
||||||
NOTE: Please do not use boost 1.39.0 for the dedicated server, due to bug
|
|
||||||
https://svn.boost.org/trac/boost/ticket/3095
|
|
||||||
- libSDL_mixer, libSDL --> http://www.libsdl.org/
|
- libSDL_mixer, libSDL --> http://www.libsdl.org/
|
||||||
- libSQLite >= 3.0 --> http://sqlite.org/
|
- libSQLite >= 3.0 --> http://sqlite.org/
|
||||||
- libtinyxml > 2.0 --> http://www.sourceforge.net/projects/tinyxml
|
- libtinyxml > 2.0 --> http://www.sourceforge.net/projects/tinyxml
|
||||||
|
|||||||
+1
-1
@@ -765,7 +765,7 @@ NonZeroId ::= INTEGER(1..4294967295)
|
|||||||
|
|
||||||
Id ::= INTEGER(0..4294967295)
|
Id ::= INTEGER(0..4294967295)
|
||||||
|
|
||||||
Guid ::= INTEGER(0..4294967295) -- TODO
|
Guid ::= OCTET STRING (SIZE(16))
|
||||||
|
|
||||||
Card ::= INTEGER(0..51)
|
Card ::= INTEGER(0..51)
|
||||||
|
|
||||||
|
|||||||
Vendored
+27
-24
@@ -10,7 +10,8 @@
|
|||||||
int
|
int
|
||||||
Guid_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
|
Guid_constraint(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) {
|
||||||
unsigned long value;
|
const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
|
||||||
|
size_t size;
|
||||||
|
|
||||||
if(!sptr) {
|
if(!sptr) {
|
||||||
_ASN_CTFAIL(app_key, td, sptr,
|
_ASN_CTFAIL(app_key, td, sptr,
|
||||||
@@ -19,31 +20,38 @@ Guid_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
value = *(const unsigned long *)sptr;
|
size = st->size;
|
||||||
|
|
||||||
/* Constraint check succeeded */
|
if((size == 16)) {
|
||||||
return 0;
|
/* Constraint check succeeded */
|
||||||
|
return 0;
|
||||||
|
} else {
|
||||||
|
_ASN_CTFAIL(app_key, td, sptr,
|
||||||
|
"%s: constraint failed (%s:%d)",
|
||||||
|
td->name, __FILE__, __LINE__);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This type is implemented using NativeInteger,
|
* This type is implemented using OCTET_STRING,
|
||||||
* so here we adjust the DEF accordingly.
|
* so here we adjust the DEF accordingly.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
Guid_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
|
Guid_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
|
||||||
td->free_struct = asn_DEF_NativeInteger.free_struct;
|
td->free_struct = asn_DEF_OCTET_STRING.free_struct;
|
||||||
td->print_struct = asn_DEF_NativeInteger.print_struct;
|
td->print_struct = asn_DEF_OCTET_STRING.print_struct;
|
||||||
td->ber_decoder = asn_DEF_NativeInteger.ber_decoder;
|
td->ber_decoder = asn_DEF_OCTET_STRING.ber_decoder;
|
||||||
td->der_encoder = asn_DEF_NativeInteger.der_encoder;
|
td->der_encoder = asn_DEF_OCTET_STRING.der_encoder;
|
||||||
td->xer_decoder = asn_DEF_NativeInteger.xer_decoder;
|
td->xer_decoder = asn_DEF_OCTET_STRING.xer_decoder;
|
||||||
td->xer_encoder = asn_DEF_NativeInteger.xer_encoder;
|
td->xer_encoder = asn_DEF_OCTET_STRING.xer_encoder;
|
||||||
td->uper_decoder = asn_DEF_NativeInteger.uper_decoder;
|
td->uper_decoder = asn_DEF_OCTET_STRING.uper_decoder;
|
||||||
td->uper_encoder = asn_DEF_NativeInteger.uper_encoder;
|
td->uper_encoder = asn_DEF_OCTET_STRING.uper_encoder;
|
||||||
if(!td->per_constraints)
|
if(!td->per_constraints)
|
||||||
td->per_constraints = asn_DEF_NativeInteger.per_constraints;
|
td->per_constraints = asn_DEF_OCTET_STRING.per_constraints;
|
||||||
td->elements = asn_DEF_NativeInteger.elements;
|
td->elements = asn_DEF_OCTET_STRING.elements;
|
||||||
td->elements_count = asn_DEF_NativeInteger.elements_count;
|
td->elements_count = asn_DEF_OCTET_STRING.elements_count;
|
||||||
/* td->specifics = asn_DEF_NativeInteger.specifics; // Defined explicitly */
|
td->specifics = asn_DEF_OCTET_STRING.specifics;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -90,13 +98,8 @@ Guid_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 asn_INTEGER_specifics_t asn_SPC_Guid_specs_1 = {
|
|
||||||
0, 0, 0, 0, 0,
|
|
||||||
0, /* Native long size */
|
|
||||||
1 /* Unsigned representation */
|
|
||||||
};
|
|
||||||
static ber_tlv_tag_t asn_DEF_Guid_tags_1[] = {
|
static ber_tlv_tag_t asn_DEF_Guid_tags_1[] = {
|
||||||
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
|
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2))
|
||||||
};
|
};
|
||||||
asn_TYPE_descriptor_t asn_DEF_Guid = {
|
asn_TYPE_descriptor_t asn_DEF_Guid = {
|
||||||
"Guid",
|
"Guid",
|
||||||
@@ -118,6 +121,6 @@ asn_TYPE_descriptor_t asn_DEF_Guid = {
|
|||||||
/sizeof(asn_DEF_Guid_tags_1[0]), /* 1 */
|
/sizeof(asn_DEF_Guid_tags_1[0]), /* 1 */
|
||||||
0, /* No PER visible constraints */
|
0, /* No PER visible constraints */
|
||||||
0, 0, /* No members */
|
0, 0, /* No members */
|
||||||
&asn_SPC_Guid_specs_1 /* Additional specs */
|
0 /* No specifics */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Vendored
+2
-2
@@ -12,14 +12,14 @@
|
|||||||
#include <asn_application.h>
|
#include <asn_application.h>
|
||||||
|
|
||||||
/* Including external dependencies */
|
/* Including external dependencies */
|
||||||
#include <NativeInteger.h>
|
#include <OCTET_STRING.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Guid */
|
/* Guid */
|
||||||
typedef unsigned long Guid_t;
|
typedef OCTET_STRING_t Guid_t;
|
||||||
|
|
||||||
/* Implementation */
|
/* Implementation */
|
||||||
extern asn_TYPE_descriptor_t asn_DEF_Guid;
|
extern asn_TYPE_descriptor_t asn_DEF_Guid;
|
||||||
|
|||||||
+4
-4
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
static asn_TYPE_member_t asn_MBR_InitAckMessage_1[] = {
|
static asn_TYPE_member_t asn_MBR_InitAckMessage_1[] = {
|
||||||
{ ATF_NOFLAGS, 0, offsetof(struct InitAckMessage, yourSessionId),
|
{ ATF_NOFLAGS, 0, offsetof(struct InitAckMessage, yourSessionId),
|
||||||
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
|
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)),
|
||||||
0,
|
0,
|
||||||
&asn_DEF_Guid,
|
&asn_DEF_Guid,
|
||||||
0, /* Defer constraints checking to the member type */
|
0, /* Defer constraints checking to the member type */
|
||||||
@@ -41,9 +41,9 @@ static ber_tlv_tag_t asn_DEF_InitAckMessage_tags_1[] = {
|
|||||||
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
|
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
|
||||||
};
|
};
|
||||||
static asn_TYPE_tag2member_t asn_MAP_InitAckMessage_tag2el_1[] = {
|
static asn_TYPE_tag2member_t asn_MAP_InitAckMessage_tag2el_1[] = {
|
||||||
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* yourSessionId at 144 */
|
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* yourPlayerId at 145 */
|
||||||
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 }, /* yourPlayerId at 145 */
|
{ (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 0, 0, 1 }, /* yourSessionId at 144 */
|
||||||
{ (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 2, 0, 0 } /* yourAvatar at 146 */
|
{ (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 2, -1, 0 } /* yourAvatar at 146 */
|
||||||
};
|
};
|
||||||
static asn_SEQUENCE_specifics_t asn_SPC_InitAckMessage_specs_1 = {
|
static asn_SEQUENCE_specifics_t asn_SPC_InitAckMessage_specs_1 = {
|
||||||
sizeof(struct InitAckMessage),
|
sizeof(struct InitAckMessage),
|
||||||
|
|||||||
Reference in New Issue
Block a user