feat: implement train arrival/departure sequence logic and add departure beep config in client
This commit is contained in:
@@ -1764,10 +1764,11 @@ function handleTrainArrival(ws, data) {
|
||||
const trainId = data.trainId;
|
||||
const stationName = getCorrectStationName(data.stationName);
|
||||
const stationCode = data.stationCode;
|
||||
const platform = data.platform || '1';
|
||||
const lineCode = data.lineCode || 'UNK';
|
||||
const destCode = data.destCode || 'UNK';
|
||||
const nextCode = data.nextCode || 'UNK';
|
||||
const platform = data.stationPlatform || data.platform || '1';
|
||||
|
||||
const lineCode = data.lineCode || (stationCode ? stationCode.split('-')[0] : 'UNK');
|
||||
const destCode = data.destCode || getStationCodeFromName(data.destination) || 'UNK';
|
||||
const nextCode = data.nextCode || getStationCodeFromName(data.nextStation) || 'UNK';
|
||||
|
||||
const existingIndex = activeTrains.findIndex(t => t.trainId === trainId);
|
||||
const trainData = {
|
||||
@@ -1824,7 +1825,7 @@ function handleTrainDeparture(ws, data) {
|
||||
const trainId = data.trainId;
|
||||
const stationName = getCorrectStationName(data.stationName);
|
||||
const stationCode = data.stationCode;
|
||||
const beep = data.beep || 'fc1';
|
||||
const beep = data.departureBeep || data.beep || 'fc1';
|
||||
|
||||
const existingIndex = activeTrains.findIndex(t => t.trainId === trainId);
|
||||
if (existingIndex >= 0) {
|
||||
|
||||
Reference in New Issue
Block a user