Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 25, 2006, 5:39:49 PM (18 years ago)
Author:
patrick
Message:

working on a dual connection server socket

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/proxy/src/lib/network/udp_server_socket.cc

    r9460 r9461  
    269269  int newConn = 0;
    270270
     271  // iterate through all newly received packets and assign them to the users packet buffer
    271272  for ( res = SDLNet_UDP_Recv( socket, packet ); res == 1; res = SDLNet_UDP_Recv( socket, packet ) )
    272273  {
     
    277278      continue;
    278279
    279     for ( userId =0; userId < (int)userList.size(); userId++ )
    280       if ( userList[userId].addr.host == packet->address.host && userList[userId].addr.port == packet->address.port && userList[userId].randomByte == ( packet->data[0] & 0xFC ) )
     280    // search the user id this backet belongs to
     281    for ( userId = 0; userId < (int)userList.size(); userId++ )
     282    {
     283      if ( userList[userId].addr.host == packet->address.host &&
     284           userList[userId].addr.port == packet->address.port &&
     285           userList[userId].randomByte == ( packet->data[0] & 0xFC ) )
    281286        break;
    282 
     287    }
     288
     289    // is it a new packet initializing a new connecion?
    283290    if ( userId >= (int)userList.size() )
    284291    {
     
    302309    }
    303310
    304     //add new packet to packetbuffer
    305 
     311
     312    // add new packet to packetbuffer
    306313    NetworkPacket networkPacket;
    307314    networkPacket.length = packet->len;
Note: See TracChangeset for help on using the changeset viewer.