Commit 90488d48 authored by nanahira's avatar nanahira

skystriker thing

parent 6de6d71d
......@@ -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,15 +2043,16 @@ if(!dp || dp == players[player])
NetServer::ReSendToPlayer(replay_recorder);
#endif
int qlen = 0;
/*while(qlen < len) {
int clen = BufferIO::ReadInt32(qbuf);
qlen += clen;
if (clen == 4)
continue;
if (qbuf[11] & POS_FACEDOWN)
memset(qbuf, 0, clen - 4);
qbuf += clen - 4;
}*/
if(!is_skystriker[1 - player])
while(qlen < len) {
int clen = BufferIO::ReadInt32(qbuf);
qlen += clen;
if (clen == 4)
continue;
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,15 +2092,16 @@ if(!dp || dp == players[player])
NetServer::ReSendToPlayer(replay_recorder);
#endif
int qlen = 0;
/*while(qlen < len) {
int clen = BufferIO::ReadInt32(qbuf);
qlen += clen;
if (clen == 4)
continue;
if (qbuf[11] & POS_FACEDOWN)
memset(qbuf, 0, clen - 4);
qbuf += clen - 4;
}*/
if(!is_skystriker[1 - player])
while(qlen < len) {
int clen = BufferIO::ReadInt32(qbuf);
qlen += clen;
if (clen == 4)
continue;
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,18 +2141,19 @@ if(!dp || dp == players[player])
NetServer::ReSendToPlayer(replay_recorder);
#endif
int qlen = 0;
/*while(qlen < len) {
int slen = BufferIO::ReadInt32(qbuf);
int qflag = *(int*)qbuf;
int offset = 8;
if(!(qflag & QUERY_CODE))
offset -= 4;
unsigned position = ((*(int*)(qbuf + offset)) >> 24) & 0xff;
if(!(position & POS_FACEUP))
memset(qbuf, 0, slen - 4);
qbuf += slen - 4;
qlen += slen;
}*/
if(!is_skystriker[1 - player])
while(qlen < len) {
int slen = BufferIO::ReadInt32(qbuf);
int qflag = *(int*)qbuf;
int offset = 8;
if(!(qflag & QUERY_CODE))
offset -= 4;
unsigned position = ((*(int*)(qbuf + offset)) >> 24) & 0xff;
if(!(position & POS_FACEUP))
memset(qbuf, 0, slen - 4);
qbuf += slen - 4;
qlen += slen;
}
#ifdef YGOPRO_SERVER_MODE
if(!dp || dp == players[1 - player])
#endif
......@@ -2220,15 +2226,16 @@ if(!dp || dp == players[player])
if(!dp)
NetServer::ReSendToPlayer(replay_recorder);
int qlen = 0;
/*while(qlen < len) {
int clen = BufferIO::ReadInt32(qbuf);
qlen += clen;
if (clen == 4)
continue;
if (qbuf[11] & POS_FACEDOWN)
memset(qbuf, 0, clen - 4);
qbuf += clen - 4;
}*/
if(!is_skystriker[1 - player])
while(qlen < len) {
int clen = BufferIO::ReadInt32(qbuf);
qlen += clen;
if (clen == 4)
continue;
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,15 +2258,16 @@ void SingleDuel::RefreshRemoved(int player, int flag, int use_cache, DuelPlayer*
if(!dp)
NetServer::ReSendToPlayer(replay_recorder);
int qlen = 0;
/*while(qlen < len) {
int clen = BufferIO::ReadInt32(qbuf);
qlen += clen;
if (clen == 4)
continue;
if (qbuf[11] & POS_FACEDOWN)
memset(qbuf, 0, clen - 4);
qbuf += clen - 4;
}*/
if(!is_skystriker[1 - player])
while(qlen < len) {
int clen = BufferIO::ReadInt32(qbuf);
qlen += clen;
if (clen == 4)
continue;
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