Beispiel #1
0
        private static void ResolvedPrivileges(PlayerInfo pi, Privileges priv)
        {
            Player player = Player.FindByUserId(pi.UserId);

            // Player isn't in the server any more, just stop it.
            if (player == null) {
                return;
            }

            OnAssignPrivileges(player, priv == null ? player.Privileges : priv);
        }
Beispiel #2
0
 /// <summary>
 /// Constructor for internal building of Players
 /// </summary>
 /// <param name="entity">
 /// Pointer to the entity struct of a player <see cref="IntPtr"/>
 /// </param>
 internal Player(IntPtr entity)
     : base(entity)
 {
     Privileges = new Privileges("");
 }
Beispiel #3
0
        internal static void OnAssignPrivileges(Player player, Privileges privileges)
        {
            player.Privileges = privileges;
            var args = new AssignPrivilegesEventArgs(player);
            OnAssignPrivileges(args);
            player.OnPlayerAssignPrivileges(args);

            PlayerInfo pi = new PlayerInfo(player);

            SharpMod.Database.GetActiveBan(pi, ResolvedBans);
        }
Beispiel #4
0
 public void LoadPrivileges(IPlayerExtendedInfo player, Action<Privileges> callback)
 {
     Privileges priv = new Privileges("");
       Client.Query(string.Format("SELECT * FROM users WHERE uniqueid = '{0}' LIMIT 1", player.AuthId))
       .On(row: (row) => {
       priv = new Privileges(row.GetValue("access") as string);
       }, end: () => {
       callback(priv);
       });
 }