I adopt your SpaceWar example for iOS platform. I use your iOS-project Tri experience and Space War unity example.
All is absolutely the same, but on Objective-C
for example
Code: Select all
-(void)onUserVariablesUpdate:(SFSEvent *)evt
{
//
SFSUser *user = [evt.params objectForKey:@"user"];
NSArray *changedVars = [evt.params objectForKey:@"changedVars"];
//etc
}
-(void)onProximityListUpdate:(SFSEvent *)evt
{
//
NSArray* addedUsers = [evt.params objectForKey:@"addedUsers"];
NSArray* removedUsers = [evt.params objectForKey:@"removedUsers"];
NSArray* addedItems = [evt.params objectForKey:@"addedItems"];
NSArray* removedItems = [evt.params objectForKey:@"removedItems"];
//Trace the number of changes for each list
NSLog(@"ProxyUpdate: %d, %d, %d, %d", addedUsers.count, removedUsers.count, addedItems.count, removedItems.count);
//etc
}
The situation
All goes perfect
1. Connection to server
2. Login
3. Join Room (room is static)
4. Spawn model for user (throught uservariable)
5. onUserVariablesUpdate and spawn ship on client
Problem begins then I try to connect another player or even if I spawn a weapon shot on server by fireWeapon command.
I checked server logs, weapon shot is spawned ok and then
I got a message SetUserPosition on client.
It’s first time this method shows in log - and the application crashes.
I think there is something with proximity list. I have no ProximityListUpdate.
It never calls.
I try to make exception breakpoint in Xcode, but it goest inside your code and i couldn’t solve it.
That's the log, last part
[SFS - INFO]Handling Message: SetUserPosition: { Message id: 30 }
{Dump: }
(int) r: 2
(sfs_array) q:
(sfs_array)
(int)0
(sfs_array)
(sfs_array)
(utf_string)vy
(byte)3
(double)0.05746759737538308
(sfs_array)
(utf_string)vx
(byte)3
(double)-0.0263004800697794
(sfs_array)
(utf_string)iModel
(byte)4
(utf_string)Torpedo
(sfs_array)
(utf_string)iType
(byte)4
(utf_string)weapon
(sfs_array)
(utf_string)y
(byte)3
(double)101.996504751687
(sfs_array)
(utf_string)x
(byte)3
(double)80.64140075409303
(sfs_array)
(int)1
(sfs_array)
(sfs_array)
(utf_string)vy
(byte)3
(double)0.05746759737538308
(sfs_array)
(utf_string)vx
(byte)3
(double)-0.0263004800697794
(sfs_array)
(utf_string)iModel
(byte)4
(utf_string)Torpedo
(sfs_array)
(utf_string)iType
(byte)4
(utf_string)weapon
(sfs_array)
(utf_string)y
(byte)3
(double)101.996504751687
(sfs_array)
(utf_string)x
(byte)3
(double)80.64140075409303
(sfs_array)
(int)2
(sfs_array)
(sfs_array)
(utf_string)vy
(byte)3
(double)0.05746759737538308
(sfs_array)
(utf_string)vx
(byte)3
(double)-0.0263004800697794
(sfs_array)
(utf_string)iModel
(byte)4
(utf_string)Torpedo
(sfs_array)
(utf_string)iType
(byte)4
(utf_string)weapon
(sfs_array)
(utf_string)y
(byte)3
(double)101.996504751687
(sfs_array)
(utf_string)x
(byte)3
(double)80.64140075409303
(sfs_array)
(int)3
(sfs_array)
(sfs_array)
(utf_string)vy
(byte)3
(double)0.05746759737538308
(sfs_array)
(utf_string)vx
(byte)3
(double)-0.0263004800697794
(sfs_array)
(utf_string)iModel
(byte)4
(utf_string)Torpedo
(sfs_array)
(utf_string)iType
(byte)4
(utf_string)weapon
(sfs_array)
(utf_string)y
(byte)3
(double)101.996504751687
(sfs_array)
(utf_string)x
(byte)3
(double)80.64140075409303
2015-04-05 00:33:49.482 Space Story RUS HD[2776:727687] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 2 beyond bounds [0 .. 1]'
*** First throw call stack:
(0x2a8645a7 0x38967c77 0x2a778177 0x39a207 0x3b2fb5 0x3aa0eb 0x3a14b1 0x3a1695 0x39e76f 0x39f1cb 0x385237 0x2a7dba17 0x2a7e5d77 0x2a7db6a3 0x2a2b4cbd 0x2a2b49ab 0x2a2b48df 0x2a82daef 0x2a82b237 0x2a82a64b 0x2a828cc9 0x2a775b51 0x2a775963 0x31cc11a9 0x2ddc7c91 0x36cdb 0x36c68)
libc++abi.dylib: terminating with uncaught exception of type NSException
I looked through message dump and it seems strange that there is three object, not one.
Please, help me!!!
I've tried to solve it for several days and don't have any attempts to try.