Skip to content

Update manager.html: Adds "Join Server" button#12

Open
y1337x wants to merge 1 commit intoskanatiker:masterfrom
y1337x:patch-5
Open

Update manager.html: Adds "Join Server" button#12
y1337x wants to merge 1 commit intoskanatiker:masterfrom
y1337x:patch-5

Conversation

@y1337x
Copy link
Copy Markdown
Contributor

@y1337x y1337x commented Mar 9, 2018

Adds a button to join the server defined by a domain and port. Sometimes you cannot find the server because steam uses IP addresses. With this button steam will start if it is not running, starts ark and tries to connect to the server. To do that the domain is translated to an IP address.

Adds a button to join the server defined by a domain and port. Sometimes you cannot find the server because steam uses IP addresses. With this button steam will start if it is not running, starts ark and tries to connect to the server. To do that the domain is translated to an IP address.
@skanatiker
Copy link
Copy Markdown
Owner

@DanyelSuxdorf : I think the configurability would be great here too. The public IP or DNS host name and the Port should be configurable in the preferences screen. Users should not have to modify html or javascript files manually.

@y1337x
Copy link
Copy Markdown
Contributor Author

y1337x commented Mar 12, 2018

I will make it configurable when I have time for that, maybe next weekend.

@y1337x
Copy link
Copy Markdown
Contributor Author

y1337x commented Mar 22, 2018

@skanatiker, can you help me? Web programming is pretty new for me. The button isn't working, I think the function isn't called and I don't know why.
manager.html:
<button type="button" class="btn btn-primary" style="text-align:center; width:100%" title="Opens Steam and tries to connect to the configurated host" ng-click="connectToServer()">Play on Server</button>

new function in models/command.js
exports.connectToServer = function(wss) { configs.findByKey('server', function(err, serverConfig) { var address = "steam://connect/" + serverConfig.data.serverHost + ":27015"; wss.broadcast('log', {log: "call steam://connect/" + serverConfig.data.serverHost + ":27015"}); window.location.href = address; }); }

added scope in src/scripts/server/server.ctrl.js
$scope.connectToServer = function(){ ws.send(JSON.stringify({event: "connectToServer"})); };

added in public/scripts/ark.js
e.connectToServer=function(){l.send(JSON.stringify({event:"connectToServer"}))}

The host is added to the db and is loading correctly in the web interface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants