In my error logs I get this error (it is very rare, twice in thousands of instances):
Destination array was not long enough. Check destIndex and length, and the array's lower bounds.
at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable)
at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length)
at System.Collections.Generic.List`1.CopyTo(T[] array, Int32 arrayIndex)
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at MyGame.Player.get_bikesCopy()
at MyGame.Room.mhRoundCountdownStart(NetUser nu, Message message)
at MyGame.Room.handleMessage(NetUser nu, Message message)
at MyGame.Room.GotMessage(NetUser nu, Message message)
So it looks like I have an error in get_bikesCopy, right...? This is the code for Player.get_bikesCopy:
- Code: Select all
public List<Bike> bikesCopy {
get {
List<Bike> bs;
lock (_bikes) bs = new List<Bike>(_bikes);
return bs;
}
}
There are no cpu aborts... What could be the problem? Seems like bug free code, right? Could it be that this code fails when the _bikes List is not initialized?
Best,
Geert