From c9a56048ca5d52f06942b629e819a618f546542b Mon Sep 17 00:00:00 2001 From: Darredevil Date: Sun, 9 Mar 2014 20:35:33 +0200 Subject: [PATCH 1/9] Update GoalManager.coffee --- app/lib/world/GoalManager.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/lib/world/GoalManager.coffee b/app/lib/world/GoalManager.coffee index 850b06859..13bf7e9d9 100644 --- a/app/lib/world/GoalManager.coffee +++ b/app/lib/world/GoalManager.coffee @@ -1,6 +1,6 @@ CocoClass = require 'lib/CocoClass' utils = require 'lib/utils' - +#test module.exports = class GoalManager extends CocoClass # The Goal Manager is created both on the main thread and # each time the world is generated. The one in world generation From 11ca60765d12cd7dfa54d3a3ce4ef00e83abac1c Mon Sep 17 00:00:00 2001 From: Sam Epps Date: Tue, 11 Mar 2014 17:16:09 +0100 Subject: [PATCH 2/9] Added some additional names to names.coffee --- app/lib/world/names.coffee | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/app/lib/world/names.coffee b/app/lib/world/names.coffee index d47f92425..91091e927 100644 --- a/app/lib/world/names.coffee +++ b/app/lib/world/names.coffee @@ -57,6 +57,7 @@ module.exports.thangNames = thangNames = "Nikita" "Alana" "Lana" + "Coco" ] "Peasant": [ "Yorik" @@ -79,6 +80,7 @@ module.exports.thangNames = thangNames = "Bernadette" "Hershell" "Gawain" + "Icey" ] "Archer F": [ "Phoebe" @@ -104,6 +106,12 @@ module.exports.thangNames = thangNames = "Alden" "Cairn" "Jensen" + "Yilitha" + "Mirana" + "Lina" + "Luna" + "Alleria" + "Vereesa" ] "Archer M": [ "Brian" @@ -111,6 +119,15 @@ module.exports.thangNames = thangNames = "Roman" "Hunter" "Simon" + "Slyvos" + "Logos" + "Denin" + "Lycan" + "Loco" + "Vican" + "Mars" + "Necros" + "Dev" ] "Ogre Munchkin M": [ "Brack" @@ -132,6 +149,7 @@ module.exports.thangNames = thangNames = "Thabt" "Snortt" "Kog" + "Ursa" ] "Ogre Munchkin F": [ "Iyert" @@ -139,6 +157,9 @@ module.exports.thangNames = thangNames = "Shmeal" "Gurzunn" "Yugark" + "Dosha" + "Inski" + "Lacos" ] "Ogre M": [ "Krogg" @@ -150,13 +171,20 @@ module.exports.thangNames = thangNames = "Trung" "Axe Ox" "Vargutt" + "Tarlok" + "Gurulax" + "Mokrul" ] "Ogre F": [ "Nareng" "Morthrug" "Glonc" "Marghurk" - + "Holkam" + "Alkaz" + "Gar'ah" + "Mak'rah" + "Marnag" ] "Ogre Brawler": [ "Grul'thock" @@ -171,6 +199,8 @@ module.exports.thangNames = thangNames = "Borgag" "Grognar" "Ironjaw" + "York" + "Ork'han" ] "Ogre Fangrider": [ "Dreek" @@ -186,6 +216,7 @@ module.exports.thangNames = thangNames = "Gurzthrot" "Murgark" "Muttin" + "Bortrok" ] "Ogre Shaman": [ "Sham'uk" @@ -205,6 +236,11 @@ module.exports.thangNames = thangNames = "Zo'Goroth" "Mogadishu" "Nazgareth" + "Gror" + "Grek" + "Gom" + "Gogg" + "Ghuk" ] "Ogre Thrower": [ "Kyrgg" From 4c7da1ea69edeb8e070b18333ffbb06866b03eb9 Mon Sep 17 00:00:00 2001 From: Dominik Kundel Date: Tue, 11 Mar 2014 23:47:27 +0100 Subject: [PATCH 3/9] update Gutter only if changed --- app/views/play/level/tome/spell_view.coffee | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/app/views/play/level/tome/spell_view.coffee b/app/views/play/level/tome/spell_view.coffee index 8c98db854..de5c2a8b5 100644 --- a/app/views/play/level/tome/spell_view.coffee +++ b/app/views/play/level/tome/spell_view.coffee @@ -430,6 +430,7 @@ module.exports = class SpellView extends View flow ?= @spellThang?.castAether?.flow return unless flow executed = [] + executedRows = {} matched = false states = flow.states ? [] currentCallIndex = null @@ -445,6 +446,7 @@ module.exports = class SpellView extends View matched = true break _.last(executed).push state + executedRows[state.range[0].row] = true #state.executing = true if state.userInfo?.time is @thang.world.age # no work currentCallIndex ?= callNumber - 1 #console.log "got call index", currentCallIndex, "for time", @thang.world.age, "out of", states.length @@ -455,10 +457,11 @@ module.exports = class SpellView extends View markerRange.end.detach() @aceSession.removeMarker markerRange.id @markerRanges = [] - @aceSession.removeGutterDecoration row, 'executing' for row in [0 ... @aceSession.getLength()] - @aceSession.removeGutterDecoration row, 'executed' for row in [0 ... @aceSession.getLength()] - $(@ace.container).find('.ace_gutter-cell.executing').removeClass('executing') - $(@ace.container).find('.ace_gutter-cell.executed').removeClass('executed') + for row in [0 ... @aceSession.getLength()] + unless executedRows[row] + @aceSession.removeGutterDecoration row, 'executing' + @aceSession.removeGutterDecoration row, 'executed' + @decoratedGutter[row] = '' if not executed.length or (@spell.name is "plan" and @spellThang.castAether.metrics.statementsExecuted < 20) @toolbarView?.toggleFlow false @debugView.setVariableStates {} @@ -486,7 +489,10 @@ module.exports = class SpellView extends View markerRange.end = @aceDoc.createAnchor markerRange.end markerRange.id = @aceSession.addMarker markerRange, clazz, markerType @markerRanges.push markerRange - @aceSession.addGutterDecoration start.row, clazz + if executedRows[start.row] and @decoratedGutter[start.row] isnt clazz + @aceSession.removeGutterDecoration start.row, @decoratedGutter[start.row] if @decoratedGutter isnt '' + @aceSession.addGutterDecoration start.row, clazz + @decoratedGutter[start.row] = clazz @debugView.setVariableStates {} unless gotVariableStates null From 012c25a8177d3b81930df512cd3da81344f7e50e Mon Sep 17 00:00:00 2001 From: Darredevil Date: Wed, 12 Mar 2014 01:57:30 +0200 Subject: [PATCH 4/9] Added GetALLToLocations and KeepALLFromLocations --- app/lib/world/GoalManager.coffee | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/app/lib/world/GoalManager.coffee b/app/lib/world/GoalManager.coffee index 13bf7e9d9..b017482b8 100644 --- a/app/lib/world/GoalManager.coffee +++ b/app/lib/world/GoalManager.coffee @@ -1,6 +1,6 @@ CocoClass = require 'lib/CocoClass' utils = require 'lib/utils' -#test + module.exports = class GoalManager extends CocoClass # The Goal Manager is created both on the main thread and # each time the world is generated. The one in world generation @@ -105,7 +105,6 @@ module.exports = class GoalManager extends CocoClass notifyGoalChanges: -> overallStatus = @checkOverallStatus() event = {goalStates: @goalStates, goals: @goals, overallStatus: overallStatus} - #console.log JSON.stringify(event), "new goal states" Backbone.Mediator.publish('goal-manager:new-goal-states', event) checkOverallStatus: (ignoreIncomplete=false) -> @@ -126,6 +125,10 @@ module.exports = class GoalManager extends CocoClass keyFrame: 0 # when it became a 'success' or 'failure' } @initGoalState(state, [goal.killThangs, goal.saveThangs], 'killed') + for getTo in goal.getAllToLocations ? [] + @initGoalState(state,[ getTo.getToLocation?.who , [] ], 'arrived') + for keepFrom in goal.keepAllFromLocations ? [] + @initGoalState(state,[ [] , keepFrom.keepFromLocation?.who], 'arrived') @initGoalState(state, [goal.getToLocations?.who, goal.keepFromLocations?.who], 'arrived') @initGoalState(state, [goal.leaveOffSides?.who, goal.keepFromLeavingOffSides?.who], 'left') @initGoalState(state, [goal.collectThangs?.who, goal.keepFromCollectingThangs?.who], 'collected') @@ -143,7 +146,13 @@ module.exports = class GoalManager extends CocoClass onThangTouchedGoal: (e, frameNumber) -> for goal in @goals ? [] @checkArrived(goal.id, goal.getToLocations.who, goal.getToLocations.targets, e.actor, e.touched.id, frameNumber) if goal.getToLocations? + if goal.getAllToLocations? + for getTo in goal.getAllToLocations + @checkArrived(goal.id, getTo.getToLocation.who, getTo.getToLocation.targets, e.actor, e.touched.id, frameNumber) @checkArrived(goal.id, goal.keepFromLocations.who, goal.keepFromLocations.targets, e.actor, e.touched.id, frameNumber) if goal.keepFromLocations? + if goal.keepAllFromLocations? + for keepFrom in goal.keepAllFromLocations + @checkArrived(goal.id, keepFrom.keepFromLocation.who , keepFrom.keepFromLocation.targets, e.actor, e.touched.id, frameNumber ) checkArrived: (goalID, who, targets, thang, touchedID, frameNumber) -> return unless touchedID in targets @@ -191,6 +200,7 @@ module.exports = class GoalManager extends CocoClass initGoalState: (state, whos, progressObjectName) -> # 'whos' is an array of goal 'who' values. # This inits the progress object for the goal tracking. + arrays = (prop for prop in whos when prop?.length) return unless arrays.length state[progressObjectName] = {} @@ -240,7 +250,9 @@ module.exports = class GoalManager extends CocoClass killThangs: 1 saveThangs: 0 getToLocations: 1 + getAllToLocations: 1 keepFromLocations: 0 + keepAllFromLocations: 0 leaveOffSides: 1 keepFromLeavingOffSides: 0 collectThangs: 1 From b1d61d368104b29e49c414f737e01c63e7e19d99 Mon Sep 17 00:00:00 2001 From: Darredevil Date: Wed, 12 Mar 2014 02:11:22 +0200 Subject: [PATCH 5/9] Added GetALLToLocations and KeepALLFromLocations schemas --- server/levels/level_schema.coffee | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/server/levels/level_schema.coffee b/server/levels/level_schema.coffee index 86f774ad0..ae895fc1c 100644 --- a/server/levels/level_schema.coffee +++ b/server/levels/level_schema.coffee @@ -36,9 +36,19 @@ GoalSchema = c.object {title: "Goal", description: "A goal that the player can a getToLocations: c.object {title: "Get To Locations", description: "Will be set off when any of the \"who\" touch any of the \"targets\" ", required: ["who", "targets"]}, who: c.array {title: "Who", description: "The Thangs who must get to the target locations.", minItems: 1}, thang targets: c.array {title: "Targets", description: "The target locations to which the Thangs must get.", minItems: 1}, thang + getAllToLocations: c.array {title: "Get all to locations", description: "Similar to getToLocations but now a specific \"who\" can have a specific \"target\"",required: ["getToLocation"]}, +  c.object {title: "", description: ""}, +    getToLocation: c.object {title: "Get To Locations", description: "TODO: explain", required: ["who", "targets"]}, +     who: c.array {title: "Who", description: "The Thangs who must get to the target locations.", minItems: 1}, thang +     targets: c.array {title: "Targets", description: "The target locations to which the Thangs must get.", minItems: 1}, thang keepFromLocations: c.object {title: "Keep From Locations", description: "TODO: explain", required: ["who", "targets"]}, who: c.array {title: "Who", description: "The Thangs who must not get to the target locations.", minItems: 1}, thang targets: c.array {title: "Targets", description: "The target locations to which the Thangs must not get.", minItems: 1}, thang + keepAllFromLocations: c.array {title: "Keep ALL From Locations", description: "Similar to keepFromLocations but now a specific \"who\" can have a specific \"target\"", required: ["keepFromLocation"]}, + c.object {title: "", description: ""}, + keepFromLocation: c.object {title: "Keep From Locations", description: "TODO: explain", required: ["who", "targets"]}, + who: c.array {title: "Who", description: "The Thangs who must not get to the target locations.", minItems: 1}, thang + targets: c.array {title: "Targets", description: "The target locations to which the Thangs must not get.", minItems: 1}, thang leaveOffSides: c.object {title: "Leave Off Sides", description: "Sides of the level to get some Thangs to leave across.", required: ["who", "sides"]}, who: c.array {title: "Who", description: "The Thangs which must leave off the sides of the level.", minItems: 1}, thang sides: c.array {title: "Sides", description: "The sides off which the Thangs must leave.", minItems: 1}, side @@ -242,3 +252,4 @@ module.exports = LevelSchema # 3. tv4.addSchema(metaschema.id, metaschema) # 4. S = # 5. tv4.validateMultiple(S, metaschema) and look for errors + From a6c508a442f14a7a3bf92c70285ff8cd0432afda Mon Sep 17 00:00:00 2001 From: Darredevil Date: Wed, 12 Mar 2014 02:20:28 +0200 Subject: [PATCH 6/9] Added descripton --- server/levels/level_schema.coffee | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/server/levels/level_schema.coffee b/server/levels/level_schema.coffee index ae895fc1c..c9bff8628 100644 --- a/server/levels/level_schema.coffee +++ b/server/levels/level_schema.coffee @@ -36,15 +36,15 @@ GoalSchema = c.object {title: "Goal", description: "A goal that the player can a getToLocations: c.object {title: "Get To Locations", description: "Will be set off when any of the \"who\" touch any of the \"targets\" ", required: ["who", "targets"]}, who: c.array {title: "Who", description: "The Thangs who must get to the target locations.", minItems: 1}, thang targets: c.array {title: "Targets", description: "The target locations to which the Thangs must get.", minItems: 1}, thang - getAllToLocations: c.array {title: "Get all to locations", description: "Similar to getToLocations but now a specific \"who\" can have a specific \"target\"",required: ["getToLocation"]}, -  c.object {title: "", description: ""}, -    getToLocation: c.object {title: "Get To Locations", description: "TODO: explain", required: ["who", "targets"]}, -     who: c.array {title: "Who", description: "The Thangs who must get to the target locations.", minItems: 1}, thang -     targets: c.array {title: "Targets", description: "The target locations to which the Thangs must get.", minItems: 1}, thang + getAllToLocations: c.array {title: "Get all to locations", description: "Similar to getToLocations but now a specific \"who\" can have a specific \"target\", also must be used with the HowMany property for desired effect",required: ["getToLocation"]}, + c.object {title: "", description: ""}, + getToLocation: c.object {title: "Get To Locations", description: "TODO: explain", required: ["who", "targets"]}, + who: c.array {title: "Who", description: "The Thangs who must get to the target locations.", minItems: 1}, thang + targets: c.array {title: "Targets", description: "The target locations to which the Thangs must get.", minItems: 1}, thang keepFromLocations: c.object {title: "Keep From Locations", description: "TODO: explain", required: ["who", "targets"]}, who: c.array {title: "Who", description: "The Thangs who must not get to the target locations.", minItems: 1}, thang targets: c.array {title: "Targets", description: "The target locations to which the Thangs must not get.", minItems: 1}, thang - keepAllFromLocations: c.array {title: "Keep ALL From Locations", description: "Similar to keepFromLocations but now a specific \"who\" can have a specific \"target\"", required: ["keepFromLocation"]}, + keepAllFromLocations: c.array {title: "Keep ALL From Locations", description: "Similar to keepFromLocations but now a specific \"who\" can have a specific \"target\", also must be used with the HowMany property for desired effect", required: ["keepFromLocation"]}, c.object {title: "", description: ""}, keepFromLocation: c.object {title: "Keep From Locations", description: "TODO: explain", required: ["who", "targets"]}, who: c.array {title: "Who", description: "The Thangs who must not get to the target locations.", minItems: 1}, thang From c7ca878c69aab6396db0a47198360557a24a4a33 Mon Sep 17 00:00:00 2001 From: Dominik Kundel Date: Wed, 12 Mar 2014 01:26:11 +0100 Subject: [PATCH 7/9] added class property that got missing --- app/views/play/level/tome/spell_view.coffee | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/play/level/tome/spell_view.coffee b/app/views/play/level/tome/spell_view.coffee index de5c2a8b5..dd9875b16 100644 --- a/app/views/play/level/tome/spell_view.coffee +++ b/app/views/play/level/tome/spell_view.coffee @@ -451,6 +451,8 @@ module.exports = class SpellView extends View currentCallIndex ?= callNumber - 1 #console.log "got call index", currentCallIndex, "for time", @thang.world.age, "out of", states.length + @decoratedGutter = @decoratedGutter || {} + # TODO: don't redo the markers if they haven't actually changed for markerRange in (@markerRanges ?= []) markerRange.start.detach() @@ -490,7 +492,7 @@ module.exports = class SpellView extends View markerRange.id = @aceSession.addMarker markerRange, clazz, markerType @markerRanges.push markerRange if executedRows[start.row] and @decoratedGutter[start.row] isnt clazz - @aceSession.removeGutterDecoration start.row, @decoratedGutter[start.row] if @decoratedGutter isnt '' + @aceSession.removeGutterDecoration start.row, @decoratedGutter[start.row] if @decoratedGutter[start.row] isnt '' @aceSession.addGutterDecoration start.row, clazz @decoratedGutter[start.row] = clazz @debugView.setVariableStates {} unless gotVariableStates From 8c57b31c5453d1a92b4dd8f3a20b345664f4e139 Mon Sep 17 00:00:00 2001 From: Nick Winter Date: Tue, 11 Mar 2014 18:06:48 -0700 Subject: [PATCH 8/9] Fixed a couple bugs with the matches tab. --- app/templates/play/ladder/my_matches_tab.jade | 5 +++-- app/views/play/ladder/my_matches_tab.coffee | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/templates/play/ladder/my_matches_tab.jade b/app/templates/play/ladder/my_matches_tab.jade index 8cacdb49f..b9cf618a2 100644 --- a/app/templates/play/ladder/my_matches_tab.jade +++ b/app/templates/play/ladder/my_matches_tab.jade @@ -52,8 +52,9 @@ div#columns.row if team.isRanking td(colspan=4).alert.alert-info | Your new code is being simulated by other players for ranking. + | This will refresh as new matches come in. else td(colspan=4).alert.alert-warning - | No ranked matches for this team! + | No ranked matches for the #{team.name} team! | Play against some competitors and then come back here to get your game ranked. - + diff --git a/app/views/play/ladder/my_matches_tab.coffee b/app/views/play/ladder/my_matches_tab.coffee index 278bcb9b0..073b80a0c 100644 --- a/app/views/play/ladder/my_matches_tab.coffee +++ b/app/views/play/ladder/my_matches_tab.coffee @@ -71,7 +71,7 @@ module.exports = class MyMatchesTabView extends CocoView for team in @teams team.session = (s for s in @sessions.models when s.get('team') is team.id)[0] team.readyToRank = @readyToRank(team.session) - team.isRanking = team.session.get('isRanking') + team.isRanking = team.session?.get('isRanking') team.matches = (convertMatch(match, team.session.get('submitDate')) for match in team.session?.get('matches') or []) team.matches.reverse() team.score = (team.session?.get('totalScore') or 10).toFixed(2) From 2b487eeed8967567bffa0aa48a1d97bdaaa121b8 Mon Sep 17 00:00:00 2001 From: Nick Winter Date: Tue, 11 Mar 2014 18:30:25 -0700 Subject: [PATCH 9/9] Using /db/thang.type instead of /db/thang_type in URLs, for consistency. --- app/models/CocoModel.coffee | 2 +- app/models/Level.coffee | 2 +- app/models/ThangType.coffee | 4 ++-- app/views/account/wizard_settings_view.coffee | 6 +++--- app/views/editor/level/thangs_tab_view.coffee | 2 +- server/levels/level_schema.coffee | 3 +-- server/levels/thangs/LevelThangType.coffee | 2 +- 7 files changed, 10 insertions(+), 11 deletions(-) diff --git a/app/models/CocoModel.coffee b/app/models/CocoModel.coffee index 3f4c9455c..34e3e641f 100644 --- a/app/models/CocoModel.coffee +++ b/app/models/CocoModel.coffee @@ -151,7 +151,7 @@ class CocoModel extends Backbone.Model return null unless schema.links? linkObject = _.find schema.links, rel: "db" return null unless linkObject - return null if linkObject.href.match("thang_type") and not @isObjectID(data) # Skip loading hardcoded Thang Types for now (TODO) + return null if linkObject.href.match("thang.type") and not @isObjectID(data) # Skip loading hardcoded Thang Types for now (TODO) # not fully extensible, but we can worry about that later link = linkObject.href diff --git a/app/models/Level.coffee b/app/models/Level.coffee index c260a8178..7832c329a 100644 --- a/app/models/Level.coffee +++ b/app/models/Level.coffee @@ -112,7 +112,7 @@ module.exports = class Level extends CocoModel if path.match(/\/systems\/\d+\/config\//) and data?.indieSprites?.length # Ugh, we need to make sure we grab the IndieSprite ThangTypes for indieSprite in data.indieSprites - link = "/db/thang_type/#{indieSprite.thangType}/version" + link = "/db/thang.type/#{indieSprite.thangType}/version" model = CocoModel.getOrMakeModelFromLink link, shouldLoadProjection models.push model if model else if path is '/' diff --git a/app/models/ThangType.coffee b/app/models/ThangType.coffee index b28bea773..037e1f8d9 100644 --- a/app/models/ThangType.coffee +++ b/app/models/ThangType.coffee @@ -218,8 +218,8 @@ module.exports = class ThangType extends CocoModel @loadUniversalWizard: -> return @wizardType if @wizardType wizOriginal = "52a00d55cf1818f2be00000b" - url = "/db/thang_type/#{wizOriginal}/version" + url = "/db/thang.type/#{wizOriginal}/version" @wizardType = new module.exports() @wizardType.url = -> url @wizardType.fetch() - @wizardType \ No newline at end of file + @wizardType diff --git a/app/views/account/wizard_settings_view.coffee b/app/views/account/wizard_settings_view.coffee index 8497c32cf..78f9cee6a 100644 --- a/app/views/account/wizard_settings_view.coffee +++ b/app/views/account/wizard_settings_view.coffee @@ -22,7 +22,7 @@ module.exports = class WizardSettingsView extends CocoView loadWizard: -> @wizardThangType = new ThangType() - @wizardThangType.url = -> '/db/thang_type/wizard' + @wizardThangType.url = -> '/db/thang.type/wizard' @wizardThangType.fetch() @wizardThangType.once 'sync', @initCanvas, @ @@ -67,7 +67,7 @@ module.exports = class WizardSettingsView extends CocoView updateSwatchVisibility: (colorGroup) -> enabled = colorGroup.find('.color-group-checkbox').prop('checked') colorGroup.find('.minicolors-swatch').toggle Boolean(enabled) - + updateColorSettings: (colorGroup) => wizardSettings = _.cloneDeep(me.get('wizard')) or {} wizardSettings.colorConfig ?= {} @@ -108,4 +108,4 @@ module.exports = class WizardSettingsView extends CocoView @movieClip.regX = reg.x @movieClip.regY = reg.y @stage.addChild @movieClip - @stage.update() \ No newline at end of file + @stage.update() diff --git a/app/views/editor/level/thangs_tab_view.coffee b/app/views/editor/level/thangs_tab_view.coffee index af5ee3c07..e5d2b79f2 100644 --- a/app/views/editor/level/thangs_tab_view.coffee +++ b/app/views/editor/level/thangs_tab_view.coffee @@ -19,7 +19,7 @@ componentOriginals = "physics.Physical" : "524b75ad7fc0f6d519000001" class ThangTypeSearchCollection extends CocoCollection - url: '/db/thang_type/search?project=true' + url: '/db/thang.type/search?project=true' model: ThangType module.exports = class ThangsTabView extends View diff --git a/server/levels/level_schema.coffee b/server/levels/level_schema.coffee index c9bff8628..7fe7fc00b 100644 --- a/server/levels/level_schema.coffee +++ b/server/levels/level_schema.coffee @@ -174,7 +174,7 @@ LevelThangSchema = c.object { }, id: thang # TODO: figure out if we can make this unique and how to set dynamic defaults # TODO: split thangType into "original" and "majorVersion" like the rest for consistency - thangType: c.objectId(links: [{rel: "db", href: "/db/thang_type/{($)}/version"}], title: "Thang Type", description: "A reference to the original Thang template being configured.", format: 'thang-type') + thangType: c.objectId(links: [{rel: "db", href: "/db/thang.type/{($)}/version"}], title: "Thang Type", description: "A reference to the original Thang template being configured.", format: 'thang-type') components: c.array {title: "Components", description: "Thangs are configured by changing the Components attached to them.", uniqueItems: true, format: 'thang-components-array'}, ThangComponentSchema # TODO: uniqueness should be based on "original", not whole thing LevelSystemSchema = c.object { @@ -252,4 +252,3 @@ module.exports = LevelSchema # 3. tv4.addSchema(metaschema.id, metaschema) # 4. S = # 5. tv4.validateMultiple(S, metaschema) and look for errors - diff --git a/server/levels/thangs/LevelThangType.coffee b/server/levels/thangs/LevelThangType.coffee index abdf5d11c..98d89c4b3 100644 --- a/server/levels/thangs/LevelThangType.coffee +++ b/server/levels/thangs/LevelThangType.coffee @@ -61,4 +61,4 @@ LevelThangTypeSchema.plugin(plugins.PermissionsPlugin) LevelThangTypeSchema.plugin(plugins.NamedPlugin) LevelThangTypeSchema.plugin(plugins.SearchablePlugin, {searchable: ['name', 'description']}) -module.exports = LevelThangType = mongoose.model('level.thang_type', LevelThangTypeSchema) +module.exports = LevelThangType = mongoose.model('level.thang.type', LevelThangTypeSchema)