CardsValue is now optionally sent by the server.
This commit is contained in:
+1
-1
@@ -574,7 +574,7 @@ PlayerResult ::= SEQUENCE {
|
||||
resultCard1 Card,
|
||||
resultCard2 Card,
|
||||
bestHandPosition SEQUENCE SIZE(5) OF INTEGER, -- TODO size restrictions
|
||||
cardsValue INTEGER,
|
||||
cardsValue INTEGER OPTIONAL,
|
||||
moneyWon AmountOfMoney,
|
||||
playerMoney AmountOfMoney
|
||||
}
|
||||
|
||||
@@ -1676,7 +1676,9 @@ ClientStateWaitHand::InternalHandlePacket(boost::shared_ptr<ClientThread> client
|
||||
tmpPlayer->setMyCards(tmpCards);
|
||||
for (int num = 0; num < 5; num++)
|
||||
bestHandPos[num] = *r->bestHandPosition.list.array[num];
|
||||
tmpPlayer->setMyCardsValueInt(r->cardsValue);
|
||||
if (r->cardsValue) {
|
||||
tmpPlayer->setMyCardsValueInt(*r->cardsValue);
|
||||
}
|
||||
tmpPlayer->setMyBestHandPosition(bestHandPos);
|
||||
tmpPlayer->setMyCash(r->playerMoney);
|
||||
tmpPlayer->setLastMoneyWon(r->moneyWon);
|
||||
@@ -1984,7 +1986,9 @@ ClientStateRunHand::InternalHandlePacket(boost::shared_ptr<ClientThread> client,
|
||||
tmpPlayer->setMyCards(tmpCards);
|
||||
for (int num = 0; num < 5; num++)
|
||||
bestHandPos[num] = *r->bestHandPosition.list.array[num];
|
||||
tmpPlayer->setMyCardsValueInt(r->cardsValue);
|
||||
if (r->cardsValue) {
|
||||
tmpPlayer->setMyCardsValueInt(*r->cardsValue);
|
||||
}
|
||||
tmpPlayer->setMyBestHandPosition(bestHandPos);
|
||||
if (tmpPlayer->getMyCardsValueInt() > highestValueOfCards)
|
||||
highestValueOfCards = tmpPlayer->getMyCardsValueInt();
|
||||
|
||||
@@ -199,7 +199,8 @@ SetPlayerResult(PlayerResult_t &playerResult, boost::shared_ptr<PlayerInterface>
|
||||
ASN_SEQUENCE_ADD(&playerResult.bestHandPosition.list, handPos);
|
||||
}
|
||||
|
||||
playerResult.cardsValue = tmpPlayer->getMyCardsValueInt();
|
||||
playerResult.cardsValue = (long *)calloc(1, sizeof(long));
|
||||
*playerResult.cardsValue = tmpPlayer->getMyCardsValueInt();
|
||||
playerResult.moneyWon = tmpPlayer->getLastMoneyWon();
|
||||
playerResult.playerMoney = tmpPlayer->getMyCash();
|
||||
}
|
||||
|
||||
Vendored
+12
-12
@@ -114,15 +114,6 @@ static asn_TYPE_member_t asn_MBR_PlayerResult_1[] = {
|
||||
0,
|
||||
"bestHandPosition"
|
||||
},
|
||||
{ ATF_NOFLAGS, 0, offsetof(struct PlayerResult, cardsValue),
|
||||
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
|
||||
0,
|
||||
&asn_DEF_NativeInteger,
|
||||
0, /* Defer constraints checking to the member type */
|
||||
0, /* PER is not compiled, use -gen-PER */
|
||||
0,
|
||||
"cardsValue"
|
||||
},
|
||||
{ ATF_NOFLAGS, 0, offsetof(struct PlayerResult, moneyWon),
|
||||
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
|
||||
0,
|
||||
@@ -141,6 +132,15 @@ static asn_TYPE_member_t asn_MBR_PlayerResult_1[] = {
|
||||
0,
|
||||
"playerMoney"
|
||||
},
|
||||
{ ATF_POINTER, 1, offsetof(struct PlayerResult, cardsValue),
|
||||
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
|
||||
0,
|
||||
&asn_DEF_NativeInteger,
|
||||
0, /* Defer constraints checking to the member type */
|
||||
0, /* PER is not compiled, use -gen-PER */
|
||||
0,
|
||||
"cardsValue"
|
||||
},
|
||||
};
|
||||
static ber_tlv_tag_t asn_DEF_PlayerResult_tags_1[] = {
|
||||
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
|
||||
@@ -149,9 +149,9 @@ static asn_TYPE_tag2member_t asn_MAP_PlayerResult_tag2el_1[] = {
|
||||
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 5 }, /* playerId at 573 */
|
||||
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 4 }, /* resultCard1 at 574 */
|
||||
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -2, 3 }, /* resultCard2 at 575 */
|
||||
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 4, -3, 2 }, /* cardsValue at 577 */
|
||||
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 5, -4, 1 }, /* moneyWon at 578 */
|
||||
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 6, -5, 0 }, /* playerMoney at 580 */
|
||||
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 4, -3, 2 }, /* moneyWon at 577 */
|
||||
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 5, -4, 1 }, /* playerMoney at 578 */
|
||||
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 6, -5, 0 }, /* cardsValue at 579 */
|
||||
{ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 3, 0, 0 } /* bestHandPosition at 576 */
|
||||
};
|
||||
static asn_SEQUENCE_specifics_t asn_SPC_PlayerResult_specs_1 = {
|
||||
|
||||
Vendored
+2
-2
@@ -14,8 +14,8 @@
|
||||
/* Including external dependencies */
|
||||
#include "NonZeroId.h"
|
||||
#include "Card.h"
|
||||
#include <NativeInteger.h>
|
||||
#include "AmountOfMoney.h"
|
||||
#include <NativeInteger.h>
|
||||
#include <asn_SEQUENCE_OF.h>
|
||||
#include <constr_SEQUENCE_OF.h>
|
||||
#include <constr_SEQUENCE.h>
|
||||
@@ -35,9 +35,9 @@ extern "C" {
|
||||
/* Context for parsing across buffer boundaries */
|
||||
asn_struct_ctx_t _asn_ctx;
|
||||
} bestHandPosition;
|
||||
long cardsValue;
|
||||
AmountOfMoney_t moneyWon;
|
||||
AmountOfMoney_t playerMoney;
|
||||
long *cardsValue /* OPTIONAL */;
|
||||
/*
|
||||
* This type is extensible,
|
||||
* possible extensions are below.
|
||||
|
||||
Reference in New Issue
Block a user