I was testing out some unity client code which is basically a hacked up version of the PlayerIO Unity example and happened upon this error.
"InvalidOperationException: Collection was modified; enumeration operation may not execute.
System.Collections.Generic.List`1+Enumerator[PlayerIOClient.Message].VerifyState ()
System.Collections.Generic.List`1+Enumerator[PlayerIOClient.Message].MoveNext ()
GameManager.FixedUpdate () (at Assets/Scripts/GameManager.cs:104)
"
A not so helpful screenshot of the Unity console is here
Normally when messages trickle in they are dumped into the message list (named msglist) which is then processed during FixedUpdate(). Here it appears that the message list is being modified while I'm processing the messages. Is this probably due to a PlayerIO thread calling handlemessage() while I'm processing messages? If so, I should either lock the message list while processing it or maintain two message lists and flip between the two (using locks) on each call to FixedUpdate().
Thanks for any help or insight guys!