From fb97415ee7762b02f114f3c4663c44e867531d0e Mon Sep 17 00:00:00 2001 From: Xinyuan Chen Date: Thu, 30 May 2019 22:57:19 -0700 Subject: [PATCH 1/9] simplified getRandomTileWithAdjacent --- .../net/simon987/server/game/world/World.java | 29 ++++--------------- 1 file changed, 6 insertions(+), 23 deletions(-) diff --git a/Server/src/main/java/net/simon987/server/game/world/World.java b/Server/src/main/java/net/simon987/server/game/world/World.java index c3890da..3e73cb2 100644 --- a/Server/src/main/java/net/simon987/server/game/world/World.java +++ b/Server/src/main/java/net/simon987/server/game/world/World.java @@ -412,6 +412,8 @@ public class World implements MongoSerializable { */ public Point getRandomTileWithAdjacent(int n, int tile) { int counter = 0; + int[] xPositions = {1, 0, -1, 0, 1, -1, 1, -1}; + int[] yPositions = {0, 1, 0, -1, 1, 1, -1, -1}; while (true) { counter++; @@ -425,29 +427,10 @@ public class World implements MongoSerializable { if (rTile != null) { int adjacentTiles = 0; - if (tileMap.isInBounds(rTile.x, rTile.y - 1) && !isTileBlocked(rTile.x, rTile.y - 1)) { - adjacentTiles++; - } - if (tileMap.isInBounds(rTile.x + 1, rTile.y) && !isTileBlocked(rTile.x + 1, rTile.y)) { - adjacentTiles++; - } - if (tileMap.isInBounds(rTile.x, rTile.y + 1) && !isTileBlocked(rTile.x, rTile.y + 1)) { - adjacentTiles++; - } - if (tileMap.isInBounds(rTile.x - 1, rTile.y) && !isTileBlocked(rTile.x - 1, rTile.y)) { - adjacentTiles++; - } - if (tileMap.isInBounds(rTile.x + 1, rTile.y + 1) && !isTileBlocked(rTile.x + 1, rTile.y + 1)) { - adjacentTiles++; - } - if (tileMap.isInBounds(rTile.x - 1, rTile.y + 1) && !isTileBlocked(rTile.x - 1, rTile.y + 1)) { - adjacentTiles++; - } - if (tileMap.isInBounds(rTile.x + 1, rTile.y - 1) && !isTileBlocked(rTile.x + 1, rTile.y - 1)) { - adjacentTiles++; - } - if (tileMap.isInBounds(rTile.x - 1, rTile.y - 1) && !isTileBlocked(rTile.x - 1, rTile.y - 1)) { - adjacentTiles++; + for (int idx = 0; idx < xPositions.length; idx++) { + if (tileMap.isInBounds(rTile.x + xPositions[idx], rTile.y + yPositions[idx]) && !isTileBlocked(rTile.x + xPositions[idx], rTile.y + yPositions[idx])) { + adjacentTiles++; + } } if (adjacentTiles >= n) { From 3a35f3fdfccc7f660b8ae9014f080960f212f747 Mon Sep 17 00:00:00 2001 From: Richard Cuthbert Date: Wed, 19 Jun 2019 00:05:44 +0100 Subject: [PATCH 2/9] In Assembler.java, I moved the overloaded parseDWInstruction() method to be sequential to the earlier method of the same name. --- .../simon987/server/assembly/Assembler.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Server/src/main/java/net/simon987/server/assembly/Assembler.java b/Server/src/main/java/net/simon987/server/assembly/Assembler.java index 53156cf..2c8af1e 100755 --- a/Server/src/main/java/net/simon987/server/assembly/Assembler.java +++ b/Server/src/main/java/net/simon987/server/assembly/Assembler.java @@ -219,6 +219,17 @@ public class Assembler { return bos.toByteArray(); } + + /** + * Parse the DW instruction (Define word). Handles DUP operator + * + * @param line Current line. assuming that comments and labels are removed + * @param currentLine Current line number + * @return Encoded instruction, null if the line is not a DW instruction + */ + private static byte[] parseDWInstruction(String line, int currentLine) throws AssemblyException { + return parseDWInstruction(line, null, currentLine); + } /** * Parse the dup operator @@ -271,17 +282,6 @@ public class Assembler { } - /** - * Parse the DW instruction (Define word). Handles DUP operator - * - * @param line Current line. assuming that comments and labels are removed - * @param currentLine Current line number - * @return Encoded instruction, null if the line is not a DW instruction - */ - private static byte[] parseDWInstruction(String line, int currentLine) throws AssemblyException { - return parseDWInstruction(line, null, currentLine); - } - /** * Check for and handle section declarations (.text and .data) * From 638c5b3bb32d4f8563cda2159545dd27e11f4266 Mon Sep 17 00:00:00 2001 From: yesji <55633427+yesji@users.noreply.github.com> Date: Sun, 6 Oct 2019 18:21:32 +0530 Subject: [PATCH 3/9] Fixed 3 "switch without 'default' clause." issues (#207) Fixed 3 "switch without 'default' clause." --- .../src/main/java/net/simon987/cubotplugin/CubotLidar.java | 3 +++ .../main/java/net/simon987/npcplugin/VaultWorldGenerator.java | 3 +++ .../java/net/simon987/server/game/objects/GameObject.java | 4 +++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Plugin Cubot/src/main/java/net/simon987/cubotplugin/CubotLidar.java b/Plugin Cubot/src/main/java/net/simon987/cubotplugin/CubotLidar.java index 89a63d3..0386f37 100644 --- a/Plugin Cubot/src/main/java/net/simon987/cubotplugin/CubotLidar.java +++ b/Plugin Cubot/src/main/java/net/simon987/cubotplugin/CubotLidar.java @@ -125,6 +125,9 @@ public class CubotLidar extends HardwareModule { getCpu().getRegisterSet().getRegister("X").setValue(unit.getWorld().getX()); getCpu().getRegisterSet().getRegister("Y").setValue(unit.getWorld().getY()); break; + + default: + break; } } diff --git a/Plugin NPC/src/main/java/net/simon987/npcplugin/VaultWorldGenerator.java b/Plugin NPC/src/main/java/net/simon987/npcplugin/VaultWorldGenerator.java index 204db43..1911054 100644 --- a/Plugin NPC/src/main/java/net/simon987/npcplugin/VaultWorldGenerator.java +++ b/Plugin NPC/src/main/java/net/simon987/npcplugin/VaultWorldGenerator.java @@ -156,6 +156,9 @@ public class VaultWorldGenerator { map.setTileAt(floorTile, 1, worldSize / 2 - 1); roomCenters.add(new Point(1, worldSize / 2 - 1)); break; + default: + + break; } } diff --git a/Server/src/main/java/net/simon987/server/game/objects/GameObject.java b/Server/src/main/java/net/simon987/server/game/objects/GameObject.java index 49f740c..eac119a 100755 --- a/Server/src/main/java/net/simon987/server/game/objects/GameObject.java +++ b/Server/src/main/java/net/simon987/server/game/objects/GameObject.java @@ -89,6 +89,8 @@ public abstract class GameObject implements JSONSerializable, MongoSerializable case WEST: setX(nextWorld.getWorldSize() - 1); break; + default: + break; } return true; @@ -270,4 +272,4 @@ public abstract class GameObject implements JSONSerializable, MongoSerializable return document; } -} \ No newline at end of file +} From 5f3c34911c40f6d03deb809eb229ece46284172c Mon Sep 17 00:00:00 2001 From: CaderHancock <30449937+CaderHancock@users.noreply.github.com> Date: Thu, 10 Oct 2019 13:46:49 -0700 Subject: [PATCH 4/9] Overload methods are not grouped together (#210) * Overload methods are not grouped together --- .../assembly/DefaultInstructionSet.java | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/Server/src/main/java/net/simon987/server/assembly/DefaultInstructionSet.java b/Server/src/main/java/net/simon987/server/assembly/DefaultInstructionSet.java index cd9aa3f..b7288a6 100755 --- a/Server/src/main/java/net/simon987/server/assembly/DefaultInstructionSet.java +++ b/Server/src/main/java/net/simon987/server/assembly/DefaultInstructionSet.java @@ -104,18 +104,9 @@ public class DefaultInstructionSet implements InstructionSet { return defaultInstruction; } } - /** - * Add a new instruction to the instructionSet - * - * @param opcode opcode of the instruction - * @param instruction Instruction to add + * Get an instruction from its mnemonic */ - public void addInstruction(int opcode, Instruction instruction) { - instructionMap.put(opcode, instruction); - } - - @Override public Instruction get(String mnemonic) { for (Instruction ins : instructionMap.values()) { @@ -131,7 +122,15 @@ public class DefaultInstructionSet implements InstructionSet { return null; } - + /** + * Add a new instruction to the instructionSet + * + * @param opcode opcode of the instruction + * @param instruction Instruction to add + */ + public void addInstruction(int opcode, Instruction instruction) { + instructionMap.put(opcode, instruction); + } @Override public void add(Instruction instruction) { From 39ca4d5143ddfafb50c5ba7e80c877d305156ead Mon Sep 17 00:00:00 2001 From: yesji <55633427+yesji@users.noreply.github.com> Date: Sun, 13 Oct 2019 18:43:27 +0530 Subject: [PATCH 5/9] Fixed "'module' is defined but never used." issue (#208) * Fixed "'module' is defined but never used." issue --- Server/src/main/resources/static/js/ace/mode-mar.js | 6 +++--- Server/src/main/resources/static/js/ace/theme-chaos.js | 2 +- Server/src/main/resources/static/js/ace/theme-chrome.js | 2 +- Server/src/main/resources/static/js/ace/theme-clouds.js | 2 +- Server/src/main/resources/static/js/ace/theme-cobalt.js | 2 +- .../main/resources/static/js/ace/theme-crimson_editor.js | 2 +- Server/src/main/resources/static/js/ace/theme-dawn.js | 2 +- Server/src/main/resources/static/js/ace/theme-dracula.js | 2 +- .../src/main/resources/static/js/ace/theme-dreamweaver.js | 2 +- Server/src/main/resources/static/js/ace/theme-eclipse.js | 2 +- Server/src/main/resources/static/js/ace/theme-github.js | 2 +- Server/src/main/resources/static/js/ace/theme-gob.js | 2 +- Server/src/main/resources/static/js/ace/theme-gruvbox.js | 2 +- .../src/main/resources/static/js/ace/theme-idle_fingers.js | 2 +- Server/src/main/resources/static/js/ace/theme-iplastic.js | 2 +- .../src/main/resources/static/js/ace/theme-katzenmilch.js | 2 +- Server/src/main/resources/static/js/ace/theme-kuroir.js | 2 +- Server/src/main/resources/static/js/ace/theme-merbivore.js | 2 +- .../main/resources/static/js/ace/theme-merbivore_soft.js | 2 +- .../main/resources/static/js/ace/theme-mono_industrial.js | 2 +- .../main/resources/static/js/ace/theme-pastel_on_dark.js | 2 +- .../main/resources/static/js/ace/theme-solarized_dark.js | 2 +- .../main/resources/static/js/ace/theme-solarized_light.js | 2 +- Server/src/main/resources/static/js/ace/theme-sqlserver.js | 2 +- Server/src/main/resources/static/js/ace/theme-terminal.js | 2 +- Server/src/main/resources/static/js/ace/theme-textmate.js | 2 +- Server/src/main/resources/static/js/ace/theme-tomorrow.js | 2 +- .../main/resources/static/js/ace/theme-tomorrow_night.js | 2 +- .../resources/static/js/ace/theme-tomorrow_night_blue.js | 2 +- .../resources/static/js/ace/theme-tomorrow_night_bright.js | 2 +- .../static/js/ace/theme-tomorrow_night_eighties.js | 2 +- Server/src/main/resources/static/js/ace/theme-twilight.js | 2 +- .../src/main/resources/static/js/ace/theme-vibrant_ink.js | 2 +- Server/src/main/resources/static/js/ace/theme-xcode.js | 2 +- 34 files changed, 36 insertions(+), 36 deletions(-) diff --git a/Server/src/main/resources/static/js/ace/mode-mar.js b/Server/src/main/resources/static/js/ace/mode-mar.js index 287ebfb..3d67171 100644 --- a/Server/src/main/resources/static/js/ace/mode-mar.js +++ b/Server/src/main/resources/static/js/ace/mode-mar.js @@ -33,7 +33,7 @@ * IT MIGHT NOT BE PERFECT ...But it's a good start from an existing *.tmlanguage file. * * fileTypes * ****************************************************************************************/ -define("ace/mode/mar_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text_highlight_rules"], function (require, exports, module) { +define("ace/mode/mar_rules", ["require", "exports", "ace/lib/oop", "ace/mode/text_highlight_rules"], function (require, exports) { "use strict"; var oop = require("../lib/oop"); @@ -95,7 +95,7 @@ define("ace/mode/mar_rules", ["require", "exports", "module", "ace/lib/oop", "ac exports.MarHighlightRules = MarHighlightRules; }); -define("ace/mode/mar", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text", "ace/mode/mar_rules"], function (require, exports, module) { +define("ace/mode/mar", ["require", "exports", "ace/lib/oop", "ace/mode/text", "ace/mode/mar_rules"], function (require, exports) { "use strict"; var oop = require("../lib/oop"); @@ -114,4 +114,4 @@ define("ace/mode/mar", ["require", "exports", "module", "ace/lib/oop", "ace/mode }).call(Mode.prototype); exports.Mode = Mode; -}); \ No newline at end of file +}); diff --git a/Server/src/main/resources/static/js/ace/theme-chaos.js b/Server/src/main/resources/static/js/ace/theme-chaos.js index e4c4a5a..185e3d9 100644 --- a/Server/src/main/resources/static/js/ace/theme-chaos.js +++ b/Server/src/main/resources/static/js/ace/theme-chaos.js @@ -1,4 +1,4 @@ -define("ace/theme/chaos", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) { +define("ace/theme/chaos", ["require", "exports", "ace/lib/dom"], function (require, exports) { exports.isDark = true; exports.cssClass = "ace-chaos"; diff --git a/Server/src/main/resources/static/js/ace/theme-chrome.js b/Server/src/main/resources/static/js/ace/theme-chrome.js index 4485d7f..cade712 100644 --- a/Server/src/main/resources/static/js/ace/theme-chrome.js +++ b/Server/src/main/resources/static/js/ace/theme-chrome.js @@ -1,4 +1,4 @@ -define("ace/theme/chrome", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) { +define("ace/theme/chrome", ["require", "exports", "ace/lib/dom"], function (require, exports) { exports.isDark = false; exports.cssClass = "ace-chrome"; diff --git a/Server/src/main/resources/static/js/ace/theme-clouds.js b/Server/src/main/resources/static/js/ace/theme-clouds.js index 2dfea40..8a8b029 100644 --- a/Server/src/main/resources/static/js/ace/theme-clouds.js +++ b/Server/src/main/resources/static/js/ace/theme-clouds.js @@ -1,4 +1,4 @@ -define("ace/theme/clouds", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) { +define("ace/theme/clouds", ["require", "exports", "ace/lib/dom"], function (require, exports) { exports.isDark = false; exports.cssClass = "ace-clouds"; diff --git a/Server/src/main/resources/static/js/ace/theme-cobalt.js b/Server/src/main/resources/static/js/ace/theme-cobalt.js index c10df60..6b867bb 100644 --- a/Server/src/main/resources/static/js/ace/theme-cobalt.js +++ b/Server/src/main/resources/static/js/ace/theme-cobalt.js @@ -1,4 +1,4 @@ -define("ace/theme/cobalt", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) { +define("ace/theme/cobalt", ["require", "exports", "ace/lib/dom"], function (require, exports) { exports.isDark = true; exports.cssClass = "ace-cobalt"; diff --git a/Server/src/main/resources/static/js/ace/theme-crimson_editor.js b/Server/src/main/resources/static/js/ace/theme-crimson_editor.js index 2302e48..807f475 100644 --- a/Server/src/main/resources/static/js/ace/theme-crimson_editor.js +++ b/Server/src/main/resources/static/js/ace/theme-crimson_editor.js @@ -1,4 +1,4 @@ -define("ace/theme/crimson_editor", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) { +define("ace/theme/crimson_editor", ["require", "exports", "ace/lib/dom"], function (require, exports) { exports.isDark = false; exports.cssText = ".ace-crimson-editor .ace_gutter {\ background: #ebebeb;\ diff --git a/Server/src/main/resources/static/js/ace/theme-dawn.js b/Server/src/main/resources/static/js/ace/theme-dawn.js index 2860e66..e956684 100644 --- a/Server/src/main/resources/static/js/ace/theme-dawn.js +++ b/Server/src/main/resources/static/js/ace/theme-dawn.js @@ -1,4 +1,4 @@ -define("ace/theme/dawn", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) { +define("ace/theme/dawn", ["require", "exports", "ace/lib/dom"], function (require, exports) { exports.isDark = false; exports.cssClass = "ace-dawn"; diff --git a/Server/src/main/resources/static/js/ace/theme-dracula.js b/Server/src/main/resources/static/js/ace/theme-dracula.js index 857bc83..41a41b7 100644 --- a/Server/src/main/resources/static/js/ace/theme-dracula.js +++ b/Server/src/main/resources/static/js/ace/theme-dracula.js @@ -1,4 +1,4 @@ -define("ace/theme/dracula", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) { +define("ace/theme/dracula", ["require", "exports", "ace/lib/dom"], function (require, exports) { exports.isDark = true; exports.cssClass = "ace-dracula"; diff --git a/Server/src/main/resources/static/js/ace/theme-dreamweaver.js b/Server/src/main/resources/static/js/ace/theme-dreamweaver.js index c297a5b..37e169c 100644 --- a/Server/src/main/resources/static/js/ace/theme-dreamweaver.js +++ b/Server/src/main/resources/static/js/ace/theme-dreamweaver.js @@ -1,4 +1,4 @@ -define("ace/theme/dreamweaver", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) { +define("ace/theme/dreamweaver", ["require", "exports", "ace/lib/dom"], function (require, exports) { exports.isDark = false; exports.cssClass = "ace-dreamweaver"; exports.cssText = ".ace-dreamweaver .ace_gutter {\ diff --git a/Server/src/main/resources/static/js/ace/theme-eclipse.js b/Server/src/main/resources/static/js/ace/theme-eclipse.js index 775fecd..eb57961 100644 --- a/Server/src/main/resources/static/js/ace/theme-eclipse.js +++ b/Server/src/main/resources/static/js/ace/theme-eclipse.js @@ -1,4 +1,4 @@ -define("ace/theme/eclipse", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) { +define("ace/theme/eclipse", ["require", "exports", "ace/lib/dom"], function (require, exports) { "use strict"; exports.isDark = false; diff --git a/Server/src/main/resources/static/js/ace/theme-github.js b/Server/src/main/resources/static/js/ace/theme-github.js index f7b73bb..e9ca960 100644 --- a/Server/src/main/resources/static/js/ace/theme-github.js +++ b/Server/src/main/resources/static/js/ace/theme-github.js @@ -1,4 +1,4 @@ -define("ace/theme/github", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) { +define("ace/theme/github", ["require", "exports", "ace/lib/dom"], function (require, exports) { exports.isDark = false; exports.cssClass = "ace-github"; diff --git a/Server/src/main/resources/static/js/ace/theme-gob.js b/Server/src/main/resources/static/js/ace/theme-gob.js index 2c37b6a..73ed835 100644 --- a/Server/src/main/resources/static/js/ace/theme-gob.js +++ b/Server/src/main/resources/static/js/ace/theme-gob.js @@ -1,4 +1,4 @@ -define("ace/theme/gob", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) { +define("ace/theme/gob", ["require", "exports", "ace/lib/dom"], function (require, exports) { exports.isDark = true; exports.cssClass = "ace-gob"; diff --git a/Server/src/main/resources/static/js/ace/theme-gruvbox.js b/Server/src/main/resources/static/js/ace/theme-gruvbox.js index 3eda485..658b39e 100644 --- a/Server/src/main/resources/static/js/ace/theme-gruvbox.js +++ b/Server/src/main/resources/static/js/ace/theme-gruvbox.js @@ -1,4 +1,4 @@ -define("ace/theme/gruvbox", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) { +define("ace/theme/gruvbox", ["require", "exports", "ace/lib/dom"], function (require, exports) { exports.isDark = true; exports.cssClass = "ace-gruvbox"; diff --git a/Server/src/main/resources/static/js/ace/theme-idle_fingers.js b/Server/src/main/resources/static/js/ace/theme-idle_fingers.js index 38da610..d6e6519 100644 --- a/Server/src/main/resources/static/js/ace/theme-idle_fingers.js +++ b/Server/src/main/resources/static/js/ace/theme-idle_fingers.js @@ -1,4 +1,4 @@ -define("ace/theme/idle_fingers", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) { +define("ace/theme/idle_fingers", ["require", "exports", "ace/lib/dom"], function (require, exports) { exports.isDark = true; exports.cssClass = "ace-idle-fingers"; diff --git a/Server/src/main/resources/static/js/ace/theme-iplastic.js b/Server/src/main/resources/static/js/ace/theme-iplastic.js index 660e6d1..2c7b13b 100644 --- a/Server/src/main/resources/static/js/ace/theme-iplastic.js +++ b/Server/src/main/resources/static/js/ace/theme-iplastic.js @@ -1,4 +1,4 @@ -define("ace/theme/iplastic", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) { +define("ace/theme/iplastic", ["require", "exports", "ace/lib/dom"], function (require, exports) { exports.isDark = false; exports.cssClass = "ace-iplastic"; diff --git a/Server/src/main/resources/static/js/ace/theme-katzenmilch.js b/Server/src/main/resources/static/js/ace/theme-katzenmilch.js index 4cce6e1..3161625 100644 --- a/Server/src/main/resources/static/js/ace/theme-katzenmilch.js +++ b/Server/src/main/resources/static/js/ace/theme-katzenmilch.js @@ -1,4 +1,4 @@ -define("ace/theme/katzenmilch", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) { +define("ace/theme/katzenmilch", ["require", "exports", "ace/lib/dom"], function (require, exports) { exports.isDark = false; exports.cssClass = "ace-katzenmilch"; diff --git a/Server/src/main/resources/static/js/ace/theme-kuroir.js b/Server/src/main/resources/static/js/ace/theme-kuroir.js index 45c4e01..e4cb640 100644 --- a/Server/src/main/resources/static/js/ace/theme-kuroir.js +++ b/Server/src/main/resources/static/js/ace/theme-kuroir.js @@ -1,4 +1,4 @@ -define("ace/theme/kuroir", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) { +define("ace/theme/kuroir", ["require", "exports", "ace/lib/dom"], function (require, exports) { exports.isDark = false; exports.cssClass = "ace-kuroir"; diff --git a/Server/src/main/resources/static/js/ace/theme-merbivore.js b/Server/src/main/resources/static/js/ace/theme-merbivore.js index 0656728..cbd82a0 100644 --- a/Server/src/main/resources/static/js/ace/theme-merbivore.js +++ b/Server/src/main/resources/static/js/ace/theme-merbivore.js @@ -1,4 +1,4 @@ -define("ace/theme/merbivore", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) { +define("ace/theme/merbivore", ["require", "exports", "ace/lib/dom"], function (require, exports) { exports.isDark = true; exports.cssClass = "ace-merbivore"; diff --git a/Server/src/main/resources/static/js/ace/theme-merbivore_soft.js b/Server/src/main/resources/static/js/ace/theme-merbivore_soft.js index 9a8300c..f825a96 100644 --- a/Server/src/main/resources/static/js/ace/theme-merbivore_soft.js +++ b/Server/src/main/resources/static/js/ace/theme-merbivore_soft.js @@ -1,4 +1,4 @@ -define("ace/theme/merbivore_soft", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) { +define("ace/theme/merbivore_soft", ["require", "exports", "ace/lib/dom"], function (require, exports) { exports.isDark = true; exports.cssClass = "ace-merbivore-soft"; diff --git a/Server/src/main/resources/static/js/ace/theme-mono_industrial.js b/Server/src/main/resources/static/js/ace/theme-mono_industrial.js index c62cc58..17b06ba 100644 --- a/Server/src/main/resources/static/js/ace/theme-mono_industrial.js +++ b/Server/src/main/resources/static/js/ace/theme-mono_industrial.js @@ -1,4 +1,4 @@ -define("ace/theme/mono_industrial", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) { +define("ace/theme/mono_industrial", ["require", "exports", "ace/lib/dom"], function (require, exports) { exports.isDark = true; exports.cssClass = "ace-mono-industrial"; diff --git a/Server/src/main/resources/static/js/ace/theme-pastel_on_dark.js b/Server/src/main/resources/static/js/ace/theme-pastel_on_dark.js index 4a72553..fc187d0 100644 --- a/Server/src/main/resources/static/js/ace/theme-pastel_on_dark.js +++ b/Server/src/main/resources/static/js/ace/theme-pastel_on_dark.js @@ -1,4 +1,4 @@ -define("ace/theme/pastel_on_dark", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) { +define("ace/theme/pastel_on_dark", ["require", "exports", "ace/lib/dom"], function (require, exports) { exports.isDark = true; exports.cssClass = "ace-pastel-on-dark"; diff --git a/Server/src/main/resources/static/js/ace/theme-solarized_dark.js b/Server/src/main/resources/static/js/ace/theme-solarized_dark.js index c106335..50001ea 100644 --- a/Server/src/main/resources/static/js/ace/theme-solarized_dark.js +++ b/Server/src/main/resources/static/js/ace/theme-solarized_dark.js @@ -1,4 +1,4 @@ -define("ace/theme/solarized_dark", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) { +define("ace/theme/solarized_dark", ["require", "exports", "ace/lib/dom"], function (require, exports) { exports.isDark = true; exports.cssClass = "ace-solarized-dark"; diff --git a/Server/src/main/resources/static/js/ace/theme-solarized_light.js b/Server/src/main/resources/static/js/ace/theme-solarized_light.js index b56f62b..6b81e24 100644 --- a/Server/src/main/resources/static/js/ace/theme-solarized_light.js +++ b/Server/src/main/resources/static/js/ace/theme-solarized_light.js @@ -1,4 +1,4 @@ -define("ace/theme/solarized_light", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) { +define("ace/theme/solarized_light", ["require", "exports", "ace/lib/dom"], function (require, exports) { exports.isDark = false; exports.cssClass = "ace-solarized-light"; diff --git a/Server/src/main/resources/static/js/ace/theme-sqlserver.js b/Server/src/main/resources/static/js/ace/theme-sqlserver.js index 417c1d7..bf72c90 100644 --- a/Server/src/main/resources/static/js/ace/theme-sqlserver.js +++ b/Server/src/main/resources/static/js/ace/theme-sqlserver.js @@ -1,4 +1,4 @@ -define("ace/theme/sqlserver", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) { +define("ace/theme/sqlserver", ["require", "exports", "ace/lib/dom"], function (require, exports) { exports.isDark = false; exports.cssClass = "ace-sqlserver"; diff --git a/Server/src/main/resources/static/js/ace/theme-terminal.js b/Server/src/main/resources/static/js/ace/theme-terminal.js index 68b9b00..7b112fb 100644 --- a/Server/src/main/resources/static/js/ace/theme-terminal.js +++ b/Server/src/main/resources/static/js/ace/theme-terminal.js @@ -1,4 +1,4 @@ -define("ace/theme/terminal", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) { +define("ace/theme/terminal", ["require", "exports", "ace/lib/dom"], function (require, exports) { exports.isDark = true; exports.cssClass = "ace-terminal-theme"; diff --git a/Server/src/main/resources/static/js/ace/theme-textmate.js b/Server/src/main/resources/static/js/ace/theme-textmate.js index 469c3c7..f42f9bc 100644 --- a/Server/src/main/resources/static/js/ace/theme-textmate.js +++ b/Server/src/main/resources/static/js/ace/theme-textmate.js @@ -1,4 +1,4 @@ -define("ace/theme/textmate", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) { +define("ace/theme/textmate", ["require", "exports", "ace/lib/dom"], function (require, exports) { "use strict"; exports.isDark = false; diff --git a/Server/src/main/resources/static/js/ace/theme-tomorrow.js b/Server/src/main/resources/static/js/ace/theme-tomorrow.js index aced69c..27aa82d 100644 --- a/Server/src/main/resources/static/js/ace/theme-tomorrow.js +++ b/Server/src/main/resources/static/js/ace/theme-tomorrow.js @@ -1,4 +1,4 @@ -define("ace/theme/tomorrow", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) { +define("ace/theme/tomorrow", ["require", "exports", "ace/lib/dom"], function (require, exports) { exports.isDark = false; exports.cssClass = "ace-tomorrow"; diff --git a/Server/src/main/resources/static/js/ace/theme-tomorrow_night.js b/Server/src/main/resources/static/js/ace/theme-tomorrow_night.js index 687843a..c0df265 100644 --- a/Server/src/main/resources/static/js/ace/theme-tomorrow_night.js +++ b/Server/src/main/resources/static/js/ace/theme-tomorrow_night.js @@ -1,4 +1,4 @@ -define("ace/theme/tomorrow_night", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) { +define("ace/theme/tomorrow_night", ["require", "exports", "ace/lib/dom"], function (require, exports) { exports.isDark = true; exports.cssClass = "ace-tomorrow-night"; diff --git a/Server/src/main/resources/static/js/ace/theme-tomorrow_night_blue.js b/Server/src/main/resources/static/js/ace/theme-tomorrow_night_blue.js index b4ee5ed..e608d01 100644 --- a/Server/src/main/resources/static/js/ace/theme-tomorrow_night_blue.js +++ b/Server/src/main/resources/static/js/ace/theme-tomorrow_night_blue.js @@ -1,4 +1,4 @@ -define("ace/theme/tomorrow_night_blue", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) { +define("ace/theme/tomorrow_night_blue", ["require", "exports", "ace/lib/dom"], function (require, exports) { exports.isDark = true; exports.cssClass = "ace-tomorrow-night-blue"; diff --git a/Server/src/main/resources/static/js/ace/theme-tomorrow_night_bright.js b/Server/src/main/resources/static/js/ace/theme-tomorrow_night_bright.js index eff04cc..3baf412 100644 --- a/Server/src/main/resources/static/js/ace/theme-tomorrow_night_bright.js +++ b/Server/src/main/resources/static/js/ace/theme-tomorrow_night_bright.js @@ -1,4 +1,4 @@ -define("ace/theme/tomorrow_night_bright", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) { +define("ace/theme/tomorrow_night_bright", ["require", "exports", "ace/lib/dom"], function (require, exports) { exports.isDark = true; exports.cssClass = "ace-tomorrow-night-bright"; diff --git a/Server/src/main/resources/static/js/ace/theme-tomorrow_night_eighties.js b/Server/src/main/resources/static/js/ace/theme-tomorrow_night_eighties.js index 55b6c38..e4bbb1e 100644 --- a/Server/src/main/resources/static/js/ace/theme-tomorrow_night_eighties.js +++ b/Server/src/main/resources/static/js/ace/theme-tomorrow_night_eighties.js @@ -1,4 +1,4 @@ -define("ace/theme/tomorrow_night_eighties", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) { +define("ace/theme/tomorrow_night_eighties", ["require", "exports", "ace/lib/dom"], function (require, exports) { exports.isDark = true; exports.cssClass = "ace-tomorrow-night-eighties"; diff --git a/Server/src/main/resources/static/js/ace/theme-twilight.js b/Server/src/main/resources/static/js/ace/theme-twilight.js index ddee95e..8224c53 100644 --- a/Server/src/main/resources/static/js/ace/theme-twilight.js +++ b/Server/src/main/resources/static/js/ace/theme-twilight.js @@ -1,4 +1,4 @@ -define("ace/theme/twilight", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) { +define("ace/theme/twilight", ["require", "exports", "ace/lib/dom"], function (require, exports) { exports.isDark = true; exports.cssClass = "ace-twilight"; diff --git a/Server/src/main/resources/static/js/ace/theme-vibrant_ink.js b/Server/src/main/resources/static/js/ace/theme-vibrant_ink.js index c4c1dfc..7f1331b 100644 --- a/Server/src/main/resources/static/js/ace/theme-vibrant_ink.js +++ b/Server/src/main/resources/static/js/ace/theme-vibrant_ink.js @@ -1,4 +1,4 @@ -define("ace/theme/vibrant_ink", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) { +define("ace/theme/vibrant_ink", ["require", "exports", "ace/lib/dom"], function (require, exports) { exports.isDark = true; exports.cssClass = "ace-vibrant-ink"; diff --git a/Server/src/main/resources/static/js/ace/theme-xcode.js b/Server/src/main/resources/static/js/ace/theme-xcode.js index ac9d680..69db62e 100644 --- a/Server/src/main/resources/static/js/ace/theme-xcode.js +++ b/Server/src/main/resources/static/js/ace/theme-xcode.js @@ -1,4 +1,4 @@ -define("ace/theme/xcode", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) { +define("ace/theme/xcode", ["require", "exports", "ace/lib/dom"], function (require, exports) { exports.isDark = false; exports.cssClass = "ace-xcode"; From 634af8859ff36c9ace88bfef44f21e4bfc48a894 Mon Sep 17 00:00:00 2001 From: Mauricio Rivera Date: Wed, 23 Oct 2019 05:34:24 -0700 Subject: [PATCH 6/9] Code style 197 (#213) --- Server/src/main/typescript/World.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Server/src/main/typescript/World.ts b/Server/src/main/typescript/World.ts index 808fb6d..2089b6e 100644 --- a/Server/src/main/typescript/World.ts +++ b/Server/src/main/typescript/World.ts @@ -296,7 +296,6 @@ class World { this.tiles.push(tile); mar.isoGroup.add(tile); - } } @@ -318,6 +317,10 @@ class World { mar.game.world.height = (size + 2) * 64; } + /** + * Set Message text + * @param msg string to set as the message + */ public setBigMessage(msg: string) { this.bigMessage = mar.game.add.text(908, 450, msg, { fontSize: 46, @@ -478,5 +481,3 @@ class WorldArrow extends Phaser.Plugin.Isometric.IsoSprite { } } - - From 03ff2e5527c27c6ef58f25cc23f1b2effe31f103 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 23 Oct 2019 07:38:01 -0500 Subject: [PATCH 7/9] Refactoring & code style (#212) --- .../simon987/server/assembly/Assembler.java | 91 ++++---- .../net/simon987/server/assembly/CPU.java | 200 +++++++++--------- .../simon987/server/assembly/OperandTest.java | 47 ++-- 3 files changed, 176 insertions(+), 162 deletions(-) diff --git a/Server/src/main/java/net/simon987/server/assembly/Assembler.java b/Server/src/main/java/net/simon987/server/assembly/Assembler.java index 2c8af1e..c5088f6 100755 --- a/Server/src/main/java/net/simon987/server/assembly/Assembler.java +++ b/Server/src/main/java/net/simon987/server/assembly/Assembler.java @@ -170,7 +170,7 @@ public class Assembler { } catch (IllegalArgumentException e) { throw new InvalidOperandException( "Invalid string operand \"" + string + "\": " + e.getMessage(), - currentLine); + currentLine); } out.write(string.getBytes(StandardCharsets.UTF_16BE)); @@ -219,7 +219,7 @@ public class Assembler { return bos.toByteArray(); } - + /** * Parse the DW instruction (Define word). Handles DUP operator * @@ -318,7 +318,7 @@ public class Assembler { /* the EQU pseudo instruction is equivalent to the #define compiler directive in C/C++ * usage: constant_name EQU * A constant treated the same way as a label. - */ + */ line = line.trim(); String[] tokens = line.split("\\s+"); @@ -362,7 +362,47 @@ public class Assembler { ByteArrayOutputStream out = new ByteArrayOutputStream(); //Pass 1: Get code origin - for (currentLine = 0; currentLine < lines.length; currentLine++) { + getCodeOrigin(lines, result); + //Pass 2: Save label names and location + saveLabelNamesAndLocation(lines, result); + //Pass 3: encode instructions + encodeInstructions(lines, result, out); + + + //If the code contains OffsetOverFlowException(s), don't bother writing the assembled bytes to memory + boolean writeToMemory = true; + for (Exception e : result.exceptions) { + if (e instanceof OffsetOverflowException) { + writeToMemory = false; + break; + } + } + + if (writeToMemory) { + result.bytes = out.toByteArray(); + } else { + result.bytes = new byte[0]; + LogManager.LOGGER.fine("Skipping writing assembled bytes to memory. (OffsetOverflowException)"); + } + + try { + out.close(); + } catch (IOException e) { + e.printStackTrace(); + } + + LogManager.LOGGER.info("Assembled " + result.bytes.length + " bytes (" + result.exceptions.size() + " errors)"); + for (AssemblyException e : result.exceptions) { + LogManager.LOGGER.severe(e.getMessage() + '@' + e.getLine()); + } + LogManager.LOGGER.info('\n' + Util.toHex(result.bytes)); + + return result; + + } + + private void getCodeOrigin(String[] lines, AssemblyResult result) { + for (int currentLine = 0; currentLine < lines.length; currentLine++) { try { checkForORGInstruction(lines[currentLine], result, currentLine); @@ -373,10 +413,11 @@ public class Assembler { //Ignore error } } + } - //Pass 2: Save label names and location + private void saveLabelNamesAndLocation(String[] lines, AssemblyResult result) { int currentOffset = 0; - for (currentLine = 0; currentLine < lines.length; currentLine++) { + for (int currentLine = 0; currentLine < lines.length; currentLine++) { try { checkForLabel(lines[currentLine], result, (char)currentOffset); @@ -394,11 +435,11 @@ public class Assembler { } } + } - - //Pass 3: encode instructions - currentOffset = 0; - for (currentLine = 0; currentLine < lines.length; currentLine++) { + private void encodeInstructions(String[] lines, AssemblyResult result, ByteArrayOutputStream out) { + int currentOffset = 0; + for (int currentLine = 0; currentLine < lines.length; currentLine++) { String line = lines[currentLine]; @@ -439,36 +480,6 @@ public class Assembler { ioE.printStackTrace(); } } - - //If the code contains OffsetOverFlowException(s), don't bother writing the assembled bytes to memory - boolean writeToMemory = true; - for (Exception e : result.exceptions) { - if (e instanceof OffsetOverflowException) { - writeToMemory = false; - } - } - - if (writeToMemory) { - result.bytes = out.toByteArray(); - } else { - result.bytes = new byte[0]; - LogManager.LOGGER.fine("Skipping writing assembled bytes to memory. (OffsetOverflowException)"); - } - - try { - out.close(); - } catch (IOException e) { - e.printStackTrace(); - } - - LogManager.LOGGER.info("Assembled " + result.bytes.length + " bytes (" + result.exceptions.size() + " errors)"); - for (AssemblyException e : result.exceptions) { - LogManager.LOGGER.severe(e.getMessage() + '@' + e.getLine()); - } - LogManager.LOGGER.info('\n' + Util.toHex(result.bytes)); - - return result; - } /** diff --git a/Server/src/main/java/net/simon987/server/assembly/CPU.java b/Server/src/main/java/net/simon987/server/assembly/CPU.java index 0cd4e96..1867e65 100755 --- a/Server/src/main/java/net/simon987/server/assembly/CPU.java +++ b/Server/src/main/java/net/simon987/server/assembly/CPU.java @@ -207,104 +207,11 @@ public class CPU implements MongoSerializable { ip++; instruction.execute(status); } else if (source == Operand.IMMEDIATE_VALUE) { - ip++; - int sourceValue = memory.get(ip); - - if (destination == 0) { - //Single operand - ip++; - instruction.execute(sourceValue, status); - } else if (destination == Operand.IMMEDIATE_VALUE) { - //Destination is an immediate value too - //this shouldn't happen - LogManager.LOGGER.severe("Trying to execute an instruction with 2" + - "immediate values as operands"); //todo remove debug info - - } else if (destination == Operand.IMMEDIATE_VALUE_MEM) { - //Destination is memory immediate - ip += 2; - instruction.execute(memory, memory.get(ip - 1), sourceValue, status); - } else if (destination <= registerSetSize) { - //Destination is a register - ip++; - instruction.execute(registerSet, destination, sourceValue, status); - - } else if (destination <= registerSetSize * 2) { - //Destination is [reg] - ip++; - instruction.execute(memory, registerSet.get(destination - registerSetSize), sourceValue, status); - } else { - //Assuming that destination is [reg + x] - ip += 2; - instruction.execute(memory, registerSet.get(destination - registerSetSize - registerSetSize) + memory.get(ip - 1), - sourceValue, status); - } - + executeImmediateValue(instruction, source, destination); } else if (source == Operand.IMMEDIATE_VALUE_MEM) { - //Source is [x] - ip++; - int sourceValue = memory.get(memory.get(ip)); - - if (destination == 0) { - //Single operand - ip++; - instruction.execute(memory, memory.get(ip - 1), status); - } else if (destination == Operand.IMMEDIATE_VALUE) { - //Destination is an immediate value - - //this shouldn't happen - LogManager.LOGGER.severe("Trying to execute an instruction with an" + - "immediate values as dst operand"); //todo remove debug info - } else if (destination == Operand.IMMEDIATE_VALUE_MEM) { - //Destination is memory immediate too - ip += 2; - instruction.execute(memory, memory.get(ip - 1), sourceValue, status); - } else if (destination <= registerSetSize) { - //Destination is a register - ip++; - instruction.execute(registerSet, destination, sourceValue, status); - } else if (destination <= registerSetSize * 2) { - //Destination is [reg] - ip++; - instruction.execute(memory, registerSet.get(destination - registerSetSize), sourceValue, status); - } else { - //Assuming that destination is [reg + x] - ip += 2; - instruction.execute(memory, registerSet.get(destination - registerSetSize - registerSetSize) + memory.get(ip - 1), sourceValue, status); - } - + executeImmediateValueMem(instruction, source, destination); } else if (source <= registerSetSize) { - //Source is a register - - if (destination == 0) { - //Single operand - ip++; - instruction.execute(registerSet, source, status); - - } else if (destination == Operand.IMMEDIATE_VALUE) { - //Destination is an immediate value - //this shouldn't happen - LogManager.LOGGER.severe("Trying to execute an instruction with an" + - "immediate values as dst operand"); //todo remove debug info - } else if (destination == Operand.IMMEDIATE_VALUE_MEM) { - //Destination is memory immediate - ip += 2; - instruction.execute(memory, memory.get(ip - 1), registerSet, source, status); - } else if (destination <= registerSetSize) { - //Destination is a register too - ip++; - instruction.execute(registerSet, destination, registerSet, source, status); - } else if (destination <= registerSetSize * 2) { - //Destination is [reg] - ip++; - instruction.execute(memory, registerSet.get(destination - registerSetSize), registerSet, source, status); - } else { - //Assuming that destination is [reg + x] - ip += 2; - instruction.execute(memory, registerSet.get(destination - registerSetSize - registerSetSize) + memory.get(ip - 1), - registerSet, source, status); - } - + executeSourceIsRegister(instruction, source, destination); } else if (source <= registerSetSize * 2) { //Source is [reg] if (destination == 0) { @@ -374,6 +281,107 @@ public class CPU implements MongoSerializable { } } + private void executeSourceIsRegister(Instruction instruction, int source, int destination) { + //Source is a register + if (destination == 0) { + //Single operand + ip++; + instruction.execute(registerSet, source, status); + + } else if (destination == Operand.IMMEDIATE_VALUE) { + //Destination is an immediate value + //this shouldn't happen + LogManager.LOGGER.severe("Trying to execute an instruction with an" + + "immediate values as dst operand"); //todo remove debug info + } else if (destination == Operand.IMMEDIATE_VALUE_MEM) { + //Destination is memory immediate + ip += 2; + instruction.execute(memory, memory.get(ip - 1), registerSet, source, status); + } else if (destination <= registerSetSize) { + //Destination is a register too + ip++; + instruction.execute(registerSet, destination, registerSet, source, status); + } else if (destination <= registerSetSize * 2) { + //Destination is [reg] + ip++; + instruction.execute(memory, registerSet.get(destination - registerSetSize), registerSet, source, status); + } else { + //Assuming that destination is [reg + x] + ip += 2; + instruction.execute(memory, registerSet.get(destination - registerSetSize - registerSetSize) + memory.get(ip - 1), + registerSet, source, status); + } + } + + private void executeImmediateValue(Instruction instruction, int source, int destination) { + ip++; + int sourceValue = memory.get(ip); + + if (destination == 0) { + //Single operand + ip++; + instruction.execute(sourceValue, status); + } else if (destination == Operand.IMMEDIATE_VALUE) { + //Destination is an immediate value too + //this shouldn't happen + LogManager.LOGGER.severe("Trying to execute an instruction with 2" + + "immediate values as operands"); //todo remove debug info + + } else if (destination == Operand.IMMEDIATE_VALUE_MEM) { + //Destination is memory immediate + ip += 2; + instruction.execute(memory, memory.get(ip - 1), sourceValue, status); + } else if (destination <= registerSetSize) { + //Destination is a register + ip++; + instruction.execute(registerSet, destination, sourceValue, status); + + } else if (destination <= registerSetSize * 2) { + //Destination is [reg] + ip++; + instruction.execute(memory, registerSet.get(destination - registerSetSize), sourceValue, status); + } else { + //Assuming that destination is [reg + x] + ip += 2; + instruction.execute(memory, registerSet.get(destination - registerSetSize - registerSetSize) + memory.get(ip - 1), + sourceValue, status); + } + } + + private void executeImmediateValueMem(Instruction instruction, int source, int destination) { + //Source is [x] + ip++; + int sourceValue = memory.get(memory.get(ip)); + + if (destination == 0) { + //Single operand + ip++; + instruction.execute(memory, memory.get(ip - 1), status); + } else if (destination == Operand.IMMEDIATE_VALUE) { + //Destination is an immediate value + + //this shouldn't happen + LogManager.LOGGER.severe("Trying to execute an instruction with an" + + "immediate values as dst operand"); //todo remove debug info + } else if (destination == Operand.IMMEDIATE_VALUE_MEM) { + //Destination is memory immediate too + ip += 2; + instruction.execute(memory, memory.get(ip - 1), sourceValue, status); + } else if (destination <= registerSetSize) { + //Destination is a register + ip++; + instruction.execute(registerSet, destination, sourceValue, status); + } else if (destination <= registerSetSize * 2) { + //Destination is [reg] + ip++; + instruction.execute(memory, registerSet.get(destination - registerSetSize), sourceValue, status); + } else { + //Assuming that destination is [reg + x] + ip += 2; + instruction.execute(memory, registerSet.get(destination - registerSetSize - registerSetSize) + memory.get(ip - 1), sourceValue, status); + } + } + @Override public Document mongoSerialise() { Document dbObject = new Document(); diff --git a/Server/src/test/java/net/simon987/server/assembly/OperandTest.java b/Server/src/test/java/net/simon987/server/assembly/OperandTest.java index 9f89eb6..e89de92 100644 --- a/Server/src/test/java/net/simon987/server/assembly/OperandTest.java +++ b/Server/src/test/java/net/simon987/server/assembly/OperandTest.java @@ -127,32 +127,27 @@ public class OperandTest { } //Invalid operands - try{ new Operand("aa", labels, registerSet, 0); } catch (InvalidOperandException e){ - //It's not a valid Operand; that's okey, just continue; VALID FOR ALL THE OTHER CATCH SENTENCES + try{ new Operand("aa", labels, registerSet, 0); } catch (InvalidOperandException ignored){ + //It's not a valid Operand; that's okay, just continue; VALID FOR ALL THE OTHER CATCH SENTENCES } - try{ new Operand("a1", labels, registerSet, 0); } catch (InvalidOperandException e){} - try{ new Operand("a_", labels, registerSet, 0); } catch (InvalidOperandException e){} - try{ new Operand("_a", labels, registerSet, 0); } catch (InvalidOperandException e){} - try{ new Operand("_1", labels, registerSet, 0); } catch (InvalidOperandException e){ } - try{ new Operand("S", labels, registerSet, 0); } catch (InvalidOperandException e){} - try{ new Operand("label1_", labels, registerSet, 0); } catch (InvalidOperandException e){} - try{ new Operand("+label1", labels, registerSet, 0); } catch (InvalidOperandException e){} - try{ new Operand("[- 12]", labels, registerSet, 0); } catch (InvalidOperandException e){} - try{ new Operand("[12+1]", labels, registerSet, 0); } catch (InvalidOperandException e){} - try{ new Operand("[+label1", labels, registerSet, 0); } catch (InvalidOperandException e){} - try{ new Operand("[*12]", labels, registerSet, 0); } catch (InvalidOperandException e){} - try{ new Operand("[-A]", labels, registerSet, 0); } catch (InvalidOperandException e){} - try{ new Operand("[A B]", labels, registerSet, 0); } catch (InvalidOperandException e){} - try{ new Operand("[A + B]", labels, registerSet, 0); } catch (InvalidOperandException e){} - try{ new Operand("[A + -1]", labels, registerSet, 0); } catch (InvalidOperandException e){} - try{ new Operand("[A + ]", labels, registerSet, 0); } catch (InvalidOperandException e){} - try{ new Operand("[]", labels, registerSet, 0); } catch (InvalidOperandException e){} - try{ new Operand("[A+A+]", labels, registerSet, 0); } catch (InvalidOperandException e){} - try{ new Operand("[A+[1]]", labels, registerSet, 0); } catch (InvalidOperandException e){} - - - - + try{ new Operand("a1", labels, registerSet, 0); } catch (InvalidOperandException ignored){} + try{ new Operand("a_", labels, registerSet, 0); } catch (InvalidOperandException ignored){} + try{ new Operand("_a", labels, registerSet, 0); } catch (InvalidOperandException ignored){} + try{ new Operand("_1", labels, registerSet, 0); } catch (InvalidOperandException ignored){ } + try{ new Operand("S", labels, registerSet, 0); } catch (InvalidOperandException ignored){} + try{ new Operand("label1_", labels, registerSet, 0); } catch (InvalidOperandException ignored){} + try{ new Operand("+label1", labels, registerSet, 0); } catch (InvalidOperandException ignored){} + try{ new Operand("[- 12]", labels, registerSet, 0); } catch (InvalidOperandException ignored){} + try{ new Operand("[12+1]", labels, registerSet, 0); } catch (InvalidOperandException ignored){} + try{ new Operand("[+label1", labels, registerSet, 0); } catch (InvalidOperandException ignored){} + try{ new Operand("[*12]", labels, registerSet, 0); } catch (InvalidOperandException ignored){} + try{ new Operand("[-A]", labels, registerSet, 0); } catch (InvalidOperandException ignored){} + try{ new Operand("[A B]", labels, registerSet, 0); } catch (InvalidOperandException ignored){} + try{ new Operand("[A + B]", labels, registerSet, 0); } catch (InvalidOperandException ignored){} + try{ new Operand("[A + -1]", labels, registerSet, 0); } catch (InvalidOperandException ignored){} + try{ new Operand("[A + ]", labels, registerSet, 0); } catch (InvalidOperandException ignored){} + try{ new Operand("[]", labels, registerSet, 0); } catch (InvalidOperandException ignored){} + try{ new Operand("[A+A+]", labels, registerSet, 0); } catch (InvalidOperandException ignored){} + try{ new Operand("[A+[1]]", labels, registerSet, 0); } catch (InvalidOperandException ignored){} } - } From 8b55466e7cd993d6fb5e7dd8d468ed8b06b1b47a Mon Sep 17 00:00:00 2001 From: simon987 Date: Sun, 27 Oct 2019 16:39:50 -0400 Subject: [PATCH 8/9] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7c6e174..ce82991 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ In its current state, players can walk around the game universe and collect Biom ![screenshot from 2017-11-12 13-01-43](https://user-images.githubusercontent.com/7120851/32701793-e5d07e98-c7a9-11e7-9931-f8db7b287994.png) Wiki: [GitHub](https://github.com/simon987/Much-Assembly-Required/wiki) -Chat: [Slack](https://join.slack.com/t/muchassemblyrequired/shared_invite/enQtMjY3Mjc1OTUwNjEwLTkyOTIwOTA5OGY4MDVlMGI4NzM5YzlhMWJiMGY1OWE2NjUxODQ1NWQ1YTcxMTA1NGZkYzNjYzMyM2E1ODdmNzg) +Chat: [Slack](https://join.slack.com/t/muchassemblyrequired/shared_invite/enQtMjY3Mjc1OTUwNjEwLWRjMjRkZTg2N2EyNWRjN2YyMDc0YzIyMTUyYzFiNTBmMTU3OGQ1ZjA0MWY0M2IyYjUxZTA4NjRkMWVkNDk2NzY) # Deploying the server From ea1ec1b1b31fb20c86f1af942c9ef1bdcbd7fc73 Mon Sep 17 00:00:00 2001 From: simon987 Date: Sun, 27 Oct 2019 22:20:28 -0400 Subject: [PATCH 9/9] jenkins hotfix --- jenkins/Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/jenkins/Jenkinsfile b/jenkins/Jenkinsfile index 1765423..8e4aeaf 100644 --- a/jenkins/Jenkinsfile +++ b/jenkins/Jenkinsfile @@ -8,6 +8,7 @@ remote.allowAnyHosts = true remote.retryCount = 3 remote.retryWaitSec = 3 logLevel = 'FINER' +remote.port = 2299 pipeline { agent any