aboutsummaryrefslogtreecommitdiff
path: root/webAO/packets/handlers/handleRT.ts
blob: 48c551f6c18b5e5d558e5677f94a025870128f23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { client } from "../../client";
import { initTestimonyUpdater } from "../../viewport/utils/initTestimonyUpdater";

/**
 * Handles a testimony states.
 * @param {Array} args packet arguments
 */
export const handleRT = (args: string[]) => {
  const judgeid = Number(args[2]);
  switch (args[1]) {
    case "testimony1":
      client.testimonyID = 1;
      break;
    case "testimony2":
      // Cross Examination
      client.testimonyID = 2;
      break;
    case "judgeruling":
      client.testimonyID = 3 + judgeid;
      break;
    default:
      console.warn("Invalid testimony");
  }
  initTestimonyUpdater();
};