Author Topic: problem with TNet  (Read 2053 times)

prasolleonid

  • Guest
problem with TNet
« on: May 13, 2013, 10:44:30 AM »
I following the example http://www.tasharen.com/?page_id=4537, I send not only UnityEngine.Vector3, I sending some few parameters:

System.String, System.Int32, System.Int32, UnityEngine.Vector3, UnityEngine.Quaternion, System.Boolean

and a result, I got same error

-------------------------------------------------------

Non matching Profiler.EndSample (BeginSample and EndSample count must match)
System.Reflection.MethodBase:Invoke(Object, Object[])
TNObject:Execute(String, Object[]) (at Assets/TNet/Client/TNObject.cs:320)
TNObject:FindAndExecute(UInt32, String, Object[]) (at Assets/TNet/Client/TNObject.cs:382)
TNManager:OnForwardedPacket(BinaryReader) (at Assets/TNet/Client/TNManager.cs:751)
TNet.GameClient:ProcessPacket(Buffer, IPEndPoint) (at Assets/TNet/Client/TNGameClient.cs:659)
TNet.GameClient:ProcessPackets() (at Assets/TNet/Client/TNGameClient.cs:603)
TNManager:Update() (at Assets/TNet/Client/TNManager.cs:763)

-------------------------------------------------------

Exception has been thrown by the target of an invocation.
NetPlayer.OnSetUniteData (System.String, System.Int32, System.Int32, UnityEngine.Vector3, UnityEngine.Quaternion, System.Boolean)
UnityEngine.Debug:LogError(Object)
TNObject:Execute(String, Object[]) (at Assets/TNet/Client/TNObject.cs:331)
TNObject:FindAndExecute(UInt32, String, Object[]) (at Assets/TNet/Client/TNObject.cs:382)
TNManager:OnForwardedPacket(BinaryReader) (at Assets/TNet/Client/TNManager.cs:751)
TNet.GameClient:ProcessPacket(Buffer, IPEndPoint) (at Assets/TNet/Client/TNGameClient.cs:659)
TNet.GameClient:ProcessPackets() (at Assets/TNet/Client/TNGameClient.cs:603)
TNManager:Update() (at Assets/TNet/Client/TNManager.cs:763)

-------------------------------------------------------

What am I doing wrong?

RFC procedure
.....................

  [RFC]
  void OnSetUniteData(string _name, int _team, int _health, Vector3 _pos, Quaternion _rot, bool _isBurning)
  {
    //_position = _pos;
    //transform.position = _pos;

...............

procedure on client call

...............

TNObject tno = _unite.NetObject.GetComponent<TNObject>();
         
          if (tno != null)
            tno.Send("OnSetUniteData", Target.AllSaved, _name, _team, _health,
                     _position, _rotation, _isBurning);
        }

...............

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: problem with TNet
« Reply #1 on: May 13, 2013, 11:10:30 AM »
Why do your function parameters match your private variables? That's a recipe for issues to begin with. You also didn't post the full script, so I can't tell what the member variables are.