Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiplayer: Typed Arrays in RPC Functions Throw Errors #81306

Closed
Luzzotica opened this issue Sep 4, 2023 · 3 comments
Closed

Multiplayer: Typed Arrays in RPC Functions Throw Errors #81306

Luzzotica opened this issue Sep 4, 2023 · 3 comments

Comments

@Luzzotica
Copy link

Godot version

4.1.1.stable

System information

Godot v4.1.1.stable - macOS 13.4.0 - Vulkan (Mobile) - dedicated AMD Radeon Pro 5500M - Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz (16 Threads)

Issue description

Here is the RPC function I have created.

rpc("call_local")
func show_items(item_names: Array[String], multiplier: int = 1, reroll: bool = false):
    pass

This function throws the following error on the clients (not the RPC caller).

E 0:00:19:0744   _process_rpc: RPC - 'CanvasLayer(ItemChooserSystem.gd)::show_items': Cannot convert argument 1 from Array to Array
  <C++ Source>   modules/multiplayer/scene_rpc_interface.cpp:294 @ _process_rpc()

I would expect it to be able to convert to the proper type, but getting rid of the type on the array resolves the issue.

Steps to reproduce

  1. Create a multiplayer game.
  2. Create an RPC function with a typed array
  3. Call that RPC function with a valid array
  4. See the error on the client

Minimal reproduction project

TypedArrayRPCError.zip

@Jordyfel

This comment was marked as off-topic.

@Jordyfel
Copy link
Contributor

Jordyfel commented Sep 4, 2023

Maybe related to #74391

@dalexeev
Copy link
Member

dalexeev commented Sep 5, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants