diff --git a/packages/bridge-server/src/races/races.service.ts b/packages/bridge-server/src/races/races.service.ts index 793281a..4d2e763 100644 --- a/packages/bridge-server/src/races/races.service.ts +++ b/packages/bridge-server/src/races/races.service.ts @@ -5,6 +5,7 @@ import { Race } from './race.model'; import { RaceResult } from 'src/race-results/race-result.model'; import { Season } from 'src/seasons/season.model'; +//https://github.com/GreepTheSheep/node-trackmania.io import * as TMIO from 'trackmania.io'; import { from } from 'rxjs'; import { Racer } from 'src/racers/racer.model'; @@ -61,7 +62,7 @@ export class RacesService { const transactionHost = { transaction: t }; await this.raceModel.create({ mapName: mapDetails.name, - mapURL: "", + mapURL: mapDetails.fileUrl, mapUID: mapUID, mapImgUrl: mapDetails.thumbnailUrl, authorTime: mapDetails.authorScore, diff --git a/packages/bridge-server/src/upload/upload.service.ts b/packages/bridge-server/src/upload/upload.service.ts index 78b20f6..af5f2a6 100644 --- a/packages/bridge-server/src/upload/upload.service.ts +++ b/packages/bridge-server/src/upload/upload.service.ts @@ -49,6 +49,11 @@ export class UploadService { return; } + if(Date.now() < race.startDate.getTime()) { + console.log("Too Soon!") + return; + } + let result = await this.raceResultsService.create(race.id, currentRacer.id, replay.bestTime, file.path); console.log(result); diff --git a/packages/bridge-ui/src/app/components/race-details/race-details.component.html b/packages/bridge-ui/src/app/components/race-details/race-details.component.html index 8131882..751c34e 100644 --- a/packages/bridge-ui/src/app/components/race-details/race-details.component.html +++ b/packages/bridge-ui/src/app/components/race-details/race-details.component.html @@ -3,6 +3,10 @@

{{race.mapName}}

+ + download + Download map +

Author Time: {{formatMilliseconds(race.authorTime)}}

diff --git a/packages/bridge-ui/src/app/models/race.model.ts b/packages/bridge-ui/src/app/models/race.model.ts index ef2b200..bfbdf44 100644 --- a/packages/bridge-ui/src/app/models/race.model.ts +++ b/packages/bridge-ui/src/app/models/race.model.ts @@ -1,7 +1,7 @@ export class Race{ id: string = ""; mapName: string = ""; - mapUrl: string = ""; + mapURL: string = ""; mapUID: string = ""; mapImgUrl: string = ""; authorTime: number = 0; diff --git a/packages/bridge-ui/src/app/pages/getting-started/getting-started.component.html b/packages/bridge-ui/src/app/pages/getting-started/getting-started.component.html index ab3a94b..42d4c90 100644 --- a/packages/bridge-ui/src/app/pages/getting-started/getting-started.component.html +++ b/packages/bridge-ui/src/app/pages/getting-started/getting-started.component.html @@ -8,6 +8,15 @@
+

Racing

+ +

If the race you need to run is from a campign, you can tell if it is its name will be a season and a number, the easiest way to race it is by using the capmaing selector on the main menu.

+

Otherwise follow the link on the race to download the map from Trackmania.exchange. Place the map into your Documents/Trackmania/Maps/My Maps folder.

+

While in the game Select Play from the main menu then Local -> Play a Track -> My Local Tracks

+ +
+ +

Replays

+ +

To report a result you are going to need to upload your replays. At the end of a race, after you cross the finish line, you must press the Save Replay button.

+

The replays are stored in your Documents folder in Documents/Trackmania/Replays/My Replays

+

To upload a replay you need to press the large "Upload Replay" button in and attach the replay you want. It will auto detect the race its for and extract your time.

+

You can upload as many attempts as you like and it will only use you fastest one.

+
diff --git a/packages/bridge-ui/src/app/services/server-endpoint.service.ts b/packages/bridge-ui/src/app/services/server-endpoint.service.ts index 6e1110d..f367ac5 100644 --- a/packages/bridge-ui/src/app/services/server-endpoint.service.ts +++ b/packages/bridge-ui/src/app/services/server-endpoint.service.ts @@ -10,7 +10,8 @@ export class ServerEndpointService { constructor() { - this.currentHost = "172.16.40.146"; + //this.currentHost = "172.16.40.146"; + this.currentHost = "localhost"; this.currentPort = "3000"; }