SS13 "Classic Servers" Support#71
Merged
DEATHB4DEFEAT merged 7 commits intoSimple-Station:masterfrom Jan 23, 2026
Merged
Conversation
Member
Author
Member
Author
DEATHB4DEFEAT
requested changes
Jan 20, 2026
Member
DEATHB4DEFEAT
left a comment
There was a problem hiding this comment.
This is all notes for when I take over this PR, and this is all without the context of existing systems, I need to compare them later.
Comment on lines
51
to
147
| private List<ClassicServerStatusData> ParseByondResponse(string response) | ||
| { | ||
| var list = new List<ClassicServerStatusData>(); | ||
| using var reader = new StringReader(response); | ||
|
|
||
| string? line; | ||
| string? currentName = null; | ||
| string? currentUrl = null; | ||
| string? currentStatus = null; | ||
| int currentPlayers = 0; | ||
|
|
||
| // Simple state machine to parse the text format | ||
| // The format uses 'world/ID' blocks for servers. | ||
|
|
||
| bool inServerBlock = false; | ||
|
|
||
| while ((line = reader.ReadLine()) != null) | ||
| { | ||
| var trimmed = line.Trim(); | ||
| if (string.IsNullOrWhiteSpace(trimmed)) continue; | ||
|
|
||
| if (trimmed.StartsWith("world/")) | ||
| { | ||
| // If we were parsing a server, save it | ||
| if (inServerBlock && currentUrl != null) | ||
| { | ||
| // Name might be missing, try to extract from status or use URL | ||
| var name = currentName ?? ExtractNameFromStatus(currentStatus) ?? "Unknown Server"; | ||
| var roundTime = ExtractRoundTimeFromStatus(currentStatus); | ||
| list.Add(new ClassicServerStatusData(name, currentUrl, currentPlayers, CleanStatus(currentStatus, name) ?? "", roundTime ?? "In-Lobby")); | ||
| } | ||
|
|
||
| // Reset for new server | ||
| inServerBlock = true; | ||
| currentName = null; | ||
| currentUrl = null; | ||
| currentStatus = null; | ||
| currentPlayers = 0; | ||
| } | ||
| else if (inServerBlock) | ||
| { | ||
| if (trimmed.StartsWith("name =")) | ||
| { | ||
| currentName = ParseStringValue(trimmed); | ||
| } | ||
| else if (trimmed.StartsWith("url =")) | ||
| { | ||
| currentUrl = ParseStringValue(trimmed); | ||
| } | ||
| else if (trimmed.StartsWith("status =")) | ||
| { | ||
| currentStatus = ParseStringValue(trimmed); | ||
| } | ||
| else if (trimmed.StartsWith("players = list(")) | ||
| { | ||
| // "players = list("Bob","Alice")" | ||
| // Just count the commas + 1, correcting for empty list "list()" | ||
| var content = trimmed.Substring("players = list(".Length); | ||
| if (content.EndsWith(")")) | ||
| { | ||
| content = content.Substring(0, content.Length - 1); | ||
| if (string.IsNullOrWhiteSpace(content)) | ||
| { | ||
| currentPlayers = 0; | ||
| } | ||
| else | ||
| { | ||
| // A simple Count(',') + 1 is risky if names contain commas, but usually they are quoted. | ||
| // However, parsing full CSV is safer but 'Splitting by ",' might be enough? | ||
| // Let's iterate and count quoted segments. | ||
| // Or simpler: Splitting by ',' is mostly fine for SS13 ckeys. | ||
| currentPlayers = content.Split(',').Length; | ||
| } | ||
| } | ||
| } | ||
| else if (trimmed.StartsWith("players =")) | ||
| { | ||
| // Fallback for simple number if ever used | ||
| var parts = trimmed.Split('='); | ||
| if (parts.Length > 1 && int.TryParse(parts[1].Trim(), out var p)) | ||
| { | ||
| currentPlayers = p; | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| // Add the last one if exists | ||
| if (inServerBlock && currentUrl != null) | ||
| { | ||
| var name = currentName ?? ExtractNameFromStatus(currentStatus) ?? "Unknown Server"; | ||
| var roundTime = ExtractRoundTimeFromStatus(currentStatus); | ||
| list.Add(new ClassicServerStatusData(name, currentUrl, currentPlayers, CleanStatus(currentStatus, name) ?? "", roundTime ?? "In-Lobby")); | ||
| } | ||
|
|
||
| return list; | ||
| } |
Member
There was a problem hiding this comment.
I think this could all be made into a regex
SS14.Launcher/ViewModels/MainWindowTabs/ClassicServerEntryViewModel.cs
Outdated
Show resolved
Hide resolved
SS14.Launcher/ViewModels/MainWindowTabs/ClassicServerEntryViewModel.cs
Outdated
Show resolved
Hide resolved
DEATHB4DEFEAT
approved these changes
Jan 23, 2026
Member
DEATHB4DEFEAT
left a comment
There was a problem hiding this comment.
It works, I'm not fixing the mess of AI it is, it's fine..
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


This PR adds a new tab for "Classic Servers", which provides the list of all Space Station 13 servers for the user to search through. These servers can be connected to via simple button, though the user is required to have the Byond client installed. If they don't have it, they'll be prompted to install it from byond's website.
Closes #68
AuroraThroughSteam.mp4