23 package com.realtime.crossfire.jxclient.queue;
30 import java.util.LinkedList;
31 import java.util.List;
32 import org.jetbrains.annotations.NotNull;
82 @SuppressWarnings(
"FieldCanBeLocal")
91 public void metaserver() {
96 public void preConnecting(@NotNull
final String serverInfo) {
101 public void connecting(@NotNull
final String serverInfo) {
106 public void connecting(@NotNull
final ClientSocketState clientSocketState, @NotNull
final String param) {
111 public void connected() {
116 public void connectFailed(@NotNull
final String reason) {
145 return oldRepeatCount;
160 assert 0 <= digit && digit <= 9;
184 public void sendNcom(
final boolean mustSend, @NotNull
final String command) {
196 public void sendNcom(
final boolean mustSend,
final int repeat, @NotNull
final String command) {
205 final String[] tmp = command.split(
" ", 2);
206 if (tmp[0].equalsIgnoreCase(
"run")) {
209 if (tmp.length >= 2) {
211 final int direction = Integer.parseInt(tmp[1]);
212 if (1 <= direction && direction <= 8) {
215 }
catch (
final NumberFormatException ignored) {
218 }
else if (tmp[0].equalsIgnoreCase(
"run_stop")) {
223 if (command.equalsIgnoreCase(
"north")) {
225 }
else if (command.equalsIgnoreCase(
"northeast")) {
227 }
else if (command.equalsIgnoreCase(
"east")) {
229 }
else if (command.equalsIgnoreCase(
"southeast")) {
231 }
else if (command.equalsIgnoreCase(
"south")) {
233 }
else if (command.equalsIgnoreCase(
"southwest")) {
235 }
else if (command.equalsIgnoreCase(
"west")) {
237 }
else if (command.equalsIgnoreCase(
"northwest")) {
242 if (direction != -1) {
304 public void sendMove(
final int to,
final int tag) {
315 if (dx == 0 && dy == -1) {
317 }
else if (dx == 1 && dy == -1) {
319 }
else if (dx == 1 && dy == 0) {
321 }
else if (dx == 1 && dy == 1) {
323 }
else if (dx == 0 && dy == 1) {
325 }
else if (dx == -1 && dy == 1) {
327 }
else if (dx == -1 && dy == 0) {
329 }
else if (dx == -1 && dy == -1) {
346 System.err.println(
"Error: got unexpected comc command #"+packetNo);
350 System.err.println(
"Warning: got out of order comc command #"+packetNo);