DoubleDeez / MDFramework

A multiplayer C# game framework for Godot 3.4 Mono.
https://discord.gg/UH49eHK
MIT License
77 stars 13 forks source link

Resolving of Method for MDRpc should be more accurate #82

Closed Beider closed 3 years ago

Beider commented 3 years ago

If you look at the following screenshot it has a method, SendUpdatePosition(MovementInput, int, float, float)

issue01

In this screenshot it tries to find the method with the following parameters, SendUpdatePosition(MovementInput, uint, float, float) issue02

This fails because the second parameter is a uint instead of an int. This is not a problem for the basic godot Rpc as it simply casts the uint to an int. As such we should rethink how we resolve methods / overloaded methods. Perhaps we should look for the exact one and if not found look for the best match? Or something like this. Or at the very least log an error saying we found these methods with these overloads, but nothing matched your parameters of these types...

DoubleDeez commented 3 years ago

Going to try this out with the help of https://stackoverflow.com/questions/2119441/check-if-types-are-castable-subclasses