Search Unity

Question Calling a function/method on Server with no code visible to the Client

Discussion in 'Multiplayer' started by Stevoyd, Aug 8, 2021.

  1. Stevoyd

    Stevoyd

    Joined:
    Apr 4, 2018
    Posts:
    3
    I have a very basic Unity project constructed currently. It contains two different builds with different scenes within them; one server build, one client build.

    There are three scenes:
    Core
    Server.Core
    Client.Core

    Running the game starts in Core, and pushes the session to either Server/Client depending on the start-up arguments for the executable. This works fine, I can connect across to the Network Manager from one scene to the other.

    I now want to trigger a process on the Client.Core scene, to call any method/function from the Server.Core scene on the server only. I want the code to be entirely private to that scene so the client has no idea what is being ran.
    I'm using Mirror as my networking framework, but everything I've seen for examples shows the code completely and totally visible on the Client side, in the Client-side files - I do not want this.

    My code is irrelevant at the moment in this scenario (or I believe it is) as I'm looking at the concept of it.

    -----

    Also if anyone has any better recommendations on how to create this project, feel free to let me know!