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"

Clients can't access other players' controller [Advanced Sessions]

With the current way I have things set up, to be able to find a player's Steam name, I have to have their PlayerController which I am attempting to get using the method below. The issue I've found with this is that only the server can use the "Get Controller" node and all other clients get a blank return value. Is there a better way to do this? alt text

Product Version: UE 4.18
Tags:
more ▼

asked Jan 21 '18 at 01:15 AM in Blueprint Scripting

avatar image

dscottwilson
33 7 8 12

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

3 answers: sort voted first

Hey there, only the server can have access to all of the player controllers, the clients only have their own. For that you can use the Player State class to access common information.

more ▼

answered Jan 21 '18 at 01:20 AM

avatar image

xlar8or
6k 161 129 304

avatar image dscottwilson Jan 21 '18 at 01:32 AM

It worked perfectly. Here is my new code. alt text Also thanks to Jin_VE

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
more ▼

answered Jan 21 '18 at 01:21 AM

avatar image

Jin_VE
4.4k 32 77 41

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

clients aren't meant to communicate with other clients its a security risk and can also cause issues with gameplay. if client 1 was directly connected to client 2 then each would have a direct line into the others PC which bypasses all security by piggybacking on the game data. and from a gameplay perspective if you have events happening that are relative to more than one player but the server doesnt know about it then inconsistencies will occur and the whole system would break down. theres a reason all actions are taken by the server then replicated on clients.

For your case i would have client one request the server to get the data. when the server gets the username it can relay it back to client one if needed.

more ▼

answered Jan 21 '18 at 01:24 AM

avatar image

ThompsonN13
10.1k 33 9 23

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
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