[Feat] Sockets admins (#56)
* pm event * player joined/left * Banned event * ban command * roleban event * Job ban event fixed + JobBan command * Restart round command * Update RoleBanCommand.cs * typos
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Content.Server.Database;
|
||||
using Content.Server.UtkaIntegration;
|
||||
using Content.Shared.GameTicking;
|
||||
using Content.Shared.GameWindow;
|
||||
using Content.Shared.Players;
|
||||
@@ -16,6 +17,7 @@ namespace Content.Server.GameTicking
|
||||
{
|
||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||
[Dependency] private readonly IServerDbManager _dbManager = default!;
|
||||
[Dependency] private readonly UtkaTCPWrapper _utkaSockets = default!; // WD
|
||||
|
||||
private void InitializePlayer()
|
||||
{
|
||||
@@ -65,6 +67,14 @@ namespace Content.Server.GameTicking
|
||||
? Loc.GetString("player-first-join-message", ("name", args.Session.Name))
|
||||
: Loc.GetString("player-join-message", ("name", args.Session.Name)));
|
||||
|
||||
//WD start
|
||||
var utkaPlayerJoined = new UtkaPlayerJoinedEvent()
|
||||
{
|
||||
Ckey = args.Session.Name
|
||||
};
|
||||
_utkaSockets.SendMessageToAll(utkaPlayerJoined);
|
||||
//WD end
|
||||
|
||||
if (LobbyEnabled && _roundStartCountdownHasNotStartedYetDueToNoPlayers)
|
||||
{
|
||||
_roundStartCountdownHasNotStartedYetDueToNoPlayers = false;
|
||||
@@ -123,6 +133,14 @@ namespace Content.Server.GameTicking
|
||||
mind.Session = null;
|
||||
}
|
||||
|
||||
//WD start
|
||||
var utkaPlayerLeft = new UtkaPlayerLeftEvent()
|
||||
{
|
||||
Ckey = args.Session.Name
|
||||
};
|
||||
_utkaSockets.SendMessageToAll(utkaPlayerLeft);
|
||||
//WD end
|
||||
|
||||
if (_playerGameStatuses.ContainsKey(args.Session.UserId)) //WD-EDIT
|
||||
_userDb.ClientDisconnected(session);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user