question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Just trying to get started

See original GitHub issue

There’s probably some step I’m just not aware of, but I would love a pointer if anyone can spot my mistake. I’m running on a windows EC2 for testing, with 27015 and 27016 open in the security groups, the test.exe allowed free movement in the windows firewall settings. I’m getting the client and the server to connect, but I can’t seem to get a list of servers to show up, nor ping for a server in Steam -> View -> Servers -> Favorites -> Add a server -> Find servers at this address.

The test project code is as follows:

`using Steamworks; using Steamworks.Data; using Steamworks.ServerList; using System.Threading.Tasks; using UnityEngine;

public class SteamServerManager : MonoBehaviour {

async void Start() {
    DontDestroyOnLoad(gameObject);

    try {
        SteamClient.Init(myAppId);
    }
    catch (System.Exception e) {
        Debug.Log(e);
        Debug.Log("SteamClient Init Failed");
        return;
    }
    Debug.Log("SteamClient connected");

    SteamServerInit serverInit = new SteamServerInit("", "MyGame") {
        GamePort = 27015,
        Secure = true,
        QueryPort = 27016
    };

    try {
        SteamServer.Init(myAppId, serverInit);
    }
    catch (System.Exception e) {
        Debug.Log(e);
        Debug.Log("SteamServer Init Failed");
        SteamClient.Shutdown();
        return;
    }
    Debug.Log("SteamServer connected");

    await GetServerList();
}

void Update() {
    
}

async Task GetServerList() {
    Debug.Log("Waiting 5s before updating");

    await Task.Delay(5000);

    Internet list = new Internet();

    await list.RunQueryAsync();

    foreach (ServerInfo server in list.Responsive) {
        Debug.Log("Server list response: " + server.Address + ", " + server.Name);
    }

    Debug.Log("Server Refresh Complete");
}

void OnDisable () {
    SteamClient.Shutdown();
    SteamServer.Shutdown();
}

}`

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:14 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
malkerecommented, May 27, 2019

I met a guy in a Discord, shared his code with my from version 0.7:

    IEnumerator StartServer() {
        var serverInit = new ServerInit("FP07Test_Data", "My Game");
        serverInit.GamePort = 27015;
        serverInit.Secure = true;
        serverInit.QueryPort = 27016;
        serverInit.GameDescription = "My Game";
        serverInit.VersionString = Application.version;
        serverInit.ModDir = "FP07Test_Data";
        new Server(appId, serverInit);
        Server.Instance.ServerName = "Test Server";
        Server.Instance.DedicatedServer = true;
        Server.Instance.AutomaticHeartbeats = true;
        Server.Instance.MaxPlayers = 12;
        Server.Instance.LogOnAnonymous();
        Server.Instance.SetKey("Players", "00");
        Server.Instance.SetKey("Port", "27015");

        if (Server.Instance.IsValid) {
            yield return new WaitForSeconds(10f);
            Debug.Log("is valid");
            Debug.Log(Server.Instance.PublicIp);
            Debug.Log(Server.Instance.LoggedOn);
            Debug.Log(Server.Instance.ServerName);
        }
    }

And this reports properly from the web api:

{"response":{"success":true,"servers":[{"addr":"ip:27016","gmsindex":65534,"appid":appId,"gamedir":"FP07Test_Data","region":-1,"secure":true,"lan":false,"gameport":27015,"specport":0}]}}

And shows up and responds on my favorite list, but still doesn’t show up on the master list. Very much progress though! I should mention this server was connected to by a dozen people without problems. Still not on the internet server list though…

1reaction
malkerecommented, May 27, 2019

So I was looking at the Steamworks Dedicated Server settings and it says “Product name (also called mod dir or game dir)”… well in the Steamworks.NET examples it says to leave mod dir to “” unless you’re your running a “mod” not the base game… Changing my ModDir = “MyGame” and now it’s properly populating to the master server list =3

Thank you to everyone that offered suggestions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Just Getting Started (2017)
An ex-F.B.I. Agent (Tommy Lee Jones) and an ex-mob lawyer in the Witness Protection Program (Morgan Freeman) have to put aside their petty...
Read more >
Why Getting Started is More Important Than Succeeding
It's doesn't matter what you're working towards, the most important thing is to get started. Read this article to find out why (and...
Read more >
How to Start Doing a Thing When You Really, Really Don't ...
Just take the time to break the thing down into smaller things. You'll be surprised how much easier it is to get started...
Read more >
Jason Aldean - Just Gettin' Started (Lyric Video) - YouTube
... Get tickets to see Jason Aldean in concert: https ... Try That In A Small Town - Jason Aldean (lyrics). Musical journey•17K ......
Read more >
How to Be a Minimalist: A Guide For Getting Started with ...
Are you wondering how to be a minimalist? If you're just getting started with minimalism and feeling overwhelmed, these tips will help!
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found