how do i use servers?

Started by Faceless 2 posts 59 views

Reply on sbox.game
  1. #1
    Faceless
    Hi
    im trying to find a way to connect a user to a dedicated server but i cant find anything plus AI dont know anything either so im here 😅

    this is what i got from AI for this but i dont think its correct at all

    public class ServerBrowser : Component
    {
            private ServerList _serverList;
            public List<ServerList.Entry> Servers { get; private set; } = new();

             public void Refresh()
             {
                      _serverList?.Dispose();
                      _serverList = new ServerList();

                      _serverList.AddFilter( "gametag", "trustlastisland" );
                      _serverList.Query();

                      Servers = _serverList.ToList();
             }
    }

    i just want to know how can i connect to a s&box dedicated server in my game.
  2. #2
    Faceless Started this
    found it my self
     
    Networking.Connect( "192.168.1.1:27015" );