Skip to content

Commit

Permalink
Add ability for Host to select server/client protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
paulov-t committed Feb 5, 2024
1 parent 0be69ca commit a6a7f72
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/CoopMatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,9 @@ export class CoopMatch {
/** All characters in the game. Including AI */
public Characters: any[] = [];

LastDataByProfileId: Record<string, Record<string, Record<string, any>>> = {};
public Protocol: string;

// @TODO: Delete
// LastDataReceivedByAccountId: Record<string, number> = {};
// LastData: Record<string, Record<string, any>> = {};
// LastMoves: Record<string, any> = {};
// LastRotates: Record<string, any> = {};
// DamageArray: any[] = [];
LastDataByProfileId: Record<string, Record<string, Record<string, any>>> = {};

PreviousSentData: string[] = [];
PreviousSentDataMaxSize: number = 128;
Expand Down Expand Up @@ -135,9 +130,8 @@ export class CoopMatch {

// Server settings
this.ServerId = inData.serverId;
this.ServerType = inData.serverType;
this.Password = inData.password !== undefined ? inData.password : undefined;

this.Protocol = inData.protocol;
this.GameVersion = inData.gameVersion;
this.SITVersion = inData.sitVersion;
this.AuthorizedUsers.push(inData.serverId);
Expand Down
1 change: 1 addition & 0 deletions src/CoopMatchResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ export class CoopMatchResponse {
GameVersion: string;
SITVersion: string;
IsPasswordLocked: boolean;
Protocol: string;
}
6 changes: 6 additions & 0 deletions src/StayInTarkovMod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,8 @@ export class StayInTarkovMod implements IPreAkiLoadMod, IPostDBLoadMod
matchResponse.SITVersion = m.SITVersion;
// Server Id
matchResponse.ServerId = itemKey;
// SIT Protocol (Tcp, Udp etc.)
matchResponse.Protocol = m.Protocol;

matches.push(matchResponse);
}
Expand Down Expand Up @@ -474,7 +476,11 @@ export class StayInTarkovMod implements IPreAkiLoadMod, IPostDBLoadMod
expectedNumberOfPlayers: coopMatch.ExpectedNumberOfPlayers,
sitVersion: coopMatch.SITVersion,
gameVersion: coopMatch.GameVersion,
protocol: coopMatch.Protocol
} : null);

console.log("JoinMatch Result Ouput:");
console.log(output);
return output;
}
},
Expand Down

0 comments on commit a6a7f72

Please sign in to comment.