Hello,

i have tested this and have tested to recieve another packet but i dont get
any...

My code after i have connected i send the request and recieve it with this
function:

   FD_ZERO( &ReadSet );
   FD_SET( Socket, &ReadSet );
   timeVal.tv_sec = 1;
   timeVal.tv_usec = 0;

   for ( int i = 1; i <= 3; i++ )
   {
    if ( select( Socket+1, &ReadSet, NULL, NULL, &timeVal ) == 1 )
    {
     if ( FD_ISSET( Socket, &ReadSet ) )
     {
      bytes = recv( Socket, buffer, sizeof( buffer ) - 1, 0 );
      buffer[ bytes ] = '\0';

      if ( bytes == SOCKET_ERROR || bytes == 0 )
      {
       printf( "    Server offline\n" );

       return;
      }
      else if ( buffer[ 4 ] != S2A_RULES )
      {
       printf( "     Error by recieving Rules!\n" );
      }

      printf( "     NumRulez: %i\n", *(short*)&buffer[5] );
     }
    }
    else
    {
     Retrys--;
     printf( "No answer...\n" );
    }
   }

In this test i run 3 times to check for 3 packets (as test)...
So in my test i have to recieve 2 packets by the servers that send me the
errors!

But i recieve:

Connected: 195.210.58.104:27015
     NumRulez: 64
No answer...
No answer...
Connected: 85.131.173.50:26000
     NumRulez: 64
No answer...
No answer...
Connected: 82.96.106.43:27100
     NumRulez: 64
No answer...
No answer...
Connected: 84.200.252.37:27025
     Error by recieving Rules!
     NumRulez: 21880
No answer...
No answer...

So you can see, the first 3 Servers responsed with 64 Cvars whats right and
i can scan it with no problems...

But the last server returns with an error how i have sayed in my first
mail..
But the other 2 checks to show the other packts returns no answer, so there
no other packets...

So the first packet has to be the packet with all infos, but i cant recieve
it right?

Can anybody tell me, whats wrong with it?

Thanks!

(sorry for my bad english!)

With friendly Reguards from Germany

Ratman2000

----- Original Message -----
From: "Ronny Schedel" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Monday, September 10, 2007 6:05 PM
Subject: Re: [hlcoders] Error in Query Protocoll ???


> Hello,
>
> first, the packet size is 1400 as far as I remember. Second, you have to
> deal with multi-packets: http://dev.kquery.com/index.php?article=21
> This will happens mostly with the rules request, because it does not fit
> into one packet. Remember, UDP packets can be received in wrong order. Try
> to handle this all and it will fix your problem.
>
> Best regards
>
> Ronny Schedel
>
>
> > Hello,
> >
> > is there an error in the Query Protocolo?
> >
> > I call from an application the Server Protocol on many different
> > servers and all wors fine.. But on few servers i am not able to recieve
> > the
> > Rulez but HLSW i have seen works fine!
> >
> > I Tested with this Servers:
> >
> > Connected: 85.131.163.208:27055
> >     NumRulez: 64
> > Connected: 89.106.68.188:27016
> >     NumRulez: 74
> > Connected: 85.14.229.244:27015
> >     NumRulez: 64
> > Connected: 85.14.225.123:27015
> >     NumRulez: 67
> > Connected: 195.4.107.178:27015
> >     Error on recieving Rules!
> >     NumRulez: 2
> >     Error on recieving Rules!
> >     NumRulez: 2
> >     Error on recieving Rules!
> >     NumRulez: 2
> >
> > So you can see, on Server 195.4.107.178:27015 i am not able to recieve
the
> > Rules right like the other servers...
> >
> > I Request the rules on this way:
> >
> > After i am connectet i send:
> >
> > strcpy( Befehl, "\xFF\xFF\xFF\xFF\x56" );
> > strcat( Befehl, GetServerChallange() );
> >
> > bytes = send( Socket, Befehl, strlen( Befehl ), 0 );
> >
> > GetServerChallange returns the Server Challange and that works fine
> > becouse
> > i am able to retrieve from all other serves
> > the rules...
> >
> > Than:
> >
> > bytes = recv( Socket, buffer, sizeof( buffer ) - 1, 0 );
> > buffer[ bytes ] = '\0';
> >
> > buffer is declared as char buffer[1024];
> >
> > After that i check for errors like:
> >
> > if ( buffer[ 4 ] != S2A_RULES )
> > {
> >     printf( "     Error on recieving Rules!\n" );
> > }
> >
> > S2A_RULES is defined as:
> >
> > #define S2A_RULES 0x45
> >
> > So i check that is the right response.
> >
> > But on many servers i get the error but i dont know why! Can anybody
help
> > me
> > to fix this problem?
> >
> > With friendly Reguards
> >
> > Ratman2000
> >
> >
> > _______________________________________________
> > To unsubscribe, edit your list preferences, or view the list archives,
> > please visit:
> > http://list.valvesoftware.com/mailman/listinfo/hlcoders
> >
>
>
> _______________________________________________
> To unsubscribe, edit your list preferences, or view the list archives,
please visit:
> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>


_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to