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

Create scenario update #543

Open
wants to merge 786 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
786 commits
Select commit Hold shift + click to select a range
6e45a8d
Fix typos in symbolIDs for area graphics. They now render correctly …
youngca Jan 30, 2018
a3df60e
Merge pull request #107 from interactive-tactical-decision-games/crea…
youngca Jan 31, 2018
d967605
Convert modifiers to the actual mil-sym modifiers when rendering in t…
youngca Feb 1, 2018
9809301
Correct modifier list for Airspace Coordination Area.
youngca Feb 1, 2018
17321c0
Keep private functions private. Use 'self' instead of 'this' in rend…
youngca Feb 1, 2018
18ef3ee
Merge pull request #108 from interactive-tactical-decision-games/Conv…
youngca Feb 1, 2018
744b55e
Add simple line and simple arrow type mission graphics. Also add in …
youngca Feb 2, 2018
2bbb763
Add more defined mission graphics.
youngca Feb 4, 2018
0e10c57
Merge pull request #109 from interactive-tactical-decision-games/crea…
youngca Feb 5, 2018
444b561
Remove unnecessary 300 ms pause before rendering new unit
eric79 Jan 25, 2018
6ac94be
Add sourceURLs to unitIcon.js
eric79 Jan 25, 2018
bc4890a
Skip rendering unit while its being created until the end
eric79 Jan 25, 2018
6d1b7ad
Simplify render function
eric79 Jan 25, 2018
99bc679
Unpause rendering on nodes once they are initialized
eric79 Jan 26, 2018
33d7751
Eliminate unnecessary explicit render once unit is initialized
eric79 Jan 26, 2018
c16767f
Add getters for stroke properties
eric79 Jan 29, 2018
4048c80
Add sourceURL to unitGroup.setPositionFromMapPosition
eric79 Jan 29, 2018
e919d82
Remove unused render function from unit.vwf
eric79 Jan 30, 2018
bba5cf5
Show unit groups when the are done being created
eric79 Jan 30, 2018
0baa55d
Fix indentation in model/kineticjs.js
eric79 Jan 30, 2018
49f626c
Eliminate unnecessary renders during mission graphic creation
eric79 Jan 31, 2018
3c50f70
Remove white space from unit.vwf.yaml
eric79 Jan 31, 2018
f2b027d
Remove debug statements for simplifying points
eric79 Feb 5, 2018
51801b9
Remove unsupported modifiers from specific mission graphics.
youngca Feb 6, 2018
eb9d9f7
Merge pull request #110 from interactive-tactical-decision-games/elim…
youngca Feb 6, 2018
ecf8ed9
Fix automatic redraw when hiding objects
eric79 Feb 6, 2018
aeccb60
Clear and redraw when an object's fill color changes
eric79 Feb 6, 2018
01a21e1
Automatically redraw object if its radius or opacity changes
eric79 Feb 6, 2018
7299599
Have konva view driver refreshState when rendering is unpaused
eric79 Feb 7, 2018
f6dfa71
Remove model-side refreshLayer method
eric79 Feb 7, 2018
7311844
Remove model-side refreshState method
eric79 Feb 7, 2018
7161876
Check for valid nodeID before trying to get node in refreshChildrenHi…
youngca Feb 8, 2018
7f1cf3d
Merge pull request #111 from interactive-tactical-decision-games/ITDG…
youngca Feb 8, 2018
2856dfa
Expose addInsertableUnits as a public function of mil-sym view
eric79 Feb 7, 2018
9b5086b
Add default shadow properties to unitIcon.vwf.yaml
eric79 Feb 7, 2018
cbf53f8
Remove stray comma in .yaml file
eric79 Feb 7, 2018
c0630c7
Merge pull request #112 from interactive-tactical-decision-games/ITDG…
youngca Feb 8, 2018
6c403b6
Fix synchrony bug when dragging units quickly
eric79 Feb 9, 2018
3445217
Fix dragging units by touch
eric79 Feb 12, 2018
ec77cdb
Merge pull request #114 from interactive-tactical-decision-games/fix-…
youngca Feb 13, 2018
76f72bf
Add single point and multipoint rectangular tactical graphics.
youngca Feb 7, 2018
9da73b1
Add Defense Areas and rectangular multipoint mission graphics.
youngca Feb 8, 2018
6f7e7c8
Add Boundary Line. Correct FEBA to simple line type. Treat rectangul…
youngca Feb 11, 2018
03fc8f7
Add offense areas and special lines.
youngca Feb 11, 2018
c889c1c
Add mine cluster.
youngca Feb 11, 2018
2d8292a
Add multi segment arrow mission graphic types.
youngca Feb 12, 2018
b45e017
Add counterattack and counterattack by fire mission graphics.
youngca Feb 12, 2018
239ffbc
Add simple path types of mission graphics.
youngca Feb 12, 2018
9cef44f
Add leaf offset angle for certain arrows so they will create the arro…
youngca Feb 12, 2018
a530ee6
Correct simple lanes which had incorrect # of points. Remove redundan…
youngca Feb 12, 2018
9d8d39d
Put a TODO comment for POSITION AREA FOR ARTILLERY RECTANGULAR.
youngca Feb 12, 2018
285c9c3
Correct whitespace indentations.
youngca Feb 13, 2018
fbb334c
Fix duplicate named entries which was making sensor zones not appear …
youngca Feb 13, 2018
3883696
Merge pull request #113 from interactive-tactical-decision-games/miss…
youngca Feb 13, 2018
ab85b08
Update to version 2.8.0 (test release for TDK 1.2).
youngca Feb 13, 2018
04c0f6b
Update to version 2.8.1.
youngca Feb 15, 2018
ffa6008
Update to version 2.8.2.
youngca Feb 16, 2018
4d0e42c
Use correct type for munition flight path.
youngca Feb 17, 2018
0210c0b
Allow the variable tolerance and high-quality parameters to be passed…
youngca Feb 18, 2018
9871801
Adjust parameters of problem children Axis of Feint and Counterattack…
youngca Feb 18, 2018
7a08a34
Set image properly - prevents blurry stretched-out mission graphic im…
youngca Feb 18, 2018
1677e75
Add modifierLabel fields to specific graphics to provide more user-fr…
youngca Feb 18, 2018
0ffc2a7
Merge pull request #116 from interactive-tactical-decision-games/ITDG…
youngca Feb 19, 2018
5730fc1
Flesh out EMS types of symbols and apply affiliations only to symbols…
youngca Feb 15, 2018
b2a8135
Add missing stability operations symbols.
youngca Feb 15, 2018
0e9cdae
index on ITDG-1313-remove-law-enforcement-group: bdfe232 Flesh out EM…
youngca Feb 15, 2018
5077b67
Add missing Stability Ops subcategory.
youngca Feb 15, 2018
7a8b407
Add missing surface and subsurface vessels and equip, civilian vehs.
youngca Feb 16, 2018
768156a
Remove bad symbol, add good symbol.
youngca Feb 16, 2018
eea70e8
Add function to get description from mil-sym, remove blank symbols, a…
youngca Feb 19, 2018
f709c93
Add missing symbols. Arctic towed mortar and 2 types of TLAR.
youngca Feb 19, 2018
5bb91f1
Merge pull request #115 from interactive-tactical-decision-games/ITDG…
youngca Feb 19, 2018
b75af5e
In cases where image url is empty string, load placeholder image
eric79 Feb 21, 2018
0356df8
Merge pull request #117 from interactive-tactical-decision-games/ITDG…
youngca Feb 21, 2018
4539653
Increase `reflector.Evaluate` timeout to 15 seconds
davideaster Feb 22, 2018
c7ea7e4
Merge pull request #118 from interactive-tactical-decision-games/mani…
youngca Feb 22, 2018
7f6d3e1
Use a default pixel tolerance if the tolerance parameter is undefined…
youngca Feb 26, 2018
47f5a24
Simplify function already handles case of tolerance being undefined. …
youngca Feb 26, 2018
9865fdd
Pass tolerance parameter.
youngca Feb 26, 2018
e374a27
Merge pull request #119 from interactive-tactical-decision-games/add-…
youngca Feb 26, 2018
32eb6b5
Fix mismapped engineering vehicle.
youngca Feb 27, 2018
004da00
Set timeout back to 1s; prevents screen update hangs which cause user…
youngca Feb 27, 2018
915a3fc
Update version to 2.9.
youngca Feb 27, 2018
092ff93
Cancel dragend bubbling and remove redundant mouseout handler
eric79 Feb 26, 2018
6e19ea0
Handle undefined draggingnode
eric79 Feb 26, 2018
5cf1909
Allow mouse/touch events to propagate
eric79 Feb 28, 2018
5357aa8
Add comments about when mouse events are not fired
eric79 Feb 28, 2018
e703ade
Move all dragend functionality into dragend handler
eric79 Feb 28, 2018
74048b3
Fix "draw off the screen" problem for mouse - remains for touch
eric79 Feb 28, 2018
27d1909
Finish drawings when drawing mode changes
eric79 Feb 28, 2018
edab745
Remove redundant (and sometimes out of sync) mouseDown property
eric79 Feb 28, 2018
032de9e
Remove unnecessary check for falsy node that might hide bugs
eric79 Feb 28, 2018
fe9d472
Remove unnecessary call to processEvent in touchEnd handler
eric79 Feb 28, 2018
963f28b
Add test-R400.jpg for map tile unit tests
eric79 Mar 5, 2018
81e328b
Merge pull request #121 from interactive-tactical-decision-games/ITDG…
youngca Mar 6, 2018
3b43601
Merge pull request #120 from interactive-tactical-decision-games/hand…
youngca Mar 8, 2018
64029fa
Update to ITDG version 2.9.2.
youngca Mar 8, 2018
d734529
Handle empty files properly in OnStreamRequest
eric79 Mar 9, 2018
d4b5cc6
Merge pull request #122 from interactive-tactical-decision-games/hand…
youngca Mar 12, 2018
c528aa8
Update mil-sym library to v0.3.31 to fix small action points
eric79 Mar 14, 2018
13fb8b9
Merge pull request #124 from interactive-tactical-decision-games/fix-…
youngca Mar 14, 2018
fed116e
Add a minimum threshold property for caching images to counter degrad…
youngca Mar 14, 2018
e386688
Remove extraneous draw.
youngca Mar 14, 2018
5867073
Merge pull request #123 from interactive-tactical-decision-games/bugf…
youngca Mar 14, 2018
dba5a16
Update to version 3.0.
youngca Mar 15, 2018
06a6f28
Add line and fill colors to modifier list. Add a default color funct…
youngca Mar 22, 2018
c5b8bf3
Merge pull request #125 from interactive-tactical-decision-games/ITDG…
youngca Mar 22, 2018
61e416e
Add missing aviation and air control points, sea surface and subsurfa…
youngca Mar 26, 2018
13ebf8e
Use upper-case for mission graphic tags.
youngca Mar 26, 2018
0636c11
Merge pull request #126 from interactive-tactical-decision-games/ITDG…
youngca Mar 27, 2018
8ba6e0b
Add special modifiers to certain symbols. Add altitudeDepth to aviat…
youngca Mar 27, 2018
44836f0
Add route and routeSequenceNumber as special modifiers to aviation co…
youngca Mar 27, 2018
453d233
Change special modifier "route" to "routeName" to avoid clashing with…
youngca Mar 27, 2018
bc94dba
Merge pull request #127 from interactive-tactical-decision-games/ITDG…
youngca Mar 27, 2018
5c11c80
Update to ITDG version 3.0.1.
youngca Mar 30, 2018
8f2b6e4
Update to version 3.0.2.
youngca Apr 3, 2018
c101e71
Added scenario .tms files to lobby export. Also changed export-scena…
landersk61 Apr 3, 2018
e09c5d1
Changed concat to union for inputFilePaths during export so that dupl…
landersk61 Apr 10, 2018
9419cc7
Added .jpg, .png, .gif files to account for old scenarios where .tms …
landersk61 Apr 11, 2018
0360067
Merge pull request #128 from interactive-tactical-decision-games/expo…
youngca Apr 13, 2018
3bcb703
Make getUnitImage public so that we can use it as a utility to check …
youngca Apr 12, 2018
6572d83
Merge pull request #129 from interactive-tactical-decision-games/ITDG…
youngca Apr 17, 2018
575bcab
Update to version 3.0.3.
youngca Apr 17, 2018
e01d235
Replace res.send( 404 ) with res.sendStatus( 404 ) in stream.js
eric79 Apr 16, 2018
2246a25
Merge pull request #130 from interactive-tactical-decision-games/repl…
youngca Apr 18, 2018
ea73901
Update to version 3.1.
youngca Apr 18, 2018
b01eb7a
package.json, shrinkwrap, .gitignore
davideaster Jan 11, 2018
bd53e1c
ESLint
davideaster Jan 11, 2018
c5f44c8
Mocha
davideaster Jan 11, 2018
21f33ab
JSDoc
davideaster Jan 11, 2018
a20e61e
webpack
davideaster Jan 11, 2018
2512206
Configure webpack to bundle CSS
davideaster Jan 11, 2018
a7da51c
Configure webpack for production and development builds
davideaster Jan 11, 2018
403dc86
Babel
davideaster Jan 11, 2018
282afe5
React
davideaster Jan 11, 2018
bb8cafc
Bootstrap
davideaster Jan 11, 2018
6a93c9b
Enable Babel Stage 2 extensions to allow class fields
davideaster Dec 10, 2017
387a8a9
Relax ESLint errors
davideaster Jan 12, 2018
1adaa3e
Layout
davideaster Jan 11, 2018
bb2c867
Scenarios, Sessions, and Review components with placeholder content
davideaster Jan 11, 2018
e9a0405
Add functions previously provided to the Jade templates as locals
davideaster Dec 8, 2017
0aec92c
Add mock version and user locals previously provided to the Jade temp…
davideaster Jan 10, 2018
6d1a3c4
Add mock manifest locals
davideaster Jan 10, 2018
ab55e1c
Configure the layout using version and user data
davideaster Jan 11, 2018
136bd9b
Render scenario, session and review content using the manifest data
davideaster Dec 8, 2017
cf46ae0
Convert `Application` to a class and maintain inputs in the state
davideaster Dec 12, 2017
24997eb
Convert `Scenario` to a class and maintain input values in the state
davideaster Dec 10, 2017
c16726f
Add jQuery to support form submission
davideaster Dec 20, 2017
c30cc4a
Submit new-application and new-scenario forms
davideaster Dec 12, 2017
54b1af7
Submit the import form
davideaster Dec 13, 2017
a40dabd
Convert `Layout` to a class and render version and user data from the…
davideaster Dec 20, 2017
8635492
Render scenario, session and review content from the layout state
davideaster Dec 20, 2017
81858a3
Add `get` and `post` wrappers for `fetch`
davideaster Jan 5, 2018
5749420
Switch jQuery POST operations to `fetch` via `post`
davideaster Dec 21, 2017
71a24dd
Remove jQuery
davideaster Dec 21, 2017
c944caa
Add `version` and `user` services for data previously available as Ja…
davideaster Jan 4, 2018
d927d32
Load version and user data from the corresponding services
davideaster Jan 11, 2018
9130bd2
Add a `manifest` service
davideaster Dec 21, 2017
bb292ae
Load manifest data from the service
davideaster Dec 21, 2017
69528bf
Remove mock locals
davideaster Jan 11, 2018
d7c7989
Refresh the manifest after posting data to the server
davideaster Dec 23, 2017
62f3def
Login page
davideaster Jan 4, 2018
85fcecf
Build the lobby pages on `npm install`
davideaster Jan 12, 2018
80e0da6
Replace the Jade index and login pages with the React versions
davideaster Jan 8, 2018
850ccf1
Remove the Jade lobby
davideaster Jan 13, 2018
ffc71c9
Defer the first render until service data is available
davideaster Jan 17, 2018
aed2c42
Fix logout form
davideaster Jan 18, 2018
300e6f6
Fix row component names
davideaster Jan 18, 2018
49e4c47
Add parens for clarity
davideaster Jan 18, 2018
4bdd557
Replace form `onSubmit` with button `onClick` to remove form from row
davideaster Feb 19, 2018
5d52db5
Use link formatting for link buttons
davideaster Feb 19, 2018
cb5cdb6
Correct capitalization on Scenarios, Sessions, and Review imports
davideaster Feb 16, 2018
3c50fbf
Remove unnecessary `instructorStudentsLabel` export
davideaster Feb 20, 2018
13a647f
`npm install --save react-table`
davideaster Jan 29, 2018
bb379a6
`react-table` component to allow rows to manage state for cells
davideaster Feb 19, 2018
da6d2b7
`react-table` CSS
davideaster Feb 19, 2018
36f7076
Scenarios (but not yet Application) as `react-table`
davideaster Feb 19, 2018
ca6c08d
app row
davideaster Feb 20, 2018
71318f8
Sessions as `react-table`
davideaster Feb 19, 2018
5aeb62a
Review as `react-table`
davideaster Feb 19, 2018
e7ea6d9
Remove unused `react-bootstrap` imports
davideaster Feb 19, 2018
788ec19
Add IDs to distinguish columns
davideaster Feb 20, 2018
fb44903
Enable filters
davideaster Feb 19, 2018
4515107
Disable sorting on non-data columns
davideaster Feb 19, 2018
d80f3be
Case-insensitive, partial string filtering
davideaster Feb 19, 2018
0e6fb20
Fix filtering on the custom Sessions title column
davideaster Feb 19, 2018
a1db1a9
Allow unused function arguments in ESLint
davideaster Feb 20, 2018
b580225
Render the Import label as a button
davideaster Feb 20, 2018
398a1c1
Switch the Export link to a button
davideaster Feb 20, 2018
109b995
Restore the view refresh after creating a session
davideaster Feb 20, 2018
472140e
Change fetch header from null to undefined to avoid type error
eric79 Feb 21, 2018
abe6eb5
Reduce timeout from 15s to 5s.
youngca Feb 23, 2018
cffd582
Rename lobby tabs
eric79 Apr 20, 2018
c65b875
Change Active Sessions tab to only show Active Sessions
eric79 Apr 20, 2018
ca4745d
Modify rules for displaying sessions as Active or Previous
eric79 Apr 25, 2018
b3b71bf
Ensure that Date column starts wide enough to show whole date
eric79 Apr 25, 2018
93f07c7
Center the Review and Resume links in their table cell
eric79 Apr 25, 2018
a425627
Line up text and links on lobby Review tab rows
eric79 Apr 26, 2018
dc276fa
Rename Sessions to ActiveSessions and Review to PreviousSessions
eric79 Apr 26, 2018
5968108
Refactor record functions to just return what the caller needs
eric79 Apr 26, 2018
597427a
Explicitly display the ActiveSessions TabPane for students
eric79 Apr 27, 2018
bbbb4be
Hide filter inputs until at least one scenario exists
eric79 Apr 27, 2018
d304b7d
Break super long line into several in Scenarios.js
eric79 Apr 27, 2018
e3ebb05
Undo hack to make student TabContent visible
eric79 Apr 27, 2018
cae81a9
Remove extra ;
eric79 Apr 30, 2018
28532a1
Reduce Evaluate timeout to 1s
eric79 Apr 30, 2018
6939d8e
Merge pull request #101 from interactive-tactical-decision-games/lobb…
eric79 Apr 30, 2018
33d9942
Remove ESLint errors by defining Cells as named functions
eric79 Apr 30, 2018
2aa5b30
Merge pull request #133 from interactive-tactical-decision-games/remo…
eric79 Apr 30, 2018
2211ba1
Add Search placeholder
eric79 Apr 30, 2018
14dc395
Clear scenario title after user hits "Create" button in lobby
eric79 Apr 30, 2018
6d5780f
Merge pull request #134 from interactive-tactical-decision-games/add-…
eric79 Apr 30, 2018
e54a178
Treat an Enter keypress in the New Scenario field as a Submit
eric79 Apr 30, 2018
d86ad38
Merge pull request #135 from interactive-tactical-decision-games/hand…
eric79 Apr 30, 2018
cdaff08
Added option to retrieve a list of metrics files from the server
landersk61 Apr 26, 2018
36fd35e
Merge pull request #132 from interactive-tactical-decision-games/metr…
youngca Apr 30, 2018
630ff75
Update to version 3.2.
youngca Apr 30, 2018
636d18f
Handle undefined referer when processing socket messages.
youngca May 1, 2018
09e15bf
Adding two metrics files as default options
landersk61 May 3, 2018
d6ad4fd
Merge pull request #136 from interactive-tactical-decision-games/metr…
youngca May 7, 2018
320e76c
Update to ITDG version 3.2.1.
youngca May 17, 2018
6bf161b
Switch filters to named functions to provide React display name
davideaster May 23, 2018
983079c
Add `propTypes`
davideaster May 23, 2018
72dd7a7
Turn off warnings for intentional uses of `console`
davideaster May 24, 2018
6e44163
Convert column components to classes and define `propTypes`
davideaster May 25, 2018
97181c3
Merge pull request #137 from interactive-tactical-decision-games/lobb…
youngca May 30, 2018
d6c4541
Update to ITDG version 3.2.2.
youngca Jun 4, 2018
c96b88a
awesome new stuff
bquader Jun 25, 2018
02451d8
Merge pull request #138 from interactive-tactical-decision-games/lobb…
k-zaback Jun 25, 2018
651c2f0
fixed syntax erors
bquader Jun 28, 2018
b4acab7
Merge pull request #140 from interactive-tactical-decision-games/synt…
k-zaback Jun 28, 2018
bbda08c
buttons
bquader Jun 28, 2018
7afe053
removed checkbox
bquader Jul 2, 2018
be34f87
edited buttons
bquader Jul 3, 2018
c964a14
code cleanup
bquader Jul 3, 2018
62c8444
Merge pull request #141 from interactive-tactical-decision-games/logi…
k-zaback Jul 3, 2018
c9e2906
process of fixing create
bquader Jul 5, 2018
f79ea22
changed create
bquader Jul 5, 2018
78d9a80
fixed buttons and stopped overlap
bquader Jul 5, 2018
8940677
Merge pull request #142 from interactive-tactical-decision-games/crea…
k-zaback Jul 5, 2018
4e42f81
Add convoy mission graphics and add acronyms for mission graphic names.
youngca Jun 12, 2018
f26e2b0
Add circular target.
youngca Jun 18, 2018
cdc0698
Add all fire support circular mission graphics.
youngca Jul 17, 2018
7ede2f9
Add distance modifier for all circular mission graphics (defines radi…
youngca Jul 17, 2018
fa0a826
Add custom radius modifier label for the distance modifier for circle…
youngca Jul 19, 2018
3c46c37
Merge pull request #144 from interactive-tactical-decision-games/ITDG…
youngca Jul 19, 2018
5ecddfa
Ignore public/ITDG and log/xapi-statements.json.
youngca Jul 19, 2018
3c17894
added comments
bquader Jul 5, 2018
d573ca1
scaled lobby and scenario screen for mobile devices
bquader Jul 9, 2018
0413d32
added layout tab in mobile interface. still under construction
bquader Jul 17, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -5,3 +5,5 @@
# Node.js
node_modules
/npm-debug.log
/log/xapi-statements.json
/public/ITDG
10 changes: 10 additions & 0 deletions CHANGELOG.md
@@ -1,6 +1,16 @@
VIRTUAL WORLD FRAMEWORK CHANGE LOG
==================================

----------------------------------
0.8.0
----------------------------------------------------------------------------------------------------
Note: (*) indicates an API change.

- CHG*: Handle reflector actions as they arrive, without waiting for a tick.
- CHG*: Don't record ticks in the queue. Don't tick nodes and model drivers.
- CHG*: Remove ticking function from model drivers.


----------------------------------
0.7.0
----------------------------------------------------------------------------------------------------
Expand Down
7 changes: 7 additions & 0 deletions StartVWFServer.bat
@@ -0,0 +1,7 @@
@echo off
set NPM_PATH=%HOMEDRIVE%%HOME_PATH%\AppData\Roaming\npm
set NODEJS_PATH=%ProgramFiles%\nodejs
set PATH=%NPM_PATH%;%NODEJS_PATH%;%PATH%
cd C:\ITDG\VWF
npm start
exit
4 changes: 4 additions & 0 deletions StartVWFServerMinimized.bat
@@ -0,0 +1,4 @@
@echo off
cd C:\ITDG\VWF
start /min StartVWFServer.bat
exit
13 changes: 13 additions & 0 deletions config/custom-environment-variables.json
@@ -0,0 +1,13 @@
{
"session": {
"secret": "VWF_SESSION_SECRET"
},
"tdg": {
"password": "VWF_TDG_PASSWORD"
},
"txs": {
"amqp_host": "VWF_TXS_AMQP_HOST",
"amqp_exchange": "VWF_TXS_AMQP_EXCHANGE",
"amqp_channel": "VWF_TXS_AMQP_CHANNEL"
}
}
24 changes: 24 additions & 0 deletions config/default.json
@@ -0,0 +1,24 @@
{

// Secret for signed sessions. Generate a new secret with
// `node -e 'console.log( require( "crypto" ).randomBytes( 32 ).toString( "hex" ) )'`

"session": {
"secret": "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"
},

// TDG instructor password.

"tdg": {
"password": "password"
},

// AMQP parameters for the `/sim` route to publish to TXS.

"txs": {
"amqp_host": "localhost",
"amqp_exchange": "x_txs",
"amqp_channel": "itdg.loadMission"
}

}
Binary file added documents/ITDG/maps/test-R400.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documents/ITDG/maps/test-R400.tif
Binary file not shown.
Binary file added documents/ITDG/maps/test-R400.tms/16/11653/22630.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documents/ITDG/maps/test-R400.tms/16/11653/22631.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documents/ITDG/maps/test-R400.tms/17/23306/45262.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documents/ITDG/maps/test-R400.tms/17/23307/45260.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions documents/ITDG/maps/test-R400.tms/tilemapresource.xml
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<TileMap version="1.0.0" tilemapservice="http://tms.osgeo.org/1.0.0">
<Title>R400_imagery_wgs84_clipped_noalpha.tif</Title>
<Abstract></Abstract>
<SRS>EPSG:4326</SRS>
<BoundingBox minx="34.30000293136028" miny="-115.98798356199879" maxx="34.31708185985235" maxy="-115.97085609083929"/>
<Origin x="34.30000293136028" y="-115.98798356199879"/>
<TileFormat width="256" height="256" mime-type="image/png" extension="png"/>
<TileSets profile="geodetic">
<TileSet href="10" units-per-pixel="0.00068664550781" order="10"/>
<TileSet href="11" units-per-pixel="0.00034332275391" order="11"/>
<TileSet href="12" units-per-pixel="0.00017166137695" order="12"/>
<TileSet href="13" units-per-pixel="0.00008583068848" order="13"/>
<TileSet href="14" units-per-pixel="0.00004291534424" order="14"/>
<TileSet href="15" units-per-pixel="0.00002145767212" order="15"/>
<TileSet href="16" units-per-pixel="0.00001072883606" order="16"/>
<TileSet href="17" units-per-pixel="0.00000536441803" order="17"/>
<TileSet href="18" units-per-pixel="0.00000268220901" order="18"/>
<TileSet href="19" units-per-pixel="0.00000134110451" order="19"/>
<TileSet href="20" units-per-pixel="0.00000067055225" order="20"/>
</TileSets>
</TileMap>

95 changes: 95 additions & 0 deletions documents/ITDG/metrics/CPG_Metrics.csv

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions documents/ITDG/metrics/TBS_BOC_Metrics.csv
@@ -0,0 +1,5 @@
"title","index","type","setLayerOwned","defaultValue","options"
"Student Orders","0","Long Text","undefined","","null"
"Instructor Rating","1","Range","undefined","","[0,10,1,{'0':'N/A','1':'Unsat','2':'Unsat','3':'Marginal','4':'Marginal','5':'Acceptable','6':'Acceptable','7':'Capable','8':'Capable','9':'Outstanding','10':'Outstanding'}]"
"Instructor Grade","2","Text","undefined","","null"
"Instructor Observations","3","Long Text","undefined","","null"
1 change: 1 addition & 0 deletions documents/ITDG/scenarioTemplate/saveState.vwf.config.json
@@ -0,0 +1 @@
{"info":{"title":"Scenario Template"},"model":{"vwf/model/javascript":"","vwf/model/kineticjs":"","vwf/model/mil-sym":"","vwf/model/object":"","nodriver":""},"view":{"vwf/view/document":"","vwf/view/touch":"","vwf/view/kineticjs":"","vwf/view/mil-sym":""}}
1 change: 1 addition & 0 deletions documents/ITDG/scenarioTemplate/saveState.vwf.json
@@ -0,0 +1 @@
{"configuration":{"log-level":"info","random-seed":1466540519030,"randomize-ids":true,"humanize-ids":true,"preserve-script-closures":false,"load-timeout":120},"kernel":{"time":0},"nodes":[{"patches":"http://vwf.example.com/clients.vwf","sequence":7,"random":{"s0":0.24205980077385902,"s1":0.9761656543705612,"s2":0.9434323732275516,"c":11304},"children":{}},{"patches":"/ITDG/index.vwf","properties":{"unitIconDefaults":{"shadowColor":"rgba( 1, 1, 1, 0.5 )","shadowBlur":10,"shadowOffsetX":8,"shadowOffsetY":8,"shadowEnabled":false}},"children":{"scenarioController":{"patches":"/ITDG/index.vwf:3-47-scenarioController","sequence":4,"random":{"s0":0.4123580085579306,"s1":0.9537082586903125,"s2":0.22647805558517575,"c":582588},"properties":{},"children":{}},"participants":{"patches":"/ITDG/index.vwf:5-08-participants","sequence":1,"random":{"s0":0.6633416542317718,"s1":0.6727178883738816,"s2":0.3024811027571559,"c":1237838},"children":{}}}}],"annotations":{"1":"application"},"queue":{"time":0,"queue":[]}}
1 change: 1 addition & 0 deletions external/README.txt
@@ -0,0 +1 @@
Place external applications in "external" folder.
7 changes: 4 additions & 3 deletions lib/nodejs/admin.js
Expand Up @@ -232,7 +232,7 @@ function HandleAdminConfig( request, response, parsedRequest ) {
if ( ( parsedRequest[ 'public_path' ] ) && ( parsedRequest[ 'application' ] ) && ( request.method == "GET" ) ) {
var filenameRoot = helpers.JoinPath( global.applicationRoot, parsedRequest[ 'public_path' ], parsedRequest[ 'application' ] );
if ( helpers.IsFile( filenameRoot + ".config.yaml" ) ) {
serve.YAML( ( filenameRoot + ".config.yaml" ).replace( /\//g, libpath.sep ), response, url.parse( request.url, true ) );
serve.YAML( request, ( filenameRoot + ".config.yaml" ).replace( /\//g, libpath.sep ), response, url.parse( request.url, true ) );
return true;
}
else if ( helpers.IsFile( filenameRoot + ".config.json" ) ) {
Expand All @@ -242,6 +242,7 @@ function HandleAdminConfig( request, response, parsedRequest ) {
else {
// If there is no config file, return an empty string to prevent 404 errors
serve.JSON("", response);
return true;
}
}
return false;
Expand All @@ -267,9 +268,9 @@ function HandleAdminChrome( request, response, parsedRequest ) {
return false;
}

// The Serve function in admin takes in the nodeJS request and nnodeJS response as well as
// The Serve function in admin takes in the nodeJS request and nodeJS response as well as
// the parsedRequest information.
// It tests if the request is actually an admin request, and if calls an appropriate handler
// It tests if the request is actually an admin request, and if so, calls an appropriate handler
// to serve the appropriate response.
// If the request is succesfully served, it returns TRUE, if the request is not succesfully
// served (whether due to a file not being present, the request being malformed, or simply it
Expand Down
9 changes: 7 additions & 2 deletions lib/nodejs/application.js
Expand Up @@ -5,7 +5,8 @@
var servehandler = require( './serve-handler' ),
helpers = require( './helpers' ),
persistence = require( './persistence' ),
admin = require( './admin' );
admin = require( './admin' ),
stream = require( './stream' );

// Requests are attempted to be served as if they pertain to a specific application.
// If any of these attempts succesfully serve the request, true is returned.
Expand All @@ -32,11 +33,15 @@ function Serve( request, response, parsedRequest ) {
if ( servehandler.Component( request, response, helpers.JoinPath( global.applicationRoot, parsedRequest[ 'public_path' ], parsedRequest[ 'private_path' ] ) ) ) {
return true;
}
// Test if mediaServer can server the request.
if ( stream.Serve( request, response, parsedRequest ) ) {
return true;
}
// If the request was still not served, try and see if the persistence functionality will serve this request.
if ( persistence.Serve( request, response, parsedRequest ) ) {
return true;
}
// Finally, test if the admin functionality can serve this request.
// Test if the admin functionality can serve this request.
if ( admin.Serve( request, response, parsedRequest ) ) {
return true;
}
Expand Down
150 changes: 150 additions & 0 deletions lib/nodejs/authentication.js
@@ -0,0 +1,150 @@
// TDG authentication scheme.
//
// A valid login is required for all routes. Any username is accepted, but instructors must provide
// the instructor password. A VWF `client.vwf` descriptor is published to the session to describe
// the user in the VWF application.

var passport = require( "passport" ),
passportLocal = require( "passport-local" ),
config = require( "config" ),
path = require( "path" );

// Passport strategy options.

var strategyOptions = {
passReqToCallback: true, // Call the strategy callback as `cb( req, ... )` instead of `cb( ... )`
usernameField: "last_name", // A non-empty field to appease `passport-local`, but we ignore `username`
passwordField: "last_name", // A non-empty field, and we ignore `password`; the actual password may be empty
};

// Create and attach the Passport strategy object.

var strategy = new passportLocal( strategyOptions, function( req, username, password, done ) {

// Build the user object from the form properties.

var user = {
last_name:
req.body.last_name || req.query.last_name,
first_name:
req.body.first_name || req.query.first_name,
middle_initial:
req.body.middle_initial || req.query.middle_initial,
instructor:
req.body.instructor || req.query.instructor,
};

// Get the actual password from the form.

password = req.body.password || req.query.password;

// Check the password if one is configured. Instructors must provide a password.

var authenticated = ! config.has( "tdg.password" ) || ! config.get( "tdg.password" ) ||
password === config.get( "tdg.password" );

// Return the result. For successful logins, return the user object. The user object will be
// attached to the request at `req.user`.
//
// For login errors, return `false` for `user` and provide an error message. If an error occurs
// while performing the lookup, return the error object.

if ( user.instructor && ! authenticated ) {
return done( null, false, { message: 'Incorrect password' } );
} else {
return done( null, user );
}

} );

passport.use( strategy );

// Convert the user object to a reference to be stored in the session. Without a user database, this
// can be the user object. With a local user database, it should be the user id in the database.
//
// Also attach a VWF `client.vwf` descriptor to the session to describe the user for the VWF
// application.

passport.serializeUser( function( req, user, done ) {

req.session.vwf = req.session.vwf || {};

req.session.vwf.client = {
properties: {
last_name:
user.last_name,
first_name:
user.first_name,
middle_initial:
user.middle_initial,
instructor:
user.instructor !== undefined ? !! user.instructor : undefined,
}
};

done( null, user );

} );

// Convert a user reference in the session to a user object. Without a user database, the session
// data is the user object. With a local user database, look up the user from an id in the session.

passport.deserializeUser( function( req, id, done ) {
done( null, id );
} );

// Create a router to contain the Passport middleware and login/logout routes.

var router = require( "express" ).Router();

// Passport and the Passport `session` module.

router.use( passport.initialize() );
router.use( passport.authenticate( "session" ) );

// Show a login form at `/login`.

router.get( "/login", function( req, res ) {
res.sendFile( path.join( __dirname, "../../support/lobby", "login.html" ) );
} );

// Receive a login request and attempt to authenticate.
//
// The URLs would need the base URL prepended if the application is not mounted at `/`. Since the
// authentication middleware is created outside the request, we don't have access to `baseUrl` to
// do this.

router.post( "/login", passport.authenticate( "local", {
successReturnToOrRedirect: /* req.baseUrl + */ "/",
failureRedirect: /* req.baseUrl + */ "/login",
failureFlash: true,
} ) );

// Receive a logout request and log out. Also remove the VWF `client.vwf` descriptor from the
// session.

router.post( "/logout", function( req, res ) {
req.logout();
req.session.vwf && delete req.session.vwf.client;
res.redirect( req.baseUrl + "/login" );
} );

// Enforce authentication rules. This implementation requires a valid login for all routes except
// for `/login` and `/logout`.

router.use( function( req, res, next ) {
if ( req.isUnauthenticated() ) {
if ( req.accepts( "html", "json" ) === "html" ) {
req.session.returnTo = req.baseUrl + req.url;
res.redirect( req.baseUrl + "/login" );
} else {
res.sendStatus( 401 );
}
} else {
next();
}
} );

// Export the router.

module.exports = router;
65 changes: 65 additions & 0 deletions lib/nodejs/authentication/passport-http.js
@@ -0,0 +1,65 @@
// Example authentication module implemented with Passport and HTTP Basic authentication.
//
// A valid login is required for all routes, but any username and password are accepted. Hooks for
// querying a user database are shown. A VWF `client.vwf` descriptor is published to the session to
// describe the user in the VWF application.
//
// Add the NPM modules `passport` and `passport-http` to support this method.

var passport = require( "passport" ),
passportHTTP = require( "passport-http" );

// Create and attach the Passport strategy object.

var strategy = new passportHTTP.BasicStrategy( function( username, password, done ) {

// Given `username` and `password` from a login form, look up the user in a local database.

var user = { username: username };

// Return the result. For successful logins, return the user object. The user object will be
// attached to the request at `req.user`.
//
// For login errors, return `false` for `user` and provide an error message. If an error occurs
// while performing the lookup, return the error object.

if ( false /* lookup error */ ) {
return done( {} /* err */ );
} else if ( false /* bad user */ ) {
return done( null, false, { message: 'Incorrect username' } );
} else if ( false /* bad password */ ) {
return done( null, false, { message: 'Incorrect password' } );
} else {
return done( null, user );
}

} );

passport.use( strategy );

// Convert the user object to a reference to be stored in the session. Without a user database, this
// can be the user object. With a local user database, it should be the user id in the database.
//
// Also attach a VWF `client.vwf` descriptor to the session to describe the user for the VWF
// application.

passport.serializeUser( function( req, user, done ) {
req.session.vwf = req.session.vwf || {};
req.session.vwf.client = { properties: { username: user.username } };
done( null, user );
} );

// Convert a user reference in the session to a user object. Without a user database, the session
// data is the user object. With a local user database, look up the user from an id in the session.

passport.deserializeUser( function( req, id, done ) {
done( null, id );
} );

// Export the Passport initializer, `session` module, and HTTP Basic strategy module.

module.exports = [
passport.initialize(),
passport.authenticate( "session" ),
passport.authenticate( "basic" ),
];