mirror of
https://github.com/simon987/Much-Assembly-Required.git
synced 2025-12-12 22:38:54 +00:00
Added basic Radio Tower functionality #32
Keypress buffer is cleared on code upload
This commit is contained in:
@@ -5,6 +5,7 @@ public enum Action {
|
||||
DIGGING,
|
||||
WALKING,
|
||||
WITHDRAWING,
|
||||
DEPOSITING
|
||||
DEPOSITING,
|
||||
LISTENING
|
||||
|
||||
}
|
||||
|
||||
@@ -21,4 +21,9 @@ public interface ControllableUnit {
|
||||
|
||||
int getEnergy();
|
||||
|
||||
int getX();
|
||||
|
||||
int getY();
|
||||
|
||||
void setAction(Action listening);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package net.simon987.server.game;
|
||||
|
||||
public interface Programmable {
|
||||
|
||||
void sendMessage(char[] message);
|
||||
|
||||
}
|
||||
@@ -33,6 +33,13 @@ public class CodeUploadHandler implements MessageHandler {
|
||||
user.getUser().getCpu().getMemory().write((char) ar.origin, assembledCode, 0, assembledCode.length);
|
||||
user.getUser().getCpu().setCodeSegmentOffset(ar.getCodeSegmentOffset());
|
||||
|
||||
//Clear keyboard buffer
|
||||
if (user.getUser().getControlledUnit() != null &&
|
||||
user.getUser().getControlledUnit().getKeyboardBuffer() != null) {
|
||||
user.getUser().getControlledUnit().getKeyboardBuffer().clear();
|
||||
}
|
||||
|
||||
|
||||
JSONObject response = new JSONObject();
|
||||
response.put("t", "codeResponse");
|
||||
response.put("bytes", ar.bytes.length);
|
||||
|
||||
Reference in New Issue
Block a user