Commit 90488d48 authored by nanahira's avatar nanahira

skystriker thing

parent 6de6d71d
Pipeline #23908 passed with stages
in 3 minutes and 44 seconds
...@@ -705,6 +705,9 @@ void SingleDuel::TPResult(DuelPlayer* dp, unsigned char tp) { ...@@ -705,6 +705,9 @@ void SingleDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
NetServer::ReSendToPlayer(players[1]); NetServer::ReSendToPlayer(players[1]);
for(auto oit = observers.begin(); oit != observers.end(); ++oit) for(auto oit = observers.begin(); oit != observers.end(); ++oit)
NetServer::ReSendToPlayer(*oit); NetServer::ReSendToPlayer(*oit);
#ifdef YGOPRO_SERVER_MODE
NetServer::ReSendToPlayers(cache_recorder, replay_recorder);
#endif
// server should send to recorder as well // server should send to recorder as well
RefreshGrave(0, 0xefffff, 0); RefreshGrave(0, 0xefffff, 0);
RefreshGrave(1, 0xefffff, 0); RefreshGrave(1, 0xefffff, 0);
...@@ -2040,15 +2043,16 @@ if(!dp || dp == players[player]) ...@@ -2040,15 +2043,16 @@ if(!dp || dp == players[player])
NetServer::ReSendToPlayer(replay_recorder); NetServer::ReSendToPlayer(replay_recorder);
#endif #endif
int qlen = 0; int qlen = 0;
/*while(qlen < len) { if(!is_skystriker[1 - player])
int clen = BufferIO::ReadInt32(qbuf); while(qlen < len) {
qlen += clen; int clen = BufferIO::ReadInt32(qbuf);
if (clen == 4) qlen += clen;
continue; if (clen == 4)
if (qbuf[11] & POS_FACEDOWN) continue;
memset(qbuf, 0, clen - 4); if (qbuf[11] & POS_FACEDOWN)
qbuf += clen - 4; memset(qbuf, 0, clen - 4);
}*/ qbuf += clen - 4;
}
#ifdef YGOPRO_SERVER_MODE #ifdef YGOPRO_SERVER_MODE
if(!dp || dp == players[1 - player]) if(!dp || dp == players[1 - player])
#endif #endif
...@@ -2088,15 +2092,16 @@ if(!dp || dp == players[player]) ...@@ -2088,15 +2092,16 @@ if(!dp || dp == players[player])
NetServer::ReSendToPlayer(replay_recorder); NetServer::ReSendToPlayer(replay_recorder);
#endif #endif
int qlen = 0; int qlen = 0;
/*while(qlen < len) { if(!is_skystriker[1 - player])
int clen = BufferIO::ReadInt32(qbuf); while(qlen < len) {
qlen += clen; int clen = BufferIO::ReadInt32(qbuf);
if (clen == 4) qlen += clen;
continue; if (clen == 4)
if (qbuf[11] & POS_FACEDOWN) continue;
memset(qbuf, 0, clen - 4); if (qbuf[11] & POS_FACEDOWN)
qbuf += clen - 4; memset(qbuf, 0, clen - 4);
}*/ qbuf += clen - 4;
}
#ifdef YGOPRO_SERVER_MODE #ifdef YGOPRO_SERVER_MODE
if(!dp || dp == players[1 - player]) if(!dp || dp == players[1 - player])
#endif #endif
...@@ -2136,18 +2141,19 @@ if(!dp || dp == players[player]) ...@@ -2136,18 +2141,19 @@ if(!dp || dp == players[player])
NetServer::ReSendToPlayer(replay_recorder); NetServer::ReSendToPlayer(replay_recorder);
#endif #endif
int qlen = 0; int qlen = 0;
/*while(qlen < len) { if(!is_skystriker[1 - player])
int slen = BufferIO::ReadInt32(qbuf); while(qlen < len) {
int qflag = *(int*)qbuf; int slen = BufferIO::ReadInt32(qbuf);
int offset = 8; int qflag = *(int*)qbuf;
if(!(qflag & QUERY_CODE)) int offset = 8;
offset -= 4; if(!(qflag & QUERY_CODE))
unsigned position = ((*(int*)(qbuf + offset)) >> 24) & 0xff; offset -= 4;
if(!(position & POS_FACEUP)) unsigned position = ((*(int*)(qbuf + offset)) >> 24) & 0xff;
memset(qbuf, 0, slen - 4); if(!(position & POS_FACEUP))
qbuf += slen - 4; memset(qbuf, 0, slen - 4);
qlen += slen; qbuf += slen - 4;
}*/ qlen += slen;
}
#ifdef YGOPRO_SERVER_MODE #ifdef YGOPRO_SERVER_MODE
if(!dp || dp == players[1 - player]) if(!dp || dp == players[1 - player])
#endif #endif
...@@ -2220,15 +2226,16 @@ if(!dp || dp == players[player]) ...@@ -2220,15 +2226,16 @@ if(!dp || dp == players[player])
if(!dp) if(!dp)
NetServer::ReSendToPlayer(replay_recorder); NetServer::ReSendToPlayer(replay_recorder);
int qlen = 0; int qlen = 0;
/*while(qlen < len) { if(!is_skystriker[1 - player])
int clen = BufferIO::ReadInt32(qbuf); while(qlen < len) {
qlen += clen; int clen = BufferIO::ReadInt32(qbuf);
if (clen == 4) qlen += clen;
continue; if (clen == 4)
if (qbuf[11] & POS_FACEDOWN) continue;
memset(qbuf, 0, clen - 4); if (qbuf[11] & POS_FACEDOWN)
qbuf += clen - 4; memset(qbuf, 0, clen - 4);
}*/ qbuf += clen - 4;
}
if(!dp || dp == players[1 - player]) if(!dp || dp == players[1 - player])
NetServer::SendBufferToPlayer(players[1 - player], STOC_GAME_MSG, query_buffer, len + 3); NetServer::SendBufferToPlayer(players[1 - player], STOC_GAME_MSG, query_buffer, len + 3);
if(!dp) if(!dp)
...@@ -2251,15 +2258,16 @@ void SingleDuel::RefreshRemoved(int player, int flag, int use_cache, DuelPlayer* ...@@ -2251,15 +2258,16 @@ void SingleDuel::RefreshRemoved(int player, int flag, int use_cache, DuelPlayer*
if(!dp) if(!dp)
NetServer::ReSendToPlayer(replay_recorder); NetServer::ReSendToPlayer(replay_recorder);
int qlen = 0; int qlen = 0;
/*while(qlen < len) { if(!is_skystriker[1 - player])
int clen = BufferIO::ReadInt32(qbuf); while(qlen < len) {
qlen += clen; int clen = BufferIO::ReadInt32(qbuf);
if (clen == 4) qlen += clen;
continue; if (clen == 4)
if (qbuf[11] & POS_FACEDOWN) continue;
memset(qbuf, 0, clen - 4); if (qbuf[11] & POS_FACEDOWN)
qbuf += clen - 4; memset(qbuf, 0, clen - 4);
}*/ qbuf += clen - 4;
}
if(!dp || dp == players[1 - player]) if(!dp || dp == players[1 - player])
NetServer::SendBufferToPlayer(players[1 - player], STOC_GAME_MSG, query_buffer, len + 3); NetServer::SendBufferToPlayer(players[1 - player], STOC_GAME_MSG, query_buffer, len + 3);
if(!dp) if(!dp)
...@@ -2278,16 +2286,16 @@ void SingleDuel::RefreshSingle(int player, int location, int sequence, int flag) ...@@ -2278,16 +2286,16 @@ void SingleDuel::RefreshSingle(int player, int location, int sequence, int flag)
BufferIO::WriteInt8(qbuf, sequence); BufferIO::WriteInt8(qbuf, sequence);
int len = query_card(pduel, player, location, sequence, flag, (unsigned char*)qbuf, 0); int len = query_card(pduel, player, location, sequence, flag, (unsigned char*)qbuf, 0);
NetServer::SendBufferToPlayer(players[player], STOC_GAME_MSG, query_buffer, len + 4); NetServer::SendBufferToPlayer(players[player], STOC_GAME_MSG, query_buffer, len + 4);
//if(location == LOCATION_REMOVED && (qbuf[15] & POS_FACEDOWN)) if(!is_skystriker[1 - player] && location == LOCATION_REMOVED && (qbuf[15] & POS_FACEDOWN))
// return; return;
//if ((location & 0x90) || ((location & 0x2c) && (qbuf[15] & POS_FACEUP))) { if (is_skystriker[1 - player] || (location & 0x90) || ((location & 0x2c) && (qbuf[15] & POS_FACEUP))) {
NetServer::ReSendToPlayer(players[1 - player]); NetServer::ReSendToPlayer(players[1 - player]);
for(auto pit = observers.begin(); pit != observers.end(); ++pit) for(auto pit = observers.begin(); pit != observers.end(); ++pit)
NetServer::ReSendToPlayer(*pit); NetServer::ReSendToPlayer(*pit);
#ifdef YGOPRO_SERVER_MODE #ifdef YGOPRO_SERVER_MODE
NetServer::ReSendToPlayers(cache_recorder, replay_recorder); NetServer::ReSendToPlayers(cache_recorder, replay_recorder);
#endif #endif
//} }
} }
int SingleDuel::MessageHandler(intptr_t fduel, int type) { int SingleDuel::MessageHandler(intptr_t fduel, int type) {
if(!enable_log) if(!enable_log)
......
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