This repository was archived by the owner on Aug 21, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +84
-3
lines changed
projects/funixproductions-requests
lib/services/pacifista-api/server/essentials/status Expand file tree Collapse file tree 5 files changed +84
-3
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @funixproductions/angular-core" ,
3- "version" : " 0.2.5 " ,
3+ "version" : " 0.2.6 " ,
44 "description" : " Package used in all FunixProductions Angular projects" ,
55 "scripts" : {
66 "ng" : " ng" ,
Original file line number Diff line number Diff line change 11{
22 "name" : " @funixproductions/funixproductions-requests" ,
3- "version" : " 0.2.5 " ,
3+ "version" : " 0.2.6 " ,
44 "description" : " Package used in all FunixProductions Angular projects" ,
55 "peerDependencies" : {
66 "@angular/common" : " ^17.1.0" ,
Original file line number Diff line number Diff line change 1+ export class PacifistaServerInfoDTO {
2+ onlinePlayers : number ;
3+ playerSlots : number ;
4+ servers : ServerData [ ] ;
5+
6+ constructor ( onlinePlayers : number ,
7+ playerSlots : number ,
8+ servers : ServerData [ ] ) {
9+ this . onlinePlayers = onlinePlayers ;
10+ this . playerSlots = playerSlots ;
11+ this . servers = servers ;
12+ }
13+ }
14+
15+ export class ServerData {
16+ name : string ;
17+ isOnline : boolean ;
18+ onlinePlayers : number ;
19+ playerSlots : number ;
20+ players : PacifistaServerPlayer [ ] ;
21+
22+ constructor ( name : string ,
23+ isOnline : boolean ,
24+ onlinePlayers : number ,
25+ playerSlots : number ,
26+ players : PacifistaServerPlayer [ ] ) {
27+ this . name = name ;
28+ this . isOnline = isOnline ;
29+ this . onlinePlayers = onlinePlayers ;
30+ this . playerSlots = playerSlots ;
31+ this . players = players ;
32+ }
33+ }
34+
35+ export class PacifistaServerPlayer {
36+ name : string ;
37+ uuid : string ;
38+
39+ constructor ( name : string , uuid : string ) {
40+ this . name = name ;
41+ this . uuid = uuid ;
42+ }
43+ }
Original file line number Diff line number Diff line change 1+ import { HttpClient , HttpHeaders } from "@angular/common/http" ;
2+ import { environment } from "../../../../../../../environments/environment" ;
3+ import { environmentDev } from "../../../../../../../environments/environment-dev" ;
4+ import { Observable } from "rxjs" ;
5+ import { PacifistaServerInfoDTO } from "../dtos/PacifistaServerInfoDTO" ;
6+
7+ export class PacifistaServerInfoService {
8+
9+ private readonly domain : string ;
10+ private readonly path : string = 'essentials/status' ;
11+ private readonly http : HttpClient ;
12+
13+ constructor ( httpClient : HttpClient , productionEnv : boolean ) {
14+ this . http = httpClient ;
15+
16+ if ( productionEnv ) {
17+ this . domain = environment . pacifistaApiUrl ;
18+ } else {
19+ this . domain = environmentDev . pacifistaApiUrl ;
20+ }
21+ }
22+
23+ public getStatus ( ) : Observable < PacifistaServerInfoDTO > {
24+ return this . http . get < PacifistaServerInfoDTO > ( this . domain + this . path , {
25+ headers : this . getHeaders ( )
26+ } ) ;
27+ }
28+
29+ private getHeaders ( ) : HttpHeaders {
30+ return new HttpHeaders ( {
31+ 'Content-Type' : 'application/json'
32+ } ) ;
33+ }
34+
35+ }
Original file line number Diff line number Diff line change @@ -88,4 +88,7 @@ export * from './lib/services/pacifista-api/web/user/services/PacifistaWebUserLi
8888export * from './lib/services/pacifista-api/web/vote/dtos/VoteDTO' ;
8989export * from './lib/services/pacifista-api/web/vote/dtos/VoteWebsiteDTO' ;
9090export * from './lib/services/pacifista-api/web/vote/dtos/VotesCountDTO' ;
91- export * from './lib/services/pacifista-api/web/vote/services/VoteService' ;
91+ export * from './lib/services/pacifista-api/web/vote/services/VoteService' ;
92+
93+ export * from './lib/services/pacifista-api/server/essentials/status/dtos/PacifistaServerInfoDTO' ;
94+ export * from './lib/services/pacifista-api/server/essentials/status/services/PacifistaServerInfoService' ;
You can’t perform that action at this time.
0 commit comments