Blaze.Server.PlayerRemovedNotification.Notify C# (CSharp) Method

Notify() public static method

public static Notify ( Client client, ulong playerID ) : void
client Client
playerID ulong
return void
        public static void Notify(Client client, ulong playerID)
        {
            var data = new List<Tdf>
            {
                new TdfInteger("GID", client.GameID),
                new TdfInteger("PID", playerID),
                new TdfInteger("REAS", 1)
            };

            client.Notify(Component.GameManager, 0x28, 0, data);
        }
    }

Usage Example

        public static void HandleRequest(Request request)
        {
            Log.Info(string.Format("Client {0} updating mesh connection", request.Client.ID));

            var gameID = (TdfInteger)request.Data["GID"];

            var targ     = (TdfList)request.Data["TARG"];
            var targData = (List <Tdf>)targ.List[0];
            var playerID = (TdfInteger)targData[1];
            var stat     = (TdfInteger)targData[2];

            request.Reply();

            if (stat.Value == 2)
            {
                if (request.Client.Type == ClientType.GameplayUser)
                {
                    GamePlayerStateChangeNotification.Notify(request.Client, gameID.Value, request.Client.User.ID);
                    PlayerJoinCompletedNotification.Notify(request.Client, gameID.Value, request.Client.User.ID);
                }
                else if (request.Client.Type == ClientType.DedicatedServer)
                {
                    GamePlayerStateChangeNotification.Notify(request.Client, gameID.Value, playerID.Value);
                    PlayerJoinCompletedNotification.Notify(request.Client, gameID.Value, playerID.Value);
                }
            }
            else if (stat.Value == 0)
            {
                if (request.Client.Type == ClientType.GameplayUser)
                {
                    var game = GameManager.Games[gameID.Value];
                    game.Slots.Remove(playerID.Value);

                    PlayerRemovedNotification.Notify(request.Client, playerID.Value);
                }
                else if (request.Client.Type == ClientType.DedicatedServer)
                {
                    var game = GameManager.Games[gameID.Value];
                    game.Slots.Remove(playerID.Value);

                    PlayerRemovedNotification.Notify(request.Client, playerID.Value);
                }
            }
        }
PlayerRemovedNotification