x


Overloading RPCs

I'm attempting to use overloading for RPC functions. The script compiles fine (javascript), but results in an error while running when I call the overloaded function.

The fact that there isn't a compiler objection suggests to me that RPC overloading is meant to work. Has anyone managed to get this working?

more ▼

asked Dec 17 '10 at 02:08 PM

Matthew A gravatar image

Matthew A
502 7 9 18

I am having the same issues. I have a couple of RPC functions that I would like to overload but I get an error durring run time. Something about RPC called failed because the number of supplied parameters doesn't match the rpc declaration. but I have an RPC call with the same number of parameters.

Did you find a solution?

Mar 23 '11 at 02:45 PM ClandestineMan

Nope, I could never really get it to work (I filed a bug report, but as with nearly all Unity bug reports it's just sitting untouched, marked open). In the end I think I just created a load of RPC functions with slightly different names. :(

Apr 09 '11 at 03:43 PM Matthew A

RPCs aren't really managed by the compiler, since they're always called using string literal lookups- the compiler doesn't know anything about them! It's not exactly a bug, and the fact that the compiler doesn't object to it doesn't mean it's supposed to work.

Jan 09 '12 at 01:22 AM syclamoth

Did you put the RPC tag on each method? Only on the parent method? Only on the overloaded method?

Jan 14 '12 at 10:09 PM Kryptos

You can't overload RPC function at all! It's one of the downsides of them...

Feb 19 at 01:39 AM Benproductions1
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Hello,

Sadly, as of yet, RPC functions cant be overloaded. As a workaround, you can overload a normal function and then call 2 different RPC's where appropriate.

Hope this helps, Benproductions1

more ▼

answered Apr 09 at 02:35 AM

Benproductions1 gravatar image

Benproductions1
1.6k 5 13

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x702
x237
x116
x16

asked: Dec 17 '10 at 02:08 PM

Seen: 1196 times

Last Updated: Apr 09 at 02:35 AM