Hello! I'm trying to run the SetUserPositionRequest to start the Proximity_Update_List in my mmoRoom. However the Vec3D in objective-c is expecting the NSNumber datatype and I'm receiving this message on the server because IT is expecting a float/int:
"java.lang.IllegalArgumentException: User coordinates don't match numeric type of the Room's Area Of Interest (AOI)"
My question is how do I send an int/float from the Vec3D class in objective-c when it is expecting a NSNumber?
[smartFox send:[SetUserPositionRequest requestWithPosition:[[Vec3D alloc] initWithX:[NSNumber numberWithFloat:player.position.x] Y:[NSNumber numberWithFloat:player.position.y]] mmoRoom:[smartFox lastJoinedRoom]]];
Here is my SetUserPositionRequest.
Thank you.
Objective-C and SetUserPositionRequest
-
- Posts: 8
- Joined: 11 Dec 2013, 08:37
-
- Posts: 8
- Joined: 11 Dec 2013, 08:37
Re: Objective-C and SetUserPositionRequest
I actually figured it out! After looking at the Vec3D class I realized there was an internal static constructor that is looking for an array! So i did that and sfs2x is happy!
-
- Posts: 8
- Joined: 11 Dec 2013, 08:37
Re: Objective-C and SetUserPositionRequest
FYI:
THIS:
[smartFox send:[SetUserPositionRequest requestWithPosition:[[Vec3D alloc] initWithX:[NSNumber numberWithFloat:player.position.x] Y:[NSNumber numberWithFloat:player.position.y]] mmoRoom:[smartFox lastJoinedRoom]]];
Does work... if you convert it to what your extension is looking for... For instance mine was looking for int... so change the numberWithFloat to numberWithInt and what do you know everything is happy.
Thanks I hope this helps someone lol...
THIS:
[smartFox send:[SetUserPositionRequest requestWithPosition:[[Vec3D alloc] initWithX:[NSNumber numberWithFloat:player.position.x] Y:[NSNumber numberWithFloat:player.position.y]] mmoRoom:[smartFox lastJoinedRoom]]];
Does work... if you convert it to what your extension is looking for... For instance mine was looking for int... so change the numberWithFloat to numberWithInt and what do you know everything is happy.
Thanks I hope this helps someone lol...
Re: Objective-C and SetUserPositionRequest
Ok, thanks. You did it all by yourself in like 25 minutes
-
- Posts: 8
- Joined: 11 Dec 2013, 08:37
Re: Objective-C and SetUserPositionRequest
Well I attempted it last night and apparently was tired... spent like an hour on it and it was an "oh duh" moment as soon as I looked at it today . Thanks for your quick responses though!!
Return to “SFS2X iPhone / iPad / OSX API”
Who is online
Users browsing this forum: No registered users and 30 guests