Added logging and rollback support for double sided signs
This commit is contained in:
parent
7e97e12969
commit
4e43a42662
25 changed files with 658 additions and 107 deletions
|
|
@ -352,7 +352,7 @@ public class Queue {
|
|||
queueStandardData(consumerId, currentConsumer, new String[] { user, null }, location);
|
||||
}
|
||||
|
||||
protected static void queueSignText(String user, Location location, int action, int color, boolean glowing, String line1, String line2, String line3, String line4, int offset) {
|
||||
protected static void queueSignText(String user, Location location, int action, int color, int colorSecondary, boolean frontGlowing, boolean backGlowing, boolean isWaxed, boolean isFront, String line1, String line2, String line3, String line4, String line5, String line6, String line7, String line8, int offset) {
|
||||
/*
|
||||
if (line1.length() == 0 && line2.length() == 0 && line3.length() == 0 && line4.length() == 0) {
|
||||
return;
|
||||
|
|
@ -361,7 +361,7 @@ public class Queue {
|
|||
int currentConsumer = Consumer.currentConsumer;
|
||||
int consumerId = Consumer.newConsumerId(currentConsumer);
|
||||
addConsumer(currentConsumer, new Object[] { consumerId, Process.SIGN_TEXT, null, color, null, action, offset, null });
|
||||
Consumer.consumerSigns.get(currentConsumer).put(consumerId, new Object[] { (glowing == true ? 1 : 0), line1, line2, line3, line4 });
|
||||
Consumer.consumerSigns.get(currentConsumer).put(consumerId, new Object[] { colorSecondary, Util.getSignData(frontGlowing, backGlowing), isWaxed, isFront, line1, line2, line3, line4, line5, line6, line7, line8 });
|
||||
queueStandardData(consumerId, currentConsumer, new String[] { user, null }, location);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ class SignTextProcess {
|
|||
Map<Integer, Object[]> signs = Consumer.consumerSigns.get(processId);
|
||||
if (signs.get(id) != null) {
|
||||
Object[] SIGN_DATA = signs.get(id);
|
||||
SignTextLogger.log(preparedStmt, batchCount, user, location, action, color, (Integer) SIGN_DATA[0], (String) SIGN_DATA[1], (String) SIGN_DATA[2], (String) SIGN_DATA[3], (String) SIGN_DATA[4], forceData);
|
||||
SignTextLogger.log(preparedStmt, batchCount, user, location, action, color, (Integer) SIGN_DATA[0], (Integer) SIGN_DATA[1], (Boolean) SIGN_DATA[2], (Boolean) SIGN_DATA[3], (String) SIGN_DATA[4], (String) SIGN_DATA[5], (String) SIGN_DATA[6], (String) SIGN_DATA[7], (String) SIGN_DATA[8], (String) SIGN_DATA[9], (String) SIGN_DATA[10], (String) SIGN_DATA[11], forceData);
|
||||
signs.remove(id);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,10 +26,10 @@ class SignUpdateProcess {
|
|||
int userid = ConfigHandler.playerIdCache.get(user.toLowerCase(Locale.ROOT));
|
||||
String query = "";
|
||||
if (action == 0) {
|
||||
query = "SELECT color, data, line_1, line_2, line_3, line_4 FROM " + ConfigHandler.prefix + "sign WHERE user='" + userid + "' AND wid='" + wid + "' AND x='" + x + "' AND z='" + z + "' AND y='" + y + "' AND time < '" + time + "' ORDER BY rowid DESC LIMIT 0, 1";
|
||||
query = "SELECT color, color_secondary, data, waxed, face, line_1, line_2, line_3, line_4, line_5, line_6, line_7, line_8 FROM " + ConfigHandler.prefix + "sign WHERE user='" + userid + "' AND wid='" + wid + "' AND x='" + x + "' AND z='" + z + "' AND y='" + y + "' AND time < '" + time + "' ORDER BY rowid DESC LIMIT 0, 1";
|
||||
}
|
||||
else {
|
||||
query = "SELECT color, data, line_1, line_2, line_3, line_4 FROM " + ConfigHandler.prefix + "sign WHERE user='" + userid + "' AND wid='" + wid + "' AND x='" + x + "' AND z='" + z + "' AND y='" + y + "' AND time >= '" + time + "' ORDER BY rowid ASC LIMIT 0, 1";
|
||||
query = "SELECT color, color_secondary, data, waxed, face, line_1, line_2, line_3, line_4, line_5, line_6, line_7, line_8 FROM " + ConfigHandler.prefix + "sign WHERE user='" + userid + "' AND wid='" + wid + "' AND x='" + x + "' AND z='" + z + "' AND y='" + y + "' AND time >= '" + time + "' ORDER BY rowid ASC LIMIT 0, 1";
|
||||
}
|
||||
SignStatement.getData(statement, block, query);
|
||||
Util.updateBlock(block);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue