room.PlayerList and user.PlayerId Exception Occur
Posted: 15 Jan 2016, 13:00
room.PlayerList and user.PlayerId Exception Occur
This problem occur client side.
We are developed Card Game by Unity. When ROOM_JOIN is event fire, I am trying to GET room.PlayerList or user.PlayerId (Is it correct way ?). Sometimes exception Occur on Real Android Device.
Second question is OnPlayerList is update when USER_ENTER_ROOM,USER_EXIT_ROOM and USER_COUNT_CHANGE events fire ?
These are exception stacks.
ERROR 1: ArgumentException: Destination array cannot hold the requested elements!
System.Collections.Generic.Dictionary`2[System.Int32,Sfs2X.Entities.User].CopyToCheck (System.Array array, Int32 index)
at System.Collections.Generic.Dictionary`2+ValueCollection[System.Int32,Sfs2X.Entities.User].CopyTo (Sfs2X.Entities.User[] array, Int32 index)
at System.Collections.Generic.List`1[Sfs2X.Entities.User].AddCollection (ICollection`1 collection)
at System.Collections.Generic.List`1[Sfs2X.Entities.User]..ctor (IEnumerable`1 collection)
at Sfs2X.Entities.Managers.SFSUserManager.GetUserList ()
at Sfs2X.Entities.SFSRoom.get_PlayerList ()
ERROR 2: IndexOutOfRangeException: Array index is out of range.
(wrapper stelemref) object:stelemref (object,intptr,object)
at System.Collections.Generic.Dictionary`2[System.Int32,Sfs2X.Entities.User].Do_CopyTo[User,User] (Sfs2X.Entities.User[] array, Int32 index, System.Collections.Generic.Transform`1 transform)
at System.Collections.Generic.Dictionary`2+ValueCollection[System.Int32,Sfs2X.Entities.User].CopyTo (Sfs2X.Entities.User[] array, Int32 index)
at System.Collections.Generic.List`1[Sfs2X.Entities.User].AddCollection (ICollection`1 collection)
at System.Collections.Generic.List`1[Sfs2X.Entities.User]..ctor (IEnumerable`1 collection)
at Sfs2X.Entities.Managers.SFSUserManager.GetUserList ()
at Sfs2X.Entities.SFSRoom.get_PlayerList ()
ERROR 3 : NullReferenceException: Object reference not set to an instance of an object.
Sfs2X.Entities.SFSRoom.get_PlayerList ()
ERROR 4 : NullReferenceException: A null value was found where an object instance was required.
Sfs2X.Entities.SFSRoom.get_PlayerList ()
ERROR 5 : NullReferenceException: Object reference not set to an instance of an object
Sfs2X.Entities.SFSUser.GetPlayerId (Room room)Sfs2X.Entities.SFSUser.get_PlayerId ()
Error Platfrom : Android (I dont know other platforms)
Unity Version : 4.6.9
Smartfox Client Version : 1.5.7.0
Smartfox Server Version : 2.9.2
This problem occur client side.
We are developed Card Game by Unity. When ROOM_JOIN is event fire, I am trying to GET room.PlayerList or user.PlayerId (Is it correct way ?). Sometimes exception Occur on Real Android Device.
Second question is OnPlayerList is update when USER_ENTER_ROOM,USER_EXIT_ROOM and USER_COUNT_CHANGE events fire ?
These are exception stacks.
ERROR 1: ArgumentException: Destination array cannot hold the requested elements!
System.Collections.Generic.Dictionary`2[System.Int32,Sfs2X.Entities.User].CopyToCheck (System.Array array, Int32 index)
at System.Collections.Generic.Dictionary`2+ValueCollection[System.Int32,Sfs2X.Entities.User].CopyTo (Sfs2X.Entities.User[] array, Int32 index)
at System.Collections.Generic.List`1[Sfs2X.Entities.User].AddCollection (ICollection`1 collection)
at System.Collections.Generic.List`1[Sfs2X.Entities.User]..ctor (IEnumerable`1 collection)
at Sfs2X.Entities.Managers.SFSUserManager.GetUserList ()
at Sfs2X.Entities.SFSRoom.get_PlayerList ()
ERROR 2: IndexOutOfRangeException: Array index is out of range.
(wrapper stelemref) object:stelemref (object,intptr,object)
at System.Collections.Generic.Dictionary`2[System.Int32,Sfs2X.Entities.User].Do_CopyTo[User,User] (Sfs2X.Entities.User[] array, Int32 index, System.Collections.Generic.Transform`1 transform)
at System.Collections.Generic.Dictionary`2+ValueCollection[System.Int32,Sfs2X.Entities.User].CopyTo (Sfs2X.Entities.User[] array, Int32 index)
at System.Collections.Generic.List`1[Sfs2X.Entities.User].AddCollection (ICollection`1 collection)
at System.Collections.Generic.List`1[Sfs2X.Entities.User]..ctor (IEnumerable`1 collection)
at Sfs2X.Entities.Managers.SFSUserManager.GetUserList ()
at Sfs2X.Entities.SFSRoom.get_PlayerList ()
ERROR 3 : NullReferenceException: Object reference not set to an instance of an object.
Sfs2X.Entities.SFSRoom.get_PlayerList ()
ERROR 4 : NullReferenceException: A null value was found where an object instance was required.
Sfs2X.Entities.SFSRoom.get_PlayerList ()
ERROR 5 : NullReferenceException: Object reference not set to an instance of an object
Sfs2X.Entities.SFSUser.GetPlayerId (Room room)Sfs2X.Entities.SFSUser.get_PlayerId ()
Error Platfrom : Android (I dont know other platforms)
Unity Version : 4.6.9
Smartfox Client Version : 1.5.7.0
Smartfox Server Version : 2.9.2