Here is the click event of the connection button:
Here is the being called function:
The function “SetupPlayerName” validates the name for forbidden symbol combinations. What can be the problem, or what important did I miss to show?
Here is the click event of the connection button:
Connecting to the server should look something like this:
In your case, you simply change the level on the client. There will be no connection to the server.
@PREDALIEN, but what set is viewed with the command “FindSessions”? Only in the LAN?
If you check the UseLAN flag - the search will take place on the local network, otherwise the search will take place on the Internet.
It searches the entire Internet? OMG!!!
@PREDALIEN, and can you write in more detailed way about this:
?
If your project has several levels, you can change them using Open Level. This is true for single player mode, or if you are doing it on a server.
If a client is already connected to the server and is on the server map, and tries to change its level, then the client will be disconnected from the server with an error.
@PREDALIEN, but what if I put an IP address into the “LevelName” field? It is a wrong way? And how to exit from the server without an error?
I thought you entered the name of the map in LevelName…
Yes, you can log into the server by entering the IP instead of the map name.
If this does not work, there is probably an error message in the Output Log. What’s there?
Before leaving the server (changing the level on the client), you must call Destroy Session. Otherwise, you will no longer be able to connect to the server in the future and will receive an error message.
You will also not be able to successfully call Destroy Session after.
The game will need to be restarted.
@PREDALIEN, but you haven’t answered: how the “FindSessions” function knows which IPs to check for sessions?
Didn’t ask this question, usually It Just Works (c), but you can look at the source code to find out…
@PREDALIEN, but will it find the server if it is in another part of the world? In other country etc.
If there is Internet there, then this is exactly what it should do, but I personally haven’t checked…
@PREDALIEN, but can I check IP of found sessions?
Well, it seems that getting an IP from a session is not as easy as I imagine…
Until you asked, my life was simpler…
Now I would also like to know how this can be done.
I found a way to get an IP knowing the session name, but the problem is that the search result does NOT have a session name.
I tried entering the session name, which is specified in the standard CreateSession function (constant name in the engine code), but I cannot find a session with that name, although it can be found and connected.
At the same time, if I create a session using my function and my session name, then I can get it by name, and get the IP, BUT I do not find this session using search.
This is all very strange and I don’t understand why it works this way…
Unfortunately, the previous suggestion turned out to not work, I need to allow the user explicitly specify the IP. The topic is actual.
Double bump.
Triple bump.