GLProgramming.com

home :: about :: development guides :: irc :: forums :: search :: paste :: links :: contribute :: code dump

-> Click here to learn how to get live help <-


New Paste :: Recent Pastes:: No Line Numbers


A Paste by Icebird
1
 
void update( void )
{
    sockset.fd_count = 1;
    
    int i = 0;
    while( select( 0, &sockset, NULL, NULL, &interval ) > 0 )
    {
        if( recvfrom( sock, (char *)&tempPlayer, packetSize, 0, (struct sockaddr *)&servAddr, &addrSize ) == packetSize )
        {
            if( tempPlayer.id == -1 )
                Me.id = tempPlayer.loc[0];
            else
                memcpy( &players[tempPlayer.id].loc, &tempPlayer.loc, locSize );
        }
        if( i > numPlayers )    break;
        sockset.fd_count = 1;
    }
}