Skip to content

Commit

Permalink
🚚 [feat/config] #83 move scs sdk files in lib directory
Browse files Browse the repository at this point in the history
Signed-off-by: JAGFx <contact@jagfx.fr>
  • Loading branch information
JAGFx committed Dec 30, 2021
1 parent 61f7915 commit 597f116
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 13 deletions.
File renamed without changes.
15 changes: 8 additions & 7 deletions lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
import store, { app, isDevelopment, logger, server, socket } from './store.js';
import { telemetryInterval } from './telemetry.js';
import { catchError, logIt } from './utils.js';
import sdkData from 'ets2-dashboard-lib/sdk/scs_sdk_plugin_parsed_data.json';

const postConfigRequest = (req, res) => {
saveAppConfig(req.body.data);
Expand Down Expand Up @@ -77,16 +78,16 @@ export const initSocket = () => {
logger.info('User connection', { socketId: socket.id });

if (isDevelopment()) {
const dataFileName = path.resolve(
process.cwd(),
'../../src/data/scs_sdk_plugin_parsed_data.json'
);
const data = JSON.parse(fs.readFileSync(dataFileName).toString());
//const dataFileName = path.resolve(
// process.cwd(),
// '../../src/data/scs_sdk_plugin_parsed_data.json'
//);
//const data = JSON.parse(fs.readFileSync(dataFileName).toString());
let lastGameName = null;

setInterval(() => {
socket.emit('update', data);
const currentGameName = data.game.game.name;
socket.emit('update', sdkData);
const currentGameName = sdkData.game.game.name;

if (currentGameName !== lastGameName) {
const config = JSON.parse(gameConfig(currentGameName));
Expand Down
2 changes: 1 addition & 1 deletion src/components/header/HeaderGameInformation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
</template>

<script>
import scsSDKData from '@/data/scs_sdk_plugin_parsed_data.json';
import scsSDKData from 'ets2-dashboard-lib/sdk/scs_sdk_plugin_parsed_data.json';
import TelemetryMixin from '@/mixins/TelemetryMixin';
import { app, history } from '@/utils/utils';
import * as axios from 'axios';
Expand Down
2 changes: 1 addition & 1 deletion src/store/telemetry.store.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import testData from '@/data/scs_sdk_plugin_parsed_data.json';
import testData from 'ets2-dashboard-lib/sdk/scs_sdk_plugin_parsed_data.json';
import Vue from 'vue';

export const store = Vue.observable({
Expand Down
4 changes: 1 addition & 3 deletions src/utils/_event.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@
* Time: 11:17
*/

import scsSDKData from '@/data/scs_sdk_plugin_parsed_data.json';
import scsSDKData from 'ets2-dashboard-lib/sdk/scs_sdk_plugin_parsed_data.json';
import app from '@/utils/utils';
import registeredEvents from '@/data/events.json';

export const EVT_UPDATE = 'evt-update';

export const eventNameToComponent = function (eventName) {
const splitedEvent = eventName.split(/\.|-/);
let finalStr = 'TelemetryEvent';
Expand Down
2 changes: 1 addition & 1 deletion src/utils/_splashScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Time: 21:41
*/

import testData from '@/data/scs_sdk_plugin_parsed_data.json';
import testData from 'ets2-dashboard-lib/sdk/scs_sdk_plugin_parsed_data.json';
import store from '@/store';
import { basePathHost, pushLog } from '@/utils/_app';
import { changeLocale, fallbackLocale } from '@/utils/_i18n';
Expand Down

0 comments on commit 597f116

Please sign in to comment.