This commit is contained in:
simon 2018-01-05 21:38:07 -05:00
parent 0bd25df977
commit a8beb8c3e2

View File

@ -21,6 +21,7 @@ public class CodeUploadHandler implements MessageHandler {
//TODO Should we wait at the end of the tick to modify the CPU ? //TODO Should we wait at the end of the tick to modify the CPU ?
user.getUser().setUserCode((String) json.get("code")); user.getUser().setUserCode((String) json.get("code"));
if (user.getUser().getUserCode() != null) {
AssemblyResult ar = new Assembler(user.getUser().getCpu().getInstructionSet(), AssemblyResult ar = new Assembler(user.getUser().getCpu().getInstructionSet(),
user.getUser().getCpu().getRegisterSet(), user.getUser().getCpu().getRegisterSet(),
GameServer.INSTANCE.getConfig()).parse(user.getUser().getUserCode()); GameServer.INSTANCE.getConfig()).parse(user.getUser().getUserCode());
@ -46,6 +47,7 @@ public class CodeUploadHandler implements MessageHandler {
user.getWebSocket().send(response.toJSONString()); user.getWebSocket().send(response.toJSONString());
} }
}
} }