minor bug fixes.
Some checks failed
🚀 Pack skyscraper8 / make-zip (push) Failing after 1m49s

This commit is contained in:
feyris-tan 2025-10-30 07:58:27 +01:00
parent 90051928eb
commit e3b125e29d
14 changed files with 115 additions and 72 deletions

View File

@ -0,0 +1,3 @@
{
"help":"https://go.microsoft.com/fwlink/?linkid=866610"
}

View File

@ -0,0 +1,7 @@
{
"profiles": {
"skyscraper8.UI.SDL2": {
"commandName": "Project"
}
}
}

View File

@ -588,11 +588,9 @@ namespace skyscraper5.Skyscraper.IO.CrazycatStreamReader
{
this.wrapped = client;
this.bufferedStream = new BufferedStream(wrapped.GetStream(), 96256);
this.packetsRemainBeforeStart = 512;
}
internal TcpClient wrapped;
internal BufferedStream bufferedStream;
private int packetsRemainBeforeStart;
public void Dispose()
{
@ -615,15 +613,6 @@ namespace skyscraper5.Skyscraper.IO.CrazycatStreamReader
internal void DropPacket(byte[] buffer, int offset, int length)
{
if (packetsRemainBeforeStart > 0)
{
if (packetsRemainBeforeStart == 512 || packetsRemainBeforeStart == 256 || packetsRemainBeforeStart == 128 || packetsRemainBeforeStart == 64 || packetsRemainBeforeStart == 32 || packetsRemainBeforeStart == 16 || packetsRemainBeforeStart == 8 || packetsRemainBeforeStart == 4 || packetsRemainBeforeStart == 2 || packetsRemainBeforeStart == 1)
{
Console.WriteLine("Waiting {0} packets before starting to send to client {1}...", packetsRemainBeforeStart, wrapped.Client.RemoteEndPoint);
}
packetsRemainBeforeStart--;
return;
}
bufferedStream?.Write(buffer, offset, length);
}
}

View File

@ -80,7 +80,15 @@ namespace skyscraper5.IO.StreamReader
public bool SetChannel(int freq, int symbrate, int pol, VITERBIRATE_TYPE fec, int lof1, int lof2, int lofsw)
{
return UnsafeStreamReaderMethods.SetChannel(freq, symbrate, pol, fec, lof1, lof2, lofsw);
try
{
return UnsafeStreamReaderMethods.SetChannel(freq, symbrate, pol, fec, lof1, lof2, lofsw);
}
catch (DivideByZeroException dvze)
{
Console.WriteLine("Mitigated Division-by-Zero bug in StreamReader.dll.");
return false;
}
}
public bool SetChannelEx(int freq, int symbrate, int pol, VITERBIRATE_TYPE fec, int lof1, int lof2, int lofsw, MOD_TYPE mod)

View File

@ -0,0 +1,15 @@
[
{
"Name": "Neues Profil",
"Projects": [
{
"Path": "IoPlugins\\skyscraper5.IO.StreamReader.RemoteStreamReaderServer\\skyscraper5.IO.StreamReader.RemoteStreamReaderServer.csproj",
"Action": "Start"
},
{
"Path": "GUIs\\skyscraper8.UI.ImGui\\skyscraper8.UI.SDL2.csproj",
"Action": "Start"
}
]
}
]

View File

