ERROR - Exception while reading commands from incoming data
My team and I have been developing a MMO styled game for the past few months and I've been testing just by connecting through my LAN. However, we are a point in development where we thought it would be nice to attempt to connect to the server through the internet. I then changed the IP configuration in Photon Control, changed the IP to connect to from the client, port forwarded etc, however to no avail. Not only is the client timing out, but I'm getting a rather strange error in the client. It reoccurs every second or so until timeout, so maybe it has something to do with retrying the connection. Here is the error:
ERROR - Exception while reading commands from incoming data: System.IndexOutOfRangeException: Array index is out of range.
at ExitGames.Client.Photon.Protocol.Deserialize (System.Int32& value, System.Byte[] source, System.Int32& offset) [0x00000] in <filename unknown>:0
at ExitGames.Client.Photon.EnetPeer.ReceiveIncomingCommands (System.Byte[] inBuff) [0x00000] in <filename unknown>:0
UnityEngine.Debug:Log(Object)
View:LogDebug(String) (at Assets/PhotonEngine/Scripts/Views/View.cs:23)
ViewController:DebugReturn(DebugLevel, String) (at Assets/PhotonEngine/Scripts/Controllers/ViewController.cs:59)
PhotonEngine:DebugReturn(DebugLevel, String) (at Assets/PhotonEngine/PhotonEngine.cs:85)
ExitGames.Client.Photon.<>c__DisplayClass2:<EnqueueDebugReturn>b__0()
ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands()
ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands()
ExitGames.Client.Photon.PhotonPeer:Service()
WaitingForConnection:OnUpdate() (at Assets/PhotonEngine/Scripts/GameStates/WaitingForConnection.cs:9)
PhotonEngine:Update() (at Assets/PhotonEngine/PhotonEngine.cs:54)
I've been stuck on this error (I hope it's why I can't seem to connect) for the past few days. Any help would be greatly appreciated, thanks!
ERROR - Exception while reading commands from incoming data: System.IndexOutOfRangeException: Array index is out of range.
at ExitGames.Client.Photon.Protocol.Deserialize (System.Int32& value, System.Byte[] source, System.Int32& offset) [0x00000] in <filename unknown>:0
at ExitGames.Client.Photon.EnetPeer.ReceiveIncomingCommands (System.Byte[] inBuff) [0x00000] in <filename unknown>:0
UnityEngine.Debug:Log(Object)
View:LogDebug(String) (at Assets/PhotonEngine/Scripts/Views/View.cs:23)
ViewController:DebugReturn(DebugLevel, String) (at Assets/PhotonEngine/Scripts/Controllers/ViewController.cs:59)
PhotonEngine:DebugReturn(DebugLevel, String) (at Assets/PhotonEngine/PhotonEngine.cs:85)
ExitGames.Client.Photon.<>c__DisplayClass2:<EnqueueDebugReturn>b__0()
ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands()
ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands()
ExitGames.Client.Photon.PhotonPeer:Service()
WaitingForConnection:OnUpdate() (at Assets/PhotonEngine/Scripts/GameStates/WaitingForConnection.cs:9)
PhotonEngine:Update() (at Assets/PhotonEngine/PhotonEngine.cs:54)
I've been stuck on this error (I hope it's why I can't seem to connect) for the past few days. Any help would be greatly appreciated, thanks!
0
Comments
viewtopic.php?f=5&t=3950&hilit=+port
I've moved your post to the Unity forum so that my client developer colleagues can help to sort out the client-side error.
Photon has feature to add a checksum per package to detect broken packages and discard them. Please enable that before you connect (you only need to do that client-side) and check what happens.
In the NetworkingPeer constructor, you can add this:
this.CrcEnabled = true;
And you can monitor this value to check how much gets dropped: networkingPeer.PacketLossByCrc
I guess you are using the Photon Unity SDK from our page then?
If your players want to connect to your servers from outside of a LAN, you need to make sure that the ISP, router and firewalls are all allowing incoming connections to that IP and Port. And: You have to pick a fitting "Game Server IP Config" (in Photon Control) before you start Photon!
Yes, we are using the SDK.
We have the firewalls setup correctly, and ports forwarded, testing and working with various checkers. Also, we have selected the autodetect public IP option in Photon Control. As far as all the setup goes, everything should be working fine. I suppose the hoster's ISP could be eating packets that are sent to that port.
Unfortunately, I don't suppose you have a suggestion for the actual error in the OP?
If you use a public IP on some ISP, you might also want to check if your IP changed over time. Some ISPs assign new IPs from time to time, I think.
http://www.mediafire.com/download/qb9pxdav9zf30qp/SAO+Client+Error+3-11-14.zip
Here are the steps to reproduce the error:
1) the IP and port i have the client set to is localhost:5055; might as well go ahead to log in with user: test pass: test but it wont make any difference as you cannot connect to the proxy server, just make sure that error doesn't pop up
2) change the IP to 186.160.2.9 and watch the magic happen
However, once the Server attempts to load up it's NHibernate session (For MySQL if it wasn't obvious), it hits this exception:
---> NHibernate.HibernateException: Could not create the driver from NHibernate.Driver.MySqlDataDriver, NHibernate, Version=3.3.1.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: Unable to find the requested .Net Framework Data Provider. It may not be installed.
Here are the things I've tried so far:
Installing .Net 3.5.1 (Inlcluded within the Server)
Installing .Net 4.5
Running as admin
And bashing my head on my desk haha
The VS is running Windows Server 2008 r2 SP1
I would rather spend money on actual testing on the server than getting it working right, so any help is appreciated, thanks.
we can not support 3rd party libraries like NHibernate, but a quick google search gives the hint that a reference to MySQL.Data.dll in your project could solve this issue.
Maybe you could give that a try?
Your right about NHibernate being a 3rd party library, I suppose I should post elsewhere for more specific support. Thanks
Good luck anyways!