Commit 58f43339 authored by mercury233's avatar mercury233

Revert "Revert "fix extra pendulum count for tag""

This reverts commit 5b95c2ed.
parent f0ee4725
...@@ -2932,6 +2932,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -2932,6 +2932,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int player = mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf)); int player = mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf));
size_t mcount = (size_t)BufferIO::ReadInt8(pbuf); size_t mcount = (size_t)BufferIO::ReadInt8(pbuf);
size_t ecount = (size_t)BufferIO::ReadInt8(pbuf); size_t ecount = (size_t)BufferIO::ReadInt8(pbuf);
size_t pcount = (size_t)BufferIO::ReadInt8(pbuf);
size_t hcount = (size_t)BufferIO::ReadInt8(pbuf); size_t hcount = (size_t)BufferIO::ReadInt8(pbuf);
int topcode = BufferIO::ReadInt32(pbuf); int topcode = BufferIO::ReadInt32(pbuf);
if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping) { if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping) {
...@@ -3006,6 +3007,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -3006,6 +3007,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->dField.extra[player].push_back(ccard); mainGame->dField.extra[player].push_back(ccard);
} }
} }
mainGame->dField.extra_p_count[player] = pcount;
if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping) if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping)
mainGame->gMutex.Unlock(); mainGame->gMutex.Unlock();
// //
...@@ -3029,7 +3031,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -3029,7 +3031,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
} }
for (auto cit = mainGame->dField.extra[player].begin(); cit != mainGame->dField.extra[player].end(); ++cit) { for (auto cit = mainGame->dField.extra[player].begin(); cit != mainGame->dField.extra[player].end(); ++cit) {
ClientCard* pcard = *cit; ClientCard* pcard = *cit;
pcard->code = 0; pcard->code = BufferIO::ReadInt32(pbuf) & 0x7fffffff;
mainGame->dField.GetCardLocation(pcard, &pcard->curPos, &pcard->curRot); mainGame->dField.GetCardLocation(pcard, &pcard->curPos, &pcard->curRot);
if(player == 0) pcard->curPos.Y += 2.0f; if(player == 0) pcard->curPos.Y += 2.0f;
else pcard->curPos.Y -= 3.0f; else pcard->curPos.Y -= 3.0f;
......
...@@ -653,7 +653,7 @@ bool ReplayMode::ReplayAnalyze(char* msg, unsigned int len) { ...@@ -653,7 +653,7 @@ bool ReplayMode::ReplayAnalyze(char* msg, unsigned int len) {
} }
case MSG_TAG_SWAP: { case MSG_TAG_SWAP: {
player = pbuf[0]; player = pbuf[0];
pbuf += pbuf[3] * 4 + 8; pbuf += pbuf[2] * 4 + pbuf[4] * 4 + 9;
DuelClient::ClientAnalyze(offset, pbuf - offset); DuelClient::ClientAnalyze(offset, pbuf - offset);
ReplayRefreshDeck(player); ReplayRefreshDeck(player);
ReplayRefreshExtra(player); ReplayRefreshExtra(player);
......
...@@ -598,7 +598,7 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) { ...@@ -598,7 +598,7 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
} }
case MSG_TAG_SWAP: { case MSG_TAG_SWAP: {
player = pbuf[0]; player = pbuf[0];
pbuf += pbuf[3] * 4 + 8; pbuf += pbuf[2] * 4 + pbuf[4] * 4 + 9;
DuelClient::ClientAnalyze(offset, pbuf - offset); DuelClient::ClientAnalyze(offset, pbuf - offset);
SinglePlayRefreshDeck(player); SinglePlayRefreshDeck(player);
SinglePlayRefreshExtra(player); SinglePlayRefreshExtra(player);
......
...@@ -1355,10 +1355,11 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) { ...@@ -1355,10 +1355,11 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) {
case MSG_TAG_SWAP: { case MSG_TAG_SWAP: {
player = BufferIO::ReadInt8(pbuf); player = BufferIO::ReadInt8(pbuf);
/*int mcount = */BufferIO::ReadInt8(pbuf); /*int mcount = */BufferIO::ReadInt8(pbuf);
/*int ecount = */BufferIO::ReadInt8(pbuf); int ecount = BufferIO::ReadInt8(pbuf);
/*int pcount = */BufferIO::ReadInt8(pbuf);
int hcount = BufferIO::ReadInt8(pbuf); int hcount = BufferIO::ReadInt8(pbuf);
pbufw = pbuf + 4; pbufw = pbuf + 4;
pbuf += hcount * 4 + 4; pbuf += hcount * 4 + ecount * 4 + 4;
NetServer::SendBufferToPlayer(cur_player[player], STOC_GAME_MSG, offset, pbuf - offset); NetServer::SendBufferToPlayer(cur_player[player], STOC_GAME_MSG, offset, pbuf - offset);
for (int i = 0; i < hcount; ++i) { for (int i = 0; i < hcount; ++i) {
if(!(pbufw[3] & 0x80)) if(!(pbufw[3] & 0x80))
...@@ -1366,6 +1367,12 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) { ...@@ -1366,6 +1367,12 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) {
else else
pbufw += 4; pbufw += 4;
} }
for (int i = 0; i < ecount; ++i) {
if(!(pbufw[3] & 0x80))
BufferIO::WriteInt32(pbufw, 0);
else
pbufw += 4;
}
for(int i = 0; i < 4; ++i) for(int i = 0; i < 4; ++i)
if(players[i] != cur_player[player]) if(players[i] != cur_player[player])
NetServer::SendBufferToPlayer(players[i], STOC_GAME_MSG, offset, pbuf - offset); NetServer::SendBufferToPlayer(players[i], STOC_GAME_MSG, offset, pbuf - offset);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment