How do I pass data to the server from the client using UI Input

Make custom events (if using blueprints) in your PlayerController. PlayerController is accessible anywhere, even in Widgets.

typical setup would be

[in Player controller blueprint]
you need 2 custom events. SendLoginData without replication(client side) and one that will be executed on the server: ServerSendLoginData. (or any names you prefer).

[CustomEvent SendLoginData] → [CustomEvent RunOnServer ServerSendLoginData]

You can have switch has authority in your ServerSendLoginData, for a little bit more protection if you’d like.
Everything done in this custom event is only executed on the server, so other clients wont have access to this.

Mark as answered, if it helped you, cheers :slight_smile:

I’m wondering how I can pass data to the server from the client using the UI. Kinda like a login screen, or a character creation system. Where you would enter things like Email and Password, Or Character Name.

The computer I’m building this project on doesn’t have internet. And this laptop is a pain to transfer data to from it. So I’m trying to keep the question general. As a general understanding should solve future problems that are similar.

Currently I am drawing the login screen from the player controller. I am handling all button/event logic in the widget blueprint that would include the login button.(E.G Submit button)

I would like the server to handle the handshake with my network server. (Communication with the Database over HTTP) Unfortunately the widget blueprint doesn’t have “Switch Has Authority” I’m using VaRest for HTTP calls.
Are there any ‘best practices’ for passing data from specific clients to the server VIA User Interface Inputs (Input Text Block, Input Text Box, etc) Since I’m passing sensitive data such as usernames and passwords they shouldn’t be accessible to other clients.

I understand if due to Unreal Engine limitations that I can’t solve this problem exactly like this. I’m also open to C++ solutions of any technical level. I’m aware of variable replication and RPC calls. All help is appreciated.

“I apologize if this question seems disrespectful. My brain is fried right now and its 5AM here.”

Thank you sooo much. I was trying so many ways to do this, I came close to using two custom events but ended up doing it wrong and trying some other solution that didn’t work. Thanks for the solution. I was having a horrible time slamming my head against doors and screaming out of my window at the top of my lungs (exaggeration) like all devs do when things just don’t seem to work lol. Also thanks for keeping it general, I have a good understanding now and hopefully I won’t run into this issue again.

P.S Your AWESOME!

as a bonus here’s a helpful pdf that helped me. It explain all network related things very, very well.

I never replied to your content, I think I went to sleep right after reading the PDF. But yes thanks you and that PDF was a great help.

PDF link is unfortunately down nowadays. Any way to get it ?