Implementing private messages in lobby chat, ticket #12. Some cosmetic improvements are still missing.

This commit is contained in:
lotodore
2011-02-11 23:02:29 +00:00
parent 02518c67b2
commit c4b8e567ed
25 changed files with 220 additions and 27 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ static ber_tlv_tag_t asn_DEF_AfkWarningMessage_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static asn_TYPE_tag2member_t asn_MAP_AfkWarningMessage_tag2el_1[] = {
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* remainingTimeouts at 709 */
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* remainingTimeouts at 714 */
};
static asn_SEQUENCE_specifics_t asn_SPC_AfkWarningMessage_specs_1 = {
sizeof(struct AfkWarningMessage),
+18 -7
View File
@@ -76,12 +76,22 @@ static asn_TYPE_member_t asn_MBR_chatType_2[] = {
0,
"chatTypeBroadcast"
},
{ ATF_NOFLAGS, 0, offsetof(struct chatType, choice.chatTypePrivate),
(ASN_TAG_CLASS_CONTEXT | (4 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_ChatTypePrivate,
0, /* Defer constraints checking to the member type */
0, /* PER is not compiled, use -gen-PER */
0,
"chatTypePrivate"
},
};
static asn_TYPE_tag2member_t asn_MAP_chatType_tag2el_2[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* chatTypeLobby at 669 */
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* chatTypeGame at 670 */
{ (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* chatTypeBot at 671 */
{ (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* chatTypeBroadcast at 673 */
{ (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* chatTypeBroadcast at 672 */
{ (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 } /* chatTypePrivate at 674 */
};
static asn_CHOICE_specifics_t asn_SPC_chatType_specs_2 = {
sizeof(struct chatType),
@@ -89,9 +99,9 @@ static asn_CHOICE_specifics_t asn_SPC_chatType_specs_2 = {
offsetof(struct chatType, present),
sizeof(((struct chatType *)0)->present),
asn_MAP_chatType_tag2el_2,
4, /* Count of tags in the map */
5, /* Count of tags in the map */
0,
4 /* Extensions start */
5 /* Extensions start */
};
static /* Use -fall-defs-global to expose */
asn_TYPE_descriptor_t asn_DEF_chatType_2 = {
@@ -112,7 +122,7 @@ asn_TYPE_descriptor_t asn_DEF_chatType_2 = {
0, /* No tags (count) */
0, /* No PER visible constraints */
asn_MBR_chatType_2,
4, /* Elements count */
5, /* Elements count */
&asn_SPC_chatType_specs_2 /* Additional specs */
};
@@ -141,17 +151,18 @@ static ber_tlv_tag_t asn_DEF_ChatMessage_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static asn_TYPE_tag2member_t asn_MAP_ChatMessage_tag2el_1[] = {
{ (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 1, 0, 0 }, /* chatText at 674 */
{ (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 1, 0, 0 }, /* chatText at 675 */
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* chatTypeLobby at 669 */
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 0, 0, 0 }, /* chatTypeGame at 670 */
{ (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 0, 0, 0 }, /* chatTypeBot at 671 */
{ (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 0, 0, 0 } /* chatTypeBroadcast at 673 */
{ (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 0, 0, 0 }, /* chatTypeBroadcast at 672 */
{ (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 0, 0, 0 } /* chatTypePrivate at 674 */
};
static asn_SEQUENCE_specifics_t asn_SPC_ChatMessage_specs_1 = {
sizeof(struct ChatMessage),
offsetof(struct ChatMessage, _asn_ctx),
asn_MAP_ChatMessage_tag2el_1,
5, /* Count of tags in the map */
6, /* Count of tags in the map */
0, 0, 0, /* Optional elements (not needed) */
1, /* Start extensions */
3 /* Stop extensions */
+3
View File
@@ -17,6 +17,7 @@
#include "ChatTypeGame.h"
#include "ChatTypeBot.h"
#include "ChatTypeBroadcast.h"
#include "ChatTypePrivate.h"
#include <constr_CHOICE.h>
#include <constr_SEQUENCE.h>
@@ -31,6 +32,7 @@ typedef enum chatType_PR {
chatType_PR_chatTypeGame,
chatType_PR_chatTypeBot,
chatType_PR_chatTypeBroadcast,
chatType_PR_chatTypePrivate,
/* Extensions may appear below */
} chatType_PR;
@@ -44,6 +46,7 @@ typedef struct ChatMessage {
ChatTypeGame_t chatTypeGame;
ChatTypeBot_t chatTypeBot;
ChatTypeBroadcast_t chatTypeBroadcast;
ChatTypePrivate_t chatTypePrivate;
/*
* This type is extensible,
* possible extensions are below.
+2 -2
View File
@@ -31,8 +31,8 @@ static ber_tlv_tag_t asn_DEF_ChatTypeGame_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static asn_TYPE_tag2member_t asn_MAP_ChatTypeGame_tag2el_1[] = {
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 682 */
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* playerId at 684 */
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 683 */
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* playerId at 685 */
};
static asn_SEQUENCE_specifics_t asn_SPC_ChatTypeGame_specs_1 = {
sizeof(struct ChatTypeGame),
+1 -1
View File
@@ -22,7 +22,7 @@ static ber_tlv_tag_t asn_DEF_ChatTypeLobby_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static asn_TYPE_tag2member_t asn_MAP_ChatTypeLobby_tag2el_1[] = {
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* playerId at 679 */
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* playerId at 680 */
};
static asn_SEQUENCE_specifics_t asn_SPC_ChatTypeLobby_specs_1 = {
sizeof(struct ChatTypeLobby),
+59
View File
@@ -0,0 +1,59 @@
/*
* Generated by asn1c-0.9.23 (http://lionet.info/asn1c)
* From ASN.1 module "POKERTH-PROTOCOL"
* found in "../../../docs/pokerth.asn1"
* `asn1c -fskeletons-copy`
*/
#include "ChatTypePrivate.h"
static asn_TYPE_member_t asn_MBR_ChatTypePrivate_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct ChatTypePrivate, playerId),
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
0,
&asn_DEF_NonZeroId,
0, /* Defer constraints checking to the member type */
0, /* PER is not compiled, use -gen-PER */
0,
"playerId"
},
};
static ber_tlv_tag_t asn_DEF_ChatTypePrivate_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static asn_TYPE_tag2member_t asn_MAP_ChatTypePrivate_tag2el_1[] = {
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* playerId at 695 */
};
static asn_SEQUENCE_specifics_t asn_SPC_ChatTypePrivate_specs_1 = {
sizeof(struct ChatTypePrivate),
offsetof(struct ChatTypePrivate, _asn_ctx),
asn_MAP_ChatTypePrivate_tag2el_1,
1, /* Count of tags in the map */
0, 0, 0, /* Optional elements (not needed) */
0, /* Start extensions */
2 /* Stop extensions */
};
asn_TYPE_descriptor_t asn_DEF_ChatTypePrivate = {
"ChatTypePrivate",
"ChatTypePrivate",
SEQUENCE_free,
SEQUENCE_print,
SEQUENCE_constraint,
SEQUENCE_decode_ber,
SEQUENCE_encode_der,
SEQUENCE_decode_xer,
SEQUENCE_encode_xer,
0, 0, /* No PER support, use "-gen-PER" to enable */
0, /* Use generic outmost tag fetcher */
asn_DEF_ChatTypePrivate_tags_1,
sizeof(asn_DEF_ChatTypePrivate_tags_1)
/sizeof(asn_DEF_ChatTypePrivate_tags_1[0]), /* 1 */
asn_DEF_ChatTypePrivate_tags_1, /* Same as above */
sizeof(asn_DEF_ChatTypePrivate_tags_1)
/sizeof(asn_DEF_ChatTypePrivate_tags_1[0]), /* 1 */
0, /* No PER visible constraints */
asn_MBR_ChatTypePrivate_1,
1, /* Elements count */
&asn_SPC_ChatTypePrivate_specs_1 /* Additional specs */
};
+42
View File
@@ -0,0 +1,42 @@
/*
* Generated by asn1c-0.9.23 (http://lionet.info/asn1c)
* From ASN.1 module "POKERTH-PROTOCOL"
* found in "../../../docs/pokerth.asn1"
* `asn1c -fskeletons-copy`
*/
#ifndef _ChatTypePrivate_H_
#define _ChatTypePrivate_H_
#include <asn_application.h>
/* Including external dependencies */
#include "NonZeroId.h"
#include <constr_SEQUENCE.h>
#ifdef __cplusplus
extern "C" {
#endif
/* ChatTypePrivate */
typedef struct ChatTypePrivate {
NonZeroId_t playerId;
/*
* This type is extensible,
* possible extensions are below.
*/
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} ChatTypePrivate_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_ChatTypePrivate;
#ifdef __cplusplus
}
#endif
#endif /* _ChatTypePrivate_H_ */
#include <asn_internal.h>
+1 -1
View File
@@ -55,7 +55,7 @@ static ber_tlv_tag_t asn_DEF_DialogMessage_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static asn_TYPE_tag2member_t asn_MAP_DialogMessage_tag2el_1[] = {
{ (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 0, 0, 0 } /* notificationText at 693 */
{ (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 0, 0, 0 } /* notificationText at 698 */
};
static asn_SEQUENCE_specifics_t asn_SPC_DialogMessage_specs_1 = {
sizeof(struct DialogMessage),
+1 -1
View File
@@ -166,7 +166,7 @@ static ber_tlv_tag_t asn_DEF_ErrorMessage_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static asn_TYPE_tag2member_t asn_MAP_ErrorMessage_tag2el_1[] = {
{ (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* errorReason at 727 */
{ (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* errorReason at 732 */
};
static asn_SEQUENCE_specifics_t asn_SPC_ErrorMessage_specs_1 = {
sizeof(struct ErrorMessage),
+2 -2
View File
@@ -151,8 +151,8 @@ static ber_tlv_tag_t asn_DEF_ReportAvatarAckMessage_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static asn_TYPE_tag2member_t asn_MAP_ReportAvatarAckMessage_tag2el_1[] = {
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* reportedPlayerId at 717 */
{ (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* reportResult at 719 */
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* reportedPlayerId at 722 */
{ (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* reportResult at 724 */
};
static asn_SEQUENCE_specifics_t asn_SPC_ReportAvatarAckMessage_specs_1 = {
sizeof(struct ReportAvatarAckMessage),
+2 -2
View File
@@ -32,8 +32,8 @@ static ber_tlv_tag_t asn_DEF_ReportAvatarMessage_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static asn_TYPE_tag2member_t asn_MAP_ReportAvatarMessage_tag2el_1[] = {
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* reportedPlayerId at 712 */
{ (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 1, 0, 0 } /* reportedAvatar at 714 */
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* reportedPlayerId at 717 */
{ (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 1, 0, 0 } /* reportedAvatar at 719 */
};
static asn_SEQUENCE_specifics_t asn_SPC_ReportAvatarMessage_specs_1 = {
sizeof(struct ReportAvatarMessage),
+2 -2
View File
@@ -149,8 +149,8 @@ static ber_tlv_tag_t asn_DEF_TimeoutWarningMessage_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static asn_TYPE_tag2member_t asn_MAP_TimeoutWarningMessage_tag2el_1[] = {
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* remainingSeconds at 702 */
{ (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* timeoutReason at 698 */
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* remainingSeconds at 707 */
{ (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* timeoutReason at 703 */
};
static asn_SEQUENCE_specifics_t asn_SPC_TimeoutWarningMessage_specs_1 = {
sizeof(struct TimeoutWarningMessage),