@ -56,6 +56,8 @@ internal class GseReader : IMisHandler
switch (labelTypeIndicator)
{
case 0:
if (ms.GetAvailableBytes() < 6)
return;
child.Label = new _6byteLabel(ms.ReadBytes(6));
gseLength -= 6;
if (!endIndicator)
@ -63,6 +65,8 @@ internal class GseReader : IMisHandler
lastLabel = child.Label;
break;
case 1:
if (ms.GetAvailableBytes() < 3)
return;
child.Label = new _3byteLabel(ms.ReadBytes(3));
gseLength -= 3;
if (!endIndicator)
@ -150,7 +154,7 @@ internal class GseReader : IMisHandler
break;
default:
if (warnedEthertypes == null)
warnedEthertypes = new bool[0xffff];
warnedEthertypes = new bool[ushort.MaxValue];
if (!warnedEthertypes[child.ProtocolType.Value])
{
logger.WarnFormat("This GSE contains other traffic types (type 0x{0:X4}) besides IP (type 0x0800). If it's not too much trouble, please consider submitting a sample.",child.ProtocolType.Value);

View File

@ -236,7 +236,10 @@ namespace skyscraper5.Mpeg2
//Marker Flag
markerBit = (escrBinary & 0x0000000000000001) != 0;
if (!markerBit)
throw new DvbException("invalid pes packet");
{
//invalid PES
return;
}
}
if (EsRateFlag)

View File

@ -572,6 +572,12 @@ namespace skyscraper8.Skyscraper.FrequencyListGenerator
if (caps.HasFlag(Caps.SR_SIGINFO))
{
int polarity = result.SearchResult.Pol;
int freq = result.SearchResult.Freq;
bool isHighBand = freq > config.LnbType.LofSw * 1000;
bool isHorizontal = polarity == 0;
SendDiseqcCommand(isHighBand, isHorizontal);
logger.Log(PluginLogLevel.Info, string.Format("Trying to BLScanEx..."), 8);
if (!config.StreamReader.BLScanEx(result.SearchResult.Freq, 5000, result.SearchResult.Pol,
config.LnbType.Lof1 * 1000, config.LnbType.Lof2 * 1000,
@ -587,47 +593,31 @@ namespace skyscraper8.Skyscraper.FrequencyListGenerator
if (!satelliteSr.Lock)
{
logger.Log(PluginLogLevel.Info, string.Format("Trying to SetChannel..."), 8);
bool channel = config.StreamReader.SetChannel(result.SearchResult.Freq, result.SearchResult.SR, result.SearchResult.Pol, result.SearchResult.FEC, config.LnbType.Lof1 * 1000, config.LnbType.Lof2 * 1000, config.LnbType.LofSw * 1000);
if (!channel)
int attempts = (result.SearchResult.Freq / 1000).GetHighestDigit();
bool success = false;
for (int i = 0; i < attempts; i++)
{
result.State = BlindscanResultState.TuningFailed;
config.Ui.OnBlindscanLockFail(satelliteSr, result.State);
config.DataStorage.UpdateTransponderState(jobInDb, result.IsSatellite(), result.SearchResult, result.State, result.SearchResult2);
return;
}
else
{
int attempts = result.SearchResult.Freq / 1000;
attempts = attempts.GetHighestDigit();
bool sucess = false;
for (int i = 0; i < attempts; i++)
Thread.Sleep(1000);
result.State = BlindscanResultState.Retrying;
logger.Log(PluginLogLevel.Info, string.Format("Retrying BLScanEx... ({0}/{1})", i + 1, attempts + 1), 8);
bool retryResult = config.StreamReader.BLScanEx(result.SearchResult.Freq, 5000, result.SearchResult.Pol, config.LnbType.Lof1 * 1000, config.LnbType.Lof2 * 1000, config.LnbType.LofSw * 1000, 1000000, (STD_TYPE)result.SearchResult.StdType,ref satelliteSr);
if (!retryResult)
{
logger.Log(PluginLogLevel.Info, string.Format("Trying to get SignalInfo..."), 8);
bool signalInfo = config.StreamReader.SignalInfo(ref satelliteSr);
if (!signalInfo)
{
result.State = BlindscanResultState.TuningFailed;
config.DataStorage.UpdateTransponderState(jobInDb, result.IsSatellite(), result.SearchResult, result.State, result.SearchResult2);
config.Ui.OnBlindscanLockFail(satelliteSr, result.State);
}
if (!satelliteSr.Lock)
{
result.State = BlindscanResultState.NoLock;
config.DataStorage.UpdateTransponderState(jobInDb, result.IsSatellite(), result.SearchResult, result.State, result.SearchResult2);
config.Ui.OnBlindscanLockFail(satelliteSr, result.State);
}
else
{
sucess = true;
break;
}
Thread.Sleep(1000);
result.State = BlindscanResultState.BlScanFailure;
continue;
}
if (!sucess)
return;
}
if (!satelliteSr.Lock)
{
result.State = BlindscanResultState.NoLock;
continue;
}
success = true;
break;
}
config.DataStorage.UpdateTransponderState(jobInDb, result.IsSatellite(), result.SearchResult, result.State, result.SearchResult2);
if (!success)
return;
logger.Log(PluginLogLevel.Debug, "Sucessfully tuned with retries.");
}
if (caps.HasFlag(Caps.SR_MISSEL))

View File

@ -27,6 +27,7 @@ namespace skyscraper5.src.Skyscraper.FrequencyListGenerator
BlScanFailure = 108,
DataSaving = 4,
IqCollecting = 5,
IqSaving = 6
}
IqSaving = 6,
Retrying = 7
}
}

View File

