Execute methods on a dedicated server other than the one the client is currently in (UE 5.3)

Hi all,

I hope the title makes sense. I’m able to spin up dedicated servers on demand for dungeons and whatnot, and can travel from server to server with no issues but I need a way to exec a method on another dedicated server without actually traveling to that server.

For Example: I have dedicated servers A, B, and C, and the game client is on Server A. I want to have that client(or that dedicated server) call a custom (C++) method on server B or C without traveling to it with the client.

What would be the best method to accomplish this? I’ve looked into Beacons and WebSockets but I’m not sure if that’s the right way to go about this. Any help would be much appreciated.

1 Like

Interesting question, I would also like to know the answer. :kissing_smiling_eyes:

I guess I’m going to answer my own question, after grinding on this the past few days. I was making the mistake of thinking the beacon client had to be created on the server where I was logged into and the host on the dedicated server I wanted to call functions on.

So, what I did was the reverse, making the remote dedicated server the beacon client and the main game world the host. Then it was a simple matter of calling whatever functions I needed using the “Client, Reliable” UFUNCTION specifiers (These functions reside in my custom beacon client class).

A Note on the creation of these beacons: Since the remote server is never logged into directly, I create the host on the main game world at server start, and then start the remote server and have the client auto-create and connect to the host on its startup. This is accomplished with a simple GetMapName() check in game mode BeginPlay determines whether the server should create the host or client beacon since each of their maps will never change.

This means the beacon connection is persistent rather than transient. I’m still not sure it’s the best method but it’s working today so I’ll revisit it at some point in the future. What I’m considering is having the remote server poll the DB every x seconds to see if it should create/connect a client beacon so I don’t have to leave a connection open all the time. Tomorrow’s problem. :slight_smile:

Thanks for taking the time to read this and I hope it helps anyone who comes across this “problem”.

I’m marking as complete but comments and suggestions are always welcome!

1 Like