diff --git a/Content/Blueprints/SubmarineCharacter.uasset b/Content/Blueprints/SubmarineCharacter.uasset index 8da6412..2826528 100644 Binary files a/Content/Blueprints/SubmarineCharacter.uasset and b/Content/Blueprints/SubmarineCharacter.uasset differ diff --git a/Content/Movies/sounds/menu_background.sfk b/Content/Movies/sounds/menu_background.sfk new file mode 100644 index 0000000..5ffc07f Binary files /dev/null and b/Content/Movies/sounds/menu_background.sfk differ diff --git a/Content/Movies/sounds/menu_background.uasset b/Content/Movies/sounds/menu_background.uasset index 86152d8..4c6765c 100644 Binary files a/Content/Movies/sounds/menu_background.uasset and b/Content/Movies/sounds/menu_background.uasset differ diff --git a/Content/UI/submarine.uasset b/Content/UI/submarine.uasset index 668f0d1..2979538 100644 Binary files a/Content/UI/submarine.uasset and b/Content/UI/submarine.uasset differ diff --git a/Submariner Server/app.js b/Submariner Server/app.js index 9ededad..7a12588 100644 --- a/Submariner Server/app.js +++ b/Submariner Server/app.js @@ -2,6 +2,11 @@ var app = require('express')(); var http = require('http').Server(app); var io = require('socket.io')(http); var util = require('util'); +var exec = require('child_process').exec; +function execute(command, callback) { + exec(command, function(error, stdout, stderr) { callback(stdout); }); +}; + var clients = []; // Interactable object states @@ -89,35 +94,41 @@ io.on('connection', function(socket) { // lose = wait 10 seconds. var loop = function() { - // Check for game start + // Check for game start (all characters selected) if (captainSelect && gunnerSelect && navigatorSelect && engineerSelect) { gameStart = true; } - // Check for victory - if (buttonPress && leverPull && crankTurn && handlePull && !gameOver) { - gameOver = true; - console.log("sending win"); - io.sockets.emit('win', { text: 'You win!' }); + if (gameStart) { + + // Generate a task + generateTask(function(state) { + console.log(state); + }); + + // Check for victory + if (buttonPress && leverPull && crankTurn && handlePull && !gameOver) { + gameOver = true; + console.log("sending win"); + io.sockets.emit('win', { text: 'You win!' }); - // Reset the game - resetGame(); - } + // Reset the game + resetGame(); + } - // Check for defeat; wait for game start (all characters selected) - if (gameStart && deciseconds >= 100 && !gameOver) { + // Check for defeat + if (deciseconds >= 600 && !gameOver) { - gameOver = true; - console.log("sending lose"); - io.sockets.emit('lose', { text: 'You lose!' }); + gameOver = true; + console.log("sending lose"); + io.sockets.emit('lose', { text: 'You lose!' }); - // Reset the game - resetGame(); - } + // Reset the game + resetGame(); + } - // Increment timer - if (gameStart) { + // Increment timer deciseconds++; } }; @@ -138,7 +149,14 @@ var resetGame = function() { gameStart = false; gameOver = false; deciseconds = 0; -} +}; + +// Generate a task +var generateTask = function(callback) { + execute("SubmarinerHelper.exe", function(object) { + callback({ state: object }); + }); +}; // Launch the server. http.listen(3000, function() { diff --git a/SubmarinerHelper/SubmarinerHelper/Debug/SubmarinerHelper.ilk b/SubmarinerHelper/SubmarinerHelper/Debug/SubmarinerHelper.ilk new file mode 100644 index 0000000..7e1b3bb Binary files /dev/null and b/SubmarinerHelper/SubmarinerHelper/Debug/SubmarinerHelper.ilk differ diff --git a/SubmarinerHelper/SubmarinerHelper/Debug/SubmarinerHelper.pdb b/SubmarinerHelper/SubmarinerHelper/Debug/SubmarinerHelper.pdb new file mode 100644 index 0000000..5f76122 Binary files /dev/null and b/SubmarinerHelper/SubmarinerHelper/Debug/SubmarinerHelper.pdb differ diff --git a/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/Debug/SubmarinerHelper.log b/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/Debug/SubmarinerHelper.log new file mode 100644 index 0000000..b358ced --- /dev/null +++ b/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/Debug/SubmarinerHelper.log @@ -0,0 +1,2 @@ + SubmarinerHelper.cpp + SubmarinerHelper.vcxproj -> E:\Unreal Projects\Submariner\SubmarinerHelper\SubmarinerHelper\Debug\SubmarinerHelper.exe diff --git a/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/Debug/SubmarinerHelper.tlog/CL.command.1.tlog b/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/Debug/SubmarinerHelper.tlog/CL.command.1.tlog new file mode 100644 index 0000000..4a7d0e4 Binary files /dev/null and b/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/Debug/SubmarinerHelper.tlog/CL.command.1.tlog differ diff --git a/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/Debug/SubmarinerHelper.tlog/CL.read.1.tlog b/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/Debug/SubmarinerHelper.tlog/CL.read.1.tlog new file mode 100644 index 0000000..d48384c Binary files /dev/null and b/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/Debug/SubmarinerHelper.tlog/CL.read.1.tlog differ diff --git a/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/Debug/SubmarinerHelper.tlog/CL.write.1.tlog b/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/Debug/SubmarinerHelper.tlog/CL.write.1.tlog new file mode 100644 index 0000000..991a24d Binary files /dev/null and b/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/Debug/SubmarinerHelper.tlog/CL.write.1.tlog differ diff --git a/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/Debug/SubmarinerHelper.tlog/SubmarinerHelper.lastbuildstate b/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/Debug/SubmarinerHelper.tlog/SubmarinerHelper.lastbuildstate new file mode 100644 index 0000000..e6c278c --- /dev/null +++ b/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/Debug/SubmarinerHelper.tlog/SubmarinerHelper.lastbuildstate @@ -0,0 +1,2 @@ +#TargetFrameworkVersion=v4.0:PlatformToolSet=v140:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=8.1 +Debug|Win32|E:\Unreal Projects\Submariner\SubmarinerHelper\SubmarinerHelper\| diff --git a/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/Debug/SubmarinerHelper.tlog/link.command.1.tlog b/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/Debug/SubmarinerHelper.tlog/link.command.1.tlog new file mode 100644 index 0000000..e7417c7 Binary files /dev/null and b/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/Debug/SubmarinerHelper.tlog/link.command.1.tlog differ diff --git a/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/Debug/SubmarinerHelper.tlog/link.read.1.tlog b/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/Debug/SubmarinerHelper.tlog/link.read.1.tlog new file mode 100644 index 0000000..c298bfc Binary files /dev/null and b/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/Debug/SubmarinerHelper.tlog/link.read.1.tlog differ diff --git a/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/Debug/SubmarinerHelper.tlog/link.write.1.tlog b/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/Debug/SubmarinerHelper.tlog/link.write.1.tlog new file mode 100644 index 0000000..9968cec Binary files /dev/null and b/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/Debug/SubmarinerHelper.tlog/link.write.1.tlog differ diff --git a/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/Debug/vc140.idb b/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/Debug/vc140.idb new file mode 100644 index 0000000..f8e91dd Binary files /dev/null and b/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/Debug/vc140.idb differ diff --git a/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/Debug/vc140.pdb b/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/Debug/vc140.pdb new file mode 100644 index 0000000..4e21598 Binary files /dev/null and b/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/Debug/vc140.pdb differ diff --git a/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/ReadMe.txt b/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/ReadMe.txt new file mode 100644 index 0000000..df4c2b2 --- /dev/null +++ b/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/ReadMe.txt @@ -0,0 +1,40 @@ +======================================================================== + CONSOLE APPLICATION : SubmarinerHelper Project Overview +======================================================================== + +AppWizard has created this SubmarinerHelper application for you. + +This file contains a summary of what you will find in each of the files that +make up your SubmarinerHelper application. + + +SubmarinerHelper.vcxproj + This is the main project file for VC++ projects generated using an Application Wizard. + It contains information about the version of Visual C++ that generated the file, and + information about the platforms, configurations, and project features selected with the + Application Wizard. + +SubmarinerHelper.vcxproj.filters + This is the filters file for VC++ projects generated using an Application Wizard. + It contains information about the association between the files in your project + and the filters. This association is used in the IDE to show grouping of files with + similar extensions under a specific node (for e.g. ".cpp" files are associated with the + "Source Files" filter). + +SubmarinerHelper.cpp + This is the main application source file. + +///////////////////////////////////////////////////////////////////////////// +Other standard files: + +StdAfx.h, StdAfx.cpp + These files are used to build a precompiled header (PCH) file + named SubmarinerHelper.pch and a precompiled types file named StdAfx.obj. + +///////////////////////////////////////////////////////////////////////////// +Other notes: + +AppWizard uses "TODO:" comments to indicate parts of the source code you +should add to or customize. + +///////////////////////////////////////////////////////////////////////////// diff --git a/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper.cpp b/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper.cpp new file mode 100644 index 0000000..6df7c24 --- /dev/null +++ b/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper.cpp @@ -0,0 +1,15 @@ +#include +#include + +using namespace std; + +random_device rd; // only used once to initialise (seed) engine +mt19937 rng(rd()); // random-number engine used (Mersenne-Twister in this case) +uniform_int_distribution uni(0, 1); // guaranteed unbiased + +// A helepr tool for task generation in C++. +int main() { + cout << "cb:" << uni(rng) << ";nl:" << uni(rng) + << ";gh:" << uni(rng) << ";ew:" << uni(rng); + return 0; +} \ No newline at end of file diff --git a/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper.vcxproj b/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper.vcxproj new file mode 100644 index 0000000..5d0fc10 --- /dev/null +++ b/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper.vcxproj @@ -0,0 +1,158 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {59922B8E-08C1-45B6-92F9-D18E3C52B28F} + Win32Proj + SubmarinerHelper + 8.1 + + + + Application + true + v140 + Unicode + + + Application + false + v140 + true + Unicode + + + Application + true + v140 + Unicode + + + Application + false + v140 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + true + + + false + + + false + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + + + Console + true + + + + + + + Level3 + Disabled + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + + + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + + + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + + + Console + true + true + true + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper.vcxproj.filters b/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper.vcxproj.filters new file mode 100644 index 0000000..ab2bff8 --- /dev/null +++ b/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper.vcxproj.filters @@ -0,0 +1,36 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + \ No newline at end of file diff --git a/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/stdafx.cpp b/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/stdafx.cpp new file mode 100644 index 0000000..4af11a5 --- /dev/null +++ b/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/stdafx.cpp @@ -0,0 +1,8 @@ +// stdafx.cpp : source file that includes just the standard includes +// SubmarinerHelper.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + +// TODO: reference any additional headers you need in STDAFX.H +// and not in this file diff --git a/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/stdafx.h b/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/stdafx.h new file mode 100644 index 0000000..b005a83 --- /dev/null +++ b/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/stdafx.h @@ -0,0 +1,15 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +#include "targetver.h" + +#include +#include + + + +// TODO: reference additional headers your program requires here diff --git a/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/targetver.h b/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/targetver.h new file mode 100644 index 0000000..87c0086 --- /dev/null +++ b/SubmarinerHelper/SubmarinerHelper/SubmarinerHelper/targetver.h @@ -0,0 +1,8 @@ +#pragma once + +// Including SDKDDKVer.h defines the highest available Windows platform. + +// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and +// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. + +#include