Skip to content

Commit b40a75a

Browse files
committed
✨ Add isPlayerOnline to CitizenServer
1 parent 6b3d1a3 commit b40a75a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/model/CitizenServer.js

+9
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,15 @@ class CitizenServer {
321321
hasTag(tag) {
322322
return this.tags.includes(tag);
323323
}
324+
325+
/** *
326+
* Get if the server has any player connected with the given name
327+
* @param {string} name Player name to check
328+
* @return {boolean} true if the server has any player connected with the given name
329+
*/
330+
isPlayerOnline(name) {
331+
return this.players.some((player) => player.name === name);
332+
}
324333
}
325334

326335
module.exports = CitizenServer;

0 commit comments

Comments
 (0)