mirror of
https://github.com/praktimarc/kst4contest.git
synced 2026-03-29 20:20:56 +02:00
fixed another bug which had been caused due to owncall is not longer in the userlist
This commit is contained in:
@@ -490,6 +490,9 @@ public class MessageBusManagementThread extends Thread {
|
|||||||
// if someone sent a message without being in the userlist (cause
|
// if someone sent a message without being in the userlist (cause
|
||||||
// on4kst missed implementing....), callsign will be marked
|
// on4kst missed implementing....), callsign will be marked
|
||||||
} else {
|
} else {
|
||||||
|
AirPlaneReflectionInfo preventNullpointerExc = new AirPlaneReflectionInfo();
|
||||||
|
preventNullpointerExc.setAirPlanesReachableCntr(0);
|
||||||
|
sender.setAirPlaneReflectInfo(preventNullpointerExc);
|
||||||
newMessage.setSender(sender); //my own call is the sender
|
newMessage.setSender(sender); //my own call is the sender
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -540,25 +543,31 @@ public class MessageBusManagementThread extends Thread {
|
|||||||
|
|
||||||
// System.out.println("message directed to: " + newMessage.getReceiver().getCallSign() + ". EQ?: " + this.client.getownChatMemberObject().getCallSign() + " sent by: " + newMessage.getSender().getCallSign().toUpperCase() + " -> EQ?: "+ this.client.getChatPreferences().getLoginCallSign().toUpperCase());
|
// System.out.println("message directed to: " + newMessage.getReceiver().getCallSign() + ". EQ?: " + this.client.getownChatMemberObject().getCallSign() + " sent by: " + newMessage.getSender().getCallSign().toUpperCase() + " -> EQ?: "+ this.client.getChatPreferences().getLoginCallSign().toUpperCase());
|
||||||
|
|
||||||
if (newMessage.getReceiver().getCallSign()
|
try {
|
||||||
.equals(this.client.getChatPreferences().getLoginCallSign())) {
|
if (newMessage.getReceiver().getCallSign()
|
||||||
|
.equals(this.client.getChatPreferences().getLoginCallSign())) {
|
||||||
|
|
||||||
this.client.getLst_toMeMessageList().add(0, newMessage);
|
this.client.getLst_toMeMessageList().add(0, newMessage);
|
||||||
|
|
||||||
System.out.println("message directed to me: " + newMessage.getReceiver().getCallSign() + ".");
|
System.out.println("message directed to me: " + newMessage.getReceiver().getCallSign() + ".");
|
||||||
|
|
||||||
} else if (newMessage.getSender().getCallSign().toUpperCase() // if you sent the message to another station, it will be sorted in to
|
} else if (newMessage.getSender().getCallSign().toUpperCase()
|
||||||
// the "to me message list" with modified messagetext, added rxers callsign
|
.equals(this.client.getChatPreferences().getLoginCallSign().toUpperCase())) {
|
||||||
.equals(this.client.getChatPreferences().getLoginCallSign().toUpperCase())) {
|
String originalMessage = newMessage.getMessageText();
|
||||||
String originalMessage = newMessage.getMessageText();
|
newMessage
|
||||||
newMessage
|
.setMessageText("(>" + newMessage.getReceiver().getCallSign() + ")" + originalMessage);
|
||||||
.setMessageText("(>" + newMessage.getReceiver().getCallSign() + ")" + originalMessage);
|
this.client.getLst_toMeMessageList().add(0, newMessage);
|
||||||
this.client.getLst_toMeMessageList().add(0, newMessage); // TODO:check
|
// if you sent the message to another station, it will be sorted in to
|
||||||
|
// the "to me message list" with modified messagetext, added rxers callsign
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
this.client.getLst_toOtherMessageList().add(0, newMessage);
|
this.client.getLst_toOtherMessageList().add(0, newMessage);
|
||||||
|
|
||||||
// System.out.println("MSGBS bgfx: tx call = " + newMessage.getSender().getCallSign() + " / rx call = " + newMessage.getReceiver().getCallSign());
|
// System.out.println("MSGBS bgfx: tx call = " + newMessage.getSender().getCallSign() + " / rx call = " + newMessage.getReceiver().getCallSign());
|
||||||
|
}
|
||||||
|
} catch (NullPointerException referenceDeletedByUserLeftChatDuringMessageprocessing) {
|
||||||
|
System.out.println("MSGBS bgfx, catched error: referenced user left the chat during messageprocessing: ");
|
||||||
|
referenceDeletedByUserLeftChatDuringMessageprocessing.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
// sdtout to me message-List
|
// sdtout to me message-List
|
||||||
@@ -613,24 +622,13 @@ public class MessageBusManagementThread extends Thread {
|
|||||||
} else {
|
} else {
|
||||||
/**
|
/**
|
||||||
* User is in the list...
|
* User is in the list...
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
this.client.getLst_chatMemberList().get(index).setFrequency(qrg);
|
this.client.getLst_chatMemberList().get(index).setFrequency(qrg);
|
||||||
System.out.println("[MSGBUSMGT:] Frequency for " + splittedMessageLine[3] + " setted: "
|
System.out.println("[MSGBUSMGT:] Frequency for " + splittedMessageLine[3] + " setted: "
|
||||||
+ locatedFrequencies);
|
+ locatedFrequencies);
|
||||||
|
|
||||||
// this.client.getLst_chatMemberList().
|
|
||||||
|
|
||||||
// ChatMember dummy = new ChatMember();
|
|
||||||
//
|
|
||||||
// dummy.setAirPlaneReflectInfo(new AirPlaneReflectionInfo()); //TODO: check if this is neccessary
|
|
||||||
// this.client.getLst_chatMemberList().add(dummy); // TODO: Bugfix for UI actualization, maybe we dont need that any more
|
|
||||||
// this.client.getLst_chatMemberList().remove(dummy);
|
|
||||||
// this.client.getLst_chatMemberList().sorted();
|
|
||||||
|
|
||||||
//
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Next: get frequency infos out of name?
|
// TODO: Next: get frequency infos out of name?
|
||||||
|
|||||||
@@ -834,31 +834,35 @@ public class Kst4ContestApplication extends Application {
|
|||||||
public ObservableValue<String> call(CellDataFeatures<ChatMessage, String> cellDataFeatures) {
|
public ObservableValue<String> call(CellDataFeatures<ChatMessage, String> cellDataFeatures) {
|
||||||
SimpleStringProperty airPlaneInfo = new SimpleStringProperty();
|
SimpleStringProperty airPlaneInfo = new SimpleStringProperty();
|
||||||
|
|
||||||
if (cellDataFeatures.getValue().getSender().getAirPlaneReflectInfo().getRisingAirplanes() == null) {
|
try {
|
||||||
airPlaneInfo.setValue("nil");
|
if (cellDataFeatures.getValue().getSender().getAirPlaneReflectInfo().getRisingAirplanes() == null) {
|
||||||
}
|
airPlaneInfo.setValue("nil");
|
||||||
|
|
||||||
else if (cellDataFeatures.getValue().getSender().getAirPlaneReflectInfo().getRisingAirplanes().size() <= 0) {
|
|
||||||
airPlaneInfo.setValue("nil");
|
|
||||||
} else {
|
|
||||||
String apInfoText = ""
|
|
||||||
+ cellDataFeatures.getValue().getSender().getAirPlaneReflectInfo().getRisingAirplanes().get(0)
|
|
||||||
.getArrivingDurationMinutes()
|
|
||||||
+ " (" + cellDataFeatures.getValue().getSender().getAirPlaneReflectInfo().getRisingAirplanes().get(0)
|
|
||||||
.getPotential()
|
|
||||||
+ "%)";
|
|
||||||
//
|
|
||||||
//
|
|
||||||
if (cellDataFeatures.getValue().getSender().getAirPlaneReflectInfo().getRisingAirplanes().size() > 1) {
|
|
||||||
apInfoText += " / "
|
|
||||||
+ cellDataFeatures.getValue().getSender().getAirPlaneReflectInfo().getRisingAirplanes().get(1)
|
|
||||||
.getArrivingDurationMinutes()
|
|
||||||
+ " (" + cellDataFeatures.getValue().getSender().getAirPlaneReflectInfo().getRisingAirplanes()
|
|
||||||
.get(1).getPotential()
|
|
||||||
+ "%)";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
airPlaneInfo.setValue(apInfoText);
|
else if (cellDataFeatures.getValue().getSender().getAirPlaneReflectInfo().getRisingAirplanes().size() <= 0) {
|
||||||
|
airPlaneInfo.setValue("nil");
|
||||||
|
} else {
|
||||||
|
String apInfoText = ""
|
||||||
|
+ cellDataFeatures.getValue().getSender().getAirPlaneReflectInfo().getRisingAirplanes().get(0)
|
||||||
|
.getArrivingDurationMinutes()
|
||||||
|
+ " (" + cellDataFeatures.getValue().getSender().getAirPlaneReflectInfo().getRisingAirplanes().get(0)
|
||||||
|
.getPotential()
|
||||||
|
+ "%)";
|
||||||
|
//
|
||||||
|
//
|
||||||
|
if (cellDataFeatures.getValue().getSender().getAirPlaneReflectInfo().getRisingAirplanes().size() > 1) {
|
||||||
|
apInfoText += " / "
|
||||||
|
+ cellDataFeatures.getValue().getSender().getAirPlaneReflectInfo().getRisingAirplanes().get(1)
|
||||||
|
.getArrivingDurationMinutes()
|
||||||
|
+ " (" + cellDataFeatures.getValue().getSender().getAirPlaneReflectInfo().getRisingAirplanes()
|
||||||
|
.get(1).getPotential()
|
||||||
|
+ "%)";
|
||||||
|
}
|
||||||
|
|
||||||
|
airPlaneInfo.setValue(apInfoText);
|
||||||
|
}
|
||||||
|
} catch (NullPointerException thereIsNoApReflectionInfo) {
|
||||||
|
//e.g. in case of mycall it´s not possible to set!
|
||||||
}
|
}
|
||||||
|
|
||||||
return airPlaneInfo;
|
return airPlaneInfo;
|
||||||
|
|||||||
Reference in New Issue
Block a user