Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

world.internet_address implementation #2017

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DMCompiler/DMStandard/Types/World.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

var/address
var/port = 0 as opendream_compiletimereadonly
var/internet_address = "127.0.0.1" as opendream_unimplemented
var/internet_address
var/url as opendream_unimplemented
var/visibility = 0 as opendream_unimplemented
var/status as opendream_unimplemented
Expand Down
4 changes: 2 additions & 2 deletions OpenDreamRuntime/Objects/Types/DreamObjectWorld.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public sealed class DreamObjectWorld : DreamObject {

[Dependency] private readonly IBaseServer _server = default!;
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly INetManager _netManager = default!;
[Dependency] private readonly NetManager _netManager = default!;
[Dependency] private readonly IConfigurationManager _cfg = default!;

private readonly ISawmill _sawmill = Logger.GetSawmill("opendream.world");
Expand Down Expand Up @@ -58,7 +58,7 @@ private bool DisplayIPv6 {
}

/// <summary> Tries to return the address of the server, as it appears over the internet. May return null.</summary>
private IPAddress? InternetAddress => null; //TODO: Implement this!
private IPAddress? InternetAddress => _netManager.ServerChannel?.RemoteEndPoint.Address ?? null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this only tells you the local address this server is bound to, not the external IP others will have to use to connect.

I don't know if RT has a way to get this currently.


public DreamObjectWorld(DreamObjectDefinition objectDefinition) :
base(objectDefinition) {
Expand Down
Loading