Commit 4cc3b3bf authored by salix5's avatar salix5

MSG_SELECT_COUNTER

Now a player can add/remove 2^16-1=65535 counters at a time.
parent dde1ac7a
...@@ -1426,7 +1426,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -1426,7 +1426,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
case MSG_SELECT_COUNTER: { case MSG_SELECT_COUNTER: {
/*int selecting_player = */BufferIO::ReadInt8(pbuf); /*int selecting_player = */BufferIO::ReadInt8(pbuf);
mainGame->dField.select_counter_type = BufferIO::ReadInt16(pbuf); mainGame->dField.select_counter_type = BufferIO::ReadInt16(pbuf);
mainGame->dField.select_counter_count = BufferIO::ReadInt8(pbuf); mainGame->dField.select_counter_count = BufferIO::ReadInt16(pbuf);
int count = BufferIO::ReadInt8(pbuf); int count = BufferIO::ReadInt8(pbuf);
mainGame->dField.selectable_cards.clear(); mainGame->dField.selectable_cards.clear();
int c, l, s, t/*, code*/; int c, l, s, t/*, code*/;
...@@ -1436,7 +1436,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -1436,7 +1436,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
c = mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf)); c = mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf));
l = BufferIO::ReadInt8(pbuf); l = BufferIO::ReadInt8(pbuf);
s = BufferIO::ReadInt8(pbuf); s = BufferIO::ReadInt8(pbuf);
t = BufferIO::ReadInt8(pbuf); t = BufferIO::ReadInt16(pbuf);
pcard = mainGame->dField.GetCard(c, l, s); pcard = mainGame->dField.GetCard(c, l, s);
mainGame->dField.selectable_cards.push_back(pcard); mainGame->dField.selectable_cards.push_back(pcard);
pcard->opParam = (t << 16) | t; pcard->opParam = (t << 16) | t;
......
...@@ -412,9 +412,9 @@ bool ReplayMode::ReplayAnalyze(char* msg, unsigned int len) { ...@@ -412,9 +412,9 @@ bool ReplayMode::ReplayAnalyze(char* msg, unsigned int len) {
} }
case MSG_SELECT_COUNTER: { case MSG_SELECT_COUNTER: {
player = BufferIO::ReadInt8(pbuf); player = BufferIO::ReadInt8(pbuf);
pbuf += 3; pbuf += 4;
count = BufferIO::ReadInt8(pbuf); count = BufferIO::ReadInt8(pbuf);
pbuf += count * 8; pbuf += count * 9;
return ReadReplayResponse(); return ReadReplayResponse();
} }
case MSG_SELECT_SUM: { case MSG_SELECT_SUM: {
......
...@@ -717,9 +717,9 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) { ...@@ -717,9 +717,9 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
} }
case MSG_SELECT_COUNTER: { case MSG_SELECT_COUNTER: {
player = BufferIO::ReadInt8(pbuf); player = BufferIO::ReadInt8(pbuf);
pbuf += 3; pbuf += 4;
count = BufferIO::ReadInt8(pbuf); count = BufferIO::ReadInt8(pbuf);
pbuf += count * 8; pbuf += count * 9;
WaitforResponse(player); WaitforResponse(player);
NetServer::SendBufferToPlayer(players[player], STOC_GAME_MSG, offset, pbuf - offset); NetServer::SendBufferToPlayer(players[player], STOC_GAME_MSG, offset, pbuf - offset);
return 1; return 1;
......
...@@ -243,9 +243,9 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) { ...@@ -243,9 +243,9 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
} }
case MSG_SELECT_COUNTER: { case MSG_SELECT_COUNTER: {
player = BufferIO::ReadInt8(pbuf); player = BufferIO::ReadInt8(pbuf);
pbuf += 3; pbuf += 4;
count = BufferIO::ReadInt8(pbuf); count = BufferIO::ReadInt8(pbuf);
pbuf += count * 8; pbuf += count * 9;
if(!DuelClient::ClientAnalyze(offset, pbuf - offset)) { if(!DuelClient::ClientAnalyze(offset, pbuf - offset)) {
mainGame->singleSignal.Reset(); mainGame->singleSignal.Reset();
mainGame->singleSignal.Wait(); mainGame->singleSignal.Wait();
......
...@@ -650,9 +650,9 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) { ...@@ -650,9 +650,9 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) {
} }
case MSG_SELECT_COUNTER: { case MSG_SELECT_COUNTER: {
player = BufferIO::ReadInt8(pbuf); player = BufferIO::ReadInt8(pbuf);
pbuf += 3; pbuf += 4;
count = BufferIO::ReadInt8(pbuf); count = BufferIO::ReadInt8(pbuf);
pbuf += count * 8; pbuf += count * 9;
WaitforResponse(player); WaitforResponse(player);
NetServer::SendBufferToPlayer(cur_player[player], STOC_GAME_MSG, offset, pbuf - offset); NetServer::SendBufferToPlayer(cur_player[player], STOC_GAME_MSG, offset, pbuf - offset);
return 1; return 1;
......
Subproject commit b2d983470ed5da3989e2b217c3e13b3c4e9352f5 Subproject commit 7f4e96536a73d8d06b1cc6dbfda206d5d65c4aff
Subproject commit 95e774916b34e4aaf47972742854cf4f30eec505 Subproject commit 95a86666fa3137bf7b2342e8bb5216de4e17014b
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