Author Topic: ExampleMenu couldn't find my local machine's ip?  (Read 11219 times)

blueskined

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 26
    • View Profile
Re: ExampleMenu couldn't find my local machine's ip?
« Reply #15 on: February 21, 2013, 08:13:59 AM »
I can't find TcpClient.Connect

blueskined

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 26
    • View Profile
Re: ExampleMenu couldn't find my local machine's ip?
« Reply #16 on: February 21, 2013, 10:56:36 AM »
does this mean anything to you!?

TypeInitializationException: An exception was thrown by the type initializer for System.Collections.Generic.EqualityComparer`1
TNet.List`1[TNet.TcpPlayer].Remove (TNet.TcpPlayer item) (at Assets/TNet/Common/TNList.cs:142)
TNet.TcpChannel.RemovePlayer (TNet.TcpPlayer p) (at Assets/TNet/Server/TNTcpChannel.cs:82)
TNet.GameServer.SendLeaveChannel (TNet.TcpPlayer player, Boolean notify) (at Assets/TNet/Server/TNGameServer.cs:823)
TNet.GameServer.RemovePlayer (TNet.TcpPlayer p) (at Assets/TNet/Server/TNGameServer.cs:382)
TNet.GameServer.Stop () (at Assets/TNet/Server/TNGameServer.cs:232)
TNServerInstance.Disconnect () (at Assets/TNet/Client/TNServerInstance.cs:258)
TNServerInstance.OnDestroy () (at Assets/TNet/Client/TNServerInstance.cs:274)

blueskined

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 26
    • View Profile
Re: ExampleMenu couldn't find my local machine's ip?
« Reply #17 on: February 21, 2013, 11:29:36 AM »
invalid arguments
UnityEngine.Debug:Log(Object)
ExampleMenu:OnNetworkConnect(Boolean, String) (at Assets/TNet/Examples/Scripts/ExampleMenu.cs:179)
System.Reflection.MethodBase:Invoke(Object, Object[])
TNet.UnityTools:Broadcast(String, Object[]) (at Assets/TNet/Client/TNUnityTools.cs:41)
TNManager:OnConnect(Boolean, String) (at Assets/TNet/Client/TNManager.cs:702)
TNet.GameClient:ProcessPacket(Buffer, IPEndPoint) (at Assets/TNet/Client/TNGameClient.cs:718)
TNet.GameClient:ProcessPackets() (at Assets/TNet/Client/TNGameClient.cs:535)
TNManager:Update() (at Assets/TNet/Client/TNManager.cs:687)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: ExampleMenu couldn't find my local machine's ip?
« Reply #18 on: February 21, 2013, 09:16:26 PM »
Did you change the function definition for Example Menu's OnNetworkConnect function? Or did you just add a Debug.Log in there? Hard to tell from your stack trace. You need to put the Debug.Log in the places I mentioned, not in that function.

P.S. The correct function is TcpProtocol.Connect.
« Last Edit: February 21, 2013, 09:19:35 PM by ArenMook »

blueskined

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 26
    • View Profile
Re: ExampleMenu couldn't find my local machine's ip?
« Reply #19 on: February 23, 2013, 01:58:43 AM »
y~I couldn't find the TcpClient.Connect, so I tried to put a debug to ExampleMenu.

but I couldn't find TcpProtocol.Connect either(search whole solution)
I found a instance of TcpProtocal in TNGameClient, I am not sure if this is what you mean?

  1.         // TCP connection is the primary method of communication with the server.
  2.         TcpProtocol mTcp = new TcpProtocol();
  3.  


  1.         public void Connect (IPEndPoint externalIP, IPEndPoint internalIP)
  2.         {
  3.                 Disconnect();
  4.                         try
  5.                         {
  6.                                 mTcp.Connect(externalIP, internalIP);
  7.                         }
  8.                         catch(Exception e)
  9.                         {
  10.                                 throw(e);
  11.                         }
  12.                
  13.         }
  14.  

but nothing be throwed out when I click the button with my external ip.

I am a bit lost in your scripts, is that possible you can add a debug info and send me that file, that will be a lot more efficient for both of us! Thank you very much.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: ExampleMenu couldn't find my local machine's ip?
« Reply #20 on: February 23, 2013, 02:48:57 AM »
It sounds like you are very new to scripting -_-

Ping me on skype (arenmook) and I will help you out. It will be easier that way.

blueskined

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 26
    • View Profile
Re: ExampleMenu couldn't find my local machine's ip?
« Reply #21 on: February 23, 2013, 03:32:58 AM »
That's true, I am not very experienced, Thank for helping me out, I will keep my question minimal, all more general questions I wouldn't ask here. I just friended you on skype, plz check.