Author Topic: Webplayer error  (Read 3585 times)

Ablaze

  • Guest
Webplayer error
« on: August 07, 2013, 09:23:22 PM »
Ever since I plugged TNet into my project the webplayer has been broken. All the stand alone versions work as expected but whenever I open the webplayer (in my browser) it does the following:

  • There is an unexplained delay in which Connect does not seem to be called. This delay seems to be different every time the browser window is open, sometimes it can be as long as 5 minutes and sometimes as short as a second. This is odd since I call Connect in Update if IsConnected is false.
  • Unity crashes with the following error: mono-1-vc.dll caused an Access Violation (0xc0000005)  in module mono-1-vc.dll at 0023:05e66c8a.

Any advice you can offer would be appreciated, I am out of ideas.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Webplayer error
« Reply #1 on: August 08, 2013, 08:57:43 AM »
Which version of TNet? http://starlink.tasharen.com runs TNet and you can connect to a server just fine without any delays.

Do you attempt to host a server or use UPnP while in the web player?

Ablaze

  • Guest
Re: Webplayer error
« Reply #2 on: August 08, 2013, 02:01:08 PM »
The version I am using is "2.0.1f1"

I am not attempting to host a server in the web player. All data is being sent via a custom packet to the stand-alone version. I use custom packets because I need to query another web server to pull in most of the data.

However, the entire pipeline works well in the debugger and on stand alone builds. It only breaks in the web player. I'm not sure where to look to fix it, the error is most unhelpful.

I don't think I am using UPnP.

  1.         void Update ()
  2.     {
  3.         if (!TNManager.isConnected)
  4.         {
  5.             if (Time.time >= lastConnectionTime + connectionTimeout)
  6.             {
  7.                 lastConnectionTime = Time.time;
  8.                 if(useLocalServer)
  9.                     TNManager.Connect("127.0.0.1", serverPort);
  10.                 else
  11.                     TNManager.Connect(serverAddress, serverPort);
  12.             }
  13.         }
  14.         else
  15.         {
  16.             LinkedListNode<DataRequest> Node = dataRequestList.First;
  17.  
  18.             while (Node != null)
  19.             {
  20.                 if (Time.time >= Node.Value.Time + packetRequestTimeout)
  21.                 {
  22.                     // Try to resend the packet.
  23.                     if (Node.Value.ResendCount < resendCountBeforeDrop)
  24.                     {
  25.                         Node.Value.Time = Time.time;
  26.                         SendRequest(Node.Value);
  27.                         Node.Value.ResendCount++;
  28.                         print("Resending packet ID " + Node.Value.ID.ToString() + " try #" + Node.Value.ResendCount.ToString());
  29.                     }
  30.                     else
  31.                     {
  32.                         print("Dropping packet ID " + Node.Value.ID.ToString() + ": " + Node.Value.Type.ToString() + " on " + Node.Value.Domain);
  33.                         dataRequestList.Remove(Node);
  34.                     }
  35.  
  36.                     // We're only going to drop or resend one packet per frame, so we don't get as confused or overwealmed.
  37.                     return;
  38.                 }
  39.                 Node = Node.Next;
  40.             }
  41.         }
  42.         }
  43.  
  44.  

Ablaze

  • Guest
Re: Webplayer error
« Reply #3 on: August 08, 2013, 02:20:02 PM »
Well, this section seems to be slightly more helpful:

Quote
Unloading 2 unused Assets to reduce memory usage. Loaded Objects now: 667.
Total: 2.025366 ms (FindLiveObjects: 0.038493 ms CreateObjectMapping: 0.025465 ms MarkObjects: 0.718353 ms  DeleteObjects: 0.010067 ms)

Disconnect
 
(Filename: C:/BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/WebPlayer/UnityEngineDebug.cpp Line: 54)

Connect: False An established connection was aborted by the software in your host machine.


 
(Filename: C:/BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/WebPlayer/UnityEngineDebug.cpp Line: 54)

Crash!!!

If I comment out the Update block (posted above) the web player never crashes. It also never connects or receives any data (of course).
« Last Edit: August 08, 2013, 02:35:26 PM by Ablaze »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Webplayer error
« Reply #4 on: August 08, 2013, 08:42:06 PM »
What is "2.0.1f1"? The latest version of TNet is 1.7.3.

Also I am not sure what it is I'm looking at in your example. I can click things, and they start growing into spindly things, and I can click some more, and they grow some more... and while it looks all weird and interesting, I have no idea what's going on. No crashes anywhere though.

Ablaze

  • Guest
Re: Webplayer error
« Reply #5 on: August 08, 2013, 10:44:29 PM »
Wow. That's what it is supposed to do.

Well, on my computer and on everyone else's computer that I have talked to it crashes before anything spawns. What could be different about your system than everyone else's? I have just performed a sanity check and it still crashes on my machine.

I have been unable to find mention of a version number in the source code. All I can find is a protocol version which is set to 7.

The readme file is marked 1.7.1, but this is true in the latest version as well.

So the standalone server prints "An existing connection was forcibly closed by the remote host" which makes sense given the other errors. At a couple points it prints that the client machine "has failed the verification check."
« Last Edit: August 08, 2013, 11:20:50 PM by Ablaze »

Ablaze

  • Guest
Re: Webplayer error
« Reply #6 on: August 08, 2013, 11:38:38 PM »
Ok, so I updated to the latest version as you implied I should do and pasted my modifications back in. That seems to have fixed the problem, whatever it was.

Thank you for your help.  :D