示例#1
0
        public void addUser(Player p)
        {
            ClanUser user = new ClanUser(p, this);

            if (p.getLoginDetails().getUsername().Equals(owner))
            {
                user.setClanRights(ClanRank.OWNER);
                own = p;
            }
            if (ownerFriends.Contains(p.getLoginDetails().getLongName()))
            {
                if (user.getClanRights() == ClanRank.NO_RANK)
                {
                    user.setClanRights(ClanRank.FRIEND);
                }
            }

            foreach (KeyValuePair <string, ClanRank> u in usersWithRank)
            {
                if (u.Key.Equals(p.getLoginDetails().getUsername()))
                {
                    user.setClanRights(u.Value);
                    break;
                }
            }
            p.setClan(this);
            lock (users)
            {
                users.Add(user);
            }
        }
示例#2
0
文件: Clan.cs 项目: ramatronics/rsps
        public void addUser(Player p)
        {
            ClanUser user = new ClanUser(p, this);
            if (p.getLoginDetails().getUsername().Equals(owner))
            {
                user.setClanRights(ClanRank.OWNER);
                own = p;
            }
            if (ownerFriends.Contains(p.getLoginDetails().getLongName()))
            {
                if (user.getClanRights() == ClanRank.NO_RANK)
                {
                    user.setClanRights(ClanRank.FRIEND);
                }
            }

            foreach (KeyValuePair<string, ClanRank> u in usersWithRank)
            {
                if (u.Key.Equals(p.getLoginDetails().getUsername()))
                {
                    user.setClanRights(u.Value);
                    break;
                }
            }
            p.setClan(this);
            lock (users)
            {
                users.Add(user);
            }
        }
示例#3
0
        public void kickUser(long name)
        {
            ClanUser user = getUserByName(Misc.longToPlayerName(name));

            if (user != null)
            {
                removeUser(user.getClanMember());
                user.getClanMember().getPackets().resetClanInterface();
                Server.getClanManager().updateClan(this);
                user.getClanMember().getPackets().sendMessage("You have been kicked from the clan channel.");
            }
        }