try {
newpieceValue = Integer.parseInt(x.substring(6));
pieceValue = Integer.parseInt(x.substring(0,1));
pieceColor = Integer.parseInt(x.substring(1,2));
fromRank = Integer.parseInt(x.substring(2,3));
fromFile = Integer.parseInt(x.substring(3,4));
toRank = Integer.parseInt(x.substring(4,5));
toFile = Integer.parseInt(x.substring(5,6));
}
catch (Exception e) {
System.out.println("Failed to parse tokenmsg " + e);
}