-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/update pacifista endpoints (#3)
* update packages * update packages * done pacifista data module * exported services
- Loading branch information
Showing
10 changed files
with
3,180 additions
and
2,387 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...unixproductions-requests/src/lib/services/pacifista-api/core/enums/PacifistaServerType.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
export enum PacifistaServerGameMode { | ||
NEUTRAL = 'NEUTRAL', | ||
SURVIVAL = 'SURVIVAL', | ||
CREATIVE = 'CREATIVE', | ||
SKYBLOCK = 'SKYBLOCK', | ||
EVENT = 'EVENT' | ||
} | ||
|
||
export enum PacifistaServerType { | ||
HUB = 'HUB', | ||
CREATIVE = 'CREATIVE', | ||
EVENT = 'EVENT', | ||
SURVIE_ALPHA = 'SURVIE_ALPHA', | ||
SURVIE_BETA = 'SURVIE_BETA', | ||
SURVIE_RESOURCE = 'SURVIE_RESOURCE' | ||
} | ||
|
||
export function getGameModeFromPacifistaServerType(serverType: PacifistaServerType) { | ||
if (serverType === PacifistaServerType.CREATIVE) { | ||
return PacifistaServerGameMode.CREATIVE; | ||
} else if (serverType === PacifistaServerType.EVENT) { | ||
return PacifistaServerGameMode.EVENT; | ||
} else if (serverType === PacifistaServerType.SURVIE_ALPHA || serverType === PacifistaServerType.SURVIE_BETA || serverType === PacifistaServerType.SURVIE_RESOURCE) { | ||
return PacifistaServerGameMode.SURVIVAL; | ||
} else { | ||
return PacifistaServerGameMode.NEUTRAL; | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
.../src/lib/services/pacifista-api/server/players/data/dtos/PacifistaPlayerChatMessageDTO.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import {ApiDTO} from "../../../../../core/dtos/api-dto"; | ||
import {PacifistaServerType} from "../../../../core/enums/PacifistaServerType"; | ||
|
||
export class PacifistaPlayerChatMessageDTO extends ApiDTO { | ||
message?: string | ||
serverType?: PacifistaServerType | ||
isCommand?: boolean | ||
} |
10 changes: 10 additions & 0 deletions
10
...equests/src/lib/services/pacifista-api/server/players/data/dtos/PacifistaPlayerDataDTO.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import {ApiDTO} from "../../../../../core/dtos/api-dto"; | ||
|
||
export class PacifistaPlayerDataDTO extends ApiDTO { | ||
playTime?: Number | ||
lastConnection?: Date | ||
firstConnection?: Date | ||
acceptPayments?: boolean | ||
acceptTeleportation?: boolean | ||
acceptPingSoundTagMessage?: boolean | ||
} |
6 changes: 6 additions & 0 deletions
6
...ests/src/lib/services/pacifista-api/server/players/data/dtos/PacifistaPlayerSessionDTO.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import {ApiDTO} from "../../../../../core/dtos/api-dto"; | ||
|
||
export class PacifistaPlayerSessionDTO extends ApiDTO { | ||
connectedAt?: Date | ||
disconnectedAt?: Date | ||
} |
15 changes: 15 additions & 0 deletions
15
.../services/pacifista-api/server/players/data/service/PacifistaPlayerChatMessagesService.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import {CrudHttpClient} from "../../../../../core/components/requests/crud-http-client"; | ||
import {PacifistaPlayerChatMessageDTO} from "../dtos/PacifistaPlayerChatMessageDTO"; | ||
import {HttpClient} from "@angular/common/http"; | ||
import {environment} from "../../../../../../../environments/environment"; | ||
import {environmentDev} from "../../../../../../../environments/environment-dev"; | ||
|
||
export class PacifistaPlayerChatMessagesService extends CrudHttpClient<PacifistaPlayerChatMessageDTO> { | ||
constructor(protected httpClient: HttpClient, production: boolean) { | ||
super( | ||
httpClient, | ||
production ? environment.pacifistaApiUrl : environmentDev.pacifistaApiUrl, | ||
'playerdata/chatmessages' | ||
); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
.../src/lib/services/pacifista-api/server/players/data/service/PacifistaPlayerDataService.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import {CrudHttpClient} from "../../../../../core/components/requests/crud-http-client"; | ||
import {PacifistaPlayerDataDTO} from "../dtos/PacifistaPlayerDataDTO"; | ||
import {HttpClient} from "@angular/common/http"; | ||
import {environment} from "../../../../../../../environments/environment"; | ||
import {environmentDev} from "../../../../../../../environments/environment-dev"; | ||
|
||
export class PacifistaPlayerDataService extends CrudHttpClient<PacifistaPlayerDataDTO> { | ||
constructor(protected httpClient: HttpClient, production: boolean) { | ||
super( | ||
httpClient, | ||
production ? environment.pacifistaApiUrl : environmentDev.pacifistaApiUrl, | ||
'playerdata/data' | ||
); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
.../lib/services/pacifista-api/server/players/data/service/PacifistaPlayerSessionsService.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import {CrudHttpClient} from "../../../../../core/components/requests/crud-http-client"; | ||
import {PacifistaPlayerSessionDTO} from "../dtos/PacifistaPlayerSessionDTO"; | ||
import {HttpClient} from "@angular/common/http"; | ||
import {environment} from "../../../../../../../environments/environment"; | ||
import {environmentDev} from "../../../../../../../environments/environment-dev"; | ||
|
||
export class PacifistaPlayerSessionsService extends CrudHttpClient<PacifistaPlayerSessionDTO> { | ||
constructor(protected httpClient: HttpClient, production: boolean) { | ||
super( | ||
httpClient, | ||
production ? environment.pacifistaApiUrl : environmentDev.pacifistaApiUrl, | ||
'playerdata/session' | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters