Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 5, 2007, 3:46:07 PM (16 years ago)
Author:
scheusso
Message:

CLient, Server

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FICN/src/network/PacketDecoder.cc

    r374 r400  
    4444                return true;
    4545                break;
     46          case CLASSID:
     47                clid(packet);
     48                return true;
     49                break;
    4650        }
    4751        return false;
     
    126130}
    127131
     132void PacketDecoder::clid( ENetPacket *packet)
     133{
     134        classid* cid = new classid;
     135        cid->length = ((classid*)(packet->data))->length;
     136        cid->id = ((classid *)(packet->data))->id;
     137        cid->classid = ((classid *)(packet->data))->classid;
     138        cid->message = (const char *)malloc(cid->length);
     139        enet_packet_destroy( packet );
     140        processClassid(&cid);
     141}
     142
     143
    128144// now the data processing functions:
    129145
     
    131147  printChat(data);
    132148}
     149
     150void PacketDecoder::processClassid( classid *cid){
     151  printClassid(cid);
     152  return;
     153}
     154
     155
    133156
    134157//these are some print functions for test stuff
     
    163186        cout << "size of gamestate: " << data->size << endl;
    164187}
     188
     189void PacketDecoder::printClassid( classid *cid)
     190{
     191        cout << "id of classid:    " << cid->id << endl;
     192        cout << "size of classid:  " << cid->length << endl;
     193        cout << "ID of classid:    " << cid->classid <<endl;
     194        cout << "data of classid:  " << cid->message <<endl;
     195}
Note: See TracChangeset for help on using the changeset viewer.