From bd3c059c2a9f6674737d624c5dfaf15eea36f463 Mon Sep 17 00:00:00 2001 From: Nick Winter Date: Mon, 28 Apr 2014 16:31:51 -0700 Subject: [PATCH 1/5] Several performance improvements based on profiling. --- app/lib/surface/Layer.coffee | 42 ++++++++++++------- app/lib/surface/SpriteBoss.coffee | 20 +++++---- app/lib/surface/Surface.coffee | 4 +- app/models/SuperModel.coffee | 24 +++++------ app/views/play/level/hud_view.coffee | 7 ++-- app/views/play/level/playback_view.coffee | 2 +- .../level/tome/thang_list_entry_view.coffee | 11 ++++- 7 files changed, 65 insertions(+), 45 deletions(-) diff --git a/app/lib/surface/Layer.coffee b/app/lib/surface/Layer.coffee index aee8f0596..a0f8d5ad4 100644 --- a/app/lib/surface/Layer.coffee +++ b/app/lib/surface/Layer.coffee @@ -35,12 +35,13 @@ module.exports = class Layer extends createjs.Container @transformStyle = options.transform ? Layer.TRANSFORM_CHILD @camera = options.camera console.error @toString(), "needs a camera." unless @camera - @updateLayerOrder = _.throttle @updateLayerOrder, 1 # don't call multiple times in one frame + @updateLayerOrder = _.throttle @updateLayerOrder, 1000 / 30 # Don't call multiple times in one frame; 30 FPS is probably good enough Backbone.Mediator.subscribe(channel, @[func], @) for channel, func of @subscriptions destroy: -> child.destroy?() for child in @children Backbone.Mediator.unsubscribe(channel, @[func], @) for channel, func of @subscriptions + delete @updateLayerOrder toString: -> "" @@ -60,21 +61,30 @@ module.exports = class Layer extends createjs.Container updateLayerOrder: => #console.log @, @toString(), "sorting children", _.clone @children if @name is 'Default' - @sortChildren (a, b) -> - alp = a.layerPriority ? 0 - blp = b.layerPriority ? 0 - return alp - blp if alp isnt blp - # TODO: remove this z stuff - az = if a.z then a.z else 1000 - bz = if b.z then b.z else 1000 - aThang = a.sprite?.thang - bThang = b.sprite?.thang - az -= 1 if aThang?.health < 0 - bz -= 1 if bThang?.health < 0 - if az == bz - return 0 unless aThang?.pos and bThang?.pos - return (bThang.pos.y - aThang.pos.y) or (bThang.pos.x - aThang.pos.x) - return az - bz + @sortChildren @layerOrderComparator + + layerOrderComparator: (a, b) -> + # Optimize + alp = a.layerPriority or 0 + blp = b.layerPriority or 0 + return alp - blp if alp isnt blp + # TODO: remove this z stuff + az = a.z or 1000 + bz = b.z or 1000 + if aSprite = a.sprite + if aThang = aSprite.thang + aPos = aThang.pos + if aThang.health < 0 + --az + if bSprite = b.sprite + if bThang = bSprite.thang + bPos = bThang.pos + if bThang.health < 0 + --bz + if az is bz + return 0 unless aPos and bPos + return (bPos.y - aPos.y) or (bPos.x - aPos.x) + return az - bz onZoomUpdated: (e) -> return unless e.camera is @camera diff --git a/app/lib/surface/SpriteBoss.coffee b/app/lib/surface/SpriteBoss.coffee index 7e3fc29a7..2ccbcabf3 100644 --- a/app/lib/surface/SpriteBoss.coffee +++ b/app/lib/surface/SpriteBoss.coffee @@ -34,17 +34,18 @@ module.exports = class SpriteBoss extends CocoClass @world = options.world @options.thangTypes ?= [] @sprites = {} + @spriteArray = [] # Mirror @sprites, but faster for when we just need to iterate @selfWizardSprite = null @createLayers() @spriteSheetCache = {} destroy: -> - @removeSprite sprite for thangID, sprite of @sprites + @removeSprite sprite for sprite in @spriteArray @targetMark?.destroy() @selectionMark?.destroy() super() - toString: -> "" + toString: -> "" thangTypeFor: (type) -> _.find @options.thangTypes, (m) -> m.get('original') is type or m.get('name') is type @@ -77,6 +78,7 @@ module.exports = class SpriteBoss extends CocoClass id ?= sprite.thang.id console.error "Sprite collision! Already have:", id if @sprites[id] @sprites[id] = sprite + @spriteArray.push sprite layer ?= @spriteLayers["Obstacle"] if sprite.thang?.spriteName.search(/(dungeon|indoor).wall/i) isnt -1 layer ?= @layerForChild sprite.displayObject, sprite layer.addChild sprite.displayObject @@ -117,7 +119,6 @@ module.exports = class SpriteBoss extends CocoClass else sprite.targetPos = if opponent.team is 'ogres' then {x:52, y: 28} else {x: 20, y:28} - createWizardSprite: (options) -> sprite = new WizardSprite @thangTypeFor("Wizard"), @createSpriteOptions(options) @addSprite sprite, sprite.thang.id, @spriteLayers["Floating"] @@ -138,7 +139,7 @@ module.exports = class SpriteBoss extends CocoClass onSetDebug: (e) -> return if e.debug is @debug @debug = e.debug - sprite.setDebug @debug for thangID, sprite of @sprites + sprite.setDebug @debug for sprite in @spriteArray onHighlightSprites: (e) -> highlightedIDs = e.thangIDs or [] @@ -159,15 +160,16 @@ module.exports = class SpriteBoss extends CocoClass sprite.displayObject.parent.removeChild sprite.displayObject thang = sprite.thang delete @sprites[sprite.thang.id] + @spriteArray.splice @spriteArray.indexOf(sprite), 1 sprite.destroy() sprite.thang = thang # Keep around so that we know which thang the destroyed thang was for updateSounds: -> - sprite.playSounds() for thangID, sprite of @sprites # hmm; doesn't work for sprites which we didn't add yet in adjustSpriteExistence + sprite.playSounds() for sprite in @spriteArray # hmm; doesn't work for sprites which we didn't add yet in adjustSpriteExistence update: (frameChanged) -> @adjustSpriteExistence() if frameChanged - sprite.update frameChanged for thangID, sprite of @sprites + sprite.update frameChanged for sprite in @spriteArray @updateSelection() @spriteLayers["Default"].updateLayerOrder() @cache() @@ -197,7 +199,7 @@ module.exports = class SpriteBoss extends CocoClass cache: (update=false) -> return if @cached and not update - wallSprites = (sprite for thangID, sprite of @sprites when sprite.thangType?.get('name').search(/(dungeon|indoor).wall/i) isnt -1) + wallSprites = (sprite for sprite in @spriteArray when sprite.thangType?.get('name').search(/(dungeon|indoor).wall/i) isnt -1) walls = (sprite.thang for sprite in wallSprites) @world.calculateBounds() wallGrid = new Grid walls, @world.size()... @@ -222,12 +224,12 @@ module.exports = class SpriteBoss extends CocoClass onCastSpells: -> @stop() play: -> - sprite.imageObject.play() for thangID, sprite of @sprites + sprite.imageObject.play() for sprite in @spriteArray @selectionMark?.play() @targetMark?.play() stop: -> - sprite.imageObject.stop() for thangID, sprite of @sprites + sprite.imageObject.stop() for sprite in @spriteArray @selectionMark?.stop() @targetMark?.stop() diff --git a/app/lib/surface/Surface.coffee b/app/lib/surface/Surface.coffee index 94d80d269..6b9e3deb5 100644 --- a/app/lib/surface/Surface.coffee +++ b/app/lib/surface/Surface.coffee @@ -221,8 +221,8 @@ module.exports = Surface = class Surface extends CocoClass @currentFrame = tempFrame frame = @world.getFrame(@getCurrentFrame()) frame.restoreState() - for thangID, sprite of @spriteBoss.sprites - sprite.playSounds false, Math.max(0.05, Math.min(1, 1 / @scrubbingPlaybackSpeed)) + volume = Math.max(0.05, Math.min(1, 1 / @scrubbingPlaybackSpeed)) + sprite.playSounds false, volume for sprite in @spriteBoss.spriteArray tempFrame += if rising then 1 else -1 @currentFrame = actualCurrentFrame diff --git a/app/models/SuperModel.coffee b/app/models/SuperModel.coffee index 7b8fa7c44..204193659 100644 --- a/app/models/SuperModel.coffee +++ b/app/models/SuperModel.coffee @@ -8,14 +8,14 @@ module.exports = class SuperModel extends Backbone.Model @models = {} @collections = {} - + # Since the supermodel has undergone some changes into being a loader and a cache interface, # it's a bit wonky to use. The next couple functions are meant to cover the majority of # use cases across the site. If they are used, the view will automatically handle errors, # retries, progress, and filling the cache. Note that the resource it passes back will not # necessarily have the same model or collection that was passed in, if it was fetched from # the cache. - + loadModel: (model, name, fetchOptions, value=1) -> cachedModel = @getModelByURL(model.getURL()) if cachedModel @@ -28,12 +28,12 @@ module.exports = class SuperModel extends Backbone.Model res = @addModelResource(cachedModel, name, fetchOptions, value) res.markLoading() return res - + else @registerModel(model) console.debug 'Registering model', model.getURL() return @addModelResource(model, name, fetchOptions, value).load() - + loadCollection: (collection, name, fetchOptions, value=1) -> url = collection.getURL() if cachedCollection = @collections[url] @@ -46,7 +46,7 @@ module.exports = class SuperModel extends Backbone.Model res = @addModelResource(cachedCollection, name, fetchOptions, value) res.markLoading() return res - + else @addCollection collection @listenToOnce collection, 'sync', (c) -> @@ -56,7 +56,7 @@ module.exports = class SuperModel extends Backbone.Model # replace or overwrite shouldSaveBackups: (model) -> false - + # Caching logic getModel: (ModelClass_or_url, id) -> @@ -102,7 +102,7 @@ module.exports = class SuperModel extends Backbone.Model else @registerModel(model) collection - + # Tracking resources being loaded for this supermodel finished: -> @@ -148,7 +148,7 @@ module.exports = class SuperModel extends Backbone.Model @trigger('failed', source) updateProgress: => - # Because this is _.defer'd, this might end up getting called after + # Because this is _.defer'd, this might end up getting called after # a bunch of things load all at once. # So make sure we only emit events if @progress has changed. newProg = if @denom then @num / @denom else 1 @@ -161,8 +161,8 @@ module.exports = class SuperModel extends Backbone.Model getResource: (rid) -> return @resources[rid] - - + + class Resource extends Backbone.Model constructor: (name, value=1) -> @@ -185,11 +185,11 @@ class Resource extends Backbone.Model @trigger('failed', {resource: @}) @isLoaded = @isLoading = false @isFailed = true - + markLoading: -> @isLoaded = @isFailed = false @isLoading = true - + load: -> @ diff --git a/app/views/play/level/hud_view.coffee b/app/views/play/level/hud_view.coffee index 4b2319bfe..3b6f660af 100644 --- a/app/views/play/level/hud_view.coffee +++ b/app/views/play/level/hud_view.coffee @@ -306,10 +306,11 @@ module.exports = class HUDView extends View for actionName, action of @thang.actions @updateActionElement(actionName, @timespans[actionName], @thang.action is actionName) tableContainer = @$el.find('.table-container') - timelineWidth = tableContainer.find('tr:not(.secret) .action-timeline').width() - right = (1 - (@timeProgress ? 0)) * timelineWidth arrow = tableContainer.find('.progress-arrow') - arrow.css 'right', right - arrow.width() / 2 + @timelineWidth ||= tableContainer.find('tr:not(.secret) .action-timeline').width() + @actionArrowWidth ||= arrow.width() + right = (1 - (@timeProgress ? 0)) * @timelineWidth + arrow.css 'right', right - @actionArrowWidth / 2 tableContainer.find('.progress-line').css 'right', right buildActionTimespans: -> diff --git a/app/views/play/level/playback_view.coffee b/app/views/play/level/playback_view.coffee index 8c0959130..82a9f04b5 100644 --- a/app/views/play/level/playback_view.coffee +++ b/app/views/play/level/playback_view.coffee @@ -238,7 +238,7 @@ module.exports = class PlaybackView extends View @currentTime = e.frame / e.world.frameRate # Game will sometimes stop at 29.97, but with only one digit, this is unnecesary. # @currentTime = @totalTime if Math.abs(@totalTime - @currentTime) < 0.04 - @updatePopupContent() + @updatePopupContent() if @timePopup?.shown @updateProgress(e.progress) @updatePlayButton(e.progress) diff --git a/app/views/play/level/tome/thang_list_entry_view.coffee b/app/views/play/level/tome/thang_list_entry_view.coffee index 6135a6d53..388a5d10f 100644 --- a/app/views/play/level/tome/thang_list_entry_view.coffee +++ b/app/views/play/level/tome/thang_list_entry_view.coffee @@ -156,9 +156,16 @@ module.exports = class ThangListEntryView extends View @$el.toggleClass('disabled', not enabled) onFrameChanged: (e) -> + # Optimize return unless currentThang = e.world.thangMap[@thang.id] - @$el.toggle Boolean(currentThang.exists) - @$el.toggleClass 'dead', currentThang.health <= 0 if currentThang.exists + exists = Boolean currentThang.exists + if @thangDidExist isnt exists + @$el.toggle exists + @thangDidExist = exists + dead = exists and currentThang.health <= 0 + if @thangWasDead isnt dead + @$el.toggleClass 'dead', dead + @thangWasDead = dead destroy: -> @avatar?.destroy() From 0b947dbeee80c16b1accf80232dced6f34b3cea9 Mon Sep 17 00:00:00 2001 From: Nick Winter Date: Mon, 28 Apr 2014 16:41:18 -0700 Subject: [PATCH 2/5] Let's try 30 FPS for a while now. --- app/lib/surface/Surface.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/lib/surface/Surface.coffee b/app/lib/surface/Surface.coffee index 6b9e3deb5..49896f360 100644 --- a/app/lib/surface/Surface.coffee +++ b/app/lib/surface/Surface.coffee @@ -48,7 +48,7 @@ module.exports = Surface = class Surface extends CocoClass coords: true playJingle: false showInvisible: false - frameRate: 60 # Best as a divisor of 60, like 15, 30, 60, with RAF_SYNCHED timing. + frameRate: 30 # Best as a divisor of 60, like 15, 30, 60, with RAF_SYNCHED timing. subscriptions: 'level-disable-controls': 'onDisableControls' From b954e70d8566591ec672d33106c31b6e270c0184 Mon Sep 17 00:00:00 2001 From: Nick Winter Date: Mon, 28 Apr 2014 17:06:43 -0700 Subject: [PATCH 3/5] Let's try 30 FPS. Fixed Surface destruction bug. --- app/lib/surface/SpriteBoss.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/lib/surface/SpriteBoss.coffee b/app/lib/surface/SpriteBoss.coffee index 2ccbcabf3..8a9823b89 100644 --- a/app/lib/surface/SpriteBoss.coffee +++ b/app/lib/surface/SpriteBoss.coffee @@ -40,7 +40,7 @@ module.exports = class SpriteBoss extends CocoClass @spriteSheetCache = {} destroy: -> - @removeSprite sprite for sprite in @spriteArray + @removeSprite sprite for thangID, sprite of @sprites @targetMark?.destroy() @selectionMark?.destroy() super() From d052390eec94ee1d8f6209a206da7ed6e953a60c Mon Sep 17 00:00:00 2001 From: Glen De Cauwsemaecker Date: Tue, 29 Apr 2014 04:35:44 +0200 Subject: [PATCH 4/5] Clean up mistakes made by merging in windows directory --- .../coco-dev-setup/batch/localization/de.coco | 84 --- .../batch/localization/zh-HANS.coco | 87 +-- .../batch/localization/zh-HANT.coco | 84 --- .../coco-dev-setup/recycle_bin/dev-setup.bat | 533 ------------------ .../coco-dev-setup/recycle_bin/git-test.bat | 50 -- 5 files changed, 1 insertion(+), 837 deletions(-) delete mode 100644 scripts/windows/coco-dev-setup/recycle_bin/dev-setup.bat delete mode 100644 scripts/windows/coco-dev-setup/recycle_bin/git-test.bat diff --git a/scripts/windows/coco-dev-setup/batch/localization/de.coco b/scripts/windows/coco-dev-setup/batch/localization/de.coco index 2b793068f..f4f93fdb2 100644 --- a/scripts/windows/coco-dev-setup/batch/localization/de.coco +++ b/scripts/windows/coco-dev-setup/batch/localization/de.coco @@ -1,86 +1,3 @@ -<<<<<<< HEAD:scripts/windows/coco-dev-setup/batch/localisation/de.coco - - - - Deutsch - Ab jetzt senden wir unser Feedback in Englisch! - - - - -Bit System erkannt. - Es wurde das Betriebssystem - erkannt. - Windows XP wird nicht unterstützt. Installation abgebrochen. - - - Sind die für CodeCombat benötigten Programme bereits installiert? - Wir empfehlen Ihnen, mit „Nein“ zu antorten, falls Sie unsicher sind. - Überspringe Installation der Programme... - Ohne Software von Drittanbietern könnte CodeCombat nicht entwickelt werden. - Aus diesem Grund müssen Sie diese Software installieren, - um sich in der Community zu engagieren. - Wenn Sie ein Programm bereits installiert haben, brechen Sie die Installation bitte ab. - Make sure to select the option that adds the application to your Windows Path, if the option is available. - Haben Sie bereits die aktuellste Version von - installiert? - wird heruntergeladen... - wird installiert... - wird entpackt... - wird aufgeräumt... - Bitte geben Sie den kompletten Pfad an, an dem MongoDB installiert werden soll - - - - - Wie Du bereits weißt, ist CodeCombat Open Source. - Unser Quellcode ist komplett auf Github. - Wenn Du möchtest, kannst du das komplette Git Repository selbst herunterladen und nach deinen wünschen einrichten. - Allerdings empfehlen wir, dass du den Prozess statt dessen uns überlässt. - - - Willst du das lokale Git Setup selbst vornehmen? - Bit vergewissere dich, dass das Repository korrekt heruntergeladen wurde, bevor du fortfährst. - Bitte schließe dieses Fenster nicht. - Wenn du fertig bist, drücke eine beliebige Taste zum Fortfahren... - - - Gebe bitte den kompletten Pfad zu deinem CodeCombat Git Repository ein: - Bitte gib den kompletten Pfad ein, an dem du die CodeCombat Umgebung einrichten willst - Diese Installation benötigt die Git Bash. - Die Git Bash ist standardmäßig in 'C:\Program Files (x86)\Git' installiert. - Die Git Bash ist standardmäßig in 'C:\Program Files\Git' installiert. - Bitte gebe den kompletten Pfad zur Git Bash ein, oder drücke Enter, um den Standardpfad zu verwenden - Willst du das Repository via SSH auschecken? - - - - Installing bower, brunch, nodemon and sendwithus... - Installing bower packages... - Installing sass... - Installing npm... - Starting brunch.... - Setting up a MongoDB database for you... - Downloading the last version of the CodeCombat database... - - - - Dieser Pfad existiert bereits. Willst du ihn wirklich überschreiben? - Dieser Pfad exisitert nicht. Bitte versuche es erneut... - - - Die CodeCombat Entwicklungsumgebung wurde erfoglreich installiert. - Vielen Dank für die Unterstützung und bis bald. - Willst du das README lesen, um weitere Informationen zu erhalten? - - - Von nun an kannst du die Entwicklungsumgebung starten unter - einmal mit der Maus klicken. - 1) Einfach Doppelklicken - und warten bis die Entwicklungsumgebung fertig geladen hat. - 2) Jetzt 'localhost:3000' in deinem bevorzugten Browser aufrufen. - Fertig. Du bist nun bereit, bei CodeCombat mitzuarbeiten! - -======= @@ -188,5 +105,4 @@ 2) Jetzt 'localhost:3000' in deinem bevorzugten Browser aufrufen. Fertig. Du bist nun bereit, bei CodeCombat mitzuarbeiten! ->>>>>>> 072729acc34123c42250d361955438cfd8c210d7:scripts/windows/coco-dev-setup/batch/localization/de.coco \ No newline at end of file diff --git a/scripts/windows/coco-dev-setup/batch/localization/zh-HANS.coco b/scripts/windows/coco-dev-setup/batch/localization/zh-HANS.coco index febc98c56..62e3a4b6a 100644 --- a/scripts/windows/coco-dev-setup/batch/localization/zh-HANS.coco +++ b/scripts/windows/coco-dev-setup/batch/localization/zh-HANS.coco @@ -1,87 +1,3 @@ -<<<<<<< HEAD:scripts/windows/coco-dev-setup/batch/localisation/zh-HANS.coco - - - - 简体中文 - 目前我们只能用英文给你反馈! - - - - -位系统. - 操作系统 - 被侦测到. - 我们不支持 Windows XP, 安装取消. - - - 你是否已经安装好运行 CodeCombat 所需的所有软件? - 如果你不确定的话请回答 No. - 正在跳过此软件的安装... - CodeCombat 无法在不使用第三方服务的情况下开发. - 这就是为什么你需要安装这些软件, - 为了开始给我们的开源社区做贡献. - 如果你已经有了这些软件 请取消安装. - Make sure to select the option that adds the application to your Windows Path, if the option is available. - 你是否已经安装了最新版本的 - ? - 正在下载... - 正在安装... - 正在解压... - 正在清理... - 请输入你希望安装 mongodb 的文件夹的全路径 - - - - - CodeCombat 是开源的. - 我们的所有源代码都放在了 Github. - 你可以选择自己手工安装 Git. - 但我们仍然建议让程序自动替你完成. - - - 你是否想自己手工安装本地 Git 安装? - 请确保在开始处理前, 你有正确设置好你的库. - 请不要关闭此窗口. - 如果你准备好了, 请按任意键继续... - - - 请输入你 CodeCombat git库的全路径: - 请输入你想安装 CodeCombat 环境的全路径 - 这项安装需要 Git Bash. - Git bash 默认安装在 'C:\Program Files (x86)\Git'. - Git bash 默认安装在 'C:\Program Files\Git'. - 请输入 git bash 的安装全路径, 如果你安装的是默认路径, 那么直接输入回车即可 - 你是否想使用 ssh 来检出(checkout)库(repository)? - - - - 正在安装 bower, brunch, nodemon 和 sendwithus... - 正在用 bower 安装依赖包... - 正在安装 sass... - 正在安装 npm... - 正在开启 brunch.... - 正在为你设置 MongoDB 数据库... - 正在下载 CodeCombat 数据库的最新版本... - - - - 这个路径已经存在, 你想要覆盖它吗? - 这个路径不存在, 请再次尝试... - - - CodeCombat 开发环境的搭建已成功. - 感谢~ 我们会很快再次见面的 :) - 你是否想阅读 README 文件以了解更多信息? - - - From now on you can start the dev. environment at - the touch of a single mouse click. - 1) 双击文件 - 启动开发环境. - 2) 在浏览器里访问 'localhost:3000' - 好了,你现在可以开始开发 CodeCombat 了! - - -======= @@ -189,5 +105,4 @@ 2) 在浏览器里访问 'localhost:3000' 好了,你现在可以开始开发 CodeCombat 了! - ->>>>>>> 072729acc34123c42250d361955438cfd8c210d7:scripts/windows/coco-dev-setup/batch/localization/zh-HANS.coco + \ No newline at end of file diff --git a/scripts/windows/coco-dev-setup/batch/localization/zh-HANT.coco b/scripts/windows/coco-dev-setup/batch/localization/zh-HANT.coco index b54a269e5..2cdaba96e 100644 --- a/scripts/windows/coco-dev-setup/batch/localization/zh-HANT.coco +++ b/scripts/windows/coco-dev-setup/batch/localization/zh-HANT.coco @@ -1,86 +1,3 @@ -<<<<<<< HEAD:scripts/windows/coco-dev-setup/batch/localisation/zh-HANT.coco - - - - 繁体中文 - From now on we'll send our feedback in English! - - - - -bit computer detected. - The operating system - was detected. - We don't support Windows XP, installation cancelled. - - - Have you already installed all the software needed for CodeCombat? - We recommand that you reply negative in case you're not sure. - Skipping the installation of the software... - CodeCombat couldn't be developed without third-party software. - That's why you'll need to install this software, - in order to start contributing to our community. - Cancel the installation if you already have the application. - Make sure to select the option that adds the application to your Windows Path, if the option is available. - Do you already have the latest version of - installed? - is downloading... - is installing... - is unzipping... - is cleaning... - Please define the full path where mongodb should be installed - - - - - CodeCombat is opensource, like you already know. - All our sourcecode can be found online at Github. - You can choose to do the entire Git setup yourself. - However we recommend that you instead let us handle it instead. - - - Do you want to do the Local Git setup manually yourself? - Make sure you have correctly setup your repository before processing. - Do not close this window please. - When you're ready, press any key to continue... - - - Please give the full path of your CodeCombat git repository: - Please enter the full path where you want to install your CodeCombat environment - This installation requires Git Bash. - Git bash is by default installed at 'C:\Program Files (x86)\Git'. - Git bash is by default installed at 'C:\Program Files\Git'. - Please enter the full path where git bash is installed or just press enter if it's in the default location - Do you want to checkout the repository via ssh? - - - - Installing bower, brunch, nodemon and sendwithus... - Installing bower packages... - Installing sass... - Installing npm... - Starting brunch.... - Setting up a MongoDB database for you... - Downloading the last version of the CodeCombat database... - - - - That path already exists, are you sure you want to overwrite it? - That path doesn't exist. Please try again... - - - The setup of the CodeCombat Dev. Environment was succesfull. - Thank you already for your contribution and see you soon. - Do you want to read the README for more information? - - - From now on you can start the dev. environment at - the touch of a single mouse click. - 1) Just double click - and let the environment start up. - 2) Now just open 'localhost:3000' in your prefered browser. - That's it, you're now ready to start working on CodeCombat! - -======= @@ -188,5 +105,4 @@ 2) Now just open 'localhost:3000' in your prefered browser. That's it, you're now ready to start working on CodeCombat! ->>>>>>> 072729acc34123c42250d361955438cfd8c210d7:scripts/windows/coco-dev-setup/batch/localization/zh-HANT.coco \ No newline at end of file diff --git a/scripts/windows/coco-dev-setup/recycle_bin/dev-setup.bat b/scripts/windows/coco-dev-setup/recycle_bin/dev-setup.bat deleted file mode 100644 index c7447cade..000000000 --- a/scripts/windows/coco-dev-setup/recycle_bin/dev-setup.bat +++ /dev/null @@ -1,533 +0,0 @@ -@echo off -setlocal EnableDelayedExpansion - -Color 0A - -mode con: cols=78 lines=60 - -:: Global Variables -set "temp-dir=C:\Coco-Temp" -set install-log=%temp-dir%\coco-dev-install-log.txt - -:: set correct curl app -IF EXIST "%PROGRAMFILES(X86)%" ( - (set "curl-app=utilities\curl\64bit\curl.exe") -) ELSE ( - set "curl-app=utilities\curl\32bit\curl.exe" -) - -set "ZU-app=utilities\7za.exe" - -:: BUGS: - :: + DEBUG ALL STEPS UNTILL NOW DONE - - -:: TODO: -:: + Write code to install vs if it's not yet installed on users pc - -:: + Configuraton and installation checklist: -:: 1) cd codecombat -:: 2) npm install -g bower brunch nodemon sendwithus -:: 3) bower install -:: 4) gem install sass -:: 5) npm install -:: 6) brunch -w -:: Extra... @ Fail run npm install - -:: + Copy the automated dev batch file to root folder -:: => Let user define mongo-db directory -:: + Start the dev environment - -:: Create The Temporary Directory -IF EXIST %temp-dir% rmdir %temp-dir% /s /q -mkdir %temp-dir% - -:: Create Log File -copy /y nul %install-log% > nul - -call:parse_aa_and_draw "config\header" -call:draw_dss - -call:parse_file_new "config\config" cnfg n - -call:log "Welcome to the automated Installation of the CodeCombat Dev. Environment!" -call:log_sse "v%%cnfg[1]%% authored by %%cnfg[2]%% and published by %%cnfg[3]%%." - -:: Language Agreement Stuff - -call:log "In order to continue the installation of the developers environment" -call:log "you will have to read and agree with the following license: -call:draw_dss -echo. -call:parse_aa_and_draw "license.txt" -echo. -call:draw_dss -call:strict_user_yn_question "Have you read the license and do you agree with it?" - -if "%res%"=="false" ( - call:log "Sorry to hear that, have a good day..." - call:log_sse "Installation and Setup of the CodeCombat environment is cancelled." - GOTO:END -) - -:: Tips -call:log "Before we start the installation, here are some tips:" -echo. - -call:parse_aa_and_draw "config\tips" - -call:draw_ss - -:: Read Language Index -call:parse_file_new "localisation\languages" lang lang_c - -:: Read Download URLs -call:parse_file_new "config\downloads" downloads n -call:parse_file_new "config\downloads_32" downloads_32 n -call:parse_file_new "config\downloads_64" downloads_64 n -call:parse_file_new "config\downloads_vista_32" downloads_vista_32 n -call:parse_file_new "config\downloads_vista_64" downloads_vista_64 n -call:parse_file_new "config\downloads_7_32" downloads_7_32 n -call:parse_file_new "config\downloads_7_64" downloads_7_64 n - -:: Parse all Localisation Files -for /L %%i in (1,1,%lang_c%) do ( - call:parse_file "localisation\%%lang[%%i]%%" languages languages_c -) - -set /A "wc = %languages_c% / %lang_c%" - -:: Start install with language question (Localisation) -call:log "Which language do you prefer?" - -set /A c=0 -for /L %%i in (1,%wc%,%languages_c%) do ( - set /A "n = %%i - 1" - call:log " [%%c%%] %%languages[%%i]%%" - set /A c+=1 -) - -set "lang_id=-1" -call:user_enter_language_id -goto:user_pick_language - -:user_enter_language_id - set /p lang_id= "Enter the language ID and press : " -goto:eof - -:user_pick_language - set res=false - if %lang_id% LSS 0 set res=true - if %lang_id% GEQ %lang_c% set res=true - if "%res%"=="true" ( - call:log "Invalid id! Please enter a correct id from the numbers listed above..." - call:draw_dss - call:user_enter_language_id - goto:user_pick_language - ) - -call:get_lw word 0 -call:log_ds "You choose '%word%', from now on all feedback will be logged in it." - -call:log_lw 1 -call:log_lw_sse 2 - -:: downloads for all version... - -:: [TODO] The choice between Cygwin && Git ?! Is => HAVE EXTERNAL GIT APPLICATION LIST!!! - -call:log_lw_sse 3 - -call:log_lw 6 -call:log_lw 7 -call:log_lw 8 -call:install_software_o "git" "%%downloads[1]%%" exe 9 -call:draw_dss -call:get_lw word 11 - -:: [TODO] Add downloads for windows visual studio ?! - -call:user_set_git_path - -:user_set_git_path_fail - if not exist "%git_exe_path%" ( - call:log_lw 27 - call:draw_dss - call:user_set_git_path - ) - :: architecture specific downloads... - IF EXIST "%PROGRAMFILES(X86)%" (GOTO 64BIT) ELSE (GOTO 32BIT) -goto:eof - -:user_set_git_path - set /p git_exe_path="%word%: " - call:user_set_git_path_fail -goto:eof - -:go_to_platform - call:log_ds "Windows %~1 detected..." - GOTO %~2 -goto:eof - -:64BIT - call:log_ds "64-bit computer detected..." - - call:install_software_o "node-js" "%%downloads_64[1]%%" msi 12 - call:draw_dss - - call:get_path_from_user 41 42 - set "node_js_path=%user_tmp_path%" - Call:draw_dss - - call:install_software_o "ruby" "%%downloads_64[2]%%" exe 13 - call:draw_dss - call:install_software_o "python" "%%downloads_64[3]%%" msi 26 - - :: Some installations require specific windows versions - for /f "tokens=4-5 delims=. " %%i in ('ver') do set VERSION=%%i.%%j - if "%version%" == "5.2" ( call:go_to_platform "XP" ver_XP_64 ) - if "%version%" == "6.0" ( call:go_to_platform "Vista" ver_Vista_64 ) - if "%version%" == "6.1" ( call:go_to_platform "7" ver_Win7_8_64 ) - if "%version%" == "6.2" ( call:go_to_platform "8.0" ver_Win7_8_64 ) - if "%version%" == "6.3" ( call:go_to_platform "8.1" ver_Win7_8_64 ) - GOTO warn_and_exit -GOTO END - -:32BIT - call:log_ds "32-bit computer detected..." - - call:install_software_o "node-js" "%%downloads_32[1]%%" msi 12 - call:draw_dss - - call:get_path_from_user 41 42 - set "node_js_path=%user_tmp_path%" - Call:draw_dss - - call:install_software_o "ruby" "%%downloads_32[2]%%" exe 13 - call:draw_dss - call:install_software_o "python" "%%downloads_32[3]%%" msi 26 - - :: Some installations require specific windows versions - for /f "tokens=4-5 delims=. " %%i in ('ver') do set VERSION=%%i.%%j - if "%version%" == "5.2" ( call:go_to_platform "XP" ver_XP_32 ) - if "%version%" == "6.0" ( call:go_to_platform "Vista" ver_Vista_32 ) - if "%version%" == "6.1" ( call:go_to_platform "7" ver_Win7_8_32 ) - if "%version%" == "6.2" ( call:go_to_platform "8.0" ver_Win7_8_32 ) - if "%version%" == "6.3" ( call:go_to_platform "8.1" ver_Win7_8_32 ) - GOTO warn_and_exit -GOTO END - -:ver_Win7_8_32 - call:install_packed_software_o "mongo-db" "%%downloads_7_32[1]%%" 25 14 - set "mong-db-path = %packed_software_path%" -goto git_rep_checkout - -:ver_Vista_32 - call:install_packed_software_o "mongo-db" "%%downloads_vista_32[1]%%" 25 14 - set "mong-db-path = %packed_software_path%" -goto git_rep_checkout - -:ver_XP_32 - call:log_lw_ds 15 -goto END - -:ver_Win7_8_64 - call:install_packed_software_o "mongo-db" "%%downloads_7_64[1]%%" 25 14 - set "mong-db-path = %packed_software_path%" -goto git_rep_checkout - -:ver_Vista_64 - call:install_packed_software_o "mongo-db" "%%downloads_vista_64[1]%%" 25 14 - set "mong-db-path = %packed_software_path%" -goto git_rep_checkout - -:ver_XP_64 - call:log_lw_ds 15 -goto END - -:git_rep_checkout - call:log_lw_ss 16 - call:log_lw_sse 17 - - set "PATH=%PATH%;%git_exe_path%\bin;%git_exe_path%\cmd" /M - - call:log_lw 36 - call:log_lw 37 - call:log_lw 38 - - call:draw_dss - - call:get_lw word 39 - set /p git_username="%word% " - - call:draw_dss - - call:get_empty_path_from_user 32 - set "git_repository_path=%user_tmp_path%" - -goto:git_rep_checkout_auto - -:git_rep_checkout_auto - git clone https://github.com/%git_username%/codecombat.git "%git_repository_path%" -goto:git_repo_configuration - -:git_repo_configuration - call:log_lw_ss 35 - call:log_lw_sse 36 - - SET "PATH=%PATH%;%node_js_path%" /M - setx -m git "%git_exe_path%\bin" - - call:log_lw 40 - start cmd /k "npm install -g bower brunch nodemon sendwithus & exit" - -goto report_ok - -:report_ok - call:log_lw 18 - call:log_lw_sse 19 - - :: Open README file - call:open_readme - -goto clean_up - -:open_readme - call:open_txt_file "config/info" -goto:eof - -:warn_and_exit - call:log_lw_ss 20 - call:log_lw_sse 21 -goto error_report - -:error_report - call:log_lw_ds 22 -goto END - -:clean_up - call:log_lw_sse 23 - rmdir %temp-dir% /s /q -goto END - -:: ============================ INSTALL SOFTWARE FUNCTIONS ====================== - -:download_software - call:get_lw word 4 - call:log "%word% %~1..." - %curl-app% -sS -k %~2 -o %temp-dir%\%~1-setup.%~3 -goto:eof - -:install_software - call:download_software %~1 %~2 %~3 - call:get_lw word 5 - call:log "%word% %~1..." - START /WAIT %temp-dir%\%~1-setup.%~3 -goto:eof - -:install_software_o - call:get_lw word %~4 - call:user_yn_question "%word%" - if "%res%"=="true" ( - call:install_software %~1 %~2 %~3 - ) else ( - call:log_lw 10 - ) -goto:eof - -:install_packed_software - call:download_software %~1 %~2 zip - - call:draw_dss - - call:get_lw word %~3 - - set /p packed_software_path="%word% " - - :: remove chosen directory of user if it already exists (to prevent a window from popping up) - IF EXIST %packed_software_path% rmdir %packed_software_path% /s /q - - %ZU-app% x %temp-dir%\%~1-setup.zip -o%packed_software_path% - - call:draw_dss - - for /f "delims=" %%a in ('dir "%packed_software_path%\" /on /ad /b') do @set temp_dir=%%a - for /f "delims=" %%a in ('dir "%packed_software_path%\%temp_dir%\" /on /ad /b') do ( - xcopy %packed_software_path%\%temp_dir% %packed_software_path%\ /S /E - ) - - call:draw_dss - rmdir %packed_software_path%\%temp_dir%\ /s /q -goto:eof - -:user_yn_question - set /p result="%~1 [Y/N]: " - call:draw_dss - set "res=false" - if "%result%"=="N" (set "res=true") - if "%result%"=="n" (set "res=true") -goto:eof - -:strict_user_yn_question - set /p result="%~1 [Y/N]: " - call:draw_dss - set "res=unset" - if "%result%"=="N" (set "res=false") - if "%result%"=="n" (set "res=false") - if "%result%"=="Y" (set "res=true") - if "%result%"=="y" (set "res=true") - - if "%res%"=="unset" ( - call:log "Please answer the question with either Y or N..." - call:draw_dss - call:strict_user_yn_question "%~1" - ) -goto:eof - -:install_packed_software_o - call:get_lw word %~4 - call:user_yn_question "%word%" - if "%res%"=="true" ( - call:install_packed_software %~1 %~2 %~3 - ) else ( - call:log_lw 10 - ) -goto:eof - -:: ===================== USER - INTERACTION - FUNCTIONS ======================== - -:get_path_from_user - call:get_lw word %~1 - set /p user_tmp_path="%word% " - if not exist "%user_tmp_path%" ( - call:log_lw 43 - call:draw_dss - call:get_path_from_user %~1 %~2 - ) -goto:eof - -:get_empty_path_from_user - call:get_lw word %~1 - set /p user_tmp_path="%word% " - if exist "%user_tmp_path%" ( - call:log_lw 33 - call:draw_dss - call:get_path_from_user %~1 - ) -goto:eof - -:: ============================== FUNCTIONS ==================================== - -:log - echo %~1 - echo %~1 >> %install-log% -goto:eof - -:draw_ss - echo. - call:log "-----------------------------------------------------------------------------" - echo. -goto:eof - -:draw_dss - echo. - call:log "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" - echo. -goto:eof - -:draw_seperator - echo. - echo + + + + + + + + - echo. -goto:eof - -:log_ss - call:draw_ss - call:log "%~1" -goto:eof - -:log_sse - call:log "%~1" - call:draw_ss -goto:eof - -:log_ds - call:log_ss "%~1" - call:draw_ss -goto:eof - -:: ============================== IO FUNCTIONS ==================================== - -:open_txt_file - start "" notepad.exe %~1 -goto:eof - -:parse_aa_and_draw - set "file=%~1" - for /f "usebackq tokens=* delims=;" %%a in ("%file%") do ( - echo.%%a - ) -goto:eof - -:parse_file - set "file=%~1" - for /F "usebackq delims=" %%a in ("%file%") do ( - set /A %~3+=1 - call set %~2[%%%~3%%]=%%a - ) -goto:eof - -:parse_file_new - set /A %~3=0 - call:parse_file %~1 %~2 %~3 -goto:eof - -:: ============================== LOCALISATION FUNCTIONS ================ - -:get_lw - call:get_lw_id %~1 %lang_id% %~2 -goto:eof - -:get_lw_id - set /A count = %~2 * %wc% + %~3 + 1 - set "%~1=!languages[%count%]!" -goto:eof - -:log_lw - call:get_lw str %~1 - call:log "%str%" -goto:eof - -:log_lw_prfx - call:get_lw str %~1 - call:log "%~2%str%" -goto:eof - -:log_lw_ss - call:get_lw str %~1 - call:log_ss "%str%" -goto:eof - -:log_lw_ds - call:get_lw str %~1 - call:log_ds "%str%" -goto:eof - -:log_lw_sse - call:get_lw str %~1 - call:log_sse "%str%" -goto:eof - -:: ============================== WINDOWS FUNCTIONS ====================== - -:set_env_var - setx -m %~1 %~2 -goto:eof - -:: ============================== EOF ==================================== - -:END - exit -goto:eof - -endlocal \ No newline at end of file diff --git a/scripts/windows/coco-dev-setup/recycle_bin/git-test.bat b/scripts/windows/coco-dev-setup/recycle_bin/git-test.bat deleted file mode 100644 index 4fc84019c..000000000 --- a/scripts/windows/coco-dev-setup/recycle_bin/git-test.bat +++ /dev/null @@ -1,50 +0,0 @@ -@echo off -setlocal EnableDelayedExpansion - -:: + Configuraton and installation checklist: -:: 1) cd codecombat -:: 2) npm install -g bower brunch nodemon sendwithus -:: 3) bower install -:: 4) gem install sass -:: 5) npm install -:: 6) brunch -w -:: Extra... @ Fail run npm install - -echo "Moving to your git repository..." -C: -cd C:\CodeCombat - -PAUSE - -SET "PATH=%PATH%;C:\Program Files\Nodejs" /M -setx -m git "C:\Program Files (x86)\Git\bin" -SET "PATH=%PATH%;C:\Program Files (x86)\Git\bin;C:\Program Files (x86)\Git\cmd" /M - -PAUSE - -echo "Installing bower, brunch, nodemon and sendwithus..." -start cmd /k "npm install -g bower brunch nodemon sendwithus & exit" - -PAUSE - -echo "running npm install..." -start cmd /k "npm install & exit" - -PAUSE - -echo "Activating bower install..." -start cmd /k "bower install & PAUSE & exit" - -PAUSE - -echo "Installing sass via gem..." -start cmd /k "install sass & PAUSE & exit" - -PAUSE - -echo "comping repository via brunch..." -start cmd /k "brunch -w & exit" - -PAUSE - -endlocal \ No newline at end of file From bc72afe75852471a3a2bfc135917051d0f2e2b18 Mon Sep 17 00:00:00 2001 From: Glen De Cauwsemaecker Date: Tue, 29 Apr 2014 05:03:05 +0200 Subject: [PATCH 5/5] fixed more errors related to recent pull request merges in the window dev scripts --- .../coco-dev-setup/batch/localisation/fr.coco | 82 ------------ .../batch/localisation/languages.coco | 7 -- .../coco-dev-setup/batch/localisation/zh.coco | 82 ------------ .../download_and_install_applications.bat | 55 -------- .../batch/scripts/get_language.bat | 38 ------ .../batch/scripts/get_system_information.bat | 34 ----- .../coco-dev-setup/batch/scripts/get_text.bat | 5 - .../batch/scripts/github_setup.bat | 117 ------------------ .../batch/scripts/npm_and_brunch_setup.bat | 92 -------------- .../batch/scripts/print_dashed_seperator.bat | 5 - .../batch/scripts/print_exit.bat | 4 - .../batch/scripts/print_seperator.bat | 5 - .../coco-dev-setup/batch/scripts/setup.bat | 69 ----------- .../batch/scripts/sign_license.bat | 17 --- 14 files changed, 612 deletions(-) delete mode 100644 scripts/windows/coco-dev-setup/batch/localisation/fr.coco delete mode 100644 scripts/windows/coco-dev-setup/batch/localisation/languages.coco delete mode 100644 scripts/windows/coco-dev-setup/batch/localisation/zh.coco diff --git a/scripts/windows/coco-dev-setup/batch/localisation/fr.coco b/scripts/windows/coco-dev-setup/batch/localisation/fr.coco deleted file mode 100644 index 9dfac45b6..000000000 --- a/scripts/windows/coco-dev-setup/batch/localisation/fr.coco +++ /dev/null @@ -1,82 +0,0 @@ - - - - français - From now on we'll send our feedback in English! - - - - -bit computer detected. - The operating system - was detected. - We don't support Windows XP, installation cancelled. - - - Have you already installed all the software needed for CodeCombat? - We recommand that you reply negative in case you're not sure. - Skipping the installation of the software... - CodeCombat couldn't be developed without third-party software. - That's why you'll need to install this software, - in order to start contributing to our community. - Cancel the installation if you already have the application. - Make sure to select the option that adds the application to your Windows Path, if the option is available. - Do you already have the latest version of - installed? - is downloading... - is installing... - is unzipping... - is cleaning... - Please define the full path where mongodb should be installed - - - - - CodeCombat is opensource, like you already know. - All our sourcecode can be found online at Github. - You can choose to do the entire Git setup yourself. - However we recommend that you instead let us handle it instead. - - - Do you want to do the Local Git setup manually yourself? - Make sure you have correctly setup your repository before processing. - Do not close this window please. - When you're ready, press any key to continue... - - - Please give the full path of your CodeCombat git repository: - Please enter the full path where you want to install your CodeCombat environment - This installation requires Git Bash. - Git bash is by default installed at 'C:\Program Files (x86)\Git'. - Git bash is by default installed at 'C:\Program Files\Git'. - Please enter the full path where git bash is installed or just press enter if it's in the default location - Do you want to checkout the repository via ssh? - - - - Installing bower, brunch, nodemon and sendwithus... - Installing bower packages... - Installing sass... - Installing npm... - Starting brunch.... - Setting up a MongoDB database for you... - Downloading the last version of the CodeCombat database... - - - - That path already exists, are you sure you want to overwrite it? - That path doesn't exist. Please try again... - - - The setup of the CodeCombat Dev. Environment was succesfull. - Thank you already for your contribution and see you soon. - Do you want to read the README for more information? - - - From now on you can start the dev. environment at - the touch of a single mouse click. - 1) Just double click - and let the environment start up. - 2) Now just open 'localhost:3000' in your prefered browser. - That's it, you're now ready to start working on CodeCombat! - - \ No newline at end of file diff --git a/scripts/windows/coco-dev-setup/batch/localisation/languages.coco b/scripts/windows/coco-dev-setup/batch/localisation/languages.coco deleted file mode 100644 index 6acbda23b..000000000 --- a/scripts/windows/coco-dev-setup/batch/localisation/languages.coco +++ /dev/null @@ -1,7 +0,0 @@ -en -nl -de -fr -zh -zh-HANT -zh-HANS \ No newline at end of file diff --git a/scripts/windows/coco-dev-setup/batch/localisation/zh.coco b/scripts/windows/coco-dev-setup/batch/localisation/zh.coco deleted file mode 100644 index 6cada7324..000000000 --- a/scripts/windows/coco-dev-setup/batch/localisation/zh.coco +++ /dev/null @@ -1,82 +0,0 @@ - - - - 中文 - From now on we'll send our feedback in English! - - - - -bit computer detected. - The operating system - was detected. - We don't support Windows XP, installation cancelled. - - - Have you already installed all the software needed for CodeCombat? - We recommand that you reply negative in case you're not sure. - Skipping the installation of the software... - CodeCombat couldn't be developed without third-party software. - That's why you'll need to install this software, - in order to start contributing to our community. - Cancel the installation if you already have the application. - Make sure to select the option that adds the application to your Windows Path, if the option is available. - Do you already have the latest version of - installed? - is downloading... - is installing... - is unzipping... - is cleaning... - Please define the full path where mongodb should be installed - - - - - CodeCombat is opensource, like you already know. - All our sourcecode can be found online at Github. - You can choose to do the entire Git setup yourself. - However we recommend that you instead let us handle it instead. - - - Do you want to do the Local Git setup manually yourself? - Make sure you have correctly setup your repository before processing. - Do not close this window please. - When you're ready, press any key to continue... - - - Please give the full path of your CodeCombat git repository: - Please enter the full path where you want to install your CodeCombat environment - This installation requires Git Bash. - Git bash is by default installed at 'C:\Program Files (x86)\Git'. - Git bash is by default installed at 'C:\Program Files\Git'. - Please enter the full path where git bash is installed or just press enter if it's in the default location - Do you want to checkout the repository via ssh? - - - - Installing bower, brunch, nodemon and sendwithus... - Installing bower packages... - Installing sass... - Installing npm... - Starting brunch.... - Setting up a MongoDB database for you... - Downloading the last version of the CodeCombat database... - - - - That path already exists, are you sure you want to overwrite it? - That path doesn't exist. Please try again... - - - The setup of the CodeCombat Dev. Environment was succesfull. - Thank you already for your contribution and see you soon. - Do you want to read the README for more information? - - - From now on you can start the dev. environment at - the touch of a single mouse click. - 1) Just double click - and let the environment start up. - 2) Now just open 'localhost:3000' in your prefered browser. - That's it, you're now ready to start working on CodeCombat! - - \ No newline at end of file diff --git a/scripts/windows/coco-dev-setup/batch/scripts/download_and_install_applications.bat b/scripts/windows/coco-dev-setup/batch/scripts/download_and_install_applications.bat index 78974d4b2..f99680802 100644 --- a/scripts/windows/coco-dev-setup/batch/scripts/download_and_install_applications.bat +++ b/scripts/windows/coco-dev-setup/batch/scripts/download_and_install_applications.bat @@ -1,57 +1,3 @@ -<<<<<<< HEAD -call print_install_header -call print_dashed_seperator - -call get_local_text install_process_sks install process sks -echo !install_process_sks! - -call get_local_text install_process_skq install process skq -call ask_question "!install_process_skq!" - -call print_dashed_seperator - -if "%result%"=="true" ( - call get_local_text install_process_skc install process skc - echo !install_process_skc! - call print_dashed_seperator - goto:exit_setup -) - -call get_system_information -call print_dashed_seperator - -if %system_info_os% == XP ( - call get_local_text install_system_xp install system xp - echo !install_system_xp! - call print_exit -) - -call get_variables ..\\config\\downloads.coco downloads download_names downloads_count 0 general general -call get_variables ..\\config\\downloads.coco downloads download_names downloads_count 2 %system_info_os% b%system_info_bit% -call get_variables ..\\config\\downloads.coco downloads download_names downloads_count 3 general b%system_info_bit% - -call get_local_text install_process_s1 install process s1 -call get_local_text install_process_s2 install process s2 -call get_local_text install_process_s3 install process s3 -call get_local_text install_process_s4 install process s4 -call get_local_text install_process_winpath install process winpath - -echo !install_process_s1! -echo !install_process_s2! -echo !install_process_s3! -echo !install_process_s4! -echo. -echo !install_process_winpath! - -call print_dashed_seperator - -for /l %%i in (1, 1, !downloads_count!) do ( - call download_and_install_app !download_names[%%i]! !downloads[%%i]! -) - -goto:exit_setup - -======= call print_install_header call print_dashed_seperator @@ -105,5 +51,4 @@ for /l %%i in (1, 1, !downloads_count!) do ( goto:exit_setup ->>>>>>> 072729acc34123c42250d361955438cfd8c210d7 :exit_setup \ No newline at end of file diff --git a/scripts/windows/coco-dev-setup/batch/scripts/get_language.bat b/scripts/windows/coco-dev-setup/batch/scripts/get_language.bat index 99e4851af..04f859da8 100644 --- a/scripts/windows/coco-dev-setup/batch/scripts/get_language.bat +++ b/scripts/windows/coco-dev-setup/batch/scripts/get_language.bat @@ -1,40 +1,3 @@ -<<<<<<< HEAD -echo Some feedback is sent in your system's language -echo but most feedback is sent and localised by us. -echo Here is a list of languages: -call print_dashed_seperator - -call get_array ..\\localisation\\languages.coco languages language_count -for /l %%i in (1,1,%language_count%) do ( - call get_text !languages[%%i]! global_native global native - echo [%%i] !global_native! -) - -goto:get_localisation_id - -:get_localisation_id - call print_dashed_seperator - set /p "localisation_id=Enter the language ID of your preference and press : " - goto:validation_check - -:validation_check - set "localisation_is_false=" - set /a local_id = %localisation_id% - if !local_id! EQU 0 set localisation_is_false=1 - if !local_id! LSS 1 set localisation_is_false=1 - if !local_id! GTR !language_count! set localisation_is_false=1 - if defined localisation_is_false ( - echo The id you entered is invalid, please try again... - goto:get_localisation_id - ) else ( - set language_id=!languages[%local_id%]! - call get_text !language_id! global_native global native - call print_dashed_seperator - echo You have choosen !global_native! as your language. - call get_text !language_id! global_intro global intro - echo !global_intro! - call print_seperator -======= echo Some feedback is sent in your system's language echo but most feedback is sent and localised by us. echo Here is a list of languages: @@ -73,5 +36,4 @@ goto:get_localization_id echo !language_feedback! call print_seperator ->>>>>>> 072729acc34123c42250d361955438cfd8c210d7 ) \ No newline at end of file diff --git a/scripts/windows/coco-dev-setup/batch/scripts/get_system_information.bat b/scripts/windows/coco-dev-setup/batch/scripts/get_system_information.bat index ee68e3274..04c66c1a3 100644 --- a/scripts/windows/coco-dev-setup/batch/scripts/get_system_information.bat +++ b/scripts/windows/coco-dev-setup/batch/scripts/get_system_information.bat @@ -1,36 +1,3 @@ -<<<<<<< HEAD -if exist "%PROGRAMFILES(X86)%" ( - call:set_bit 64 -) else ( - call:set_bit 32 -) - -for /f "tokens=4-5 delims=. " %%i in ('ver') do set VERSION=%%i.%%j -if "%version%" == "5.2" ( call:set_os XP ) -if "%version%" == "6.0" ( call:set_os Vista ) -if "%version%" == "6.1" ( call:set_os Win7 ) -:: we handle win8.0 as win7 -if "%version%" == "6.2" ( call:set_os Win7 ) -:: we handle win8.1 as win7 -if "%version%" == "6.3" ( call:set_os Win7 ) - -goto:end - -:set_bit - call get_local_text install_system_bit install system bit - set system_info_bit=%~1 - echo %system_info_bit%%install_system_bit% -goto:eof - -:set_os - set system_info_os=%~1 - call get_local_text install_system_prefix install system prefix - call get_local_text install_system_sufix install system sufix - echo %install_system_prefix% %system_info_os% %install_system_sufix% -goto:eof - -:end -======= if exist "%PROGRAMFILES(X86)%" ( call:set_bit 64 ) else ( @@ -60,4 +27,3 @@ goto:eof goto:eof :end ->>>>>>> 072729acc34123c42250d361955438cfd8c210d7 diff --git a/scripts/windows/coco-dev-setup/batch/scripts/get_text.bat b/scripts/windows/coco-dev-setup/batch/scripts/get_text.bat index c36bd06fb..617d5b00a 100644 --- a/scripts/windows/coco-dev-setup/batch/scripts/get_text.bat +++ b/scripts/windows/coco-dev-setup/batch/scripts/get_text.bat @@ -1,8 +1,3 @@ -<<<<<<< HEAD -for /F "delims=" %%F in ('call run_script .\\get_var.ps1 ..\\localisation\\%1.coco %3 %4 %5 %6') do ( - set "%2=%%F" -======= for /F "delims=" %%F in ('call run_script .\\get_var.ps1 ..\\localization\\%1.coco %3 %4 %5 %6') do ( set "%2=%%F" ->>>>>>> 072729acc34123c42250d361955438cfd8c210d7 ) \ No newline at end of file diff --git a/scripts/windows/coco-dev-setup/batch/scripts/github_setup.bat b/scripts/windows/coco-dev-setup/batch/scripts/github_setup.bat index 2bdf32529..38234f51b 100644 --- a/scripts/windows/coco-dev-setup/batch/scripts/github_setup.bat +++ b/scripts/windows/coco-dev-setup/batch/scripts/github_setup.bat @@ -1,119 +1,3 @@ -<<<<<<< HEAD -call print_github_header -call print_dashed_seperator - -call get_local_text github_intro_opensource github intro opensource -call get_local_text github_intro_online github intro online -call get_local_text github_intro_manual github intro manual -call get_local_text github_intro_norec github intro norec - -echo !github_intro_opensource! -echo !github_intro_online! -echo !github_intro_manual! -echo !github_intro_norec! - -call print_dashed_seperator - -call get_local_text github_skip_question github skip question -call ask_question "!github_skip_question!" -call print_dashed_seperator - -if "%result%"=="true" ( - call get_local_text github_skip_consequence github skip consequence - echo !github_skip_consequence! - - call get_local_text github_skip_donotclose github skip donotclose - echo !github_skip_donotclose! - - call get_local_text github_skip_wait github skip wait - set /p "github_skip_wait=!github_skip_wait!" - - call print_dashed_seperator - - call get_local_text github_process_path github process path - call get_path_safe "!github_process_path!" - set "repository_path=!tmp_safe_path!" - - goto:exit_git_setup -) - -goto:get_bash_path - -:get_bash_path - call get_local_text github_process_bashi github process bashi - echo !github_process_bashi! - - if not defined install_system_bit ( - call print_dashed_seperator - call get_system_information - call print_dashed_seperator - ) - - if "%system_info_bit%"=="64" ( - call get_local_text github_process_bashp64 github process bashp64 - echo !github_process_bashp64! - ) else ( - call get_local_text github_process_bashp32 github process bashp32 - echo !github_process_bashp32! - ) - - call get_local_text github_process_bashq github process bashq - set /p "git_bash_path=!github_process_bashq!: " - - if not defined git_bash_path ( - if "%system_info_bit%"=="64" ( - set "git_bash_path=C:\Program Files (x86)\Git" - ) else ( - set "git_bash_path=C:\Program Files\Git" - ) - goto:get_git_path - ) - - if not exist "%git_bash_path%" ( - call get_local_text error_exist error exist - echo !error_exist! - call print_dashed_seperator - goto:get_bash_path - ) else ( - goto:get_git_path - ) -goto:eof - -:get_git_path - call print_dashed_seperator - call get_local_text github_process_checkout github process checkout - set /p "repository_path=!github_process_checkout!: " - if exist !repository_path! ( - call get_local_text error_path error path - call ask_question "!error_path!" - if "!result!"=="false" ( - call print_dashed_seperator - goto:get_git_path - ) else ( - rmdir /s /q %repository_path% - goto:git_checkout - ) - ) else ( - goto:git_checkout - ) -goto:eof - -:git_checkout - md "%repository_path%" - set "repository_path=%repository_path%\coco" - - call print_dashed_seperator - set "git_app_path=%git_bash_path%\bin\git.exe" - - call get_config github_url - "%git_app_path%" clone "!github_url!" "%repository_path%" - - goto:exit_git_setup -goto:eof - -:exit_git_setup - call print_dashed_seperator -======= call print_github_header call print_dashed_seperator @@ -262,5 +146,4 @@ goto:eof :exit_git_setup call print_dashed_seperator ->>>>>>> 072729acc34123c42250d361955438cfd8c210d7 goto:eof \ No newline at end of file diff --git a/scripts/windows/coco-dev-setup/batch/scripts/npm_and_brunch_setup.bat b/scripts/windows/coco-dev-setup/batch/scripts/npm_and_brunch_setup.bat index 8a3819228..4f6a7964a 100644 --- a/scripts/windows/coco-dev-setup/batch/scripts/npm_and_brunch_setup.bat +++ b/scripts/windows/coco-dev-setup/batch/scripts/npm_and_brunch_setup.bat @@ -1,94 +1,3 @@ -<<<<<<< HEAD -call print_npm_and_brunch_header -call print_dashed_seperator - -set work_directory=%CD% - -set "curl_app=..\utilities\curl.exe" -set "zu_app=..\utilities\7za.exe" -set "keystuff=..\utilities\keystuff.exe" - -set "coco_root=!repository_path!\coco" - -goto:automatic_script - -call get_local_text npm-install -echo !npm_install! - -cd !coco_root! -start /wait cmd /c "echo !npm_install! & npm install -g bower brunch nodemon sendwithus" -cd !work_directory! - -call print_dashed_seperator -call get_local_text npm-binstall -echo !npm_binstall! - -cd "!coco_root!" -start /wait cmd /c "echo !npm_binstall! & bower install" -cd "!work_directory!" - -call print_dashed_seperator -call get_local_text npm-sass -echo !npm_sass! - -cd "!coco_root!" -start /wait cmd /c "echo !npm_sass! & gem install sass" -cd "!work_directory!" - -call print_dashed_seperator -call get_local_text npm-npm -echo !npm_npm! - -cd "!coco_root!" -start /wait cmd /c "echo !npm_npm! & npm install" -cd "!work_directory!" - -:: --- MONGODB - -:mongodb -call print_dashed_seperator -call get_local_text npm-mongodb -echo !npm_mongodb! - -set "mdb_directory=!repository_path!\cocodb" - -if exist mdb_directory ( - rmdir /s /q "!mdb_directory!" -) - -md !mdb_directory! - -call print_dashed_seperator -call get_local_text npm-db -echo !npm_db! - -call get_config database_backup - -cd !mdb_directory! - -start cmd /c "%work_directory%\%keystuff% Alt-Tab && mongod --setParameter textSearchEnabled=true --dbpath !mdb_directory!" - -%curl_app% -k !database_backup! -o dump.tar.gz - -start /wait cmd /c "%work_directory%\%keystuff% Alt-Tab && %zu_app% e dump.tar.gz && del dump.tar.gz && %zu_app% x dump.tar && del dump.tar" - -start /wait cmd /c "mongorestore dump" - -rmdir /s /q db - -:: --- AUTOMATIC SCRIPT - -::automatic_script -call print_dashed_seperator -call get_local_text npm-script -echo !npm_script! - -:: --- END - -call print_dashed_seperator - -pause -======= call print_npm_and_brunch_header call print_dashed_seperator @@ -113,4 +22,3 @@ call nab_install_mongodb %coco_db% call nab_automatic_script.bat %coco_root% %coco_db% call print_dashed_seperator ->>>>>>> 072729acc34123c42250d361955438cfd8c210d7 diff --git a/scripts/windows/coco-dev-setup/batch/scripts/print_dashed_seperator.bat b/scripts/windows/coco-dev-setup/batch/scripts/print_dashed_seperator.bat index b79e5154b..cf1c60ada 100644 --- a/scripts/windows/coco-dev-setup/batch/scripts/print_dashed_seperator.bat +++ b/scripts/windows/coco-dev-setup/batch/scripts/print_dashed_seperator.bat @@ -1,8 +1,3 @@ -<<<<<<< HEAD -echo. -echo - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -======= echo. echo - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ->>>>>>> 072729acc34123c42250d361955438cfd8c210d7 echo. \ No newline at end of file diff --git a/scripts/windows/coco-dev-setup/batch/scripts/print_exit.bat b/scripts/windows/coco-dev-setup/batch/scripts/print_exit.bat index afe7bbf61..107790d88 100644 --- a/scripts/windows/coco-dev-setup/batch/scripts/print_exit.bat +++ b/scripts/windows/coco-dev-setup/batch/scripts/print_exit.bat @@ -1,7 +1,3 @@ -<<<<<<< HEAD -set /p res="Press any key to exit..." -======= call get_local_text global_exit global exit set /p res="%global_exit%" ->>>>>>> 072729acc34123c42250d361955438cfd8c210d7 exit \ No newline at end of file diff --git a/scripts/windows/coco-dev-setup/batch/scripts/print_seperator.bat b/scripts/windows/coco-dev-setup/batch/scripts/print_seperator.bat index aae85a7d8..50f484b80 100644 --- a/scripts/windows/coco-dev-setup/batch/scripts/print_seperator.bat +++ b/scripts/windows/coco-dev-setup/batch/scripts/print_seperator.bat @@ -1,8 +1,3 @@ -<<<<<<< HEAD -echo. -echo ----------------------------------------------------------------------------- -======= echo. echo ------------------------------------------------------------------------------- ->>>>>>> 072729acc34123c42250d361955438cfd8c210d7 echo. \ No newline at end of file diff --git a/scripts/windows/coco-dev-setup/batch/scripts/setup.bat b/scripts/windows/coco-dev-setup/batch/scripts/setup.bat index 0fb896ea7..fe24e6855 100644 --- a/scripts/windows/coco-dev-setup/batch/scripts/setup.bat +++ b/scripts/windows/coco-dev-setup/batch/scripts/setup.bat @@ -1,71 +1,3 @@ -<<<<<<< HEAD -@echo off -setlocal EnableDelayedExpansion - -Color 0A -mode con: cols=79 lines=55 - -call print_header -call print_dashed_seperator - -call get_config.bat version -call get_config.bat author -call get_config.bat copyright -echo Welcome to the automated Installation of the CodeCombat Dev. Environment! -echo v%version% authored by %author% and published by %copyright%. -call print_seperator - -echo Before we start the installation, here are some tips: -call print_tips -call print_seperator - -call sign_license - -call get_language - -call download_and_install_applications - -call github_setup - -:: This will be available in v2.0 -::call npm_and_brunch_setup - -call print_finished_header -call print_dashed_seperator - -call get_local_text end_succesfull end succesfull -call get_local_text end_thankyou end thankyou -echo %end_succesfull% -echo %end_thankyou% - -call print_dashed_seperator - -call get_local_text start_s1 start s1 -call get_local_text start_s2 start s2 -call get_local_text start_s3 start s3 -call get_local_text start_s4 start s4 -call get_local_text start_s5 start s5 -call get_local_text start_s6 start s6 - -echo !start_s1! -echo !start_s2! -echo. -echo !start_s3! '!repository_path!\coco\SCOCODE.bat' -echo !start_s4! -echo !start_s5! -echo. -echo !start_s6! - -call print_dashed_seperator - -call get_local_text end_readme end readme -call ask_question "!end_readme!" - -if "%result%"=="true" ( - call open_readme -) - -======= @echo off setlocal EnableDelayedExpansion @@ -94,5 +26,4 @@ call download_and_install_applications start cmd /c "setup_p2.bat" ->>>>>>> 072729acc34123c42250d361955438cfd8c210d7 endlocal \ No newline at end of file diff --git a/scripts/windows/coco-dev-setup/batch/scripts/sign_license.bat b/scripts/windows/coco-dev-setup/batch/scripts/sign_license.bat index db0b51e4b..a3d3a3f3f 100644 --- a/scripts/windows/coco-dev-setup/batch/scripts/sign_license.bat +++ b/scripts/windows/coco-dev-setup/batch/scripts/sign_license.bat @@ -1,19 +1,3 @@ -<<<<<<< HEAD -echo In order to continue the installation of the developers environment -echo you will have to read and agree with the following license: -call print_dashed_seperator - -call print_license -call print_dashed_seperator - -call ask_question "Have you read the license and do you agree with it?" -call print_dashed_seperator - -if "%result%"=="false" ( - echo This setup can't happen without an agreement. - echo Installation and Setup of the CodeCombat environment is cancelled. - call print_exit -======= call get_local_text license_s1 license s1 echo !license_s1! @@ -40,5 +24,4 @@ if "%result%"=="false" ( echo. call print_exit ->>>>>>> 072729acc34123c42250d361955438cfd8c210d7 ) \ No newline at end of file