Page 1 of 1

Dynamic configuration of client

Posted: 24 Sep 2013, 06:19
by clam61
Currently I am querying a database for configuration data. This includes the port,zone, and IP of the SFS2x server

I am creating a client

Code: Select all

_smartFox = [[SmartFox2XClient alloc] initSmartFoxWithDebugMode:NO delegate:self];
[_smartFox connect:_gameServerUrl port:_gameServerPort];
but there is no way to configure the httpPort, or blueBoxPollingRate

do i have to load a config file from the bundle to configure these options?

Re: Dynamic configuration of client

Posted: 25 Sep 2013, 09:24
by Lapo
A few releases ago we added to the API a new method for connecting called connectWithConfig which allows to pass a programmatic configuration:

Code: Select all

ConfigData *cfg = [[[ConfigData alloc] init] autorelease];
cfg.host = @"127..0.0.1";
cfg.port = 9933;
cfg.zone = @"BasicExamples";
cfg.useBlueBox = YES;
    
// Start connection
[smartFox connectWithConfig:cfg];
Hope it helps