Author Topic: Network Connection issue with strange error  (Read 2255 times)

Offline Invelios

  • Jr. Member Mark III
  • **
  • Posts: 88
Network Connection issue with strange error
« on: September 27, 2010, 11:09:42 pm »
I've been trying to play a game of AI War with one of my friends. We are not on the same network, and I'm currently at college, so I don't have a way to change router settings. So we tried to use Hamachi, which we have used before with other games, to connect. However, if I host and my friend tries to connect, he gets stuck on the "connecting to server" screen forever. If I try to connect I get a really long error message and my game crashes. We tried using the tunngle program I saw some people on here talking about, but the only difference is that we can see each other in the server list instead of having to type the ip directly. However we still get the same problem when we actually try to connect. The really weird error I got says:

Code: [Select]
-----------------------------------Application_ThreadException-----------------------------------System.ArgumentOutOfRangeException: Index and count must refer to a location within the buffer.
Parameter name: bytes
   at System.Text.UTF8Encoding.GetString(Byte[] bytes, Int32 index, Int32 count)
   at Lidgren.Network.NetBuffer.ReadString()
   at AIWar.NetworkClientWrapper.CheckClient() in C:\vcprojs\AIWar\DX\NetworkClientWrapper.cs:line 191
   at AIWar.Game.RunNextCycle(Boolean DoRendering, Boolean DoScrollingAndInput) in C:\vcprojs\AIWar\GameFormParts\GameLoop.cs:line 696
   at AIWar.Game.gameLoop() in C:\vcprojs\AIWar\GameFormParts\GameLoop.cs:line 361
   at AIWar.Game.GameForm_Load(Object sender, EventArgs e) in C:\vcprojs\AIWar\GameFormParts\Startup.cs:line 287
   at System.Windows.Forms.Form.OnLoad(EventArgs e)
   at System.Windows.Forms.Form.OnCreateControl()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ContainerControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WmShowWindow(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

I was wondering if anyone knew why I'm getting this error message and if there is any way I can fix it so me and my friend can connect successfully?

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: Network Connection issue with strange error
« Reply #1 on: September 27, 2010, 11:18:05 pm »
Hmm, that's a very weird error message indeed -- that basically means that the game is receiving bad data.  Often that can happen if you have some other program also sending data to the same port that you're using for the game; beyond that, I've never seen such an error message, though.  Any chance something else is sending you data on that port?
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline Invelios

  • Jr. Member Mark III
  • **
  • Posts: 88
Re: Network Connection issue with strange error
« Reply #2 on: September 27, 2010, 11:42:47 pm »
Ah, well, I'm using my schools network, and they require you to log-on everyday, so there might be something going on I don't know about. I remember them saying they require you to install a specific anti-virus they give you for free, so maybe it's using that port to check that we have it installed or something? Is there also a chance that another application is using the port? I do use skype to talk to my friend before we connect in-game. I don't really know that much about ports other than how to forward them, and I can't do that here since I'm connected to my schools network.

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: Network Connection issue with strange error
« Reply #3 on: September 28, 2010, 01:29:29 am »
Well, so far as I know no other application should be set to run on the AI War port by default -- I picked an obscure one on purpose.  That said, there are a lot of applications and some of them might use the same port.  The main problem I've seen in the past is when someone has set AI War to port 80, or when they've set some other game to AI War's port to avoid the need to forward another port, etc.  That can lead to stuff like this.

It could be something odd about the antivirus if it's got a software firewall installed in it, yes.  You could try explicitly making an exception for AI War and/or the AI War port and see if that solves it -- could be some sort of probe the firewall is doing or something... I'm not sure.  None of the major software firewalls do that, but there's all sorts of obscure firewalls, some of which do "application-level filtering," which can cause extra odd results.
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline Invelios

  • Jr. Member Mark III
  • **
  • Posts: 88
Re: Network Connection issue with strange error
« Reply #4 on: September 28, 2010, 12:21:25 pm »
Well, the anti-virus they have us use is "Symantec Endpoint Protection". I found an option under the network settings in it called "Enable Port scan protection". I'll try connecting again after turning it off, but I have to wait for my friend to get online again. I also added the AI war folder to "Exceptions" just in case, but I think all that does is stop it from scanning that folder.

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: Network Connection issue with strange error
« Reply #5 on: September 28, 2010, 12:23:06 pm »
Ah!  That's probably it, if it's messing with the way ports are interacting.  Nice!
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline Invelios

  • Jr. Member Mark III
  • **
  • Posts: 88
Re: Network Connection issue with strange error
« Reply #6 on: September 28, 2010, 10:45:58 pm »
No Luck. I do know I only get the error under circumstances where I should normally be able to connect. For example, if I try to direct connect via public IP, which shouldn't work since his ports aren't forwarded, I don't get the strange error, it just doesn't get through like expected. So maybe the issue is on his end? I wish I had someone else to try and connect to, so I could see if it's my issue or his.

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: Network Connection issue with strange error
« Reply #7 on: September 28, 2010, 10:47:38 pm »
Hmm, indeed, that sounds like it is his issue, then.  If you want to find someone for a quick connect, I suggest popping in here: http://www.arcengames.com/aiwar_irc.php

Hope that leads to good results!
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline Invelios

  • Jr. Member Mark III
  • **
  • Posts: 88
Re: Network Connection issue with strange error
« Reply #8 on: October 02, 2010, 02:24:11 am »
Ok, I fixed the problem. I feel really stupid now. It turns out I forgot that the CoN expansion upgrades you to a beta verison, and since my friend was only playing the trail of the base game, he was still on the latest stable release. The bad data was probably because of the version difference, and his problem connecting to me too. Well, we can connect through hamachi now, so everything good. I must say, even only playing the 1st 3 hours, I had a blast playing the game. I also convinced him to try and get the game, so maybe we can play a full game soon. I made sure to save the game right before time ran out.

I must say thanks for all the help, even if it turned out to be something silly like this. I'm very impressed with the amount of effort your company puts forth, especially for an indie group. And I'm even more impressed with your game. I thought I got tired of any RTS like game a while ago, but I can't stop playing AI War.

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: Network Connection issue with strange error
« Reply #9 on: October 02, 2010, 02:43:11 am »
Glad that worked it out!  Sorry, the game should have complained about the unlike version numbers, but apparently it has not been doing that lately.  I've logged a bug for that!

And, glad you've been enjoying the game so well. :)  Don't worry, you can save even after the time runs out, it just won't go any further once the time limit is up.  We try to make it easy!

Anyway, thanks for the kind words, and I'm really glad it worked out so well.
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!