aboutsummaryrefslogtreecommitdiff
path: root/webAO/packets/handlers/handleFM.ts
blob: 5c09bfcee655bdf9cb660f9838fbf9cca142340a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import { client } from "../../client";
import { addTrack } from "../../client/addTrack";

/**
 * Handles updated music list
 * @param {Array} args packet arguments
 */
export const handleFM = (args: string[]) => {
  client.resetMusicList();

  for (let i = 1; i < args.length - 1; i++) {
    // Check when found the song for the first time
    addTrack(args[i]);
  }
};