@modlock/modlock 0.1.71 → 0.1.72

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -2814,7 +2814,8 @@ var StartResult = /* @__PURE__ */ createMessageType(
2814
2814
  [1, "frames", 8],
2815
2815
  [2, "damage", 8],
2816
2816
  [3, "damaged", 8],
2817
- [4, "chat", 8]
2817
+ [4, "chat", 8],
2818
+ [5, "joins", 8]
2818
2819
  ],
2819
2820
  {
2820
2821
  decode: (r, end, m) => {
@@ -2834,6 +2835,9 @@ var StartResult = /* @__PURE__ */ createMessageType(
2834
2835
  case 4:
2835
2836
  m.chat = r.bool();
2836
2837
  break;
2838
+ case 5:
2839
+ m.joins = r.bool();
2840
+ break;
2837
2841
  default:
2838
2842
  r.skip(t);
2839
2843
  }
@@ -2857,6 +2861,10 @@ var StartResult = /* @__PURE__ */ createMessageType(
2857
2861
  const v = m.chat;
2858
2862
  if (v) w.uint32(32).bool(v);
2859
2863
  }
2864
+ {
2865
+ const v = m.joins;
2866
+ if (v) w.uint32(40).bool(v);
2867
+ }
2860
2868
  }
2861
2869
  }
2862
2870
  );
@@ -4440,6 +4448,58 @@ var HitOptions = /* @__PURE__ */ createMessageType(
4440
4448
  }
4441
4449
  }
4442
4450
  );
