Tasharen Entertainment Forum

Support => TNet 3 Support => Topic started by: Scobbo on June 15, 2013, 11:55:18 PM

Title: Parameters do not match signature
Post by: Scobbo on June 15, 2013, 11:55:18 PM
Hi, I get a message I can't understand when sending data via RFC.
Quote
parameters do not match signature
WorldScript.Login(System.String, System.String, System.String
Quote
parameters do not match signature
WorldScript.Login (System.String, System.String, System.String)
UnityEngine.Debug:LogError(Object)
TNObject:Execute(String, Object[]) (at Assets/TNet/Client/TNObject.cs:352)
TNObject:FindAndExecute(UInt32, String, Object[]) (at Assets/TNet/Client/TNObject.cs:403)
TNObject:SendRFC(UInt32, Byte, String, Target, Boolean, Object[]) (at Assets/TNet/Client/TNObject.cs:605)
TNObject:Send(String, Target, Object[]) (at Assets/TNet/Client/TNObject.cs:470)
LoginScript:OnClick() (at Assets/Game/Scripts/UI/LoginScript.cs:31)
UnityEngine.GameObject:SendMessage(String, Object, SendMessageOptions)
UICamera:Notify(GameObject, String, Object) (at Assets/NGUI/Scripts/UI/UICamera.cs:638)
UICamera:ProcessTouch(Boolean, Boolean) (at Assets/NGUI/Scripts/UI/UICamera.cs:1137)
UICamera:ProcessMouse() (at Assets/NGUI/Scripts/UI/UICamera.cs:896)
UICamera:Update() (at Assets/NGUI/Scripts/UI/UICamera.cs:751)

The code that might be causing is this:
  1. [RFC]
  2.         void Login(string[] package)
  3.         {
  4.                 if (!TNManager.isHosting)
  5.                 {
  6.                         return;
  7.                 }
  8.                
  9.                 package = new string[3];
  10.                 string username = package[0];
  11.                 string pass = package[1];
  12.                 string colour = package[2];
  13.                
  14.                 string data = "pass";
  15.                
  16.                 FirstTime(package);
  17.                 loginButton.GetComponent<TNObject>().Send("Login", Target.All, data, username);
  18.         }
on WorldScript
or
  1. void Login(string message, string user)
  2.         {
  3.                 if (userName == user)
  4.                 {
  5.                         switch (message)
  6.                         {
  7.                         case "pass":
  8.                                 hudPanel.SetActive(true);
  9.                                 loginPanel.SetActive(false);
  10.                                 break; 
  11.                         case "user":
  12.                                 // user already exists or password is incorrect.
  13.                                 break;
  14.                         case "full":
  15.                                 // server is full.
  16.                                 break;
  17.                         default:
  18.                                 // Throw generic error.
  19.                                 break;
  20.                         }
  21.                 }
  22.         }

Am I using the send function wrong?

Cheers,
Title: Re: Parameters do not match signature
Post by: ArenMook on June 16, 2013, 08:16:45 AM
Did you have 3 string parameters at some point? I'm guessing you did, and you created a persistent channel, and then sent a Target.AllSaved RFC.

Delete server.dat save file.
Title: Re: Parameters do not match signature
Post by: Scobbo on June 17, 2013, 06:45:54 PM
Hi, I never had three parameters, it was always an array, I changed the code to accommodate the two strings I was sending and it worked fine (well that bit did). Thanks for your help though.