fix naming

This commit is contained in:
SrGooglo 2025-04-02 00:32:13 +00:00
parent 493c09cab9
commit e92f8f852c
4 changed files with 28 additions and 28 deletions

View File

@ -0,0 +1,26 @@
export default class ActivityEvent {
constructor(id, payload) {
if (typeof id !== "string") {
console.error("Event id is required")
return false
}
this.id = id
this.payload = payload
this.send().catch((err) => {
console.error("Failed to send remote event >", err)
})
}
send = async () => {
app.cores.api.customRequest({
url: "/activity/client",
method: "POST",
data: {
id: this.id,
payload: this.payload,
},
})
}
}

View File

@ -1,26 +0,0 @@
export default class RemoteEvent {
constructor(id, payload) {
if (typeof id !== "string") {
console.error("Event id is required")
return false
}
this.id = id
this.payload = payload
this.send().catch((err) => {
console.error("Failed to send remote event >", err)
})
}
send = async () => {
app.cores.api.customRequest({
url: "/events/client",
method: "POST",
data: {
id: this.id,
payload: this.payload
}
})
}
}

View File

@ -1,6 +1,6 @@
import { Core } from "@ragestudio/vessel" import { Core } from "@ragestudio/vessel"
import RemoteEvent from "@classes/RemoteEvent" import ActivityEvent from "@classes/ActivityEvent"
import QueueManager from "@classes/QueueManager" import QueueManager from "@classes/QueueManager"
import TrackInstance from "./classes/TrackInstance" import TrackInstance from "./classes/TrackInstance"
//import MediaSession from "./classes/MediaSession" //import MediaSession from "./classes/MediaSession"
@ -201,7 +201,7 @@ export default class Player extends Core {
// send the event to the server // send the event to the server
if (item.manifest._id && item.manifest.service === "default") { if (item.manifest._id && item.manifest.service === "default") {
new RemoteEvent("player.play", { new ActivityEvent("player.play", {
identifier: "unique", // this must be unique to prevent duplicate events and ensure only have unique track events identifier: "unique", // this must be unique to prevent duplicate events and ensure only have unique track events
track_id: item.manifest._id, track_id: item.manifest._id,
service: item.manifest.service, service: item.manifest.service,