LAN & Online Server/ Broadcast

Greetings BOLT community,

I have been doing a lot of research and trying to use the Bolt Engine for my game, but I am stuck at a very simple step and need your help. I am implementing a multiplayer game, involving a PC Server with multiple Android clients. I want the server to run constantly and handle connections from the clients, who are active as players. The server needs to support LAN broadcasting so that the clients can directly find it without the need of IP input. I tried implementing the Lan Broadcast tutorial , but I am unable to get it to connect. There are no Sessions in the Boltnetwork.SessionList so I can't get an endpoint address. Is there something I have to define, when I use the EnableLanBroadcast method so that it casts to the proper IP and port, or how does that work exactly?
I also want the server to be able to run in Online mode so that clients can connect over the Internet. Is that possible with the same script/code or do I need two different implementations of the server-client code?

Thank you so much!

Comments

  • After starting the server you need to call SetHostInfo to get it to show up
  • I am calling it in the ServerCallbacks. The problem is I don't get how the LanBroadcast works? Does it do a multicast or does it send data to a specific IP? It looks like it somehow defines an IP on its own and sends the session data to this IP. Is there any proper example Server-Client connection script out there? All I found are Zeus implementation or very basic connection examples, which don't work.
  • Hey MelonHead,

    I just started looking at Bolt for a local lan and had the same issue in testing. Did you find out how you find Lan games? As My session list is empty and the GetSessions() function doesn't exist anymore.

    Thanks.
  • You need to call BoltNetwork.EnableLanBroadcast() to get LAN sessions.
  • I found the issue, I was trying to test locally on same machine. On 2 different machines on network it was fine.

    My bad, thanks for quick response
Sign In or Register to comment.