mirror of
https://github.com/l0k1/oprf_assets.git
synced 2026-07-14 10:09:19 +00:00
Auto-Update shared Files
damage 1.4.7->1.4.8 (BUK-M2/Nasal/damage.nas) damage 1.4.7->1.4.8 (depot/Nasal/damage.nas) damage 1.4.7->1.4.8 (fleet/Nasal/damage.nas) damage 1.4.7->1.4.8 (Frigate/Nasal/damage.nas) damage 1.4.7->1.4.8 (gci-radar/Nasal/damage.nas) damage 1.4.7->1.4.8 (groundtarget/Nasal/damage.nas) damage 1.4.7->1.4.8 (MIM-104D/Nasal/damage.nas) damage 1.4.7->1.4.8 (missile-frigate/Nasal/damage.nas) damage 1.4.7->1.4.8 (S-200/Nasal/damage.nas) damage 1.4.7->1.4.8 (S-300/Nasal/damage.nas) damage 1.4.7->1.4.8 (S-75/Nasal/damage.nas) damage 1.4.7->1.4.8 (SA-3/Nasal/damage.nas) damage 1.4.7->1.4.8 (SA-6/Nasal/damage.nas) damage 1.4.7->1.4.8 (ZSU-23/Nasal/damage.nas)
This commit is contained in:
@@ -212,6 +212,7 @@ var radar_signatures = {
|
||||
var id2warhead = [];
|
||||
var launched = {};# callsign: elapsed-sec
|
||||
var approached = {};# callsign: uniqueID
|
||||
var lastSeenTacObject = {};# tacID: last time seen
|
||||
var heavy_smoke = [61,62,63,65,92,96,97,100];
|
||||
|
||||
var k = keys(warheads);
|
||||
@@ -322,6 +323,31 @@ var DamageRecipient =
|
||||
var index = DamageRecipient.emesaryID2typeID(notification.SecondaryKind);
|
||||
var typ = id2warhead[index];
|
||||
|
||||
if (tacview_supported and tacview.starttime and (getprop("sim/multiplay/txhost") != "mpserver.opredflag.com" or m28_auto) and notification.NotificationType == "ObjectInFlightNotification") {
|
||||
# record other aircraft flares to tacview
|
||||
var wh = id2warhead[DamageRecipient.emesaryID2typeID(notification.SecondaryKind)][4];
|
||||
var tacID = left(md5(notification.Callsign~notification.UniqueIdentity~wh),6);
|
||||
var elapsed = getprop("sim/time/elapsed-sec");
|
||||
lastSeenTacObject[tacID] = elapsed;
|
||||
if (notification.Kind == 2) {
|
||||
var target = ",Color=Red";
|
||||
if (wh=="Flare") wh=wh~",Type=Flare";
|
||||
var content = sprintf("%s,T=%.6f|%.6f|%.2f|0|%.1f|%.1f,TAS=%.2f,AOA=0,Visible=1,Name=%s,%s\n",tacID,notification.Position.lon(),notification.Position.lat(),notification.Position.alt(),0,0,0,wh,target);
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
tacview.write(content);
|
||||
thread.unlock(tacview.mutexWrite);
|
||||
} else {
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
tacview.write(tacID ~ ",Visible=0"~"\n");
|
||||
tacview.write("0,Event=LeftArea|"~tacID~"|\n");
|
||||
#tacview.write("0,Event=Destroyed|"~tacID~"|\n");
|
||||
#tacview.write("-"~tacID~"\n");
|
||||
thread.unlock(tacview.mutexWrite);
|
||||
}
|
||||
}
|
||||
|
||||
if (notification.Kind == MOVE) {
|
||||
if (thrustOn or index == 93 or index == 95) {
|
||||
# visualize missile smoke trail
|
||||
@@ -332,6 +358,7 @@ var DamageRecipient =
|
||||
} elsif (index == 95) {
|
||||
smoke = 3;
|
||||
if (notification.Position.distance_to(ownPos)*M2NM > 5) {
|
||||
# Don't bother to show flares further than 5 nm
|
||||
return emesary.Transmitter.ReceiptStatus_OK;
|
||||
}
|
||||
} else {
|
||||
@@ -353,8 +380,11 @@ var DamageRecipient =
|
||||
}
|
||||
|
||||
if (tacview_supported and (getprop("sim/multiplay/txhost") != "mpserver.opredflag.com" or m28_auto)) {
|
||||
# Record armament flightpath in tacview
|
||||
if (tacview.starttime) {
|
||||
var tacID = left(md5(notification.Callsign~notification.UniqueIdentity),6);
|
||||
var elapsed = getprop("sim/time/elapsed-sec");
|
||||
lastSeenTacObject[tacID] = elapsed;
|
||||
if (notification.Kind == DESTROY) {
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
@@ -451,6 +481,7 @@ var DamageRecipient =
|
||||
}
|
||||
var callsign = processCallsign(getprop("sim/multiplay/callsign"));
|
||||
if (tacview_supported and tacview.starttime and (getprop("sim/multiplay/txhost") != "mpserver.opredflag.com" or m28_auto or notification.RemoteCallsign == callsign)) {
|
||||
# Record hits in tacview
|
||||
var node = getCallsign(notification.RemoteCallsign);
|
||||
if (notification.RemoteCallsign == callsign) node = 1;
|
||||
if (node != nil and (notification.SecondaryKind > 20 or notification.SecondaryKind < -40)) {
|
||||
@@ -1408,6 +1439,23 @@ var processCallsigns = func () {
|
||||
setprop("payload/armament/MAW-semiactive", 0);
|
||||
setprop("payload/armament/MAW-semiactive-callsign", "");
|
||||
}
|
||||
if (tacview_supported and tacview.starttime) {
|
||||
var keyss = keys(lastSeenTacObject);
|
||||
var elapsed = getprop("sim/time/elapsed-sec");
|
||||
var new_lastSeenTacObject = {};
|
||||
foreach (var key; keyss) {
|
||||
if (elapsed - lastSeenTacObject[key] > 30) {
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
tacview.write(key ~ ",Visible=0"~"\n");
|
||||
tacview.write("0,Event=LeftArea|"~key~"|\n");
|
||||
thread.unlock(tacview.mutexWrite);
|
||||
} else {
|
||||
new_lastSeenTacObject[key] = lastSeenTacObject[key];
|
||||
}
|
||||
}
|
||||
lastSeenTacObject = new_lastSeenTacObject;
|
||||
}
|
||||
|
||||
# spike handling:
|
||||
setprop("payload/armament/spike", painted);
|
||||
|
||||
@@ -212,6 +212,7 @@ var radar_signatures = {
|
||||
var id2warhead = [];
|
||||
var launched = {};# callsign: elapsed-sec
|
||||
var approached = {};# callsign: uniqueID
|
||||
var lastSeenTacObject = {};# tacID: last time seen
|
||||
var heavy_smoke = [61,62,63,65,92,96,97,100];
|
||||
|
||||
var k = keys(warheads);
|
||||
@@ -322,6 +323,31 @@ var DamageRecipient =
|
||||
var index = DamageRecipient.emesaryID2typeID(notification.SecondaryKind);
|
||||
var typ = id2warhead[index];
|
||||
|
||||
if (tacview_supported and tacview.starttime and (getprop("sim/multiplay/txhost") != "mpserver.opredflag.com" or m28_auto) and notification.NotificationType == "ObjectInFlightNotification") {
|
||||
# record other aircraft flares to tacview
|
||||
var wh = id2warhead[DamageRecipient.emesaryID2typeID(notification.SecondaryKind)][4];
|
||||
var tacID = left(md5(notification.Callsign~notification.UniqueIdentity~wh),6);
|
||||
var elapsed = getprop("sim/time/elapsed-sec");
|
||||
lastSeenTacObject[tacID] = elapsed;
|
||||
if (notification.Kind == 2) {
|
||||
var target = ",Color=Red";
|
||||
if (wh=="Flare") wh=wh~",Type=Flare";
|
||||
var content = sprintf("%s,T=%.6f|%.6f|%.2f|0|%.1f|%.1f,TAS=%.2f,AOA=0,Visible=1,Name=%s,%s\n",tacID,notification.Position.lon(),notification.Position.lat(),notification.Position.alt(),0,0,0,wh,target);
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
tacview.write(content);
|
||||
thread.unlock(tacview.mutexWrite);
|
||||
} else {
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
tacview.write(tacID ~ ",Visible=0"~"\n");
|
||||
tacview.write("0,Event=LeftArea|"~tacID~"|\n");
|
||||
#tacview.write("0,Event=Destroyed|"~tacID~"|\n");
|
||||
#tacview.write("-"~tacID~"\n");
|
||||
thread.unlock(tacview.mutexWrite);
|
||||
}
|
||||
}
|
||||
|
||||
if (notification.Kind == MOVE) {
|
||||
if (thrustOn or index == 93 or index == 95) {
|
||||
# visualize missile smoke trail
|
||||
@@ -332,6 +358,7 @@ var DamageRecipient =
|
||||
} elsif (index == 95) {
|
||||
smoke = 3;
|
||||
if (notification.Position.distance_to(ownPos)*M2NM > 5) {
|
||||
# Don't bother to show flares further than 5 nm
|
||||
return emesary.Transmitter.ReceiptStatus_OK;
|
||||
}
|
||||
} else {
|
||||
@@ -353,8 +380,11 @@ var DamageRecipient =
|
||||
}
|
||||
|
||||
if (tacview_supported and (getprop("sim/multiplay/txhost") != "mpserver.opredflag.com" or m28_auto)) {
|
||||
# Record armament flightpath in tacview
|
||||
if (tacview.starttime) {
|
||||
var tacID = left(md5(notification.Callsign~notification.UniqueIdentity),6);
|
||||
var elapsed = getprop("sim/time/elapsed-sec");
|
||||
lastSeenTacObject[tacID] = elapsed;
|
||||
if (notification.Kind == DESTROY) {
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
@@ -451,6 +481,7 @@ var DamageRecipient =
|
||||
}
|
||||
var callsign = processCallsign(getprop("sim/multiplay/callsign"));
|
||||
if (tacview_supported and tacview.starttime and (getprop("sim/multiplay/txhost") != "mpserver.opredflag.com" or m28_auto or notification.RemoteCallsign == callsign)) {
|
||||
# Record hits in tacview
|
||||
var node = getCallsign(notification.RemoteCallsign);
|
||||
if (notification.RemoteCallsign == callsign) node = 1;
|
||||
if (node != nil and (notification.SecondaryKind > 20 or notification.SecondaryKind < -40)) {
|
||||
@@ -1408,6 +1439,23 @@ var processCallsigns = func () {
|
||||
setprop("payload/armament/MAW-semiactive", 0);
|
||||
setprop("payload/armament/MAW-semiactive-callsign", "");
|
||||
}
|
||||
if (tacview_supported and tacview.starttime) {
|
||||
var keyss = keys(lastSeenTacObject);
|
||||
var elapsed = getprop("sim/time/elapsed-sec");
|
||||
var new_lastSeenTacObject = {};
|
||||
foreach (var key; keyss) {
|
||||
if (elapsed - lastSeenTacObject[key] > 30) {
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
tacview.write(key ~ ",Visible=0"~"\n");
|
||||
tacview.write("0,Event=LeftArea|"~key~"|\n");
|
||||
thread.unlock(tacview.mutexWrite);
|
||||
} else {
|
||||
new_lastSeenTacObject[key] = lastSeenTacObject[key];
|
||||
}
|
||||
}
|
||||
lastSeenTacObject = new_lastSeenTacObject;
|
||||
}
|
||||
|
||||
# spike handling:
|
||||
setprop("payload/armament/spike", painted);
|
||||
|
||||
@@ -212,6 +212,7 @@ var radar_signatures = {
|
||||
var id2warhead = [];
|
||||
var launched = {};# callsign: elapsed-sec
|
||||
var approached = {};# callsign: uniqueID
|
||||
var lastSeenTacObject = {};# tacID: last time seen
|
||||
var heavy_smoke = [61,62,63,65,92,96,97,100];
|
||||
|
||||
var k = keys(warheads);
|
||||
@@ -322,6 +323,31 @@ var DamageRecipient =
|
||||
var index = DamageRecipient.emesaryID2typeID(notification.SecondaryKind);
|
||||
var typ = id2warhead[index];
|
||||
|
||||
if (tacview_supported and tacview.starttime and (getprop("sim/multiplay/txhost") != "mpserver.opredflag.com" or m28_auto) and notification.NotificationType == "ObjectInFlightNotification") {
|
||||
# record other aircraft flares to tacview
|
||||
var wh = id2warhead[DamageRecipient.emesaryID2typeID(notification.SecondaryKind)][4];
|
||||
var tacID = left(md5(notification.Callsign~notification.UniqueIdentity~wh),6);
|
||||
var elapsed = getprop("sim/time/elapsed-sec");
|
||||
lastSeenTacObject[tacID] = elapsed;
|
||||
if (notification.Kind == 2) {
|
||||
var target = ",Color=Red";
|
||||
if (wh=="Flare") wh=wh~",Type=Flare";
|
||||
var content = sprintf("%s,T=%.6f|%.6f|%.2f|0|%.1f|%.1f,TAS=%.2f,AOA=0,Visible=1,Name=%s,%s\n",tacID,notification.Position.lon(),notification.Position.lat(),notification.Position.alt(),0,0,0,wh,target);
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
tacview.write(content);
|
||||
thread.unlock(tacview.mutexWrite);
|
||||
} else {
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
tacview.write(tacID ~ ",Visible=0"~"\n");
|
||||
tacview.write("0,Event=LeftArea|"~tacID~"|\n");
|
||||
#tacview.write("0,Event=Destroyed|"~tacID~"|\n");
|
||||
#tacview.write("-"~tacID~"\n");
|
||||
thread.unlock(tacview.mutexWrite);
|
||||
}
|
||||
}
|
||||
|
||||
if (notification.Kind == MOVE) {
|
||||
if (thrustOn or index == 93 or index == 95) {
|
||||
# visualize missile smoke trail
|
||||
@@ -332,6 +358,7 @@ var DamageRecipient =
|
||||
} elsif (index == 95) {
|
||||
smoke = 3;
|
||||
if (notification.Position.distance_to(ownPos)*M2NM > 5) {
|
||||
# Don't bother to show flares further than 5 nm
|
||||
return emesary.Transmitter.ReceiptStatus_OK;
|
||||
}
|
||||
} else {
|
||||
@@ -353,8 +380,11 @@ var DamageRecipient =
|
||||
}
|
||||
|
||||
if (tacview_supported and (getprop("sim/multiplay/txhost") != "mpserver.opredflag.com" or m28_auto)) {
|
||||
# Record armament flightpath in tacview
|
||||
if (tacview.starttime) {
|
||||
var tacID = left(md5(notification.Callsign~notification.UniqueIdentity),6);
|
||||
var elapsed = getprop("sim/time/elapsed-sec");
|
||||
lastSeenTacObject[tacID] = elapsed;
|
||||
if (notification.Kind == DESTROY) {
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
@@ -451,6 +481,7 @@ var DamageRecipient =
|
||||
}
|
||||
var callsign = processCallsign(getprop("sim/multiplay/callsign"));
|
||||
if (tacview_supported and tacview.starttime and (getprop("sim/multiplay/txhost") != "mpserver.opredflag.com" or m28_auto or notification.RemoteCallsign == callsign)) {
|
||||
# Record hits in tacview
|
||||
var node = getCallsign(notification.RemoteCallsign);
|
||||
if (notification.RemoteCallsign == callsign) node = 1;
|
||||
if (node != nil and (notification.SecondaryKind > 20 or notification.SecondaryKind < -40)) {
|
||||
@@ -1408,6 +1439,23 @@ var processCallsigns = func () {
|
||||
setprop("payload/armament/MAW-semiactive", 0);
|
||||
setprop("payload/armament/MAW-semiactive-callsign", "");
|
||||
}
|
||||
if (tacview_supported and tacview.starttime) {
|
||||
var keyss = keys(lastSeenTacObject);
|
||||
var elapsed = getprop("sim/time/elapsed-sec");
|
||||
var new_lastSeenTacObject = {};
|
||||
foreach (var key; keyss) {
|
||||
if (elapsed - lastSeenTacObject[key] > 30) {
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
tacview.write(key ~ ",Visible=0"~"\n");
|
||||
tacview.write("0,Event=LeftArea|"~key~"|\n");
|
||||
thread.unlock(tacview.mutexWrite);
|
||||
} else {
|
||||
new_lastSeenTacObject[key] = lastSeenTacObject[key];
|
||||
}
|
||||
}
|
||||
lastSeenTacObject = new_lastSeenTacObject;
|
||||
}
|
||||
|
||||
# spike handling:
|
||||
setprop("payload/armament/spike", painted);
|
||||
|
||||
@@ -212,6 +212,7 @@ var radar_signatures = {
|
||||
var id2warhead = [];
|
||||
var launched = {};# callsign: elapsed-sec
|
||||
var approached = {};# callsign: uniqueID
|
||||
var lastSeenTacObject = {};# tacID: last time seen
|
||||
var heavy_smoke = [61,62,63,65,92,96,97,100];
|
||||
|
||||
var k = keys(warheads);
|
||||
@@ -322,6 +323,31 @@ var DamageRecipient =
|
||||
var index = DamageRecipient.emesaryID2typeID(notification.SecondaryKind);
|
||||
var typ = id2warhead[index];
|
||||
|
||||
if (tacview_supported and tacview.starttime and (getprop("sim/multiplay/txhost") != "mpserver.opredflag.com" or m28_auto) and notification.NotificationType == "ObjectInFlightNotification") {
|
||||
# record other aircraft flares to tacview
|
||||
var wh = id2warhead[DamageRecipient.emesaryID2typeID(notification.SecondaryKind)][4];
|
||||
var tacID = left(md5(notification.Callsign~notification.UniqueIdentity~wh),6);
|
||||
var elapsed = getprop("sim/time/elapsed-sec");
|
||||
lastSeenTacObject[tacID] = elapsed;
|
||||
if (notification.Kind == 2) {
|
||||
var target = ",Color=Red";
|
||||
if (wh=="Flare") wh=wh~",Type=Flare";
|
||||
var content = sprintf("%s,T=%.6f|%.6f|%.2f|0|%.1f|%.1f,TAS=%.2f,AOA=0,Visible=1,Name=%s,%s\n",tacID,notification.Position.lon(),notification.Position.lat(),notification.Position.alt(),0,0,0,wh,target);
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
tacview.write(content);
|
||||
thread.unlock(tacview.mutexWrite);
|
||||
} else {
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
tacview.write(tacID ~ ",Visible=0"~"\n");
|
||||
tacview.write("0,Event=LeftArea|"~tacID~"|\n");
|
||||
#tacview.write("0,Event=Destroyed|"~tacID~"|\n");
|
||||
#tacview.write("-"~tacID~"\n");
|
||||
thread.unlock(tacview.mutexWrite);
|
||||
}
|
||||
}
|
||||
|
||||
if (notification.Kind == MOVE) {
|
||||
if (thrustOn or index == 93 or index == 95) {
|
||||
# visualize missile smoke trail
|
||||
@@ -332,6 +358,7 @@ var DamageRecipient =
|
||||
} elsif (index == 95) {
|
||||
smoke = 3;
|
||||
if (notification.Position.distance_to(ownPos)*M2NM > 5) {
|
||||
# Don't bother to show flares further than 5 nm
|
||||
return emesary.Transmitter.ReceiptStatus_OK;
|
||||
}
|
||||
} else {
|
||||
@@ -353,8 +380,11 @@ var DamageRecipient =
|
||||
}
|
||||
|
||||
if (tacview_supported and (getprop("sim/multiplay/txhost") != "mpserver.opredflag.com" or m28_auto)) {
|
||||
# Record armament flightpath in tacview
|
||||
if (tacview.starttime) {
|
||||
var tacID = left(md5(notification.Callsign~notification.UniqueIdentity),6);
|
||||
var elapsed = getprop("sim/time/elapsed-sec");
|
||||
lastSeenTacObject[tacID] = elapsed;
|
||||
if (notification.Kind == DESTROY) {
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
@@ -451,6 +481,7 @@ var DamageRecipient =
|
||||
}
|
||||
var callsign = processCallsign(getprop("sim/multiplay/callsign"));
|
||||
if (tacview_supported and tacview.starttime and (getprop("sim/multiplay/txhost") != "mpserver.opredflag.com" or m28_auto or notification.RemoteCallsign == callsign)) {
|
||||
# Record hits in tacview
|
||||
var node = getCallsign(notification.RemoteCallsign);
|
||||
if (notification.RemoteCallsign == callsign) node = 1;
|
||||
if (node != nil and (notification.SecondaryKind > 20 or notification.SecondaryKind < -40)) {
|
||||
@@ -1408,6 +1439,23 @@ var processCallsigns = func () {
|
||||
setprop("payload/armament/MAW-semiactive", 0);
|
||||
setprop("payload/armament/MAW-semiactive-callsign", "");
|
||||
}
|
||||
if (tacview_supported and tacview.starttime) {
|
||||
var keyss = keys(lastSeenTacObject);
|
||||
var elapsed = getprop("sim/time/elapsed-sec");
|
||||
var new_lastSeenTacObject = {};
|
||||
foreach (var key; keyss) {
|
||||
if (elapsed - lastSeenTacObject[key] > 30) {
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
tacview.write(key ~ ",Visible=0"~"\n");
|
||||
tacview.write("0,Event=LeftArea|"~key~"|\n");
|
||||
thread.unlock(tacview.mutexWrite);
|
||||
} else {
|
||||
new_lastSeenTacObject[key] = lastSeenTacObject[key];
|
||||
}
|
||||
}
|
||||
lastSeenTacObject = new_lastSeenTacObject;
|
||||
}
|
||||
|
||||
# spike handling:
|
||||
setprop("payload/armament/spike", painted);
|
||||
|
||||
@@ -212,6 +212,7 @@ var radar_signatures = {
|
||||
var id2warhead = [];
|
||||
var launched = {};# callsign: elapsed-sec
|
||||
var approached = {};# callsign: uniqueID
|
||||
var lastSeenTacObject = {};# tacID: last time seen
|
||||
var heavy_smoke = [61,62,63,65,92,96,97,100];
|
||||
|
||||
var k = keys(warheads);
|
||||
@@ -322,6 +323,31 @@ var DamageRecipient =
|
||||
var index = DamageRecipient.emesaryID2typeID(notification.SecondaryKind);
|
||||
var typ = id2warhead[index];
|
||||
|
||||
if (tacview_supported and tacview.starttime and (getprop("sim/multiplay/txhost") != "mpserver.opredflag.com" or m28_auto) and notification.NotificationType == "ObjectInFlightNotification") {
|
||||
# record other aircraft flares to tacview
|
||||
var wh = id2warhead[DamageRecipient.emesaryID2typeID(notification.SecondaryKind)][4];
|
||||
var tacID = left(md5(notification.Callsign~notification.UniqueIdentity~wh),6);
|
||||
var elapsed = getprop("sim/time/elapsed-sec");
|
||||
lastSeenTacObject[tacID] = elapsed;
|
||||
if (notification.Kind == 2) {
|
||||
var target = ",Color=Red";
|
||||
if (wh=="Flare") wh=wh~",Type=Flare";
|
||||
var content = sprintf("%s,T=%.6f|%.6f|%.2f|0|%.1f|%.1f,TAS=%.2f,AOA=0,Visible=1,Name=%s,%s\n",tacID,notification.Position.lon(),notification.Position.lat(),notification.Position.alt(),0,0,0,wh,target);
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
tacview.write(content);
|
||||
thread.unlock(tacview.mutexWrite);
|
||||
} else {
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
tacview.write(tacID ~ ",Visible=0"~"\n");
|
||||
tacview.write("0,Event=LeftArea|"~tacID~"|\n");
|
||||
#tacview.write("0,Event=Destroyed|"~tacID~"|\n");
|
||||
#tacview.write("-"~tacID~"\n");
|
||||
thread.unlock(tacview.mutexWrite);
|
||||
}
|
||||
}
|
||||
|
||||
if (notification.Kind == MOVE) {
|
||||
if (thrustOn or index == 93 or index == 95) {
|
||||
# visualize missile smoke trail
|
||||
@@ -332,6 +358,7 @@ var DamageRecipient =
|
||||
} elsif (index == 95) {
|
||||
smoke = 3;
|
||||
if (notification.Position.distance_to(ownPos)*M2NM > 5) {
|
||||
# Don't bother to show flares further than 5 nm
|
||||
return emesary.Transmitter.ReceiptStatus_OK;
|
||||
}
|
||||
} else {
|
||||
@@ -353,8 +380,11 @@ var DamageRecipient =
|
||||
}
|
||||
|
||||
if (tacview_supported and (getprop("sim/multiplay/txhost") != "mpserver.opredflag.com" or m28_auto)) {
|
||||
# Record armament flightpath in tacview
|
||||
if (tacview.starttime) {
|
||||
var tacID = left(md5(notification.Callsign~notification.UniqueIdentity),6);
|
||||
var elapsed = getprop("sim/time/elapsed-sec");
|
||||
lastSeenTacObject[tacID] = elapsed;
|
||||
if (notification.Kind == DESTROY) {
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
@@ -451,6 +481,7 @@ var DamageRecipient =
|
||||
}
|
||||
var callsign = processCallsign(getprop("sim/multiplay/callsign"));
|
||||
if (tacview_supported and tacview.starttime and (getprop("sim/multiplay/txhost") != "mpserver.opredflag.com" or m28_auto or notification.RemoteCallsign == callsign)) {
|
||||
# Record hits in tacview
|
||||
var node = getCallsign(notification.RemoteCallsign);
|
||||
if (notification.RemoteCallsign == callsign) node = 1;
|
||||
if (node != nil and (notification.SecondaryKind > 20 or notification.SecondaryKind < -40)) {
|
||||
@@ -1408,6 +1439,23 @@ var processCallsigns = func () {
|
||||
setprop("payload/armament/MAW-semiactive", 0);
|
||||
setprop("payload/armament/MAW-semiactive-callsign", "");
|
||||
}
|
||||
if (tacview_supported and tacview.starttime) {
|
||||
var keyss = keys(lastSeenTacObject);
|
||||
var elapsed = getprop("sim/time/elapsed-sec");
|
||||
var new_lastSeenTacObject = {};
|
||||
foreach (var key; keyss) {
|
||||
if (elapsed - lastSeenTacObject[key] > 30) {
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
tacview.write(key ~ ",Visible=0"~"\n");
|
||||
tacview.write("0,Event=LeftArea|"~key~"|\n");
|
||||
thread.unlock(tacview.mutexWrite);
|
||||
} else {
|
||||
new_lastSeenTacObject[key] = lastSeenTacObject[key];
|
||||
}
|
||||
}
|
||||
lastSeenTacObject = new_lastSeenTacObject;
|
||||
}
|
||||
|
||||
# spike handling:
|
||||
setprop("payload/armament/spike", painted);
|
||||
|
||||
@@ -212,6 +212,7 @@ var radar_signatures = {
|
||||
var id2warhead = [];
|
||||
var launched = {};# callsign: elapsed-sec
|
||||
var approached = {};# callsign: uniqueID
|
||||
var lastSeenTacObject = {};# tacID: last time seen
|
||||
var heavy_smoke = [61,62,63,65,92,96,97,100];
|
||||
|
||||
var k = keys(warheads);
|
||||
@@ -322,6 +323,31 @@ var DamageRecipient =
|
||||
var index = DamageRecipient.emesaryID2typeID(notification.SecondaryKind);
|
||||
var typ = id2warhead[index];
|
||||
|
||||
if (tacview_supported and tacview.starttime and (getprop("sim/multiplay/txhost") != "mpserver.opredflag.com" or m28_auto) and notification.NotificationType == "ObjectInFlightNotification") {
|
||||
# record other aircraft flares to tacview
|
||||
var wh = id2warhead[DamageRecipient.emesaryID2typeID(notification.SecondaryKind)][4];
|
||||
var tacID = left(md5(notification.Callsign~notification.UniqueIdentity~wh),6);
|
||||
var elapsed = getprop("sim/time/elapsed-sec");
|
||||
lastSeenTacObject[tacID] = elapsed;
|
||||
if (notification.Kind == 2) {
|
||||
var target = ",Color=Red";
|
||||
if (wh=="Flare") wh=wh~",Type=Flare";
|
||||
var content = sprintf("%s,T=%.6f|%.6f|%.2f|0|%.1f|%.1f,TAS=%.2f,AOA=0,Visible=1,Name=%s,%s\n",tacID,notification.Position.lon(),notification.Position.lat(),notification.Position.alt(),0,0,0,wh,target);
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
tacview.write(content);
|
||||
thread.unlock(tacview.mutexWrite);
|
||||
} else {
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
tacview.write(tacID ~ ",Visible=0"~"\n");
|
||||
tacview.write("0,Event=LeftArea|"~tacID~"|\n");
|
||||
#tacview.write("0,Event=Destroyed|"~tacID~"|\n");
|
||||
#tacview.write("-"~tacID~"\n");
|
||||
thread.unlock(tacview.mutexWrite);
|
||||
}
|
||||
}
|
||||
|
||||
if (notification.Kind == MOVE) {
|
||||
if (thrustOn or index == 93 or index == 95) {
|
||||
# visualize missile smoke trail
|
||||
@@ -332,6 +358,7 @@ var DamageRecipient =
|
||||
} elsif (index == 95) {
|
||||
smoke = 3;
|
||||
if (notification.Position.distance_to(ownPos)*M2NM > 5) {
|
||||
# Don't bother to show flares further than 5 nm
|
||||
return emesary.Transmitter.ReceiptStatus_OK;
|
||||
}
|
||||
} else {
|
||||
@@ -353,8 +380,11 @@ var DamageRecipient =
|
||||
}
|
||||
|
||||
if (tacview_supported and (getprop("sim/multiplay/txhost") != "mpserver.opredflag.com" or m28_auto)) {
|
||||
# Record armament flightpath in tacview
|
||||
if (tacview.starttime) {
|
||||
var tacID = left(md5(notification.Callsign~notification.UniqueIdentity),6);
|
||||
var elapsed = getprop("sim/time/elapsed-sec");
|
||||
lastSeenTacObject[tacID] = elapsed;
|
||||
if (notification.Kind == DESTROY) {
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
@@ -451,6 +481,7 @@ var DamageRecipient =
|
||||
}
|
||||
var callsign = processCallsign(getprop("sim/multiplay/callsign"));
|
||||
if (tacview_supported and tacview.starttime and (getprop("sim/multiplay/txhost") != "mpserver.opredflag.com" or m28_auto or notification.RemoteCallsign == callsign)) {
|
||||
# Record hits in tacview
|
||||
var node = getCallsign(notification.RemoteCallsign);
|
||||
if (notification.RemoteCallsign == callsign) node = 1;
|
||||
if (node != nil and (notification.SecondaryKind > 20 or notification.SecondaryKind < -40)) {
|
||||
@@ -1408,6 +1439,23 @@ var processCallsigns = func () {
|
||||
setprop("payload/armament/MAW-semiactive", 0);
|
||||
setprop("payload/armament/MAW-semiactive-callsign", "");
|
||||
}
|
||||
if (tacview_supported and tacview.starttime) {
|
||||
var keyss = keys(lastSeenTacObject);
|
||||
var elapsed = getprop("sim/time/elapsed-sec");
|
||||
var new_lastSeenTacObject = {};
|
||||
foreach (var key; keyss) {
|
||||
if (elapsed - lastSeenTacObject[key] > 30) {
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
tacview.write(key ~ ",Visible=0"~"\n");
|
||||
tacview.write("0,Event=LeftArea|"~key~"|\n");
|
||||
thread.unlock(tacview.mutexWrite);
|
||||
} else {
|
||||
new_lastSeenTacObject[key] = lastSeenTacObject[key];
|
||||
}
|
||||
}
|
||||
lastSeenTacObject = new_lastSeenTacObject;
|
||||
}
|
||||
|
||||
# spike handling:
|
||||
setprop("payload/armament/spike", painted);
|
||||
|
||||
@@ -212,6 +212,7 @@ var radar_signatures = {
|
||||
var id2warhead = [];
|
||||
var launched = {};# callsign: elapsed-sec
|
||||
var approached = {};# callsign: uniqueID
|
||||
var lastSeenTacObject = {};# tacID: last time seen
|
||||
var heavy_smoke = [61,62,63,65,92,96,97,100];
|
||||
|
||||
var k = keys(warheads);
|
||||
@@ -322,6 +323,31 @@ var DamageRecipient =
|
||||
var index = DamageRecipient.emesaryID2typeID(notification.SecondaryKind);
|
||||
var typ = id2warhead[index];
|
||||
|
||||
if (tacview_supported and tacview.starttime and (getprop("sim/multiplay/txhost") != "mpserver.opredflag.com" or m28_auto) and notification.NotificationType == "ObjectInFlightNotification") {
|
||||
# record other aircraft flares to tacview
|
||||
var wh = id2warhead[DamageRecipient.emesaryID2typeID(notification.SecondaryKind)][4];
|
||||
var tacID = left(md5(notification.Callsign~notification.UniqueIdentity~wh),6);
|
||||
var elapsed = getprop("sim/time/elapsed-sec");
|
||||
lastSeenTacObject[tacID] = elapsed;
|
||||
if (notification.Kind == 2) {
|
||||
var target = ",Color=Red";
|
||||
if (wh=="Flare") wh=wh~",Type=Flare";
|
||||
var content = sprintf("%s,T=%.6f|%.6f|%.2f|0|%.1f|%.1f,TAS=%.2f,AOA=0,Visible=1,Name=%s,%s\n",tacID,notification.Position.lon(),notification.Position.lat(),notification.Position.alt(),0,0,0,wh,target);
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
tacview.write(content);
|
||||
thread.unlock(tacview.mutexWrite);
|
||||
} else {
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
tacview.write(tacID ~ ",Visible=0"~"\n");
|
||||
tacview.write("0,Event=LeftArea|"~tacID~"|\n");
|
||||
#tacview.write("0,Event=Destroyed|"~tacID~"|\n");
|
||||
#tacview.write("-"~tacID~"\n");
|
||||
thread.unlock(tacview.mutexWrite);
|
||||
}
|
||||
}
|
||||
|
||||
if (notification.Kind == MOVE) {
|
||||
if (thrustOn or index == 93 or index == 95) {
|
||||
# visualize missile smoke trail
|
||||
@@ -332,6 +358,7 @@ var DamageRecipient =
|
||||
} elsif (index == 95) {
|
||||
smoke = 3;
|
||||
if (notification.Position.distance_to(ownPos)*M2NM > 5) {
|
||||
# Don't bother to show flares further than 5 nm
|
||||
return emesary.Transmitter.ReceiptStatus_OK;
|
||||
}
|
||||
} else {
|
||||
@@ -353,8 +380,11 @@ var DamageRecipient =
|
||||
}
|
||||
|
||||
if (tacview_supported and (getprop("sim/multiplay/txhost") != "mpserver.opredflag.com" or m28_auto)) {
|
||||
# Record armament flightpath in tacview
|
||||
if (tacview.starttime) {
|
||||
var tacID = left(md5(notification.Callsign~notification.UniqueIdentity),6);
|
||||
var elapsed = getprop("sim/time/elapsed-sec");
|
||||
lastSeenTacObject[tacID] = elapsed;
|
||||
if (notification.Kind == DESTROY) {
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
@@ -451,6 +481,7 @@ var DamageRecipient =
|
||||
}
|
||||
var callsign = processCallsign(getprop("sim/multiplay/callsign"));
|
||||
if (tacview_supported and tacview.starttime and (getprop("sim/multiplay/txhost") != "mpserver.opredflag.com" or m28_auto or notification.RemoteCallsign == callsign)) {
|
||||
# Record hits in tacview
|
||||
var node = getCallsign(notification.RemoteCallsign);
|
||||
if (notification.RemoteCallsign == callsign) node = 1;
|
||||
if (node != nil and (notification.SecondaryKind > 20 or notification.SecondaryKind < -40)) {
|
||||
@@ -1408,6 +1439,23 @@ var processCallsigns = func () {
|
||||
setprop("payload/armament/MAW-semiactive", 0);
|
||||
setprop("payload/armament/MAW-semiactive-callsign", "");
|
||||
}
|
||||
if (tacview_supported and tacview.starttime) {
|
||||
var keyss = keys(lastSeenTacObject);
|
||||
var elapsed = getprop("sim/time/elapsed-sec");
|
||||
var new_lastSeenTacObject = {};
|
||||
foreach (var key; keyss) {
|
||||
if (elapsed - lastSeenTacObject[key] > 30) {
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
tacview.write(key ~ ",Visible=0"~"\n");
|
||||
tacview.write("0,Event=LeftArea|"~key~"|\n");
|
||||
thread.unlock(tacview.mutexWrite);
|
||||
} else {
|
||||
new_lastSeenTacObject[key] = lastSeenTacObject[key];
|
||||
}
|
||||
}
|
||||
lastSeenTacObject = new_lastSeenTacObject;
|
||||
}
|
||||
|
||||
# spike handling:
|
||||
setprop("payload/armament/spike", painted);
|
||||
|
||||
@@ -212,6 +212,7 @@ var radar_signatures = {
|
||||
var id2warhead = [];
|
||||
var launched = {};# callsign: elapsed-sec
|
||||
var approached = {};# callsign: uniqueID
|
||||
var lastSeenTacObject = {};# tacID: last time seen
|
||||
var heavy_smoke = [61,62,63,65,92,96,97,100];
|
||||
|
||||
var k = keys(warheads);
|
||||
@@ -322,6 +323,31 @@ var DamageRecipient =
|
||||
var index = DamageRecipient.emesaryID2typeID(notification.SecondaryKind);
|
||||
var typ = id2warhead[index];
|
||||
|
||||
if (tacview_supported and tacview.starttime and (getprop("sim/multiplay/txhost") != "mpserver.opredflag.com" or m28_auto) and notification.NotificationType == "ObjectInFlightNotification") {
|
||||
# record other aircraft flares to tacview
|
||||
var wh = id2warhead[DamageRecipient.emesaryID2typeID(notification.SecondaryKind)][4];
|
||||
var tacID = left(md5(notification.Callsign~notification.UniqueIdentity~wh),6);
|
||||
var elapsed = getprop("sim/time/elapsed-sec");
|
||||
lastSeenTacObject[tacID] = elapsed;
|
||||
if (notification.Kind == 2) {
|
||||
var target = ",Color=Red";
|
||||
if (wh=="Flare") wh=wh~",Type=Flare";
|
||||
var content = sprintf("%s,T=%.6f|%.6f|%.2f|0|%.1f|%.1f,TAS=%.2f,AOA=0,Visible=1,Name=%s,%s\n",tacID,notification.Position.lon(),notification.Position.lat(),notification.Position.alt(),0,0,0,wh,target);
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
tacview.write(content);
|
||||
thread.unlock(tacview.mutexWrite);
|
||||
} else {
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
tacview.write(tacID ~ ",Visible=0"~"\n");
|
||||
tacview.write("0,Event=LeftArea|"~tacID~"|\n");
|
||||
#tacview.write("0,Event=Destroyed|"~tacID~"|\n");
|
||||
#tacview.write("-"~tacID~"\n");
|
||||
thread.unlock(tacview.mutexWrite);
|
||||
}
|
||||
}
|
||||
|
||||
if (notification.Kind == MOVE) {
|
||||
if (thrustOn or index == 93 or index == 95) {
|
||||
# visualize missile smoke trail
|
||||
@@ -332,6 +358,7 @@ var DamageRecipient =
|
||||
} elsif (index == 95) {
|
||||
smoke = 3;
|
||||
if (notification.Position.distance_to(ownPos)*M2NM > 5) {
|
||||
# Don't bother to show flares further than 5 nm
|
||||
return emesary.Transmitter.ReceiptStatus_OK;
|
||||
}
|
||||
} else {
|
||||
@@ -353,8 +380,11 @@ var DamageRecipient =
|
||||
}
|
||||
|
||||
if (tacview_supported and (getprop("sim/multiplay/txhost") != "mpserver.opredflag.com" or m28_auto)) {
|
||||
# Record armament flightpath in tacview
|
||||
if (tacview.starttime) {
|
||||
var tacID = left(md5(notification.Callsign~notification.UniqueIdentity),6);
|
||||
var elapsed = getprop("sim/time/elapsed-sec");
|
||||
lastSeenTacObject[tacID] = elapsed;
|
||||
if (notification.Kind == DESTROY) {
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
@@ -451,6 +481,7 @@ var DamageRecipient =
|
||||
}
|
||||
var callsign = processCallsign(getprop("sim/multiplay/callsign"));
|
||||
if (tacview_supported and tacview.starttime and (getprop("sim/multiplay/txhost") != "mpserver.opredflag.com" or m28_auto or notification.RemoteCallsign == callsign)) {
|
||||
# Record hits in tacview
|
||||
var node = getCallsign(notification.RemoteCallsign);
|
||||
if (notification.RemoteCallsign == callsign) node = 1;
|
||||
if (node != nil and (notification.SecondaryKind > 20 or notification.SecondaryKind < -40)) {
|
||||
@@ -1408,6 +1439,23 @@ var processCallsigns = func () {
|
||||
setprop("payload/armament/MAW-semiactive", 0);
|
||||
setprop("payload/armament/MAW-semiactive-callsign", "");
|
||||
}
|
||||
if (tacview_supported and tacview.starttime) {
|
||||
var keyss = keys(lastSeenTacObject);
|
||||
var elapsed = getprop("sim/time/elapsed-sec");
|
||||
var new_lastSeenTacObject = {};
|
||||
foreach (var key; keyss) {
|
||||
if (elapsed - lastSeenTacObject[key] > 30) {
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
tacview.write(key ~ ",Visible=0"~"\n");
|
||||
tacview.write("0,Event=LeftArea|"~key~"|\n");
|
||||
thread.unlock(tacview.mutexWrite);
|
||||
} else {
|
||||
new_lastSeenTacObject[key] = lastSeenTacObject[key];
|
||||
}
|
||||
}
|
||||
lastSeenTacObject = new_lastSeenTacObject;
|
||||
}
|
||||
|
||||
# spike handling:
|
||||
setprop("payload/armament/spike", painted);
|
||||
|
||||
@@ -212,6 +212,7 @@ var radar_signatures = {
|
||||
var id2warhead = [];
|
||||
var launched = {};# callsign: elapsed-sec
|
||||
var approached = {};# callsign: uniqueID
|
||||
var lastSeenTacObject = {};# tacID: last time seen
|
||||
var heavy_smoke = [61,62,63,65,92,96,97,100];
|
||||
|
||||
var k = keys(warheads);
|
||||
@@ -322,6 +323,31 @@ var DamageRecipient =
|
||||
var index = DamageRecipient.emesaryID2typeID(notification.SecondaryKind);
|
||||
var typ = id2warhead[index];
|
||||
|
||||
if (tacview_supported and tacview.starttime and (getprop("sim/multiplay/txhost") != "mpserver.opredflag.com" or m28_auto) and notification.NotificationType == "ObjectInFlightNotification") {
|
||||
# record other aircraft flares to tacview
|
||||
var wh = id2warhead[DamageRecipient.emesaryID2typeID(notification.SecondaryKind)][4];
|
||||
var tacID = left(md5(notification.Callsign~notification.UniqueIdentity~wh),6);
|
||||
var elapsed = getprop("sim/time/elapsed-sec");
|
||||
lastSeenTacObject[tacID] = elapsed;
|
||||
if (notification.Kind == 2) {
|
||||
var target = ",Color=Red";
|
||||
if (wh=="Flare") wh=wh~",Type=Flare";
|
||||
var content = sprintf("%s,T=%.6f|%.6f|%.2f|0|%.1f|%.1f,TAS=%.2f,AOA=0,Visible=1,Name=%s,%s\n",tacID,notification.Position.lon(),notification.Position.lat(),notification.Position.alt(),0,0,0,wh,target);
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
tacview.write(content);
|
||||
thread.unlock(tacview.mutexWrite);
|
||||
} else {
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
tacview.write(tacID ~ ",Visible=0"~"\n");
|
||||
tacview.write("0,Event=LeftArea|"~tacID~"|\n");
|
||||
#tacview.write("0,Event=Destroyed|"~tacID~"|\n");
|
||||
#tacview.write("-"~tacID~"\n");
|
||||
thread.unlock(tacview.mutexWrite);
|
||||
}
|
||||
}
|
||||
|
||||
if (notification.Kind == MOVE) {
|
||||
if (thrustOn or index == 93 or index == 95) {
|
||||
# visualize missile smoke trail
|
||||
@@ -332,6 +358,7 @@ var DamageRecipient =
|
||||
} elsif (index == 95) {
|
||||
smoke = 3;
|
||||
if (notification.Position.distance_to(ownPos)*M2NM > 5) {
|
||||
# Don't bother to show flares further than 5 nm
|
||||
return emesary.Transmitter.ReceiptStatus_OK;
|
||||
}
|
||||
} else {
|
||||
@@ -353,8 +380,11 @@ var DamageRecipient =
|
||||
}
|
||||
|
||||
if (tacview_supported and (getprop("sim/multiplay/txhost") != "mpserver.opredflag.com" or m28_auto)) {
|
||||
# Record armament flightpath in tacview
|
||||
if (tacview.starttime) {
|
||||
var tacID = left(md5(notification.Callsign~notification.UniqueIdentity),6);
|
||||
var elapsed = getprop("sim/time/elapsed-sec");
|
||||
lastSeenTacObject[tacID] = elapsed;
|
||||
if (notification.Kind == DESTROY) {
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
@@ -451,6 +481,7 @@ var DamageRecipient =
|
||||
}
|
||||
var callsign = processCallsign(getprop("sim/multiplay/callsign"));
|
||||
if (tacview_supported and tacview.starttime and (getprop("sim/multiplay/txhost") != "mpserver.opredflag.com" or m28_auto or notification.RemoteCallsign == callsign)) {
|
||||
# Record hits in tacview
|
||||
var node = getCallsign(notification.RemoteCallsign);
|
||||
if (notification.RemoteCallsign == callsign) node = 1;
|
||||
if (node != nil and (notification.SecondaryKind > 20 or notification.SecondaryKind < -40)) {
|
||||
@@ -1408,6 +1439,23 @@ var processCallsigns = func () {
|
||||
setprop("payload/armament/MAW-semiactive", 0);
|
||||
setprop("payload/armament/MAW-semiactive-callsign", "");
|
||||
}
|
||||
if (tacview_supported and tacview.starttime) {
|
||||
var keyss = keys(lastSeenTacObject);
|
||||
var elapsed = getprop("sim/time/elapsed-sec");
|
||||
var new_lastSeenTacObject = {};
|
||||
foreach (var key; keyss) {
|
||||
if (elapsed - lastSeenTacObject[key] > 30) {
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
tacview.write(key ~ ",Visible=0"~"\n");
|
||||
tacview.write("0,Event=LeftArea|"~key~"|\n");
|
||||
thread.unlock(tacview.mutexWrite);
|
||||
} else {
|
||||
new_lastSeenTacObject[key] = lastSeenTacObject[key];
|
||||
}
|
||||
}
|
||||
lastSeenTacObject = new_lastSeenTacObject;
|
||||
}
|
||||
|
||||
# spike handling:
|
||||
setprop("payload/armament/spike", painted);
|
||||
|
||||
@@ -212,6 +212,7 @@ var radar_signatures = {
|
||||
var id2warhead = [];
|
||||
var launched = {};# callsign: elapsed-sec
|
||||
var approached = {};# callsign: uniqueID
|
||||
var lastSeenTacObject = {};# tacID: last time seen
|
||||
var heavy_smoke = [61,62,63,65,92,96,97,100];
|
||||
|
||||
var k = keys(warheads);
|
||||
@@ -322,6 +323,31 @@ var DamageRecipient =
|
||||
var index = DamageRecipient.emesaryID2typeID(notification.SecondaryKind);
|
||||
var typ = id2warhead[index];
|
||||
|
||||
if (tacview_supported and tacview.starttime and (getprop("sim/multiplay/txhost") != "mpserver.opredflag.com" or m28_auto) and notification.NotificationType == "ObjectInFlightNotification") {
|
||||
# record other aircraft flares to tacview
|
||||
var wh = id2warhead[DamageRecipient.emesaryID2typeID(notification.SecondaryKind)][4];
|
||||
var tacID = left(md5(notification.Callsign~notification.UniqueIdentity~wh),6);
|
||||
var elapsed = getprop("sim/time/elapsed-sec");
|
||||
lastSeenTacObject[tacID] = elapsed;
|
||||
if (notification.Kind == 2) {
|
||||
var target = ",Color=Red";
|
||||
if (wh=="Flare") wh=wh~",Type=Flare";
|
||||
var content = sprintf("%s,T=%.6f|%.6f|%.2f|0|%.1f|%.1f,TAS=%.2f,AOA=0,Visible=1,Name=%s,%s\n",tacID,notification.Position.lon(),notification.Position.lat(),notification.Position.alt(),0,0,0,wh,target);
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
tacview.write(content);
|
||||
thread.unlock(tacview.mutexWrite);
|
||||
} else {
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
tacview.write(tacID ~ ",Visible=0"~"\n");
|
||||
tacview.write("0,Event=LeftArea|"~tacID~"|\n");
|
||||
#tacview.write("0,Event=Destroyed|"~tacID~"|\n");
|
||||
#tacview.write("-"~tacID~"\n");
|
||||
thread.unlock(tacview.mutexWrite);
|
||||
}
|
||||
}
|
||||
|
||||
if (notification.Kind == MOVE) {
|
||||
if (thrustOn or index == 93 or index == 95) {
|
||||
# visualize missile smoke trail
|
||||
@@ -332,6 +358,7 @@ var DamageRecipient =
|
||||
} elsif (index == 95) {
|
||||
smoke = 3;
|
||||
if (notification.Position.distance_to(ownPos)*M2NM > 5) {
|
||||
# Don't bother to show flares further than 5 nm
|
||||
return emesary.Transmitter.ReceiptStatus_OK;
|
||||
}
|
||||
} else {
|
||||
@@ -353,8 +380,11 @@ var DamageRecipient =
|
||||
}
|
||||
|
||||
if (tacview_supported and (getprop("sim/multiplay/txhost") != "mpserver.opredflag.com" or m28_auto)) {
|
||||
# Record armament flightpath in tacview
|
||||
if (tacview.starttime) {
|
||||
var tacID = left(md5(notification.Callsign~notification.UniqueIdentity),6);
|
||||
var elapsed = getprop("sim/time/elapsed-sec");
|
||||
lastSeenTacObject[tacID] = elapsed;
|
||||
if (notification.Kind == DESTROY) {
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
@@ -451,6 +481,7 @@ var DamageRecipient =
|
||||
}
|
||||
var callsign = processCallsign(getprop("sim/multiplay/callsign"));
|
||||
if (tacview_supported and tacview.starttime and (getprop("sim/multiplay/txhost") != "mpserver.opredflag.com" or m28_auto or notification.RemoteCallsign == callsign)) {
|
||||
# Record hits in tacview
|
||||
var node = getCallsign(notification.RemoteCallsign);
|
||||
if (notification.RemoteCallsign == callsign) node = 1;
|
||||
if (node != nil and (notification.SecondaryKind > 20 or notification.SecondaryKind < -40)) {
|
||||
@@ -1408,6 +1439,23 @@ var processCallsigns = func () {
|
||||
setprop("payload/armament/MAW-semiactive", 0);
|
||||
setprop("payload/armament/MAW-semiactive-callsign", "");
|
||||
}
|
||||
if (tacview_supported and tacview.starttime) {
|
||||
var keyss = keys(lastSeenTacObject);
|
||||
var elapsed = getprop("sim/time/elapsed-sec");
|
||||
var new_lastSeenTacObject = {};
|
||||
foreach (var key; keyss) {
|
||||
if (elapsed - lastSeenTacObject[key] > 30) {
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
tacview.write(key ~ ",Visible=0"~"\n");
|
||||
tacview.write("0,Event=LeftArea|"~key~"|\n");
|
||||
thread.unlock(tacview.mutexWrite);
|
||||
} else {
|
||||
new_lastSeenTacObject[key] = lastSeenTacObject[key];
|
||||
}
|
||||
}
|
||||
lastSeenTacObject = new_lastSeenTacObject;
|
||||
}
|
||||
|
||||
# spike handling:
|
||||
setprop("payload/armament/spike", painted);
|
||||
|
||||
@@ -212,6 +212,7 @@ var radar_signatures = {
|
||||
var id2warhead = [];
|
||||
var launched = {};# callsign: elapsed-sec
|
||||
var approached = {};# callsign: uniqueID
|
||||
var lastSeenTacObject = {};# tacID: last time seen
|
||||
var heavy_smoke = [61,62,63,65,92,96,97,100];
|
||||
|
||||
var k = keys(warheads);
|
||||
@@ -322,6 +323,31 @@ var DamageRecipient =
|
||||
var index = DamageRecipient.emesaryID2typeID(notification.SecondaryKind);
|
||||
var typ = id2warhead[index];
|
||||
|
||||
if (tacview_supported and tacview.starttime and (getprop("sim/multiplay/txhost") != "mpserver.opredflag.com" or m28_auto) and notification.NotificationType == "ObjectInFlightNotification") {
|
||||
# record other aircraft flares to tacview
|
||||
var wh = id2warhead[DamageRecipient.emesaryID2typeID(notification.SecondaryKind)][4];
|
||||
var tacID = left(md5(notification.Callsign~notification.UniqueIdentity~wh),6);
|
||||
var elapsed = getprop("sim/time/elapsed-sec");
|
||||
lastSeenTacObject[tacID] = elapsed;
|
||||
if (notification.Kind == 2) {
|
||||
var target = ",Color=Red";
|
||||
if (wh=="Flare") wh=wh~",Type=Flare";
|
||||
var content = sprintf("%s,T=%.6f|%.6f|%.2f|0|%.1f|%.1f,TAS=%.2f,AOA=0,Visible=1,Name=%s,%s\n",tacID,notification.Position.lon(),notification.Position.lat(),notification.Position.alt(),0,0,0,wh,target);
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
tacview.write(content);
|
||||
thread.unlock(tacview.mutexWrite);
|
||||
} else {
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
tacview.write(tacID ~ ",Visible=0"~"\n");
|
||||
tacview.write("0,Event=LeftArea|"~tacID~"|\n");
|
||||
#tacview.write("0,Event=Destroyed|"~tacID~"|\n");
|
||||
#tacview.write("-"~tacID~"\n");
|
||||
thread.unlock(tacview.mutexWrite);
|
||||
}
|
||||
}
|
||||
|
||||
if (notification.Kind == MOVE) {
|
||||
if (thrustOn or index == 93 or index == 95) {
|
||||
# visualize missile smoke trail
|
||||
@@ -332,6 +358,7 @@ var DamageRecipient =
|
||||
} elsif (index == 95) {
|
||||
smoke = 3;
|
||||
if (notification.Position.distance_to(ownPos)*M2NM > 5) {
|
||||
# Don't bother to show flares further than 5 nm
|
||||
return emesary.Transmitter.ReceiptStatus_OK;
|
||||
}
|
||||
} else {
|
||||
@@ -353,8 +380,11 @@ var DamageRecipient =
|
||||
}
|
||||
|
||||
if (tacview_supported and (getprop("sim/multiplay/txhost") != "mpserver.opredflag.com" or m28_auto)) {
|
||||
# Record armament flightpath in tacview
|
||||
if (tacview.starttime) {
|
||||
var tacID = left(md5(notification.Callsign~notification.UniqueIdentity),6);
|
||||
var elapsed = getprop("sim/time/elapsed-sec");
|
||||
lastSeenTacObject[tacID] = elapsed;
|
||||
if (notification.Kind == DESTROY) {
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
@@ -451,6 +481,7 @@ var DamageRecipient =
|
||||
}
|
||||
var callsign = processCallsign(getprop("sim/multiplay/callsign"));
|
||||
if (tacview_supported and tacview.starttime and (getprop("sim/multiplay/txhost") != "mpserver.opredflag.com" or m28_auto or notification.RemoteCallsign == callsign)) {
|
||||
# Record hits in tacview
|
||||
var node = getCallsign(notification.RemoteCallsign);
|
||||
if (notification.RemoteCallsign == callsign) node = 1;
|
||||
if (node != nil and (notification.SecondaryKind > 20 or notification.SecondaryKind < -40)) {
|
||||
@@ -1408,6 +1439,23 @@ var processCallsigns = func () {
|
||||
setprop("payload/armament/MAW-semiactive", 0);
|
||||
setprop("payload/armament/MAW-semiactive-callsign", "");
|
||||
}
|
||||
if (tacview_supported and tacview.starttime) {
|
||||
var keyss = keys(lastSeenTacObject);
|
||||
var elapsed = getprop("sim/time/elapsed-sec");
|
||||
var new_lastSeenTacObject = {};
|
||||
foreach (var key; keyss) {
|
||||
if (elapsed - lastSeenTacObject[key] > 30) {
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
tacview.write(key ~ ",Visible=0"~"\n");
|
||||
tacview.write("0,Event=LeftArea|"~key~"|\n");
|
||||
thread.unlock(tacview.mutexWrite);
|
||||
} else {
|
||||
new_lastSeenTacObject[key] = lastSeenTacObject[key];
|
||||
}
|
||||
}
|
||||
lastSeenTacObject = new_lastSeenTacObject;
|
||||
}
|
||||
|
||||
# spike handling:
|
||||
setprop("payload/armament/spike", painted);
|
||||
|
||||
@@ -212,6 +212,7 @@ var radar_signatures = {
|
||||
var id2warhead = [];
|
||||
var launched = {};# callsign: elapsed-sec
|
||||
var approached = {};# callsign: uniqueID
|
||||
var lastSeenTacObject = {};# tacID: last time seen
|
||||
var heavy_smoke = [61,62,63,65,92,96,97,100];
|
||||
|
||||
var k = keys(warheads);
|
||||
@@ -322,6 +323,31 @@ var DamageRecipient =
|
||||
var index = DamageRecipient.emesaryID2typeID(notification.SecondaryKind);
|
||||
var typ = id2warhead[index];
|
||||
|
||||
if (tacview_supported and tacview.starttime and (getprop("sim/multiplay/txhost") != "mpserver.opredflag.com" or m28_auto) and notification.NotificationType == "ObjectInFlightNotification") {
|
||||
# record other aircraft flares to tacview
|
||||
var wh = id2warhead[DamageRecipient.emesaryID2typeID(notification.SecondaryKind)][4];
|
||||
var tacID = left(md5(notification.Callsign~notification.UniqueIdentity~wh),6);
|
||||
var elapsed = getprop("sim/time/elapsed-sec");
|
||||
lastSeenTacObject[tacID] = elapsed;
|
||||
if (notification.Kind == 2) {
|
||||
var target = ",Color=Red";
|
||||
if (wh=="Flare") wh=wh~",Type=Flare";
|
||||
var content = sprintf("%s,T=%.6f|%.6f|%.2f|0|%.1f|%.1f,TAS=%.2f,AOA=0,Visible=1,Name=%s,%s\n",tacID,notification.Position.lon(),notification.Position.lat(),notification.Position.alt(),0,0,0,wh,target);
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
tacview.write(content);
|
||||
thread.unlock(tacview.mutexWrite);
|
||||
} else {
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
tacview.write(tacID ~ ",Visible=0"~"\n");
|
||||
tacview.write("0,Event=LeftArea|"~tacID~"|\n");
|
||||
#tacview.write("0,Event=Destroyed|"~tacID~"|\n");
|
||||
#tacview.write("-"~tacID~"\n");
|
||||
thread.unlock(tacview.mutexWrite);
|
||||
}
|
||||
}
|
||||
|
||||
if (notification.Kind == MOVE) {
|
||||
if (thrustOn or index == 93 or index == 95) {
|
||||
# visualize missile smoke trail
|
||||
@@ -332,6 +358,7 @@ var DamageRecipient =
|
||||
} elsif (index == 95) {
|
||||
smoke = 3;
|
||||
if (notification.Position.distance_to(ownPos)*M2NM > 5) {
|
||||
# Don't bother to show flares further than 5 nm
|
||||
return emesary.Transmitter.ReceiptStatus_OK;
|
||||
}
|
||||
} else {
|
||||
@@ -353,8 +380,11 @@ var DamageRecipient =
|
||||
}
|
||||
|
||||
if (tacview_supported and (getprop("sim/multiplay/txhost") != "mpserver.opredflag.com" or m28_auto)) {
|
||||
# Record armament flightpath in tacview
|
||||
if (tacview.starttime) {
|
||||
var tacID = left(md5(notification.Callsign~notification.UniqueIdentity),6);
|
||||
var elapsed = getprop("sim/time/elapsed-sec");
|
||||
lastSeenTacObject[tacID] = elapsed;
|
||||
if (notification.Kind == DESTROY) {
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
@@ -451,6 +481,7 @@ var DamageRecipient =
|
||||
}
|
||||
var callsign = processCallsign(getprop("sim/multiplay/callsign"));
|
||||
if (tacview_supported and tacview.starttime and (getprop("sim/multiplay/txhost") != "mpserver.opredflag.com" or m28_auto or notification.RemoteCallsign == callsign)) {
|
||||
# Record hits in tacview
|
||||
var node = getCallsign(notification.RemoteCallsign);
|
||||
if (notification.RemoteCallsign == callsign) node = 1;
|
||||
if (node != nil and (notification.SecondaryKind > 20 or notification.SecondaryKind < -40)) {
|
||||
@@ -1408,6 +1439,23 @@ var processCallsigns = func () {
|
||||
setprop("payload/armament/MAW-semiactive", 0);
|
||||
setprop("payload/armament/MAW-semiactive-callsign", "");
|
||||
}
|
||||
if (tacview_supported and tacview.starttime) {
|
||||
var keyss = keys(lastSeenTacObject);
|
||||
var elapsed = getprop("sim/time/elapsed-sec");
|
||||
var new_lastSeenTacObject = {};
|
||||
foreach (var key; keyss) {
|
||||
if (elapsed - lastSeenTacObject[key] > 30) {
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
tacview.write(key ~ ",Visible=0"~"\n");
|
||||
tacview.write("0,Event=LeftArea|"~key~"|\n");
|
||||
thread.unlock(tacview.mutexWrite);
|
||||
} else {
|
||||
new_lastSeenTacObject[key] = lastSeenTacObject[key];
|
||||
}
|
||||
}
|
||||
lastSeenTacObject = new_lastSeenTacObject;
|
||||
}
|
||||
|
||||
# spike handling:
|
||||
setprop("payload/armament/spike", painted);
|
||||
|
||||
@@ -212,6 +212,7 @@ var radar_signatures = {
|
||||
var id2warhead = [];
|
||||
var launched = {};# callsign: elapsed-sec
|
||||
var approached = {};# callsign: uniqueID
|
||||
var lastSeenTacObject = {};# tacID: last time seen
|
||||
var heavy_smoke = [61,62,63,65,92,96,97,100];
|
||||
|
||||
var k = keys(warheads);
|
||||
@@ -322,6 +323,31 @@ var DamageRecipient =
|
||||
var index = DamageRecipient.emesaryID2typeID(notification.SecondaryKind);
|
||||
var typ = id2warhead[index];
|
||||
|
||||
if (tacview_supported and tacview.starttime and (getprop("sim/multiplay/txhost") != "mpserver.opredflag.com" or m28_auto) and notification.NotificationType == "ObjectInFlightNotification") {
|
||||
# record other aircraft flares to tacview
|
||||
var wh = id2warhead[DamageRecipient.emesaryID2typeID(notification.SecondaryKind)][4];
|
||||
var tacID = left(md5(notification.Callsign~notification.UniqueIdentity~wh),6);
|
||||
var elapsed = getprop("sim/time/elapsed-sec");
|
||||
lastSeenTacObject[tacID] = elapsed;
|
||||
if (notification.Kind == 2) {
|
||||
var target = ",Color=Red";
|
||||
if (wh=="Flare") wh=wh~",Type=Flare";
|
||||
var content = sprintf("%s,T=%.6f|%.6f|%.2f|0|%.1f|%.1f,TAS=%.2f,AOA=0,Visible=1,Name=%s,%s\n",tacID,notification.Position.lon(),notification.Position.lat(),notification.Position.alt(),0,0,0,wh,target);
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
tacview.write(content);
|
||||
thread.unlock(tacview.mutexWrite);
|
||||
} else {
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
tacview.write(tacID ~ ",Visible=0"~"\n");
|
||||
tacview.write("0,Event=LeftArea|"~tacID~"|\n");
|
||||
#tacview.write("0,Event=Destroyed|"~tacID~"|\n");
|
||||
#tacview.write("-"~tacID~"\n");
|
||||
thread.unlock(tacview.mutexWrite);
|
||||
}
|
||||
}
|
||||
|
||||
if (notification.Kind == MOVE) {
|
||||
if (thrustOn or index == 93 or index == 95) {
|
||||
# visualize missile smoke trail
|
||||
@@ -332,6 +358,7 @@ var DamageRecipient =
|
||||
} elsif (index == 95) {
|
||||
smoke = 3;
|
||||
if (notification.Position.distance_to(ownPos)*M2NM > 5) {
|
||||
# Don't bother to show flares further than 5 nm
|
||||
return emesary.Transmitter.ReceiptStatus_OK;
|
||||
}
|
||||
} else {
|
||||
@@ -353,8 +380,11 @@ var DamageRecipient =
|
||||
}
|
||||
|
||||
if (tacview_supported and (getprop("sim/multiplay/txhost") != "mpserver.opredflag.com" or m28_auto)) {
|
||||
# Record armament flightpath in tacview
|
||||
if (tacview.starttime) {
|
||||
var tacID = left(md5(notification.Callsign~notification.UniqueIdentity),6);
|
||||
var elapsed = getprop("sim/time/elapsed-sec");
|
||||
lastSeenTacObject[tacID] = elapsed;
|
||||
if (notification.Kind == DESTROY) {
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
@@ -451,6 +481,7 @@ var DamageRecipient =
|
||||
}
|
||||
var callsign = processCallsign(getprop("sim/multiplay/callsign"));
|
||||
if (tacview_supported and tacview.starttime and (getprop("sim/multiplay/txhost") != "mpserver.opredflag.com" or m28_auto or notification.RemoteCallsign == callsign)) {
|
||||
# Record hits in tacview
|
||||
var node = getCallsign(notification.RemoteCallsign);
|
||||
if (notification.RemoteCallsign == callsign) node = 1;
|
||||
if (node != nil and (notification.SecondaryKind > 20 or notification.SecondaryKind < -40)) {
|
||||
@@ -1408,6 +1439,23 @@ var processCallsigns = func () {
|
||||
setprop("payload/armament/MAW-semiactive", 0);
|
||||
setprop("payload/armament/MAW-semiactive-callsign", "");
|
||||
}
|
||||
if (tacview_supported and tacview.starttime) {
|
||||
var keyss = keys(lastSeenTacObject);
|
||||
var elapsed = getprop("sim/time/elapsed-sec");
|
||||
var new_lastSeenTacObject = {};
|
||||
foreach (var key; keyss) {
|
||||
if (elapsed - lastSeenTacObject[key] > 30) {
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
tacview.write(key ~ ",Visible=0"~"\n");
|
||||
tacview.write("0,Event=LeftArea|"~key~"|\n");
|
||||
thread.unlock(tacview.mutexWrite);
|
||||
} else {
|
||||
new_lastSeenTacObject[key] = lastSeenTacObject[key];
|
||||
}
|
||||
}
|
||||
lastSeenTacObject = new_lastSeenTacObject;
|
||||
}
|
||||
|
||||
# spike handling:
|
||||
setprop("payload/armament/spike", painted);
|
||||
|
||||
@@ -212,6 +212,7 @@ var radar_signatures = {
|
||||
var id2warhead = [];
|
||||
var launched = {};# callsign: elapsed-sec
|
||||
var approached = {};# callsign: uniqueID
|
||||
var lastSeenTacObject = {};# tacID: last time seen
|
||||
var heavy_smoke = [61,62,63,65,92,96,97,100];
|
||||
|
||||
var k = keys(warheads);
|
||||
@@ -322,6 +323,31 @@ var DamageRecipient =
|
||||
var index = DamageRecipient.emesaryID2typeID(notification.SecondaryKind);
|
||||
var typ = id2warhead[index];
|
||||
|
||||
if (tacview_supported and tacview.starttime and (getprop("sim/multiplay/txhost") != "mpserver.opredflag.com" or m28_auto) and notification.NotificationType == "ObjectInFlightNotification") {
|
||||
# record other aircraft flares to tacview
|
||||
var wh = id2warhead[DamageRecipient.emesaryID2typeID(notification.SecondaryKind)][4];
|
||||
var tacID = left(md5(notification.Callsign~notification.UniqueIdentity~wh),6);
|
||||
var elapsed = getprop("sim/time/elapsed-sec");
|
||||
lastSeenTacObject[tacID] = elapsed;
|
||||
if (notification.Kind == 2) {
|
||||
var target = ",Color=Red";
|
||||
if (wh=="Flare") wh=wh~",Type=Flare";
|
||||
var content = sprintf("%s,T=%.6f|%.6f|%.2f|0|%.1f|%.1f,TAS=%.2f,AOA=0,Visible=1,Name=%s,%s\n",tacID,notification.Position.lon(),notification.Position.lat(),notification.Position.alt(),0,0,0,wh,target);
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
tacview.write(content);
|
||||
thread.unlock(tacview.mutexWrite);
|
||||
} else {
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
tacview.write(tacID ~ ",Visible=0"~"\n");
|
||||
tacview.write("0,Event=LeftArea|"~tacID~"|\n");
|
||||
#tacview.write("0,Event=Destroyed|"~tacID~"|\n");
|
||||
#tacview.write("-"~tacID~"\n");
|
||||
thread.unlock(tacview.mutexWrite);
|
||||
}
|
||||
}
|
||||
|
||||
if (notification.Kind == MOVE) {
|
||||
if (thrustOn or index == 93 or index == 95) {
|
||||
# visualize missile smoke trail
|
||||
@@ -332,6 +358,7 @@ var DamageRecipient =
|
||||
} elsif (index == 95) {
|
||||
smoke = 3;
|
||||
if (notification.Position.distance_to(ownPos)*M2NM > 5) {
|
||||
# Don't bother to show flares further than 5 nm
|
||||
return emesary.Transmitter.ReceiptStatus_OK;
|
||||
}
|
||||
} else {
|
||||
@@ -353,8 +380,11 @@ var DamageRecipient =
|
||||
}
|
||||
|
||||
if (tacview_supported and (getprop("sim/multiplay/txhost") != "mpserver.opredflag.com" or m28_auto)) {
|
||||
# Record armament flightpath in tacview
|
||||
if (tacview.starttime) {
|
||||
var tacID = left(md5(notification.Callsign~notification.UniqueIdentity),6);
|
||||
var elapsed = getprop("sim/time/elapsed-sec");
|
||||
lastSeenTacObject[tacID] = elapsed;
|
||||
if (notification.Kind == DESTROY) {
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
@@ -451,6 +481,7 @@ var DamageRecipient =
|
||||
}
|
||||
var callsign = processCallsign(getprop("sim/multiplay/callsign"));
|
||||
if (tacview_supported and tacview.starttime and (getprop("sim/multiplay/txhost") != "mpserver.opredflag.com" or m28_auto or notification.RemoteCallsign == callsign)) {
|
||||
# Record hits in tacview
|
||||
var node = getCallsign(notification.RemoteCallsign);
|
||||
if (notification.RemoteCallsign == callsign) node = 1;
|
||||
if (node != nil and (notification.SecondaryKind > 20 or notification.SecondaryKind < -40)) {
|
||||
@@ -1408,6 +1439,23 @@ var processCallsigns = func () {
|
||||
setprop("payload/armament/MAW-semiactive", 0);
|
||||
setprop("payload/armament/MAW-semiactive-callsign", "");
|
||||
}
|
||||
if (tacview_supported and tacview.starttime) {
|
||||
var keyss = keys(lastSeenTacObject);
|
||||
var elapsed = getprop("sim/time/elapsed-sec");
|
||||
var new_lastSeenTacObject = {};
|
||||
foreach (var key; keyss) {
|
||||
if (elapsed - lastSeenTacObject[key] > 30) {
|
||||
thread.lock(tacview.mutexWrite);
|
||||
tacview.write("#" ~ (systime() - tacview.starttime)~"\n");
|
||||
tacview.write(key ~ ",Visible=0"~"\n");
|
||||
tacview.write("0,Event=LeftArea|"~key~"|\n");
|
||||
thread.unlock(tacview.mutexWrite);
|
||||
} else {
|
||||
new_lastSeenTacObject[key] = lastSeenTacObject[key];
|
||||
}
|
||||
}
|
||||
lastSeenTacObject = new_lastSeenTacObject;
|
||||
}
|
||||
|
||||
# spike handling:
|
||||
setprop("payload/armament/spike", painted);
|
||||
|
||||
@@ -81,59 +81,59 @@
|
||||
],
|
||||
"damage": [
|
||||
{
|
||||
"version": "1.4.7",
|
||||
"version": "1.4.8",
|
||||
"path": "BUK-M2/Nasal/damage.nas"
|
||||
},
|
||||
{
|
||||
"version": "1.4.7",
|
||||
"version": "1.4.8",
|
||||
"path": "depot/Nasal/damage.nas"
|
||||
},
|
||||
{
|
||||
"version": "1.4.7",
|
||||
"version": "1.4.8",
|
||||
"path": "fleet/Nasal/damage.nas"
|
||||
},
|
||||
{
|
||||
"version": "1.4.7",
|
||||
"version": "1.4.8",
|
||||
"path": "Frigate/Nasal/damage.nas"
|
||||
},
|
||||
{
|
||||
"version": "1.4.7",
|
||||
"version": "1.4.8",
|
||||
"path": "gci-radar/Nasal/damage.nas"
|
||||
},
|
||||
{
|
||||
"version": "1.4.7",
|
||||
"version": "1.4.8",
|
||||
"path": "groundtarget/Nasal/damage.nas"
|
||||
},
|
||||
{
|
||||
"version": "1.4.7",
|
||||
"version": "1.4.8",
|
||||
"path": "MIM-104D/Nasal/damage.nas"
|
||||
},
|
||||
{
|
||||
"version": "1.4.7",
|
||||
"version": "1.4.8",
|
||||
"path": "missile-frigate/Nasal/damage.nas"
|
||||
},
|
||||
{
|
||||
"version": "1.4.7",
|
||||
"version": "1.4.8",
|
||||
"path": "S-200/Nasal/damage.nas"
|
||||
},
|
||||
{
|
||||
"version": "1.4.7",
|
||||
"version": "1.4.8",
|
||||
"path": "S-300/Nasal/damage.nas"
|
||||
},
|
||||
{
|
||||
"version": "1.4.7",
|
||||
"version": "1.4.8",
|
||||
"path": "S-75/Nasal/damage.nas"
|
||||
},
|
||||
{
|
||||
"version": "1.4.7",
|
||||
"version": "1.4.8",
|
||||
"path": "SA-3/Nasal/damage.nas"
|
||||
},
|
||||
{
|
||||
"version": "1.4.7",
|
||||
"version": "1.4.8",
|
||||
"path": "SA-6/Nasal/damage.nas"
|
||||
},
|
||||
{
|
||||
"version": "1.4.7",
|
||||
"version": "1.4.8",
|
||||
"path": "ZSU-23/Nasal/damage.nas"
|
||||
}
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user