PDA

Voir la version complète : Probleme connection RakPeerInterface


Thelvyn
18/06/2006, 22h58
bonsoir !
jai un probleme pour effectuer une connexion :00000010:

// RakNet
#include <RakNet/RakNetworkFactory.h>
#include <RakNet/RakPeerInterface.h>

// Windows
#include <windows.h>

// Std
#include <iostream>
#include <string>

int main( int argc, char** argv )
{
RakPeerInterface* rakPeer = RakNetworkFactory::GetRakPeerInterface();

std::string command;
std::cout << "rejoindre : /join \nattendre : /wait \n";
std::cin >> command;

// juste un test on n'est pas sense taper autre chose
if( command == "/join" )
{
rakPeer->Initialize( 1, 60000,0,0 );
while( rakPeer->GetPlayerIDFromIndex(0) == UNASSIGNED_PLAYER_ID )
{
Sleep(50);
rakPeer->Connect( "127.0.0.1" , 60500 , 0,0 );// marche tres bien
}
}
else if( command == "/wait" )
{
rakPeer->Initialize( 1, 60500, 0, 0 );
rakPeer->SetMaximumIncomingConnections( 1 );

while( rakPeer->GetPlayerIDFromIndex(0) == UNASSIGNED_PLAYER_ID )
{
Sleep( 50 );
}
}

std::cout << "Connection OK" << std::endl;
Sleep( 2000 );
RakNetworkFactory::DestroyRakPeerInterface( rakPeer );

return 0;
}

ce code marche tres bien, le probleme arrive quand je remplace 127.0.0.1 par mon ip, jai fait plusieurs tests avec un ami il n'arrive pas a me rejoindre.

PS. jai peut etre fait des conneries , jai commencé raknet ce matin :00000025:

Spirit
18/06/2006, 23h10
connais pas ça, mais vérifie que le port utilisé pour se co à ton pc ne soit pas fermé ou bloqué:00000030:

Thelvyn
20/06/2006, 13h33
c'est bon, jai trouvé !
le probleme c'etait au niveau de l'ip :00000009: