@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using Content.Server.Players;
|
||||
using Content.Shared.GameTicking;
|
||||
using Content.Shared.GameWindow;
|
||||
@@ -35,6 +36,8 @@ namespace Content.Server.GameTicking
|
||||
|
||||
case SessionStatus.Connected:
|
||||
{
|
||||
AddPlayerToDb(args.Session.UserId.UserId);
|
||||
|
||||
// Always make sure the client has player data. Mind gets assigned on spawn.
|
||||
if (session.Data.ContentDataUncast == null)
|
||||
session.Data.ContentDataUncast = new PlayerData(session.UserId, args.Session.Name);
|
||||
@@ -106,6 +109,14 @@ namespace Content.Server.GameTicking
|
||||
await _prefsManager.WaitPreferencesLoaded(session);
|
||||
SpawnPlayer(session);
|
||||
}
|
||||
|
||||
async void AddPlayerToDb(Guid id)
|
||||
{
|
||||
if (RoundId != 0 && _runLevel != GameRunLevel.PreRoundLobby)
|
||||
{
|
||||
await _db.AddRoundPlayers(RoundId, id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private HumanoidCharacterProfile GetPlayerProfile(IPlayerSession p)
|
||||
|
||||
Reference in New Issue
Block a user