Adding country code to protocol (currently broken).
This commit is contained in:
@@ -249,6 +249,7 @@ PlayerInfoData ::= SEQUENCE {
|
|||||||
playerName UTF8String (SIZE(1..32)),
|
playerName UTF8String (SIZE(1..32)),
|
||||||
isHuman BOOLEAN,
|
isHuman BOOLEAN,
|
||||||
playerRights PlayerInfoRights,
|
playerRights PlayerInfoRights,
|
||||||
|
countryCode UTF8String (SIZE(2)) OPTIONAL,
|
||||||
avatarData SEQUENCE {
|
avatarData SEQUENCE {
|
||||||
avatarType NetAvatarType,
|
avatarType NetAvatarType,
|
||||||
avatar AvatarHash
|
avatar AvatarHash
|
||||||
|
|||||||
@@ -670,7 +670,11 @@ AbstractClientStateReceiving::HandlePacket(boost::shared_ptr<ClientThread> clien
|
|||||||
tmpInfo.playerName = STL_STRING_FROM_OCTET_STRING(netInfo->playerName);
|
tmpInfo.playerName = STL_STRING_FROM_OCTET_STRING(netInfo->playerName);
|
||||||
tmpInfo.ptype = netInfo->isHuman ? PLAYER_TYPE_HUMAN : PLAYER_TYPE_COMPUTER;
|
tmpInfo.ptype = netInfo->isHuman ? PLAYER_TYPE_HUMAN : PLAYER_TYPE_COMPUTER;
|
||||||
tmpInfo.isGuest = netInfo->playerRights == PlayerInfoRights_playerRightsGuest;
|
tmpInfo.isGuest = netInfo->playerRights == PlayerInfoRights_playerRightsGuest;
|
||||||
if (netInfo->avatarData != NULL)
|
if (netInfo->countryCode)
|
||||||
|
{
|
||||||
|
tmpInfo.countryCode = STL_STRING_FROM_OCTET_STRING(*netInfo->countryCode);
|
||||||
|
}
|
||||||
|
if (netInfo->avatarData)
|
||||||
{
|
{
|
||||||
tmpInfo.hasAvatar = true;
|
tmpInfo.hasAvatar = true;
|
||||||
memcpy(tmpInfo.avatar.GetData(), netInfo->avatarData->avatar.buf, MD5_DATA_SIZE);
|
memcpy(tmpInfo.avatar.GetData(), netInfo->avatarData->avatar.buf, MD5_DATA_SIZE);
|
||||||
|
|||||||
@@ -1205,7 +1205,7 @@ ServerLobbyThread::HandleNetPacketRetrievePlayerInfo(SessionWrapper session, con
|
|||||||
PlayerInfoReplyMessage_t *netPlayerInfoReply = &packet->GetMsg()->choice.playerInfoReplyMessage;
|
PlayerInfoReplyMessage_t *netPlayerInfoReply = &packet->GetMsg()->choice.playerInfoReplyMessage;
|
||||||
netPlayerInfoReply->playerId = tmpPlayer->GetUniqueId();
|
netPlayerInfoReply->playerId = tmpPlayer->GetUniqueId();
|
||||||
|
|
||||||
if (tmpPlayer.get())
|
if (tmpPlayer)
|
||||||
{
|
{
|
||||||
// Send player info to client.
|
// Send player info to client.
|
||||||
netPlayerInfoReply->playerInfoResult.present = playerInfoResult_PR_playerInfoData;
|
netPlayerInfoReply->playerInfoResult.present = playerInfoResult_PR_playerInfoData;
|
||||||
@@ -1217,6 +1217,13 @@ ServerLobbyThread::HandleNetPacketRetrievePlayerInfo(SessionWrapper session, con
|
|||||||
&data->playerName,
|
&data->playerName,
|
||||||
tmpPlayer->GetName().c_str(),
|
tmpPlayer->GetName().c_str(),
|
||||||
tmpPlayer->GetName().length());
|
tmpPlayer->GetName().length());
|
||||||
|
if (!tmpPlayer->GetCountry().empty())
|
||||||
|
{
|
||||||
|
data->countryCode = OCTET_STRING_new_fromBuf(
|
||||||
|
&asn_DEF_UTF8String,
|
||||||
|
tmpPlayer->GetCountry().c_str(),
|
||||||
|
tmpPlayer->GetCountry().length());
|
||||||
|
}
|
||||||
if (!tmpPlayer->GetAvatarMD5().IsZero())
|
if (!tmpPlayer->GetAvatarMD5().IsZero())
|
||||||
{
|
{
|
||||||
data->avatarData = (struct PlayerInfoData::avatarData *)calloc(1, sizeof(struct PlayerInfoData::avatarData));
|
data->avatarData = (struct PlayerInfoData::avatarData *)calloc(1, sizeof(struct PlayerInfoData::avatarData));
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ struct PlayerInfo
|
|||||||
std::string playerName;
|
std::string playerName;
|
||||||
PlayerType ptype;
|
PlayerType ptype;
|
||||||
bool isGuest;
|
bool isGuest;
|
||||||
|
std::string countryCode;
|
||||||
bool hasAvatar;
|
bool hasAvatar;
|
||||||
MD5Buf avatar;
|
MD5Buf avatar;
|
||||||
AvatarFileType avatarType;
|
AvatarFileType avatarType;
|
||||||
|
|||||||
Reference in New Issue
Block a user