Author Topic: Parameters do not match signature  (Read 2899 times)

Scobbo

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 29
    • View Profile
Parameters do not match signature
« 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,

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Parameters do not match signature
« Reply #1 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.

Scobbo

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 29
    • View Profile
Re: Parameters do not match signature
« Reply #2 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.