Commit 2cc2ad72 authored by nanahira's avatar nanahira

test +1s

parent 0d1850d7
......@@ -699,6 +699,10 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
while (pbuf - msgbuffer < (int)len) {
offset = pbuf;
unsigned char engType = BufferIO::ReadUInt8(pbuf);
#ifdef YGOPRO_SERVER_MODE
if(engType != MSG_RETRY)
curMsg = engType;
#endif
switch (engType) {
case MSG_RETRY: {
WaitforResponse(last_response);
......@@ -1731,6 +1735,16 @@ void SingleDuel::GetResponse(DuelPlayer* dp, void* pdata, unsigned int len) {
else time_limit[dp->type] = 0;
event_del(etimer);
}
#ifdef YGOPRO_SERVER_MODE
if(len >= 4 && time_limit[dp->type] < host_info.time_limit) {
int resp = *(int*)pdata;
if((curMsg == MSG_SELECT_IDLECMD && (resp & 0xffff) != 8)
|| (curMsg == MSG_SELECT_BATTLECMD)
|| (curMsg == MSG_SELECT_CHAIN && resp != -1)
)
++time_limit[dp->type];
}
#endif
Process();
}
void SingleDuel::EndDuel() {
......
......@@ -68,6 +68,7 @@ protected:
DuelPlayer* replay_recorder;
unsigned char turn_player;
unsigned short phase;
unsigned char curMsg;
#endif
Replay last_replay;
bool match_mode;
......
......@@ -639,6 +639,10 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) {
while (pbuf - msgbuffer < (int)len) {
offset = pbuf;
unsigned char engType = BufferIO::ReadUInt8(pbuf);
#ifdef YGOPRO_SERVER_MODE
if(engType != MSG_RETRY)
curMsg = engType;
#endif
switch (engType) {
case MSG_RETRY: {
WaitforResponse(last_response);
......@@ -1800,6 +1804,17 @@ void TagDuel::GetResponse(DuelPlayer* dp, void* pdata, unsigned int len) {
else time_limit[resp_type] = 0;
event_del(etimer);
}
#ifdef YGOPRO_SERVER_MODE
int resp_type = dp->type < 2 ? 0 : 1;
if(len >= 4 && time_limit[resp_type] < host_info.time_limit) {
int resp = *(int*)pdata;
if((curMsg == MSG_SELECT_IDLECMD && (resp & 0xffff) != 8)
|| (curMsg == MSG_SELECT_BATTLECMD)
|| (curMsg == MSG_SELECT_CHAIN && resp != -1)
)
++time_limit[resp_type];
}
#endif
Process();
}
void TagDuel::EndDuel() {
......
......@@ -64,6 +64,7 @@ protected:
DuelPlayer* replay_recorder;
int turn_player;
int phase;
unsigned char curMsg;
#endif
bool ready[4];
Deck pdeck[4];
......
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