x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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

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."

Product Version: UE Github Master branch
Tags:
more ▼

asked Oct 25 '16 at 09:04 AM in Blueprint Scripting

avatar image

AilurusFulgen
8 1 2 5

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

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 :)

more ▼

answered Oct 25 '16 at 09:23 AM

avatar image

Holybreath
378 10 7 19

avatar image AilurusFulgen Oct 25 '16 at 10:00 AM

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!

avatar image Holybreath Oct 25 '16 at 11:23 AM

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

avatar image AilurusFulgen Oct 29 '16 at 12:28 PM

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.

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question