Notify() public static method

public static Notify ( Client client, ulong userID, string userName ) : void
client Client
userID ulong
userName string
return void
        public static void HandleRequest(Request request)
        {
            Log.Info(string.Format("Client {0} logging in to persona {1}", request.Client.ID, request.Client.User.Name));

            var data = new List <Tdf>
            {
                new TdfInteger("BUID", request.Client.User.ID),
                new TdfInteger("FRST", 0),
                new TdfString("KEY", ""),
                new TdfInteger("LLOG", Utils.GetUnixTime()),
                new TdfString("MAIL", request.Client.User.Email),
                new TdfStruct("PDTL", new List <Tdf>
                {
                    new TdfString("DSNM", request.Client.User.Name),
                    new TdfInteger("LAST", Utils.GetUnixTime()),
                    new TdfInteger("PID", request.Client.User.ID),
                    new TdfInteger("STAS", 2),
                    new TdfInteger("XREF", 0),
                    new TdfInteger("XTYP", (ulong)ExternalRefType.Unknown)
                }),
                new TdfInteger("UID", (ulong)request.Client.ID)
            };

            request.Reply(0, data);

            UserAddedNotification.Notify(request.Client, request.Client.User.ID, request.Client.User.Name);
            UserUpdatedNotification.Notify(request.Client, request.Client.User.ID);
        }
Beispiel #2
0
        public static void HandleRequest(Request request)
        {
            var personaID = (TdfInteger)request.Data["PID"];

            var user = Configuration.Users.Find(u => u.ID == personaID.Value);

            request.Client.User = user;

            var data = new List <Tdf>
            {
                new TdfInteger("AGUP", 0),
                new TdfString("LDHT", ""),
                new TdfInteger("NTOS", 0),
                new TdfString("PCTK", ""),
                new TdfString("PRIV", ""),
                new TdfStruct("SESS", new List <Tdf>
                {
                    new TdfInteger("BUID", request.Client.User.ID),
                    new TdfInteger("FRST", 0),
                    new TdfString("KEY", ""),
                    new TdfInteger("LLOG", 0),
                    new TdfString("MAIL", request.Client.User.Email),
                    new TdfStruct("PDTL", new List <Tdf>
                    {
                        new TdfString("DSNM", request.Client.User.Name),
                        new TdfInteger("LAST", 0),
                        new TdfInteger("PID", request.Client.User.ID),
                        new TdfInteger("STAS", 0),
                        new TdfInteger("XREF", 0),
                        new TdfInteger("XTYP", (ulong)ExternalRefType.Unknown)
                    }),
                    new TdfInteger("UID", (ulong)request.Client.ID)
                }),
                new TdfInteger("SPAM", 0),
                new TdfString("THST", ""),
                new TdfString("TSUI", ""),
                new TdfString("TURI", "")
            };

            request.Reply(0, data);

            UserAddedNotification.Notify(request.Client, request.Client.User.ID, request.Client.User.Name);
            UserUpdatedNotification.Notify(request.Client, request.Client.User.ID);
        }
        public static void HandleRequest(Request request)
        {
            var gameID = (TdfInteger)request.Data["GID"];

            if (!GameManager.Games.ContainsKey(gameID.Value))
            {
                request.Reply(0x12D0004, null);
                return;
            }

            request.Client.GameID = gameID.Value;

            var data = new List <Tdf>
            {
                new TdfInteger("GID", (ulong)gameID.Value),
                new TdfInteger("JGS", 0)
            };

            request.Reply(0, data);

            var game       = GameManager.Games[gameID.Value];
            var gameClient = BlazeServer.Clients[game.ClientID];

            game.Slots.Add(request.Client.User.ID);
            var slotID = game.Slots.FindIndex(slot => slot == request.Client.User.ID);

            Log.Info(string.Format("Client {0} reserving slot {1} in game {2}", request.Client.ID, slotID, gameID.Value));

            UserAddedNotification.Notify(request.Client, gameClient.User.ID, gameClient.User.Name);
            UserUpdatedNotification.Notify(request.Client, gameClient.User.ID);

            PlayerJoiningNotification.Notify(request.Client);

            JoiningPlayerInitiateConnectionsNotification.Notify(request.Client);
            PlayerClaimingReservationNotification.Notify(request.Client);
        }