@ -52,13 +52,17 @@ namespace skyscraper8.Skyscraper.FrequencyListGenerator
if (!_proxiedStreamReader.StartDvbEx(targetTuner))
return false;
if (lastDiseqcType != uint.MaxValue)
/*if (lastDiseqcType != uint.MaxValue)
{
if (!_proxiedStreamReader.SendDiSEqC(lastDiseqcType, lastDiseqcOpcode))
return false;
if (!_proxiedStreamReader.SendDiSEqC(lastDiseqcType, lastDiseqcOpcode))
}*/
if (lastDiseqcOpcode.HasFlag(DiSEqC_Opcode.DISEQC_HORIZONTAL))
{
if (!_proxiedStreamReader.StopDVB())
return false;
if (!_proxiedStreamReader.SendDiSEqC(lastDiseqcType, lastDiseqcOpcode))
if (!_proxiedStreamReader.StartDvbEx(targetTuner))
return false;
}

View File

@ -1276,14 +1276,21 @@ namespace skyscraper5.Skyscraper.Scraper.Storage.InMemory
return 0;
}
private byte[][] _tmst;
public byte[] GetTmst(ushort interactiveNetworkId)
{
throw new NotImplementedException();
if (_tmst == null)
return null;
if (_tmst[interactiveNetworkId] == null)
return null;
return _tmst[interactiveNetworkId];
}
public void InsertTmst(ushort interactiveNetworkId, byte[] modes)
{
throw new NotImplementedException();
if (_tmst == null)
_tmst = new byte[ushort.MaxValue][];
_tmst[interactiveNetworkId] = modes;
}
public void UpdateTmst(ushort interactiveNetworkId, byte[] modes)

View File

@ -78,19 +78,21 @@ namespace skyscraper5.Skyscraper.Text.Encodings
case 0xee: resultBuilder.Append('ī'); break;
case 0xf0: resultBuilder.Append('š'); break;
case 0xf1: resultBuilder.Append('ń'); break;
case 0xf2: resultBuilder.Append('ņ'); break;
case 0xf3: resultBuilder.Append('ó'); break;
case 0xf5: resultBuilder.Append('õ'); break;
case 0xf6: resultBuilder.Append('ö'); break;
case 0xf8: resultBuilder.Append('ų'); break;
case 0xf9: resultBuilder.Append('ł'); break;
case 0xfa: resultBuilder.Append('ś'); break;
case 0xfb: resultBuilder.Append('ū'); break;
case 0xfc: resultBuilder.Append('ü'); break;
case 0xfd: resultBuilder.Append('ż'); break;
case 0xfe: resultBuilder.Append('ž'); break;
case 0xff: resultBuilder.Append(''); break;
default:
throw new NotImplementedException(String.Format("0x{0:X2}", preprocessed[i]));
}
case 0xf8: resultBuilder.Append('ų'); break;
case 0xf9: resultBuilder.Append('ł'); break;
case 0xfa: resultBuilder.Append('ś'); break;
case 0xfb: resultBuilder.Append('ū'); break;
case 0xfc: resultBuilder.Append('ü'); break;
case 0xfd: resultBuilder.Append('ż'); break;
case 0xfe: resultBuilder.Append('ž'); break;
case 0xff: resultBuilder.Append(''); break;
default:
throw new NotImplementedException(String.Format("0x{0:X2}", preprocessed[i]));
}
}
return resultBuilder.ToString().ToCharArray();

View File

@ -26,6 +26,7 @@ namespace skyscraper5.Skyscraper.Text.Encodings
case 0xa2: resultBuilder.Append(''); break;
case 0xa3: resultBuilder.Append('£'); break;
case 0xa4: resultBuilder.Append('€'); break;
case 0xa8: resultBuilder.Append('¨'); break;
case 0xa9: resultBuilder.Append('©'); break;
case 0xab: resultBuilder.Append('«'); break;
case 0xad: resultBuilder.Append('\u00AD'); break;

View File

@ -32,17 +32,26 @@ namespace skyscraper5.Teletext
{
//Non-Displayable Packet Y = 26 to 31
if (ms.GetAvailableBytes() == 0)
{
Valid = false;
return;
}
DesignationCode = ms.ReadUInt8();
if (ms.GetAvailableBytes() < 39)
return;
{
Valid = false;
return;
}
CharacterCodes = ms.ReadBytes(39);
}
else
{
//Normal Packet (Y = 1 to 25)
if (ms.GetAvailableBytes() < 40)
return;
{
Valid = false;
return;
}
CharacterCodes = ms.ReadBytes(40);
}
}