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) {
NetServer::ReSendToPlayer(players[1]);
for(auto oit = observers.begin(); oit != observers.end(); ++oit)
NetServer::ReSendToPlayer(*oit);
#ifdef YGOPRO_SERVER_MODE
NetServer::ReSendToPlayers(cache_recorder, replay_recorder);
#endif
// server should send to recorder as well
RefreshGrave(0, 0xefffff, 0);
RefreshGrave(1, 0xefffff, 0);
......@@ -2040,7 +2043,8 @@ if(!dp || dp == players[player])
NetServer::ReSendToPlayer(replay_recorder);
#endif
int qlen = 0;
/*while(qlen < len) {
if(!is_skystriker[1 - player])
while(qlen < len) {
int clen = BufferIO::ReadInt32(qbuf);
qlen += clen;
if (clen == 4)
......@@ -2048,7 +2052,7 @@ if(!dp || dp == players[player])
if (qbuf[11] & POS_FACEDOWN)
memset(qbuf, 0, clen - 4);
qbuf += clen - 4;
}*/
}
#ifdef YGOPRO_SERVER_MODE
if(!dp || dp == players[1 - player])
#endif
......@@ -2088,7 +2092,8 @@ if(!dp || dp == players[player])
NetServer::ReSendToPlayer(replay_recorder);
#endif
int qlen = 0;
/*while(qlen < len) {
if(!is_skystriker[1 - player])
while(qlen < len) {
int clen = BufferIO::ReadInt32(qbuf);
qlen += clen;
if (clen == 4)
......@@ -2096,7 +2101,7 @@ if(!dp || dp == players[player])
if (qbuf[11] & POS_FACEDOWN)
memset(qbuf, 0, clen - 4);
qbuf += clen - 4;
}*/
}
#ifdef YGOPRO_SERVER_MODE
if(!dp || dp == players[1 - player])
#endif
......@@ -2136,7 +2141,8 @@ if(!dp || dp == players[player])
NetServer::ReSendToPlayer(replay_recorder);
#endif
int qlen = 0;
/*while(qlen < len) {
if(!is_skystriker[1 - player])
while(qlen < len) {
int slen = BufferIO::ReadInt32(qbuf);
int qflag = *(int*)qbuf;
int offset = 8;
......@@ -2147,7 +2153,7 @@ if(!dp || dp == players[player])
memset(qbuf, 0, slen - 4);
qbuf += slen - 4;
qlen += slen;
}*/
}
#ifdef YGOPRO_SERVER_MODE
if(!dp || dp == players[1 - player])
#endif
......@@ -2220,7 +2226,8 @@ if(!dp || dp == players[player])
if(!dp)
NetServer::ReSendToPlayer(replay_recorder);
int qlen = 0;
/*while(qlen < len) {
if(!is_skystriker[1 - player])
while(qlen < len) {
int clen = BufferIO::ReadInt32(qbuf);
qlen += clen;
if (clen == 4)
......@@ -2228,7 +2235,7 @@ if(!dp || dp == players[player])
if (qbuf[11] & POS_FACEDOWN)
memset(qbuf, 0, clen - 4);
qbuf += clen - 4;
}*/
}
if(!dp || dp == players[1 - player])
NetServer::SendBufferToPlayer(players[1 - player], STOC_GAME_MSG, query_buffer, len + 3);
if(!dp)
......@@ -2251,7 +2258,8 @@ void SingleDuel::RefreshRemoved(int player, int flag, int use_cache, DuelPlayer*
if(!dp)
NetServer::ReSendToPlayer(replay_recorder);
int qlen = 0;
/*while(qlen < len) {
if(!is_skystriker[1 - player])
while(qlen < len) {
int clen = BufferIO::ReadInt32(qbuf);
qlen += clen;
if (clen == 4)
......@@ -2259,7 +2267,7 @@ void SingleDuel::RefreshRemoved(int player, int flag, int use_cache, DuelPlayer*
if (qbuf[11] & POS_FACEDOWN)
memset(qbuf, 0, clen - 4);
qbuf += clen - 4;
}*/
}
if(!dp || dp == players[1 - player])
NetServer::SendBufferToPlayer(players[1 - player], STOC_GAME_MSG, query_buffer, len + 3);
if(!dp)
......@@ -2278,16 +2286,16 @@ void SingleDuel::RefreshSingle(int player, int location, int sequence, int flag)
BufferIO::WriteInt8(qbuf, sequence);
int len = query_card(pduel, player, location, sequence, flag, (unsigned char*)qbuf, 0);
NetServer::SendBufferToPlayer(players[player], STOC_GAME_MSG, query_buffer, len + 4);
//if(location == LOCATION_REMOVED && (qbuf[15] & POS_FACEDOWN))
// return;
//if ((location & 0x90) || ((location & 0x2c) && (qbuf[15] & POS_FACEUP))) {
if(!is_skystriker[1 - player] && location == LOCATION_REMOVED && (qbuf[15] & POS_FACEDOWN))
return;
if (is_skystriker[1 - player] || (location & 0x90) || ((location & 0x2c) && (qbuf[15] & POS_FACEUP))) {
NetServer::ReSendToPlayer(players[1 - player]);
for(auto pit = observers.begin(); pit != observers.end(); ++pit)
NetServer::ReSendToPlayer(*pit);
#ifdef YGOPRO_SERVER_MODE
NetServer::ReSendToPlayers(cache_recorder, replay_recorder);
#endif
//}
}
}
int SingleDuel::MessageHandler(intptr_t fduel, int type) {
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