Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 12, 2009, 11:58:01 PM (15 years ago)
Author:
rgrieder
Message:

Merged most of the core4 revisions back to the trunk except for:

  • orxonox_cast
  • all the radical changes in the input library
Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/network/packet/Packet.cc

    r3214 r3280  
    6363Packet::Packet(){
    6464  flags_ = PACKET_FLAG_DEFAULT;
    65   packetDirection_ = ENUM::Outgoing;
     65  packetDirection_ = Direction::Outgoing;
    6666  clientID_=0;
    6767  data_=0;
     
    7676Packet::Packet(uint8_t *data, unsigned int clientID){
    7777  flags_ = PACKET_FLAG_DEFAULT;
    78   packetDirection_ = ENUM::Incoming;
     78  packetDirection_ = Direction::Incoming;
    7979  clientID_=clientID;
    8080  data_=data;
     
    125125
    126126bool Packet::send(){
    127   if(packetDirection_ != ENUM::Outgoing && packetDirection_ != ENUM::Bidirectional ){
     127  if(packetDirection_ != Direction::Outgoing && packetDirection_ != Direction::Bidirectional ){
    128128    assert(0);
    129129    return false;
     
    147147  }
    148148#ifndef NDEBUG
    149   switch( *(ENUM::Type *)(data_ + _PACKETID) )
     149  switch( *(Type::Value *)(data_ + _PACKETID) )
    150150  {
    151     case ENUM::Acknowledgement:
    152     case ENUM::Chat:
    153     case ENUM::ClassID:
    154     case ENUM::Gamestate:
    155     case ENUM::Welcome:
    156     case ENUM::DeleteObjects:
    157     case ENUM::FunctionIDs:
    158     case ENUM::FunctionCalls:
     151    case Type::Acknowledgement:
     152    case Type::Chat:
     153    case Type::ClassID:
     154    case Type::Gamestate:
     155    case Type::Welcome:
     156    case Type::DeleteObjects:
     157    case Type::FunctionIDs:
     158    case Type::FunctionCalls:
    159159      break;
    160160    default:
     
    175175  unsigned int clientID = ClientInformation::findClient(&peer->address)->getID();
    176176  Packet *p = 0;
    177   COUT(6) << "packet type: " << *(ENUM::Type *)&data[_PACKETID] << std::endl;
    178   switch( *(ENUM::Type *)(data + _PACKETID) )
     177  COUT(6) << "packet type: " << *(Type::Value *)&data[_PACKETID] << std::endl;
     178  switch( *(Type::Value *)(data + _PACKETID) )
    179179  {
    180     case ENUM::Acknowledgement:
     180    case Type::Acknowledgement:
    181181      COUT(5) << "ack" << std::endl;
    182182      p = new Acknowledgement( data, clientID );
    183183      break;
    184     case ENUM::Chat:
     184    case Type::Chat:
    185185      COUT(5) << "chat" << std::endl;
    186186      p = new Chat( data, clientID );
    187187      break;
    188     case ENUM::ClassID:
     188    case Type::ClassID:
    189189      COUT(5) << "classid" << std::endl;
    190190      p = new ClassID( data, clientID );
    191191      break;
    192     case ENUM::Gamestate:
     192    case Type::Gamestate:
    193193      COUT(5) << "gamestate" << std::endl;
    194194      // TODO: remove brackets
    195195      p = new Gamestate( data, clientID );
    196196      break;
    197     case ENUM::Welcome:
     197    case Type::Welcome:
    198198      COUT(5) << "welcome" << std::endl;
    199199      p = new Welcome( data, clientID );
    200200      break;
    201     case ENUM::DeleteObjects:
     201    case Type::DeleteObjects:
    202202      COUT(5) << "deleteobjects" << std::endl;
    203203      p = new DeleteObjects( data, clientID );
    204204      break;
    205     case ENUM::FunctionCalls:
     205    case Type::FunctionCalls:
    206206      COUT(5) << "functionCalls" << std::endl;
    207207      p = new FunctionCalls( data, clientID );
    208208      break;
    209     case ENUM::FunctionIDs:
     209    case Type::FunctionIDs:
    210210      COUT(5) << "functionIDs" << std::endl;
    211211      p = new FunctionIDs( data, clientID );
Note: See TracChangeset for help on using the changeset viewer.