Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 26, 2008, 9:21:53 PM (16 years ago)
Author:
scheusso
Message:

another one bites the dust: solved that problem with zeros in the gamestate

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network/src/network/Client.cc

    r1425 r1431  
    8585    isConnected=false;
    8686    isSynched_=false;
     87    gameStateFailure_=false;
    8788  }
    8889
     
    9596    isConnected=false;
    9697    isSynched_=false;
     98    gameStateFailure_=false;
    9799  }
    98100
     
    105107    isConnected=false;
    106108    isSynched_=false;
     109    gameStateFailure_=false;
    107110  }
    108111
     
    247250    }
    248251    int gameStateID = gamestate.processGameState();
    249     if(gameStateID!=GAMESTATEID_INITIAL){
     252    if(gameStateID==GAMESTATEID_INITIAL)
     253      if(gameStateFailure_){
     254        if(!client_connection.addPacket(pck_gen.acknowledgement(GAMESTATEID_INITIAL)))
     255          COUT(3) << "could not (negatively) ack gamestate" << std::endl;
     256        else
     257          COUT(4) << "negatively acked a gamestate" << std::endl;
     258        }
     259      else
     260        gameStateFailure_=true;
     261    else if(gameStateID!=0){
    250262      // ack gamestate and set synched
    251263      if(!isSynched_)
    252264        isSynched_=true;
     265      gameStateFailure_=false;
    253266      if(!client_connection.addPacket(pck_gen.acknowledgement(gameStateID)))
    254267        COUT(3) << "could not ack gamestate" << std::endl;
    255     }
     268    }// otherwise we had no gamestate to load
    256269    gamestate.cleanup();
    257270    if(!client_connection.sendPackets())
Note: See TracChangeset for help on using the changeset viewer.