4451
+ var KillOptions = /* @__PURE__ */ createMessageType(
4452
+ "modlock.wasm.combat.KillOptions",
4453
+ () => [
4454
+ [1, "victim", 13],
4455
+ [2, "attacker", 13, 4],
4456
+ [3, "inflictor", 13, 4],
4457
+ [4, "ability", 13, 4]
4458
+ ],
4459
+ {
4460
+ decode: (r, end, m) => {
4461
+ while (r.pos < end) {
4462
+ const t = r.tag();
4463
+ if ((t & 7) === 4) return m;
4464
+ switch (t >>> 3) {
4465
+ case 1:
4466
+ m.victim = r.uint32();
4467
+ break;
4468
+ case 2:
4469
+ m.attacker = r.uint32();
4470
+ break;
4471
+ case 3:
4472
+ m.inflictor = r.uint32();
4473
+ break;
4474
+ case 4:
4475
+ m.ability = r.uint32();
4476
+ break;
4477
+ default:
4478
+ r.skip(t);
4479
+ }
4480
+ }
4481
+ return m;
4482
+ },
4483
+ encode: (m, w) => {
4484
+ {
4485
+ const v = m.victim;
4486
+ if (v) w.uint32(8).uint32(v);
4487
+ }
4488
+ {
4489
+ const v = m.attacker;
4490
+ if (v != null) w.uint32(16).uint32(v);
4491
+ }
4492
+ {
4493
+ const v = m.inflictor;
4494
+ if (v != null) w.uint32(24).uint32(v);
4495
+ }
4496
+ {
4497
+ const v = m.ability;
4498
+ if (v != null) w.uint32(32).uint32(v);
4499
+ }
4500
+ }
4501
+ }
4502
+ );
4443
4503
  var TraceOptions = /* @__PURE__ */ createMessageType(
4444
4504
  "modlock.wasm.combat.TraceOptions",
4445
4505
  () => [
@@ -7989,6 +8049,132 @@ var ShowObjectOnlyToRequest = /* @__PURE__ */ createMessageType(
7989
8049
  );
7990
8050
 
7991
8051
  // src/wasm/players/players.pb.ts
8052
+ var DisconnectReason_Enum = /* @__PURE__ */ createEnumType(
8053
+ "modlock.wasm.players.DisconnectReason",
8054
+ [
8055
+ [0, "DISCONNECT_REASON_UNKNOWN"],
8056
+ [1, "DISCONNECT_REASON_SHUTDOWN"],
8057
+ [2, "DISCONNECT_REASON_DISCONNECT_BY_USER"],
8058
+ [3, "DISCONNECT_REASON_DISCONNECT_BY_SERVER"],
8059
+ [4, "DISCONNECT_REASON_LOST"],
8060
+ [5, "DISCONNECT_REASON_OVERFLOW"],
8061
+ [6, "DISCONNECT_REASON_STEAM_BANNED"],
8062
+ [7, "DISCONNECT_REASON_STEAM_INUSE"],
8063
+ [8, "DISCONNECT_REASON_STEAM_TICKET"],
8064
+ [9, "DISCONNECT_REASON_STEAM_LOGON"],
8065
+ [10, "DISCONNECT_REASON_STEAM_AUTHCANCELLED"],
8066
+ [11, "DISCONNECT_REASON_STEAM_AUTHALREADYUSED"],
8067
+ [12, "DISCONNECT_REASON_STEAM_AUTHINVALID"],
8068
+ [13, "DISCONNECT_REASON_STEAM_VACBANSTATE"],
8069
+ [14, "DISCONNECT_REASON_STEAM_LOGGED_IN_ELSEWHERE"],
8070
+ [15, "DISCONNECT_REASON_STEAM_VAC_CHECK_TIMEDOUT"],
8071
+ [16, "DISCONNECT_REASON_STEAM_DROPPED"],
8072
+ [17, "DISCONNECT_REASON_STEAM_OWNERSHIP"],
8073
+ [18, "DISCONNECT_REASON_SERVERINFO_OVERFLOW"],
8074
+ [19, "DISCONNECT_REASON_TICKMSG_OVERFLOW"],
8075
+ [20, "DISCONNECT_REASON_STRINGTABLEMSG_OVERFLOW"],
8076
+ [21, "DISCONNECT_REASON_DELTAENTMSG_OVERFLOW"],
8077
+ [22, "DISCONNECT_REASON_TEMPENTMSG_OVERFLOW"],
8078
+ [23, "DISCONNECT_REASON_SOUNDSMSG_OVERFLOW"],
8079
+ [24, "DISCONNECT_REASON_SNAPSHOTOVERFLOW"],
8080
+ [25, "DISCONNECT_REASON_SNAPSHOTERROR"],
8081
+ [26, "DISCONNECT_REASON_RELIABLEOVERFLOW"],
8082
+ [27, "DISCONNECT_REASON_BADDELTATICK"],
8083
+ [28, "DISCONNECT_REASON_NOMORESPLITS"],
8084
+ [29, "DISCONNECT_REASON_TIMEDOUT"],
8085
+ [30, "DISCONNECT_REASON_DISCONNECTED"],
8086
+ [31, "DISCONNECT_REASON_LEAVINGSPLIT"],
8087
+ [32, "DISCONNECT_REASON_DIFFERENTCLASSTABLES"],
8088
+ [33, "DISCONNECT_REASON_BADRELAYPASSWORD"],
8089
+ [34, "DISCONNECT_REASON_BADSPECTATORPASSWORD"],
8090
+ [35, "DISCONNECT_REASON_HLTVRESTRICTED"],
8091
+ [36, "DISCONNECT_REASON_NOSPECTATORS"],
8092
+ [37, "DISCONNECT_REASON_HLTVUNAVAILABLE"],
8093
+ [38, "DISCONNECT_REASON_HLTVSTOP"],
8094
+ [39, "DISCONNECT_REASON_KICKED"],
8095
+ [40, "DISCONNECT_REASON_BANADDED"],
8096
+ [41, "DISCONNECT_REASON_KICKBANADDED"],
8097
+ [42, "DISCONNECT_REASON_HLTVDIRECT"],
8098
+ [43, "DISCONNECT_REASON_PURESERVER_CLIENTEXTRA"],
8099
+ [44, "DISCONNECT_REASON_PURESERVER_MISMATCH"],
8100
+ [45, "DISCONNECT_REASON_USERCMD"],
8101
+ [46, "DISCONNECT_REASON_REJECTED_BY_GAME"],
8102
+ [47, "DISCONNECT_REASON_MESSAGE_PARSE_ERROR"],
8103
+ [48, "DISCONNECT_REASON_INVALID_MESSAGE_ERROR"],
8104
+ [49, "DISCONNECT_REASON_BAD_SERVER_PASSWORD"],
8105
+ [50, "DISCONNECT_REASON_DIRECT_CONNECT_RESERVATION"],
8106
+ [51, "DISCONNECT_REASON_CONNECTION_FAILURE"],
8107
+ [52, "DISCONNECT_REASON_NO_PEER_GROUP_HANDLERS"],
8108
+ [53, "DISCONNECT_REASON_RECONNECTION"],
8109
+ [54, "DISCONNECT_REASON_LOOPSHUTDOWN"],
8110
+ [55, "DISCONNECT_REASON_LOOPDEACTIVATE"],
8111
+ [56, "DISCONNECT_REASON_HOST_ENDGAME"],
8112
+ [57, "DISCONNECT_REASON_LOOP_LEVELLOAD_ACTIVATE"],
8113
+ [58, "DISCONNECT_REASON_CREATE_SERVER_FAILED"],
8114
+ [59, "DISCONNECT_REASON_EXITING"],
8115
+ [60, "DISCONNECT_REASON_REQUEST_HOSTSTATE_IDLE"],
8116
+ [61, "DISCONNECT_REASON_REQUEST_HOSTSTATE_HLTVRELAY"],
8117
+ [62, "DISCONNECT_REASON_CLIENT_CONSISTENCY_FAIL"],
8118
+ [63, "DISCONNECT_REASON_CLIENT_UNABLE_TO_CRC_MAP"],
8119
+ [64, "DISCONNECT_REASON_CLIENT_NO_MAP"],
8120
+ [65, "DISCONNECT_REASON_CLIENT_DIFFERENT_MAP"],
8121
+ [66, "DISCONNECT_REASON_SERVER_REQUIRES_STEAM"],
8122
+ [67, "DISCONNECT_REASON_STEAM_DENY_MISC"],
8123
+ [68, "DISCONNECT_REASON_STEAM_DENY_BAD_ANTI_CHEAT"],
8124
+ [69, "DISCONNECT_REASON_SERVER_SHUTDOWN"],
8125
+ [71, "DISCONNECT_REASON_REPLAY_INCOMPATIBLE"],
8126
+ [72, "DISCONNECT_REASON_CONNECT_REQUEST_TIMEDOUT"],
8127
+ [73, "DISCONNECT_REASON_SERVER_INCOMPATIBLE"],
8128
+ [74, "DISCONNECT_REASON_LOCALPROBLEM_MANYRELAYS"],
8129
+ [75, "DISCONNECT_REASON_LOCALPROBLEM_HOSTEDSERVERPRIMARYRELAY"],
8130
+ [76, "DISCONNECT_REASON_LOCALPROBLEM_NETWORKCONFIG"],
8131
+ [77, "DISCONNECT_REASON_LOCALPROBLEM_OTHER"],
8132
+ [79, "DISCONNECT_REASON_REMOTE_TIMEOUT"],
8133
+ [80, "DISCONNECT_REASON_REMOTE_TIMEOUT_CONNECTING"],
8134
+ [81, "DISCONNECT_REASON_REMOTE_OTHER"],
8135
+ [82, "DISCONNECT_REASON_REMOTE_BADCRYPT"],
8136
+ [83, "DISCONNECT_REASON_REMOTE_CERTNOTTRUSTED"],
8137
+ [84, "DISCONNECT_REASON_UNUSUAL"],
8138
+ [85, "DISCONNECT_REASON_INTERNAL_ERROR"],
8139
+ [128, "DISCONNECT_REASON_REJECT_BADCHALLENGE"],
8140
+ [129, "DISCONNECT_REASON_REJECT_NOLOBBY"],
8141
+ [130, "DISCONNECT_REASON_REJECT_BACKGROUND_MAP"],
8142
+ [131, "DISCONNECT_REASON_REJECT_SINGLE_PLAYER"],
8143
+ [132, "DISCONNECT_REASON_REJECT_HIDDEN_GAME"],
8144
+ [133, "DISCONNECT_REASON_REJECT_LANRESTRICT"],
8145
+ [134, "DISCONNECT_REASON_REJECT_BADPASSWORD"],
8146
+ [135, "DISCONNECT_REASON_REJECT_SERVERFULL"],
8147
+ [136, "DISCONNECT_REASON_REJECT_INVALIDRESERVATION"],
8148
+ [137, "DISCONNECT_REASON_REJECT_FAILEDCHANNEL"],
8149
+ [138, "DISCONNECT_REASON_REJECT_CONNECT_FROM_LOBBY"],
8150
+ [139, "DISCONNECT_REASON_REJECT_RESERVED_FOR_LOBBY"],
8151
+ [140, "DISCONNECT_REASON_REJECT_INVALIDKEYLENGTH"],
8152
+ [141, "DISCONNECT_REASON_REJECT_OLDPROTOCOL"],
8153
+ [142, "DISCONNECT_REASON_REJECT_NEWPROTOCOL"],
8154
+ [143, "DISCONNECT_REASON_REJECT_INVALIDCONNECTION"],
8155
+ [144, "DISCONNECT_REASON_REJECT_INVALIDCERTLEN"],
8156
+ [145, "DISCONNECT_REASON_REJECT_INVALIDSTEAMCERTLEN"],
8157
+ [146, "DISCONNECT_REASON_REJECT_STEAM"],
8158
+ [147, "DISCONNECT_REASON_REJECT_SERVERAUTHDISABLED"],
8159
+ [148, "DISCONNECT_REASON_REJECT_SERVERCDKEYAUTHINVALID"],
8160
+ [149, "DISCONNECT_REASON_REJECT_BANNED"],
8161
+ [150, "DISCONNECT_REASON_KICKED_TEAMKILLING"],
8162
+ [151, "DISCONNECT_REASON_KICKED_TK_START"],
8163
+ [152, "DISCONNECT_REASON_KICKED_UNTRUSTEDACCOUNT"],
8164
+ [153, "DISCONNECT_REASON_KICKED_CONVICTEDACCOUNT"],
8165
+ [154, "DISCONNECT_REASON_KICKED_COMPETITIVECOOLDOWN"],
8166
+ [155, "DISCONNECT_REASON_KICKED_TEAMHURTING"],
8167
+ [156, "DISCONNECT_REASON_KICKED_HOSTAGEKILLING"],
8168
+ [157, "DISCONNECT_REASON_KICKED_VOTEDOFF"],
8169
+ [158, "DISCONNECT_REASON_KICKED_IDLE"],
8170
+ [159, "DISCONNECT_REASON_KICKED_SUICIDE"],
8171
+ [160, "DISCONNECT_REASON_KICKED_NOSTEAMLOGIN"],
8172
+ [161, "DISCONNECT_REASON_KICKED_NOSTEAMTICKET"],
8173
+ [162, "DISCONNECT_REASON_KICKED_INPUTAUTOMATION"],
8174
+ [163, "DISCONNECT_REASON_KICKED_VACNETABNORMALBEHAVIOR"],
8175
+ [164, "DISCONNECT_REASON_KICKED_INSECURECLIENT"]
8176
+ ]
8177
+ );
7992
8178
  var ModRole_Enum = /* @__PURE__ */ createEnumType(
7993
8179
  "modlock.wasm.players.ModRole",
7994
8180
  [
@@ -8070,6 +8256,84 @@ var PlayersChangedEvent = /* @__PURE__ */ createMessageType(
8070
8256
  }
8071
8257
  }
8072
8258
  );
8259
+ var PlayerJoinedEvent = /* @__PURE__ */ createMessageType(
8260
+ "modlock.wasm.players.PlayerJoinedEvent",
8261
+ () => [[1, "connection", 11, 0, Connection.codec]],
8262
+ {
8263
+ decode: (r, end, m) => {
8264
+ while (r.pos < end) {
8265
+ const t = r.tag();
8266
+ if ((t & 7) === 4) return m;
8267
+ switch (t >>> 3) {
8268
+ case 1:
8269
+ m.connection = Connection.decode(
8270
+ r,
8271
+ r.delimited(),
8272
+ m.connection ?? {}
8273
+ );
8274
+ break;
8275
+ default:
8276
+ r.skip(t);
8277
+ }
8278
+ }
8279
+ return m;
8280
+ },
8281
+ encode: (m, w) => {
8282
+ {
8283
+ const v = m.connection;
8284
+ if (v != null) Connection.writeField(w, 1, v);
8285
+ }
8286
+ }
8287
+ }
8288
+ );
8289
+ var PlayerLeftEvent = /* @__PURE__ */ createMessageType(
8290
+ "modlock.wasm.players.PlayerLeftEvent",
8291
+ () => [
8292
+ [1, "connection", 11, 0, Connection.codec],
8293
+ [2, "disconnected", 8],
8294
+ [3, "reason", 14, 4, DisconnectReason_Enum]
8295
+ ],
8296
+ {
8297
+ decode: (r, end, m) => {
8298
+ while (r.pos < end) {
8299
+ const t = r.tag();
8300
+ if ((t & 7) === 4) return m;
8301
+ switch (t >>> 3) {
8302
+ case 1:
8303
+ m.connection = Connection.decode(
8304
+ r,
8305
+ r.delimited(),
8306
+ m.connection ?? {}
8307
+ );
8308
+ break;
8309
+ case 2:
8310
+ m.disconnected = r.bool();
8311
+ break;
8312
+ case 3:
8313
+ m.reason = r.int32();
8314
+ break;
8315
+ default:
8316
+ r.skip(t);
8317
+ }
8318
+ }
8319
+ return m;
8320
+ },
8321
+ encode: (m, w) => {
8322
+ {
8323
+ const v = m.connection;
8324
+ if (v != null) Connection.writeField(w, 1, v);
8325
+ }
8326
+ {
8327
+ const v = m.disconnected;
8328
+ if (v) w.uint32(16).bool(v);
8329
+ }
8330
+ {
8331
+ const v = m.reason;
8332
+ if (v != null) w.uint32(24).int32(v);
8333
+ }
8334
+ }
8335
+ }
8336
+ );
8073
8337
  var PlayerRequest = /* @__PURE__ */ createMessageType(
8074
8338
  "modlock.wasm.players.PlayerRequest",
8075
8339
  () => [[1, "player", 5]],
@@ -11451,7 +11715,8 @@ var Change = /* @__PURE__ */ createMessageType(
11451
11715
  () => [
11452
11716
  [1, "reset", 8],
11453
11717
  [2, "set", 11, 1, Node.codec],
11454
- [3, "removed", 9, 1]
11718
+ [3, "removed", 9, 1],
11719
+ [4, "generation", 4]
11455
11720
  ],
11456
11721
  {
11457
11722
  decode: (r, end, m) => {
@@ -11470,6 +11735,9 @@ var Change = /* @__PURE__ */ createMessageType(
11470
11735
  ;
11471
11736
  (m.removed ??= []).push(r.string());
11472
11737
  break;
11738
+ case 4:
11739
+ m.generation = r.uint64();
11740
+ break;
11473
11741
  default:
11474
11742
  r.skip(t);
11475
11743
  }
@@ -11489,6 +11757,10 @@ var Change = /* @__PURE__ */ createMessageType(
11489
11757
  const a = m.removed;
11490
11758
  if (a != null) for (const e of a) w.uint32(26).string(e);
11491
11759
  }
11760
+ {
11761
+ const v = m.generation;
11762
+ if (v) w.uint32(32).uint64(v);
11763
+ }
11492
11764
  }
11493
11765
  }
11494
11766
  );
@@ -11736,6 +12008,128 @@ var textVerticalAlignValues = {
11736
12008
  center: 1,
11737
12009
  top: 2
11738
12010
  };
12011
+ var disconnectReasonNames = {
12012
+ 1: "shutdown",
12013
+ 2: "disconnectByUser",
12014
+ 3: "disconnectByServer",
12015
+ 4: "lost",
12016
+ 5: "overflow",
12017
+ 6: "steamBanned",
12018
+ 7: "steamInuse",
12019
+ 8: "steamTicket",
12020
+ 9: "steamLogon",
12021
+ 10: "steamAuthcancelled",
12022
+ 11: "steamAuthalreadyused",
12023
+ 12: "steamAuthinvalid",
12024
+ 13: "steamVacbanstate",
12025
+ 14: "steamLoggedInElsewhere",
12026
+ 15: "steamVacCheckTimedout",
12027
+ 16: "steamDropped",
12028
+ 17: "steamOwnership",
12029
+ 18: "serverinfoOverflow",
12030
+ 19: "tickmsgOverflow",
12031
+ 20: "stringtablemsgOverflow",
12032
+ 21: "deltaentmsgOverflow",
12033
+ 22: "tempentmsgOverflow",
12034
+ 23: "soundsmsgOverflow",
12035
+ 24: "snapshotoverflow",
12036
+ 25: "snapshoterror",
12037
+ 26: "reliableoverflow",
12038
+ 27: "baddeltatick",
12039
+ 28: "nomoresplits",
12040
+ 29: "timedout",
12041
+ 30: "disconnected",
12042
+ 31: "leavingsplit",
12043
+ 32: "differentclasstables",
12044
+ 33: "badrelaypassword",
12045
+ 34: "badspectatorpassword",
12046
+ 35: "hltvrestricted",
12047
+ 36: "nospectators",
12048
+ 37: "hltvunavailable",
12049
+ 38: "hltvstop",
12050
+ 39: "kicked",
12051
+ 40: "banadded",
12052
+ 41: "kickbanadded",
12053
+ 42: "hltvdirect",
12054
+ 43: "pureserverClientextra",
12055
+ 44: "pureserverMismatch",
12056
+ 45: "usercmd",
12057
+ 46: "rejectedByGame",
12058
+ 47: "messageParseError",
12059
+ 48: "invalidMessageError",
12060
+ 49: "badServerPassword",
12061
+ 50: "directConnectReservation",
12062
+ 51: "connectionFailure",
12063
+ 52: "noPeerGroupHandlers",
12064
+ 53: "reconnection",
12065
+ 54: "loopshutdown",
12066
+ 55: "loopdeactivate",
12067
+ 56: "hostEndgame",
12068
+ 57: "loopLevelloadActivate",
12069
+ 58: "createServerFailed",
12070
+ 59: "exiting",
12071
+ 60: "requestHoststateIdle",
12072
+ 61: "requestHoststateHltvrelay",
12073
+ 62: "clientConsistencyFail",
12074
+ 63: "clientUnableToCrcMap",
12075
+ 64: "clientNoMap",
12076
+ 65: "clientDifferentMap",
12077
+ 66: "serverRequiresSteam",
12078
+ 67: "steamDenyMisc",
12079
+ 68: "steamDenyBadAntiCheat",
12080
+ 69: "serverShutdown",
12081
+ 71: "replayIncompatible",
12082
+ 72: "connectRequestTimedout",
12083
+ 73: "serverIncompatible",
12084
+ 74: "localproblemManyrelays",
12085
+ 75: "localproblemHostedserverprimaryrelay",
12086
+ 76: "localproblemNetworkconfig",
12087
+ 77: "localproblemOther",
12088
+ 79: "remoteTimeout",
12089
+ 80: "remoteTimeoutConnecting",
12090
+ 81: "remoteOther",
12091
+ 82: "remoteBadcrypt",
12092
+ 83: "remoteCertnottrusted",
12093
+ 84: "unusual",
12094
+ 85: "internalError",
12095
+ 128: "rejectBadchallenge",
12096
+ 129: "rejectNolobby",
12097
+ 130: "rejectBackgroundMap",
12098
+ 131: "rejectSinglePlayer",
12099
+ 132: "rejectHiddenGame",
12100
+ 133: "rejectLanrestrict",
12101
+ 134: "rejectBadpassword",
12102
+ 135: "rejectServerfull",
12103
+ 136: "rejectInvalidreservation",
12104
+ 137: "rejectFailedchannel",
12105
+ 138: "rejectConnectFromLobby",
12106
+ 139: "rejectReservedForLobby",
12107
+ 140: "rejectInvalidkeylength",
12108
+ 141: "rejectOldprotocol",
12109
+ 142: "rejectNewprotocol",
12110
+ 143: "rejectInvalidconnection",
12111
+ 144: "rejectInvalidcertlen",
12112
+ 145: "rejectInvalidsteamcertlen",
12113
+ 146: "rejectSteam",
12114
+ 147: "rejectServerauthdisabled",
12115
+ 148: "rejectServercdkeyauthinvalid",
12116
+ 149: "rejectBanned",
12117
+ 150: "kickedTeamkilling",
12118
+ 151: "kickedTkStart",
12119
+ 152: "kickedUntrustedaccount",
12120
+ 153: "kickedConvictedaccount",
12121
+ 154: "kickedCompetitivecooldown",
12122
+ 155: "kickedTeamhurting",
12123
+ 156: "kickedHostagekilling",
12124
+ 157: "kickedVotedoff",
12125
+ 158: "kickedIdle",
12126
+ 159: "kickedSuicide",
12127
+ 160: "kickedNosteamlogin",
12128
+ 161: "kickedNosteamticket",
12129
+ 162: "kickedInputautomation",
12130
+ 163: "kickedVacnetabnormalbehavior",
12131
+ 164: "kickedInsecureclient"
12132
+ };
11739
12133
  var modRoleNames = {
11740
12134
  0: "unspecified",
11741
12135
  1: "developer",
@@ -11813,7 +12207,7 @@ function fromLaunchEvent(message) {
11813
12207
  entity: message.entity ?? 0,
11814
12208
  name: message.name ?? "",
11815
12209
  owner: message.owner ?? 0,
11816
- player: new Player(message.player ?? 0),
12210
+ player: Player.of(message.player ?? 0),
11817
12211
  position: vector(message.position)
11818
12212
  };
11819
12213
  }
@@ -11822,7 +12216,7 @@ function fromImpactEvent(message) {
11822
12216
  entity: message.entity ?? 0,
11823
12217
  name: message.name ?? "",
11824
12218
  owner: message.owner ?? 0,
11825
- player: new Player(message.player ?? 0),
12219
+ player: Player.of(message.player ?? 0),
11826
12220
  start: vector(message.start),
11827
12221
  end: vector(message.end),
11828
12222
  position: vector(message.position),
@@ -11863,7 +12257,7 @@ function fromTraceHit(message) {
11863
12257
  };
11864
12258
  }
11865
12259
  function toFieldValue(value) {
11866
- return { value: typeof value === "boolean" ? { case: "boolean", value } : typeof value === "number" ? { case: "number", value } : typeof value === "bigint" ? { case: "integer", value } : typeof value === "string" ? { case: "text", value } : { case: "vector", value } };
12260
+ return { value: typeof value === "boolean" ? { case: "boolean", value } : typeof value === "number" ? { case: "number", value } : typeof value === "bigint" ? { case: "integer", value } : typeof value === "string" ? { case: "text", value } : typeof value === "object" ? { case: "vector", value } : void 0 };
11867
12261
  }
11868
12262
  function fromFieldValue(message) {
11869
12263
  const value = message?.value;
@@ -11923,7 +12317,7 @@ function toEntityValue(value) {
11923
12317
  }
11924
12318
  function fromInputEvent(message) {
11925
12319
  return {
11926
- player: new Player(message.player ?? 0),
12320
+ player: Player.of(message.player ?? 0),
11927
12321
  pressed: message.pressed ?? 0n,
11928
12322
  released: message.released ?? 0n
11929
12323
  };
@@ -11940,7 +12334,7 @@ function fromRiftState(message) {
11940
12334
  }
11941
12335
  function fromMovementSample(message) {
11942
12336
  return {
11943
- player: new Player(message.player ?? 0),
12337
+ player: Player.of(message.player ?? 0),
11944
12338
  pawn: message.pawn ?? 0,
11945
12339
  position: vector(message.position),
11946
12340
  velocity: vector(message.velocity),
@@ -11988,7 +12382,7 @@ function fromMovementCommand(message) {
11988
12382
  }
11989
12383
  function fromLandedEvent(message) {
11990
12384
  return {
11991
- player: new Player(message.player ?? 0),
12385
+ player: Player.of(message.player ?? 0),
11992
12386
  on: message.on ?? 0,
11993
12387
  speed: message.speed ?? 0
11994
12388
  };
@@ -12073,7 +12467,7 @@ function toParticlePoint(value) {
12073
12467
  }
12074
12468
  function fromRestoredEvent(message) {
12075
12469
  return {
12076
- player: new Player(message.player ?? 0),
12470
+ player: Player.of(message.player ?? 0),
12077
12471
  error: message.error ?? ""
12078
12472
  };
12079
12473
  }
@@ -12082,9 +12476,21 @@ function fromPlayersChangedEvent(message) {
12082
12476
  players: (message.players ?? []).map((v) => fromConnection(v))
12083
12477
  };
12084
12478
  }
12479
+ function fromPlayerJoinedEvent(message) {
12480
+ return {
12481
+ connection: fromConnection(message.connection ?? {})
12482
+ };
12483
+ }
12484
+ function fromPlayerLeftEvent(message) {
12485
+ return {
12486
+ connection: fromConnection(message.connection ?? {}),
12487
+ disconnected: message.disconnected ?? false,
12488
+ reason: message.reason === void 0 ? void 0 : disconnectReasonNames[message.reason]
12489
+ };
12490
+ }
12085
12491
  function fromConnection(message) {
12086
12492
  return {
12087
- player: new Player(message.player ?? 0),
12493
+ player: Player.of(message.player ?? 0),
12088
12494
  steamId: message.steamId ?? 0n,
12089
12495
  name: message.name ?? "",
12090
12496
  bot: message.bot ?? false,
@@ -12128,7 +12534,7 @@ function fromScore(message) {
12128
12534
  };
12129
12535
  }
12130
12536
  function toCameraValue(value) {
12131
- return { value: typeof value === "number" ? { case: "number", value } : { case: "position", value } };
12537
+ return { value: typeof value === "number" ? { case: "number", value } : typeof value === "object" ? { case: "position", value } : void 0 };
12132
12538
  }
12133
12539
  function toCameraMotion(value) {
12134
12540
  if ("hold" in value) return { motion: { case: "hold", value: value.hold } };
@@ -12212,13 +12618,13 @@ function toBotOptions(value) {
12212
12618
  return {
12213
12619
  name: value.name,
12214
12620
  team: int32(value.team),
12215
- hero: value.hero === void 0 ? void 0 : typeof value.hero === "string" ? { case: "heroName", value: value.hero } : { case: "heroId", value: value.hero },
12621
+ hero: value.hero === void 0 ? void 0 : typeof value.hero === "string" ? { case: "heroName", value: value.hero } : typeof value.hero === "number" ? { case: "heroId", value: value.hero } : void 0,
12216
12622
  position: value.position
12217
12623
  };
12218
12624
  }
12219
12625
  function fromSettingChangedEvent(message) {
12220
12626
  return {
12221
- player: new Player(message.player ?? 0),
12627
+ player: Player.of(message.player ?? 0),
12222
12628
  key: message.key ?? "",
12223
12629
  value: message.value ?? ""
12224
12630
  };
@@ -12231,13 +12637,13 @@ function fromWheel(message) {
12231
12637
  }
12232
12638
  function fromUiPressEvent(message) {
12233
12639
  return {
12234
- player: new Player(message.player ?? 0),
12640
+ player: Player.of(message.player ?? 0),
12235
12641
  node: message.node ?? ""
12236
12642
  };
12237
12643
  }
12238
12644
  function fromUiInputEvent(message) {
12239
12645
  return {
12240
- player: new Player(message.player ?? 0),
12646
+ player: Player.of(message.player ?? 0),
12241
12647
  node: message.node ?? "",
12242
12648
  value: message.value?.case === "wheel" ? fromWheel(message.value.value) : message.value?.value
12243
12649
  };
@@ -12259,13 +12665,13 @@ function fromFrameEvent(message) {
12259
12665
  }
12260
12666
  function fromCommandEvent(message) {
12261
12667
  return {
12262
- player: new Player(message.player ?? 0),
12668
+ player: Player.of(message.player ?? 0),
12263
12669
  line: message.line ?? ""
12264
12670
  };
12265
12671
  }
12266
12672
  function fromChatEvent(message) {
12267
12673
  return {
12268
- player: new Player(message.player ?? 0),
12674
+ player: Player.of(message.player ?? 0),
12269
12675
  text: message.text ?? "",
12270
12676
  all: message.all ?? false,
12271
12677
  lane: message.lane ?? 0
@@ -12289,12 +12695,31 @@ function toPrecacheOptions(value) {
12289
12695
  resources: value.resources?.slice()
12290
12696
  };
12291
12697
  }
12292
- var Player = class {
12698
+ var playerObjects = /* @__PURE__ */ new Map();
12699
+ var Player = class _Player {
12293
12700
  /** slot identifies the player on the server. */
12294
12701
  slot;
12295
12702
  constructor(slot) {
12296
12703
  this.slot = slot;
12297
12704
  }
12705
+ /**
12706
+ * of returns the Player for slot, the same object each time until release
12707
+ * forgets it, so === tells whether two values are the same player.
12708
+ */
12709
+ static of(slot) {
12710
+ let object = playerObjects.get(slot);
12711
+ if (object === void 0) {
12712
+ object = new _Player(slot);
12713
+ playerObjects.set(slot, object);
12714
+ }
12715
+ return object;
12716
+ }
12717
+ /**
12718
+ * release forgets the Player for slot, so the next Player.of makes a new one.
12719
+ */
12720
+ static release(slot) {
12721
+ playerObjects.delete(slot);
12722
+ }
12298
12723
  /** chat sends a server chat line to the player. */
12299
12724
  chat(text2) {
12300
12725
  return call("Chat", ChatRequest.toBinary({ player: this.slot, text: text2 })) !== void 0;
@@ -12366,7 +12791,7 @@ var Player = class {
12366
12791
  * frame.
12367
12792
  */
12368
12793
  selectHero(hero, team) {
12369
- const reply2 = call("SelectHero", SelectHeroRequest.toBinary({ player: this.slot, hero: typeof hero === "string" ? { case: "heroName", value: hero } : { case: "heroId", value: hero }, team: int32(team) }));
12794
+ const reply2 = call("SelectHero", SelectHeroRequest.toBinary({ player: this.slot, hero: typeof hero === "string" ? { case: "heroName", value: hero } : typeof hero === "number" ? { case: "heroId", value: hero } : void 0, team: int32(team) }));
12370
12795
  if (reply2 === void 0) return void 0;
12371
12796
  const response = HeroResponse.fromBinary(reply2);
12372
12797
  return response.hero ?? 0;
@@ -12925,7 +13350,7 @@ function addBot(options) {
12925
13350
  const reply2 = call("AddBot", BotOptions.toBinary(toBotOptions(options)));
12926
13351
  if (reply2 === void 0) return void 0;
12927
13352
  const response = BotResponse.fromBinary(reply2);
12928
- return new Player(response.player ?? 0);
13353
+ return Player.of(response.player ?? 0);
12929
13354
  }
12930
13355
  function blockInput(buttons) {
12931
13356
  return call("BlockInput", InputRequest.toBinary({ buttons })) !== void 0;
@@ -13002,6 +13427,9 @@ function clearMap() {
13002
13427
  function damage(options) {
13003
13428
  return call("Damage", HitOptions.toBinary(toHitOptions(options))) !== void 0;
13004
13429
  }
13430
+ function killEntity(options) {
13431
+ return call("KillEntity", KillOptions.toBinary(options)) !== void 0;
13432
+ }
13005
13433
  function trace(options) {
13006
13434
  const reply2 = call("Trace", TraceOptions.toBinary(toTraceOptions(options)));
13007
13435
  if (reply2 === void 0) return void 0;
@@ -13096,6 +13524,12 @@ function serveMod(handlers2, bytes) {
13096
13524
  case "SettingChanged":
13097
13525
  handlers2.settingChanged(fromSettingChangedEvent(SettingChangedEvent.fromBinary(input2)));
13098
13526
  return reply();
13527
+ case "PlayerJoined":
13528
+ handlers2.playerJoined(fromPlayerJoinedEvent(PlayerJoinedEvent.fromBinary(input2)));
13529
+ return reply();
13530
+ case "PlayerLeft":
13531
+ handlers2.playerLeft(fromPlayerLeftEvent(PlayerLeftEvent.fromBinary(input2)));
13532
+ return reply();
13099
13533
  case "PlayersChanged":
13100
13534
  handlers2.playersChanged(fromPlayersChangedEvent(PlayersChangedEvent.fromBinary(input2)));
13101
13535
  return reply();
@@ -13108,13 +13542,26 @@ function serveMod(handlers2, bytes) {
13108
13542
 
13109
13543
  // js/src/players.ts
13110
13544
  var roster = void 0;
13545
+ var generations = /* @__PURE__ */ new Map();
13111
13546
  var watchers = [];
13112
13547
  function keepPlayers(players2) {
13113
- roster = players2;
13548
+ roster = adopt(players2);
13114
13549
  for (const watcher of watchers) {
13115
- watcher(players2);
13550
+ watcher(roster);
13116
13551
  }
13117
13552
  }
13553
+ function adopt(players2) {
13554
+ const current = new Map(players2.map((c) => [c.player.slot, c.generation]));
13555
+ for (const [slot, generation] of generations) {
13556
+ if (current.get(slot) !== generation) Player.release(slot);
13557
+ }
13558
+ generations.clear();
13559
+ return players2.map((c) => {
13560
+ generations.set(c.player.slot, c.generation);
13561
+ const player = Player.of(c.player.slot);
13562
+ return player === c.player ? c : { ...c, player };
13563
+ });
13564
+ }
13118
13565
  function watchPlayers(watcher) {
13119
13566
  watchers.push(watcher);
13120
13567
  if (roster !== void 0) watcher(roster);
@@ -13123,15 +13570,17 @@ function players() {
13123
13570
  if (roster !== void 0) return roster.slice();
13124
13571
  const reply2 = call("Players", new Uint8Array());
13125
13572
  if (reply2 === void 0) return [];
13126
- return (PlayersResponse.fromBinary(reply2).players ?? []).map((c) => ({
13127
- player: new Player(c.player ?? 0),
13128
- steamId: c.steamId ?? 0n,
13129
- name: c.name ?? "",
13130
- bot: c.bot ?? false,
13131
- ready: c.ready ?? false,
13132
- generation: c.generation ?? 0,
13133
- roles: (c.roles ?? []).flatMap((role) => roleNames[role] ?? [])
13134
- }));
13573
+ return adopt(
13574
+ (PlayersResponse.fromBinary(reply2).players ?? []).map((c) => ({
13575
+ player: Player.of(c.player ?? 0),
13576
+ steamId: c.steamId ?? 0n,
13577
+ name: c.name ?? "",
13578
+ bot: c.bot ?? false,
13579
+ ready: c.ready ?? false,
13580
+ generation: c.generation ?? 0,
13581
+ roles: (c.roles ?? []).flatMap((role) => roleNames[role] ?? [])
13582
+ }))
13583
+ );
13135
13584
  }
13136
13585
  var roleNames = {
13137
13586
  [1 /* DEVELOPER */]: "developer",
@@ -13743,10 +14192,8 @@ var Layout = class {
13743
14192
  }
13744
14193
  /** add records a node. */
13745
14194
  add(node) {
13746
- const encoded = JSON.stringify(
13747
- node,
13748
- (_, value) => typeof value === "bigint" ? String(value) : value
13749
- );
14195
+ const value = node.steamId === void 0 ? node : { ...node, steamId: String(node.steamId) };
14196
+ const encoded = JSON.stringify(value);
13750
14197
  this.screen.nodes.set(node.id, { node, encoded });
13751
14198
  }
13752
14199
  /** id returns the node id for the element at place. */
@@ -15132,10 +15579,11 @@ var Hook = class {
15132
15579
  /**
15133
15580
  * update reads the thrower's hook at game time now, keeps it fully upgraded
15134
15581
  * and sets the length of any cooldown a throw started. It reports nothing
15135
- * for a hero without the hook.
15582
+ * for a hero without the hook. A caller that already read this frame's
15583
+ * abilities passes them to avoid another read.
15136
15584
  */
15137
- update(player, now4) {
15138
- const ability = player.abilities().find((a) => a.name === hookAbility);
15585
+ update(player, now4, abilities = player.abilities()) {
15586
+ const ability = abilities.find((a) => a.name === hookAbility);
15139
15587
  if (!ability) {
15140
15588
  return void 0;
15141
15589
  }
@@ -15891,6 +16339,217 @@ function ground(point, {
15891
16339
  return hit && !hit.startSolid ? hit.position : void 0;
15892
16340
  }
15893
16341
 
16342
+ // js/src/rotation.ts
16343
+ var startingRating = 1e3;
16344
+ var ratingStep = 32;
16345
+ var Standings = class {
16346
+ constructor(extra = () => ({})) {
16347
+ this.extra = extra;
16348
+ }
16349
+ extra;
16350
+ bySteamId = /* @__PURE__ */ new Map();
16351
+ /**
16352
+ * join is steamId's standing, made at the starting rating on their first
16353
+ * join. Its matches played rise to the fewest anyone present has played,
16354
+ * so joining late or rejoining never puts a player ahead of the line.
16355
+ */
16356
+ join(steamId, present) {
16357
+ const least = fewestPlayed(present);
16358
+ let standing = this.bySteamId.get(steamId);
16359
+ if (!standing) {
16360
+ standing = {
16361
+ played: least,
16362
+ rating: startingRating,
16363
+ wins: 0,
16364
+ losses: 0,
16365
+ streak: 0,
16366
+ ...this.extra()
16367
+ };
16368
+ this.bySteamId.set(steamId, standing);
16369
+ }
16370
+ standing.played = Math.max(standing.played, least);
16371
+ return standing;
16372
+ }
16373
+ /** get is steamId's standing, or undefined before they join. */
16374
+ get(steamId) {
16375
+ return this.bySteamId.get(steamId);
16376
+ }
16377
+ };
16378
+ function fewestPlayed(standings) {
16379
+ let least = Infinity;
16380
+ for (const standing of standings) {
16381
+ least = Math.min(least, standing.played);
16382
+ }
16383
+ return least === Infinity ? 0 : least;
16384
+ }
16385
+ function nextMatch(line2, size, standing) {
16386
+ const seated = [...line2].sort((a, b) => standing(a).played - standing(b).played).slice(0, 2 * size);
16387
+ if (size < 1 || seated.length < 2 * size) {
16388
+ return void 0;
16389
+ }
16390
+ const ranked = seated.sort((a, b) => standing(b).rating - standing(a).rating);
16391
+ const sides = [[], []];
16392
+ for (const [i, player] of ranked.entries()) {
16393
+ const round = Math.floor(i / 2);
16394
+ const first = i % 2 === 0 ? round % 2 === 0 : round % 2 === 1;
16395
+ sides[first ? 0 : 1].push(player);
16396
+ }
16397
+ return sides;
16398
+ }
16399
+ function afterMatch(line2, fought) {
16400
+ const fighters = new Set(fought);
16401
+ return [
16402
+ ...line2.filter((player) => !fighters.has(player)),
16403
+ ...line2.filter((player) => fighters.has(player))
16404
+ ];
16405
+ }
16406
+ function ratingChange(winners, losers, step = ratingStep) {
16407
+ const expected = 1 / (1 + 10 ** ((losers - winners) / 400));
16408
+ return Math.round(step * (1 - expected));
16409
+ }
16410
+ function settle(winners, losers, step = ratingStep) {
16411
+ const change2 = winners.length > 0 && losers.length > 0 ? ratingChange(average(winners), average(losers), step) : 0;
16412
+ for (const standing of winners) {
16413
+ standing.rating += change2;
16414
+ standing.wins++;
16415
+ standing.streak++;
16416
+ }
16417
+ for (const standing of losers) {
16418
+ standing.rating -= change2;
16419
+ standing.losses++;
16420
+ standing.streak = 0;
16421
+ }
16422
+ return change2;
16423
+ }
16424
+ function average(standings) {
16425
+ let sum = 0;
16426
+ for (const standing of standings) {
16427
+ sum += standing.rating;
16428
+ }
16429
+ return sum / standings.length;
16430
+ }
16431
+ function leastUsed(counts, prefer = 0) {
16432
+ const least = Math.min(...counts);
16433
+ if (counts[prefer] === least) {
16434
+ return prefer;
16435
+ }
16436
+ return counts.indexOf(least);
16437
+ }
16438
+ function leaderboard(players2, standing, rows, viewer) {
16439
+ const ranked = [...players2].sort(
16440
+ (a, b) => standing(b).wins - standing(a).wins || standing(b).rating - standing(a).rating
16441
+ );
16442
+ const shown = ranked.slice(0, rows);
16443
+ if (viewer !== void 0 && shown.length > 0 && players2.includes(viewer) && !shown.includes(viewer)) {
16444
+ shown[shown.length - 1] = viewer;
16445
+ }
16446
+ return shown;
16447
+ }
16448
+
16449
+ // js/src/bystander.ts
16450
+ var bystanderStates = [
16451
+ "MODIFIER_STATE_IMMOBILIZED",
16452
+ "MODIFIER_STATE_DISARMED",
16453
+ "MODIFIER_STATE_MELEE_DISABLED",
16454
+ "MODIFIER_STATE_SILENCED",
16455
+ "MODIFIER_STATE_INVULNERABLE",
16456
+ "MODIFIER_STATE_TECH_UNTARGETABLE_BY_ENEMIES",
16457
+ "MODIFIER_STATE_TECH_UNTARGETABLE_BY_TEAMMATES",
16458
+ "MODIFIER_STATE_DISPLACEMENT_IMMUNE",
16459
+ "MODIFIER_STATE_IGNORE_BULLETS",
16460
+ "MODIFIER_STATE_IGNORE_MELEE",
16461
+ "MODIFIER_STATE_IN_ABILITY_DISABLE_ZOOM"
16462
+ ];
16463
+ function holdBystander(entity, active = true) {
16464
+ let held = true;
16465
+ for (const state of bystanderStates) {
16466
+ held = holdModifierState(entity, state, active) && held;
16467
+ }
16468
+ return held;
16469
+ }
16470
+
16471
+ // js/src/strays.ts
16472
+ var strayGraceSeconds = 3;
16473
+ var strayRespawnTime = 1e9;
16474
+ var strayBlow = 1e6;
16475
+ var Strays = class {
16476
+ /** since maps each stray pawn to when it was first seen with no player. */
16477
+ since = /* @__PURE__ */ new Map();
16478
+ sweptAt = -Infinity;
16479
+ /**
16480
+ * sweep lays down each hero pawn that has belonged to no player for
16481
+ * strayGraceSeconds, at most once a second. The game sets a dead pawn's
16482
+ * respawn when it dies, so the hold repeats on each sweep.
16483
+ */
16484
+ sweep(now4) {
16485
+ if (now4 - this.sweptAt < 1) {
16486
+ return;
16487
+ }
16488
+ this.sweptAt = now4;
16489
+ const held = /* @__PURE__ */ new Set();
16490
+ for (const { player } of players()) {
16491
+ const pawn = player.pawn();
16492
+ if (pawn) {
16493
+ held.add(pawn.entity);
16494
+ }
16495
+ }
16496
+ const since = /* @__PURE__ */ new Map();
16497
+ for (const entity of findEntities("player")) {
16498
+ if (held.has(entity) || ownHero(entity)) {
16499
+ continue;
16500
+ }
16501
+ const first = this.since.get(entity) ?? now4;
16502
+ since.set(entity, first);
16503
+ if (now4 - first >= strayGraceSeconds) {
16504
+ layDown(entity);
16505
+ }
16506
+ }
16507
+ this.since = since;
16508
+ }
16509
+ };
16510
+ function ownHero(entity) {
16511
+ const controller = readField(
16512
+ entity,
16513
+ "CBasePlayerPawn",
16514
+ "m_hController",
16515
+ "handle"
16516
+ );
16517
+ if (typeof controller !== "number") {
16518
+ return false;
16519
+ }
16520
+ const connected = readField(
16521
+ controller,
16522
+ "CBasePlayerController",
16523
+ "m_iConnected",
16524
+ "int32"
16525
+ );
16526
+ if (connected === 3 || connected === 4) {
16527
+ return false;
16528
+ }
16529
+ const hero = readField(
16530
+ controller,
16531
+ "CCitadelPlayerController",
16532
+ "m_hHeroPawn",
16533
+ "handle"
16534
+ );
16535
+ return hero === entity;
16536
+ }
16537
+ function layDown(entity) {
16538
+ holdBystander(entity, false);
16539
+ const health = readField(entity, "CBaseEntity", "m_iHealth", "int32");
16540
+ if (typeof health === "number" && health > 0) {
16541
+ damage({ victim: entity, amount: strayBlow });
16542
+ log(`laid down a stray hero pawn ${entity}`);
16543
+ }
16544
+ writeField(
16545
+ entity,
16546
+ "CCitadelPlayerPawn",
16547
+ "m_flRespawnTime",
16548
+ "float32",
16549
+ strayRespawnTime
16550
+ );
16551
+ }
16552
+
15894
16553
  // js/src/probe.ts
15895
16554
  var ProbeRun = class {
15896
16555
  /**
@@ -16650,6 +17309,12 @@ function onStart(handler) {
16650
17309
  function onChat(handler) {
16651
17310
  chats.push(handler);
16652
17311
  }
17312
+ function onPlayerJoin(handler) {
17313
+ joins.push(handler);
17314
+ }
17315
+ function onPlayerLeave(handler) {
17316
+ leaves.push(handler);
17317
+ }
16653
17318
  function onFrame(handler) {
16654
17319
  frames.push(handler);
16655
17320
  }
@@ -16696,6 +17361,8 @@ var services = /* @__PURE__ */ new Map();
16696
17361
  var starts = [];
16697
17362
  var frames = [];
16698
17363
  var chats = [];
17364
+ var joins = [];
17365
+ var leaves = [];
16699
17366
  var worlds = [];
16700
17367
  var inputs = [];
16701
17368
  var restoreds = [];
@@ -16715,7 +17382,8 @@ var handlers = {
16715
17382
  frames: true,
16716
17383
  damage: damages.length !== 0,
16717
17384
  damaged: damageds.length !== 0,
16718
- chat: chats.length !== 0
17385
+ chat: chats.length !== 0,
17386
+ joins: joins.length !== 0 || leaves.length !== 0
16719
17387
  };
16720
17388
  },
16721
17389
  frame(event) {
@@ -16818,6 +17486,17 @@ var handlers = {
16818
17486
  },
16819
17487
  playersChanged(event) {
16820
17488
  keepPlayers(event.players);
17489
+ },
17490
+ // A join and a leave run at once, so the leaving player's hero still reads.
17491
+ playerJoined(event) {
17492
+ for (const handler of joins) {
17493
+ handler(event);
17494
+ }
17495
+ },
17496
+ playerLeft(event) {
17497
+ for (const handler of leaves) {
17498
+ handler(event);
17499
+ }
16821
17500
  }
16822
17501
  };
16823
17502
  serveEvents((call2) => serveMod(handlers, call2));
@@ -16847,13 +17526,17 @@ export {
16847
17526
  Puppet,
16848
17527
  Roster,
16849
17528
  Score2 as Score,
17529
+ Standings,
17530
+ Strays,
16850
17531
  Tag,
16851
17532
  Text,
16852
17533
  TopStrip,
16853
17534
  WorldObject,
16854
17535
  addBot,
16855
17536
  after,
17537
+ afterMatch,
16856
17538
  blockInput,
17539
+ bystanderStates,
16857
17540
  callService,
16858
17541
  cameraPulse,
16859
17542
  cameraShake,
@@ -16876,6 +17559,7 @@ export {
16876
17559
  entityName,
16877
17560
  entityPosition,
16878
17561
  every,
17562
+ fewestPlayed,
16879
17563
  findEntities,
16880
17564
  findEntitiesByName,
16881
17565
  findHero,
@@ -16892,6 +17576,7 @@ export {
16892
17576
  heroes,
16893
17577
  hide,
16894
17578
  hideHud,
17579
+ holdBystander,
16895
17580
  holdMatchClock,
16896
17581
  holdModifierState,
16897
17582
  holdReload,
@@ -16902,11 +17587,15 @@ export {
16902
17587
  items,
16903
17588
  jsx,
16904
17589
  jsxs,
17590
+ killEntity,
17591
+ leaderboard,
17592
+ leastUsed,
16905
17593
  loadSpot,
16906
17594
  log2 as log,
16907
17595
  matchClock,
16908
17596
  modifierState,
16909
17597
  moveEntity,
17598
+ nextMatch,
16910
17599
  onChat,
16911
17600
  onDamage,
16912
17601
  onDamaged,
@@ -16916,6 +17605,8 @@ export {
16916
17605
  onLanded,
16917
17606
  onLaunch,
16918
17607
  onNpcsRestored,
17608
+ onPlayerJoin,
17609
+ onPlayerLeave,
16919
17610
  onRestored,
16920
17611
  onSettingChanged,
16921
17612
  onStart,
@@ -16926,6 +17617,8 @@ export {
16926
17617
  poseAt,
16927
17618
  precache,
16928
17619
  pushEntity,
17620
+ ratingChange,
17621
+ ratingStep,
16929
17622
  readField,
16930
17623
  readFieldList,
16931
17624
  readFile,
@@ -16949,12 +17642,15 @@ export {
16949
17642
  setTeamSeating,
16950
17643
  settingNumber,
16951
17644
  settingOn,
17645
+ settle,
16952
17646
  sheet,
16953
17647
  show,
16954
17648
  showEntityOnlyTo,
16955
17649
  showEntityToAll,
16956
17650
  spawnNpc,
16957
17651
  startRift,
17652
+ startingRating,
17653
+ strayGraceSeconds,
16958
17654
  theme_exports as theme,
16959
17655
  ticksPerSecond,
16960
17656
  toast,