Commit d7dbd3f5 authored by nanahira's avatar nanahira

Merge branch 'master' into server

parents 56278c1a ee335948
......@@ -1010,6 +1010,10 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
is_swapping = false;
}
switch(mainGame->dInfo.curMsg) {
case MSG_RESET_TIME: {
pbuf += 2;
break;
}
case MSG_RETRY: {
if(last_successful_msg_length) {
char* p = last_successful_msg;
......
......@@ -310,6 +310,10 @@ bool ReplayMode::ReplayAnalyze(char* msg, unsigned int len) {
bool pauseable = true;
mainGame->dInfo.curMsg = BufferIO::ReadUInt8(pbuf);
switch (mainGame->dInfo.curMsg) {
case MSG_RESET_TIME: {
pbuf += 2;
break;
}
case MSG_RETRY: {
if(mainGame->dInfo.isReplaySkiping) {
mainGame->dInfo.isReplaySkiping = false;
......
......@@ -747,6 +747,17 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
offset = pbuf;
unsigned char engType = BufferIO::ReadUInt8(pbuf);
switch (engType) {
case MSG_RESET_TIME: {
player = BufferIO::ReadInt8(pbuf);
int time = BufferIO::ReadInt8(pbuf);
if(host_info.time_limit) {
if(time)
time_limit[player] = time;
else
time_limit[player] = host_info.time_limit;
}
break;
}
case MSG_RETRY: {
WaitforResponse(last_response);
NetServer::SendBufferToPlayer(players[last_response], STOC_GAME_MSG, offset, pbuf - offset);
......
......@@ -181,6 +181,10 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
offset = pbuf;
mainGame->dInfo.curMsg = BufferIO::ReadUInt8(pbuf);
switch (mainGame->dInfo.curMsg) {
case MSG_RESET_TIME: {
pbuf += 2;
break;
}
case MSG_RETRY: {
if(!DuelClient::ClientAnalyze(offset, pbuf - offset)) {
mainGame->singleSignal.Reset();
......
......@@ -703,6 +703,17 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) {
offset = pbuf;
unsigned char engType = BufferIO::ReadUInt8(pbuf);
switch (engType) {
case MSG_RESET_TIME: {
player = BufferIO::ReadInt8(pbuf);
int time = BufferIO::ReadInt8(pbuf);
if(host_info.time_limit) {
if(time)
time_limit[player] = time;
else
time_limit[player] = host_info.time_limit;
}
break;
}
case MSG_RETRY: {
WaitforResponse(last_response);
NetServer::SendBufferToPlayer(cur_player[last_response], STOC_GAME_MSG, offset, pbuf - offset);
......
Subproject commit 713fa28498e55cce46da359234c501ffe16d34d9
Subproject commit b43c3762795b73c51c3bcb684fe789fc7bb07b17
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