FindByUserId() public static method

public static FindByUserId ( int id ) : Player
id int
return Player
示例#1
0
文件: Command.cs 项目: voed/sharpmod
        protected virtual void OnFailure(int userid, string errorMessage)
        {
            Player player = Player.FindByUserId(userid);

            WriteLine(player, errorMessage);
            OnFailure(player);
        }
示例#2
0
文件: Command.cs 项目: voed/sharpmod
        protected virtual void OnFailure(int userid, Exception exception)
        {
            Player player = Player.FindByUserId(userid);

            WriteLine(player, exception.Message);
            WriteLine(player, exception.StackTrace);
            OnFailure(player);
        }
示例#3
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);
        }
示例#4
0
        private static void ResolvedBans(BanInfo information)
        {
            if (information == null)
            {
                return;
            }

            Player target = Player.FindByUserId(information.Player.UserId);

            if (target == null)
            {
                return;
            }

            if (!target.Privileges.HasPrivilege("noban"))
            {
                target.Kick(information.Reason);
            }
        }
示例#5
0
文件: Command.cs 项目: voed/sharpmod
 protected virtual void OnFailure(int userid)
 {
     OnFailure(Player.FindByUserId(userid));
 }
示例#6
0
文件: Command.cs 项目: voed/sharpmod
 protected void OnSuccess(int userid)
 {
     OnSuccess(Player.FindByUserId(userid));
 }