This repository was archived by the owner on Aug 24, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathServerPlayer.cs
More file actions
49 lines (44 loc) · 1.79 KB
/
Copy pathServerPlayer.cs
File metadata and controls
49 lines (44 loc) · 1.79 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using System.Collections.Generic;
using Blaze3SDK.Blaze;
using Blaze3SDK.Blaze.Authentication;
using Blaze3SDK.Blaze.GameManager;
using BlazeCommon;
namespace Zamboni11;
public class ServerPlayer
{
public ServerPlayer(BlazeServerConnection blazeServerConnection, UserIdentification userIdentification, UserSessionExtendedData extendedData, SessionInfo sessionInfo)
{
BlazeServerConnection = blazeServerConnection;
UserIdentification = userIdentification;
ExtendedData = extendedData;
SessionInfo = sessionInfo;
_ = ServerManager.AddServerPlayer(userIdentification.mAccountId, this);
}
public BlazeServerConnection BlazeServerConnection { get; }
public UserIdentification UserIdentification { get; set; }
public UserSessionExtendedData ExtendedData { get; set; }
public SessionInfo SessionInfo { get; set; }
public uint LastPingedTime { get; set; }
public ReplicatedGamePlayer ToReplicatedGamePlayer(byte slot, uint gameId)
{
return new ReplicatedGamePlayer
{
mAccountLocale = 1701729619,
mCustomData = UserIdentification.mExternalBlob,
mExternalId = UserIdentification.mExternalId,
mGameId = gameId,
mJoinedGameTimestamp = 0,
mNetworkAddress = ExtendedData.mAddress,
mPlayerAttribs = new SortedDictionary<string, string>(),
mPlayerId = UserIdentification.mBlazeId,
mPlayerName = UserIdentification.mName,
mPlayerSessionId = (uint)UserIdentification.mBlazeId,
mPlayerState = PlayerState.ACTIVE_CONNECTING,
mSlotId = slot,
mSlotType = SlotType.SLOT_PUBLIC,
mTeamIndex = slot,
mTeam = (ushort)(slot + 1),
mUserGroupId = default
};
}
}