onExtensionResponse stops firing
onExtensionResponse stops firing
On some iPads the game seems to stop calling "onExtensionResponse" but we know that the message is coming in because we are printing the stream in "onDebugMessage". We took out a message with an empty parameter and that seems to help but is that a known issue? Should we be passing null? We are also adding the param to a queue comprised of an NSMutableArray and NSmutableDictionary, could that be causing problems?
Re: onExtensionResponse stops firing
We took out a message with an empty parameter and that seems to help but is that a known issue? Should we be passing null?
What do you mean by message with an empty parameter? And what else could it be if not null?
I mean the only way in which you can send a key in an SFSObject without any values is to use the NULL type.
Can you clarify?
We are also adding the param to a queue comprised of an NSMutableArray and NSmutableDictionary, could that be causing problems?
This is also not clear.
What is the param? Are we talking about the Extension SFSObject or something else?
Re: onExtensionResponse stops firing
Hi Lapo,
Sorry didn't mean to be unclear. On the server side we are sending it off like this:
instead of
and on the client side we are doing this:
where PostOffice is storing the params in like this:
where _mQueue is a NSMutableArray (it's later processed in an Update loop).
Sorry didn't mean to be unclear. On the server side we are sending it off like this:
Code: Select all
ISFSObject respObj = new SFSObject();
mMainServer.send("MSG_ARE_YOU_STILL_HERE", respObj, mGameRoom.getUserList());
instead of
Code: Select all
mMainServer.send("MSG_ARE_YOU_STILL_HERE", null, mGameRoom.getUserList());
and on the client side we are doing this:
Code: Select all
-(void)onExtensionResponse:(SFSEvent *)evt
{
NSString *cmd = [evt.params objectForKey:@"cmd"];
SFSObject *params = [evt.params objectForKey:@"params"];
if(cmd && params)
{
if([cmd isEqualToString:MSG_MONTAGE])
{
MontageMessage * obj = [[[MontageMessage alloc] initWithSFSObject:params] autorelease];
[[PostOffice Single] Broadcast:cmd withParam:obj];
}
else
{
[[PostOffice Single] Broadcast:cmd withParam:params];
}
}
}
where PostOffice is storing the params in like this:
Code: Select all
-(void) Broadcast:(NSString*)msg withParam:(id)param
{
@synchronized(_mQueue)
{
NSArray * broadcastItem = [NSArray arrayWithObjects:[NSString stringWithFormat:@"%@",msg], param,nil];
[_mQueue addObject:broadcastItem];
}
}
where _mQueue is a NSMutableArray (it's later processed in an Update loop).
Re: onExtensionResponse stops firing
If you don't need to send any extra parameter from server side just pass a new SFSObject() . Null may cause problems to the client, although Objective-C is resilient to null pointers.
Thanks
Thanks
Re: onExtensionResponse stops firing
I see, but that's what we are doing. When we remove that message the game is way more stable.
Re: onExtensionResponse stops firing
You're probably sending too many messages per second. What is the frequency?
Thanks
Thanks
Return to “SFS2X iPhone / iPad / OSX API”
Who is online
Users browsing this forum: No registered users and 28 guests