quake2ts 0.0.417 → 0.0.420
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/package.json +1 -1
- package/packages/client/dist/browser/index.global.js +16 -16
- package/packages/client/dist/browser/index.global.js.map +1 -1
- package/packages/client/dist/cjs/index.cjs +151 -16
- package/packages/client/dist/cjs/index.cjs.map +1 -1
- package/packages/client/dist/esm/index.js +151 -16
- package/packages/client/dist/esm/index.js.map +1 -1
- package/packages/client/dist/tsconfig.tsbuildinfo +1 -1
- package/packages/client/dist/types/blend.d.ts +9 -0
- package/packages/client/dist/types/blend.d.ts.map +1 -0
- package/packages/client/dist/types/index.d.ts.map +1 -1
- package/packages/client/dist/types/net/serverBrowser.d.ts +17 -0
- package/packages/client/dist/types/net/serverBrowser.d.ts.map +1 -0
- package/packages/client/dist/types/session.d.ts +1 -0
- package/packages/client/dist/types/session.d.ts.map +1 -1
- package/packages/engine/dist/tsconfig.tsbuildinfo +1 -1
- package/packages/engine/dist/types/render/debug.d.ts +7 -0
- package/packages/engine/dist/types/render/debug.d.ts.map +1 -1
- package/packages/engine/dist/types/render/frame.d.ts +1 -0
- package/packages/engine/dist/types/render/frame.d.ts.map +1 -1
- package/packages/engine/dist/types/render/gpuProfiler.d.ts +19 -2
- package/packages/engine/dist/types/render/gpuProfiler.d.ts.map +1 -1
- package/packages/engine/dist/types/render/renderer.d.ts +2 -2
- package/packages/engine/dist/types/render/renderer.d.ts.map +1 -1
- package/packages/game/dist/tsconfig.tsbuildinfo +1 -1
- package/packages/server/dist/index.cjs +35 -0
- package/packages/server/dist/index.d.cts +1 -0
- package/packages/server/dist/index.d.ts +1 -0
- package/packages/server/dist/index.js +35 -0
|
@@ -1123,8 +1123,43 @@ var DedicatedServer = class {
|
|
|
1123
1123
|
this.handleConnect(client, userInfo);
|
|
1124
1124
|
} else if (cmd === "begin") {
|
|
1125
1125
|
this.handleBegin(client);
|
|
1126
|
+
} else if (cmd === "status") {
|
|
1127
|
+
this.handleStatus(client);
|
|
1126
1128
|
}
|
|
1127
1129
|
}
|
|
1130
|
+
handleStatus(client) {
|
|
1131
|
+
let activeClients = 0;
|
|
1132
|
+
for (const c of this.svs.clients) {
|
|
1133
|
+
if (c && c.state >= 2 /* Connected */) {
|
|
1134
|
+
activeClients++;
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
let status = `map: ${this.sv.name}
|
|
1138
|
+
`;
|
|
1139
|
+
status += `players: ${activeClients} active (${MAX_CLIENTS} max)
|
|
1140
|
+
|
|
1141
|
+
`;
|
|
1142
|
+
status += `num score ping name lastmsg address qport rate
|
|
1143
|
+
`;
|
|
1144
|
+
status += `--- ----- ---- --------------- ------- --------------------- ----- -----
|
|
1145
|
+
`;
|
|
1146
|
+
for (const c of this.svs.clients) {
|
|
1147
|
+
if (c && c.state >= 2 /* Connected */) {
|
|
1148
|
+
const score = 0;
|
|
1149
|
+
const ping = 0;
|
|
1150
|
+
const lastMsg = this.sv.frame - c.lastMessage;
|
|
1151
|
+
const address = "unknown";
|
|
1152
|
+
status += `${c.index.toString().padStart(3)} ${score.toString().padStart(5)} ${ping.toString().padStart(4)} ${c.userInfo.substring(0, 15).padEnd(15)} ${lastMsg.toString().padStart(7)} ${address.padEnd(21)} ${c.netchan.qport.toString().padStart(5)} 0
|
|
1153
|
+
`;
|
|
1154
|
+
}
|
|
1155
|
+
}
|
|
1156
|
+
const writer = new import_shared4.BinaryWriter();
|
|
1157
|
+
writer.writeByte(import_shared4.ServerCommand.print);
|
|
1158
|
+
writer.writeByte(2);
|
|
1159
|
+
writer.writeString(status);
|
|
1160
|
+
const packet = client.netchan.transmit(writer.getData());
|
|
1161
|
+
client.net.send(packet);
|
|
1162
|
+
}
|
|
1128
1163
|
handleGetChallenge(client) {
|
|
1129
1164
|
const challenge = Math.floor(Math.random() * 1e6) + 1;
|
|
1130
1165
|
client.challenge = challenge;
|
|
@@ -1083,8 +1083,43 @@ var DedicatedServer = class {
|
|
|
1083
1083
|
this.handleConnect(client, userInfo);
|
|
1084
1084
|
} else if (cmd === "begin") {
|
|
1085
1085
|
this.handleBegin(client);
|
|
1086
|
+
} else if (cmd === "status") {
|
|
1087
|
+
this.handleStatus(client);
|
|
1086
1088
|
}
|
|
1087
1089
|
}
|
|
1090
|
+
handleStatus(client) {
|
|
1091
|
+
let activeClients = 0;
|
|
1092
|
+
for (const c of this.svs.clients) {
|
|
1093
|
+
if (c && c.state >= 2 /* Connected */) {
|
|
1094
|
+
activeClients++;
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
let status = `map: ${this.sv.name}
|
|
1098
|
+
`;
|
|
1099
|
+
status += `players: ${activeClients} active (${MAX_CLIENTS} max)
|
|
1100
|
+
|
|
1101
|
+
`;
|
|
1102
|
+
status += `num score ping name lastmsg address qport rate
|
|
1103
|
+
`;
|
|
1104
|
+
status += `--- ----- ---- --------------- ------- --------------------- ----- -----
|
|
1105
|
+
`;
|
|
1106
|
+
for (const c of this.svs.clients) {
|
|
1107
|
+
if (c && c.state >= 2 /* Connected */) {
|
|
1108
|
+
const score = 0;
|
|
1109
|
+
const ping = 0;
|
|
1110
|
+
const lastMsg = this.sv.frame - c.lastMessage;
|
|
1111
|
+
const address = "unknown";
|
|
1112
|
+
status += `${c.index.toString().padStart(3)} ${score.toString().padStart(5)} ${ping.toString().padStart(4)} ${c.userInfo.substring(0, 15).padEnd(15)} ${lastMsg.toString().padStart(7)} ${address.padEnd(21)} ${c.netchan.qport.toString().padStart(5)} 0
|
|
1113
|
+
`;
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
const writer = new BinaryWriter2();
|
|
1117
|
+
writer.writeByte(ServerCommand2.print);
|
|
1118
|
+
writer.writeByte(2);
|
|
1119
|
+
writer.writeString(status);
|
|
1120
|
+
const packet = client.netchan.transmit(writer.getData());
|
|
1121
|
+
client.net.send(packet);
|
|
1122
|
+
}
|
|
1088
1123
|
handleGetChallenge(client) {
|
|
1089
1124
|
const challenge = Math.floor(Math.random() * 1e6) + 1;
|
|
1090
1125
|
client.challenge = challenge;
|