Author Topic: Trouble sending string array over network  (Read 1996 times)

destructicorn

  • Guest
Trouble sending string array over network
« on: October 30, 2013, 01:25:54 PM »
I just built a RFC function that takes a string array as an argument, but every time it runs I get a "Parameters do not match signature" error.  Below is a rough outline of what my code does.

public void sendStringArray(string[] array) {
  tno.Send(1, Target.All, array);
}

[RFC(1)]
private void acceptArray(string[] networkArray) {
//do stuff here
}

I don't have another component on this object with a RFC(1) and I don't save any server data so I'm not sure exactly what's going wrong.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Trouble sending string array over network
« Reply #1 on: November 01, 2013, 11:07:45 AM »
Does it tell you which parameters it expects?

destructicorn

  • Guest
Re: Trouble sending string array over network
« Reply #2 on: November 01, 2013, 01:07:14 PM »
Since my string array changes size depending on user input it says it's expecting the size of the array but as separate strings.

If I have a string array of size three it'll say it's expecting three separate strings.  I've tested it out with other array types and those work fine but a string array of fixed or varying size doesn't seem to work.


Here's a copy of the error submitting a hard coded string array of size three.

parameters do not match signature
MovementScript.setUpPatrolRoute (System.String, System.String, System.String)
UnityEngine.Debug:LogError(Object)
TNet.UnityTools:PrintException(Exception, CachedFunc, Object[]) (at Assets/TNet/Client/TNUnityTools.cs:83)
TNet.UnityTools:ExecuteAll(List`1, Byte, Object[]) (at Assets/TNet/Client/TNUnityTools.cs:162)
TNObject:Execute(Byte, Object[]) (at Assets/TNet/Client/TNObject.cs:305)
TNObject:FindAndExecute(UInt32, Byte, Object[]) (at Assets/TNet/Client/TNObject.cs:329)
TNManager:OnForwardedPacket(BinaryReader) (at Assets/TNet/Client/TNManager.cs:826)
TNet.GameClient:ProcessPacket(Buffer, IPEndPoint) (at Assets/TNet/Client/TNGameClient.cs:683)
TNet.GameClient:ProcessPackets() (at Assets/TNet/Client/TNGameClient.cs:627)
TNManager:Update() (at Assets/TNet/Client/TNManager.cs:834)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Trouble sending string array over network
« Reply #3 on: November 01, 2013, 08:27:25 PM »
Curious. Perhaps you're hitting some limitation of reflection? I handled string arrays exactly the same as all other arrays.