Skip to content
Permalink
Browse files

First code commit, adding framework for websocket communication and i…

…nitial menu templates.
  • Loading branch information...
roncli committed Jun 25, 2015
1 parent eb686fe commit 4154492cdf9d30b843ac55186554ac91d9415cc0
@@ -25,3 +25,9 @@ build/Release
# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules

# Test file
test.js

# PHP Storm
.idea
@@ -1,2 +1,3 @@
# descentDSNclient

The client portion of the Descent Dedicated Server Network.
@@ -0,0 +1,32 @@
var express = require("express"),
app = express(),
WebSocket = require("ws"),
wss = new WebSocket.Server({port: 20921});

// Setup web server.
app.use(function(req, res, next) {
"use strict";

if (req.headers.host === "localhost:20920") {
next();
} else {
res.status(404).send("Not found");
}
});

app.use(express.static("public"));

app.listen(20920);

// Setup web sockets.
wss.on("connection", function(ws) {
"use strict";

ws.on("message", function(ev) {
// TODO: Handle message.
});

ws.on("error", function(ev) {
// TODO: Handle error.
});
});
@@ -0,0 +1,32 @@
{
"name": "descentDSNclient",
"version": "0.1.0",
"description": "The client portion of the Descent Dedicated Server Network.",
"homepage": "https://github.com/roncli/descentDSNclient",
"bugs": {
"url": "https://github.com/roncli/descentDSNclient/issues",
"email": "roncli@roncli.com"
},
"license": "MIT",
"author": {
"name": "Ronald M. Clifford",
"email": "roncli@roncli.com",
"url": "http://www.roncli.com"
},
"repository": {
"type": "git",
"url": "https://github.com/roncli/descentDSNclient.git"
},
"dependencies": {
"descent3console": "0.1.1",
"descent3launcher": "0.1.2",
"express": "4.13.0",
"handlebars": "3.0.3",
"ws": "0.7.2"
},
"devDependencies": {},
"engines": {
"node": ">=0.12.4"
},
"private": false
}

Large diffs are not rendered by default.

Binary file not shown.

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,17 @@
<html>
<head>
<script src="/js/jquery-2.1.4.min.js"></script>
<script src="/js/bootstrap-3.3.5.min.js"></script>
<script src="/js/handlebars-3.0.3.min.js"></script>
<script src="/js/ddsn.js"></script>
<link rel="stylesheet" href="/css/bootstrap-slate-3.3.5.min.css" />
</head>
<body>
<div class="jumbotron text-center">
<h1>Descent DSN</h1>
</div>
<ul id="server-tabs" class="nav nav-pills"></ul>
<ul id="menu-tabs" class="nav nav-pills"></ul>
<div id="content"></div>
</body>
</html>

Large diffs are not rendered by default.

@@ -0,0 +1,23 @@
/*jslint browser: true*/
/*global $, WebSocket*/
$(document).ready(function() {
"use strict";

var ws = new WebSocket("ws://localhost:20921");

ws.onopen = function() {
// TODO: Request initialization data.
};

ws.onclose = function() {
// TODO: Shut down the web page.
};

ws.onmessage = function(ev) {
// TODO: Handle message.
};

ws.onerror = function(ev) {
// TODO: Display error and shut down the web page.
};
});

Large diffs are not rendered by default.

Large diffs are not rendered by default.

@@ -0,0 +1,6 @@
<li role="presentation">
<button id="dashboard-currentgames" class="btn btn-primary"><span class="glyphicon glyphicon-play"></span> Current Games</button>
</li>
<li role="presentation">
<button id="dashboard-currentgames" class="btn btn-primary"><span class="glyphicon glyphicon-list-alt"></span> Past Games</button>
</li>
@@ -0,0 +1,18 @@
<li role="presentation">
<button id="newserver-savedservers" class="btn btn-primary"><span class="glyphicon glyphicon-hdd"></span> Saved Servers</button>
</li>
<li role="presentation">
<button id="newserver-serveroptions" class="btn btn-primary"><span class="glyphicon glyphicon-wrench"></span> Server Options</button>
</li>
<li role="presentation">
<button id="newserver-gameoptions" class="btn btn-primary"><span class="glyphicon glyphicon-th-list"></span> Game Options</button>
</li>
<li role="presentation">
<button id="newserver-allowedobjects" class="btn btn-primary"><span class="glyphicon glyphicon-ok"></span> Allowed Objects</button>
</li>
<li role="presentation">
<button id="newserver-modifications" class="btn btn-primary"><span class="glyphicon glyphicon-tasks"></span> Modifications</button>
</li>
<li role="presentation">
<button id="newserver-launchserver" class="btn btn-primary"><span class="glyphicon glyphicon-share"></span> Launch Server</button>
</li>
@@ -0,0 +1,12 @@
<li role="presentation">
<button id="server-scoreboard" class="btn btn-primary"><span class="glyphicon glyphicon-dashboard"></span> Scoreboard</button>
</li>
<li role="presentation">
<button id="server-log" class="btn btn-primary"><span class="glyphicon glyphicon-list-alt"></span> Log</button>
</li>
<li role="presentation">
<button id="server-console" class="btn btn-primary"><span class="glyphicon glyphicon-console"></span> Console</button>
</li>
<li role="presentation">
<button id="server-settings" class="btn btn-primary"><span class="glyphicon glyphicon-cog"></span> Settings</button>
</li>
@@ -0,0 +1,6 @@
<li role="presentation">
<button id="settings-descent3" class="btn btn-primary"><span class="glyphicon glyphicon-globe"></span> Descent 3</button>
</li>
<li role="presentation">
<button id="settings-modifications" class="btn btn-primary"><span class="glyphicon glyphicon-tasks"></span> Modifications</button>
</li>
@@ -0,0 +1,3 @@
<li role="presentation">
<button class="btn btn-primary server" data-id="{{port}}">{{gameName}} <span class="glyphicon glyphicon-arrow-right"></span> {{port}}</button>
</li>
@@ -0,0 +1,12 @@
<li role="presentation">
<button id="dashboard" class="btn btn-primary"><span class="glyphicon glyphicon-dashboard"></span> Dashboard</button>
</li>
{{#each tabs}}
{{partial "server-tab"}}
{{/each}}
<li role="presentation">
<button id="addserver" class="btn btn-primary"><span class="glyphicon glyphicon-plus"></span> Add Server</button>
</li>
<li role="presentation">
<button id="settings" class="btn btn-primary"><span class="glyphicon glyphicon-cog"></span> Settings</button>
</li>

0 comments on commit 4154492

Please sign in to comment.
You can’t perform that action at this time.