mirror of
https://github.com/exogen/t2-mapper.git
synced 2026-03-19 04:11:00 +00:00
improve input handling
This commit is contained in:
parent
e9125951e4
commit
9694e0fd82
45 changed files with 1307 additions and 720 deletions
|
|
@ -1846,10 +1846,17 @@ export abstract class StreamEngine implements StreamingPlayback {
|
|||
});
|
||||
this.onRosterChanged();
|
||||
}
|
||||
// The first MsgClientJoin is the connected player's own join message.
|
||||
// Detect our own join: the server sends "Welcome to Tribes2" in the
|
||||
// format string (args[1]) only for the joining client. This is the same
|
||||
// technique the T2 community's player_support.cs uses.
|
||||
if (!this.connectedPlayerName && name) {
|
||||
this.connectedPlayerName = name;
|
||||
this.onMissionInfoChange?.();
|
||||
const msgFormat = stripTaggedStringMarkup(
|
||||
this.resolveNetString(args[1]),
|
||||
);
|
||||
if (msgFormat.includes("Welcome to Tribes")) {
|
||||
this.connectedPlayerName = name;
|
||||
this.onMissionInfoChange?.();
|
||||
}
|
||||
}
|
||||
} else if (msgType === "MsgClientDrop" && args.length >= 3) {
|
||||
const clientId = parseInt(this.resolveNetString(args[2]), 10);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue