I just check log...
- But I use C++ API 1.6.4, client cannot login to server.
I saw client can connect to server, but cannot login.
Where my problem in my client or my server?
- But I use C++ API 1.6.4, client cannot login to server.
Code: Select all
SFSConnection::SFSConnection()
{
mSmartFox = boost::shared_ptr<Sfs2X::SmartFox>();
}
boost::shared_ptr<Sfs2X::SmartFox> SFSConnection::mSmartFox = NULL;
void SFSConnection::initServer( )
{
CCLOG("Smartfox: Init Server");
if(mSmartFox)
{
mSmartFox->RemoveAllEventListeners();
//delete boost::shared_ptr<Sfs2X::SmartFox>( mSmartFox);
mSmartFox = nullptr;
}
// Initialize Smart Fox
mSmartFox = boost::shared_ptr<Sfs2X::SmartFox>(new Sfs2X::SmartFox(true));
mSmartFox->ThreadSafeMode(true);
mSmartFox->Debug(true);
// Add event listeners
mSmartFox->AddEventListener(SFSEvent::CONNECTION
, boost::shared_ptr<EventListenerDelegate> (new EventListenerDelegate(SFSConnection::OnSmartFoxConnection, (unsigned long long)this)));
mSmartFox->AddEventListener(SFSEvent::LOGIN
, boost::shared_ptr<EventListenerDelegate> (new EventListenerDelegate(SFSConnection::OnSmartFoxLogin, (unsigned long long)this)));
mSmartFox->AddEventListener(SFSEvent::LOGIN_ERROR
, boost::shared_ptr<EventListenerDelegate> (new EventListenerDelegate(SFSConnection::OnSmartFoxLoginError, (unsigned long long)this)));
}
//connect server
void SFSConnection::connectToServer(char const* p_sHostIp, int p_iPort )
{
// I call IPv4
mSmartFox->Connect(p_sHostIp, p_iPort);
}
void SFSConnection::OnSmartFoxConnection(unsigned long long ptrContext, boost::shared_ptr<BaseEvent> ptrEvent)
{
CCLOG("OnSmartFoxConnection Ok & call login");
SFSConnection::getInstance()->loginTest();
}
void SFSConnection::OnSmartFoxLogin(unsigned long long ptrContext, boost::shared_ptr<BaseEvent> ptrEvent)
{
CCLOG("OnSmartFoxLogin");
}
void SFSConnection::OnSmartFoxLoginError(unsigned long long ptrContext, boost::shared_ptr<BaseEvent> ptrEvent)
{
CCLOG("OnSmartFoxLoginError");
}
void SFSConnection::loginTest()
{
//send requeste
boost::shared_ptr<IRequest> request (new LoginRequest("", "", "Zone_Name"));
mSmartFox->Send( request );
}
Hello. The server is still running. The sample app still connects just fine. Im not sure if its because the dns hasnt propagated to your region yet.
Users browsing this forum: No registered users and 134 guests