Hey Mahn, Much appreciate your effort. Thanks a lot. Let me try it.
Hey Mahn, I really appreciate the effort you have put in for helping someone. Finally I solved the issue. But one thing I noticed is, my sever is not responsive at times. Say, when you connect like 5-6 times, once in a while, It doesnât respond. Then when I go to the server and click any button, It suddenly starts to tun some logs and accept the player. I dont understand the reason. You have any idea?
Iâm not totally sure, but it could be timing out from either dormancy on the server or perhaps the client side connection. I had a slight issue with this myself that I resolved by specifying a longer timeout in the ini. for the client. I hadnât had to tinker with anything in that regard on the server itself. Yet anywayâŚ
My issue was spurred from unbeknownst packet loss on my local network causing the connection to timeout before authentication. Running some packet loss tests revealed this and I later identified an external SSD drive causing interference on my network.
I hadnât noticed until actually finally uploading my servers and connecting to and from them on my physical remote servers in another state, which revealed this issue is way more sensitive when travelling a distance.
The specified timeout was great in mitigating âlag/packet lossâ, but only masking my issue. I lost some hair figuring that out and that may not be your issue, but Iâd look into making sure your ISP connections are solid before running your code amok like I did lol.
Hey Mahn, How do you run packet loss tests? Sorry for troubling you. But you are the only person who is kind of active in this forum. Thanks a tonne buddy. Hope you have a great day.
Hey, no prob. Thereâs not a lot of talk about dedicated servers going on and itâs what Iâm working on a lot lol.
As far a ping tests, Itâs relatively easy, but not easy for me to explain lol. There are a lot of quick resources which can walk you through it on the Internet. You can run these through easily on your command prompt if youâre using windows.
HEy Mahn thanks. I will try that out. Also how did you resolve the issue? Is it like you increased the connection timeout parameter in engine.ini. Can you share the exact parameters that you changed to resolve the issue?
Yes I masked the problem by simply specifying:
[/Script/OnlineSubsystem.IpNetDriver]
ConnectionTimeout=300.0
MaxClientRate=100000
MaxInternetClientRate=100000
This connection timeout should also work with any other subsystem you specify it with like above. Iâm not sure if 300 (seconds) is too overkill, but I havenât had any ill side effects from it yet. Not to say I wonât lol.
The real problem was from a bad internet connection in my case. Iâll probably tune this timeout down before I ship to the lowest I can get away with.
Hey Mahn, Actually I am testing on a dedicated server system from Azure Playfab and want to openlevel to a specific IP address from azure which requires the data to travel through the internet. But is there anything I have to do to enable connection across the internet in UE5? Why am I getting this log Created socket for bind address: 0.0.0.0 on port 0 ? Does that mean my client is at present able to connect to LAN only?
I believe the created socket at 0.0.0.0 in port 0 is referring to the socket in which the server is listening for a connection at any address and possibly port 0 would be any port specified from that incoming IP address. I could be wrong on this.
If youâre using the default online subsystem to connect it shouldnât take much to establish a connection outside of just OpenLevel-> ipaddress:port you wonât even need to specify the port if you are only running one server instance at that address.
If you want to run multiple server instances on the same machine, just swap out the port in the BaseEngine.ini to your choosing and package the server and then swap out the maps, go back into the BaseEngine.ini change to port to another port and package again. Rinse and repeat.
Example:
Game #1 x.x.x.x:7777
Game #2 x.x.x.x:7778
Game #3 x.x.x.x:7779
Assuming you are using a remote windows server in the end game, I know for a fact that you will need to enable/allow connections specifically at those port ranges in the server instance itself as it wonât allow any outside connections out of the box on a new server instance without making those changes in the firewallâs security settings.
Hey Man, Thanks. Let me check the remote server settings then. Much Thanks
Hey man, It was with the server. I chose the TCP protocol instead of UDP and that was the reasonb for the connection failure. Thanks for giving the hint that the issue might be with the server side. Much Thanks
Hi MAhn, I just have a doubt. How do you persist data of player controller between levels. So I have a lobby level where I am able to get certain information of the player in the lobby gamemode though options parsing. I store these information in player controller as its for indiidual player information such as playerid and their ping score. I want to retain these variables as the server takes the players to another map. Any idea on how to do this?
Also If you could give me some channel like discord where I can reach out to you, it will be really helpful.
Check this compendium on how you can persist data.
And Unreal Slackers should be your ultimate discord server.
I personally use the game instance for storing a lot of the information I need to persist between level transitions and server travel and retrieve it from the game instance and set it on the player controller via server or custom events when they initialize or call them from the game state.
The obstacle here is if the information changes within the player controller and needs to persist when changing levels again to another player controller, the variables need to be set on the game instance again also or theyâll persist the way they were set the first time.
An example would be a weapon type. In the lobby you select a certain weapon and set it on the playerâs game instance and possibly the controller as well. You travel to another level and get it from the game instance and set it on the player controller in the new level. If you perhaps change to a different weapon in the new level, you may have to set the new weapon on the game instance again so it will persist when travelling to the new level.
Iâm sure there may be other ways to do it, but I find this way pretty simple. I think of the game instance like âthe cloudâ and itâll store everything the same while the game is running and can access it anytime anywhere until itâs changed again. If I want to keep it that way when I close the game and reopen, I can use save game to bring back those variables when I reopen the game.