I keep "assuming" and it keeps biting me in the arse.
I have no FTP experience with DBPro/DarkGDK at all. So I did the best I could for a little code snippet type thing. The code below seems to do what your code wanted to above. I dont know if "password" and "username" needs to be changed to finally get "connected". So I guess it's up to you to supply that.
Hopefully this will work for ya:
#include "DarkGDK.h"
// function prototypes
int ConnectToServer();
// the main entry point for the application is this function
void DarkGDK ( void )
{
int isConnected;
isConnected=0;
int retrycount;
retrycount=0;
char txt[256];
sprintf(txt,"");
dbSyncOn ( );
dbSyncRate ( 60 );
dbAutoCamOff();
dbMakeCamera( 1 );
dbColorBackdrop( 1, dbRGB(0,0,0) );
dbSync();
while ( LoopGDK ( ) )
{
if (isConnected==0)
{
dbText(10,10,"CONNECTING TO THE BLACK KNIGHT GAME SERVER");
sprintf(txt,"Number of Retries = %d",retrycount);
dbText(10,30,txt);
dbSync();
if (ConnectToServer())
{
isConnected=1;
sprintf(txt,"%s",dbGetFTPDir());
}
else
{
retrycount++;
}
}
else
{
dbText(10,10,"* CONNECTED TO THE BLACK KNIGHT GAME SERVER *");
dbText(10,30,txt);
}
dbSync();
}
return;
}
int ConnectToServer()
{
dbFTPConnect("ftp.theblackknightgames.com", "username", "password" );
if (dbGetFTPFailure())
{
// dbGetFTPFailure returns 1 on failure
return 0; // ConnectToServer() returns 0 on failure
}
return 1; //ConnectToServer() returns 1 on success
}
Inspirational Music: Descent ][ Redbook Audio CD Soundtrack