本文整理汇总了Java中org.anjocaido.groupmanager.GroupManager类的典型用法代码示例。如果您正苦于以下问题:Java GroupManager类的具体用法?Java GroupManager怎么用?Java GroupManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GroupManager类属于org.anjocaido.groupmanager包,在下文中一共展示了GroupManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: changeUserGroup
import org.anjocaido.groupmanager.GroupManager; //导入依赖的package包/类
public static boolean changeUserGroup(Player player, String groupName) {
OverloadedWorldHolder dataHolder = null;
if (player != null) {
dataHolder = ((GroupManager) Bukkit.getPluginManager().getPlugin("GroupManager")).getWorldsHolder().getWorldData(player);
}
if (dataHolder != null) {
Group auxGroup = dataHolder.getGroup(groupName);
User auxUser = dataHolder.getUser(player.getName());
if (auxGroup != null && auxUser != null) {
auxUser.setGroup(auxGroup);
return true;
}
}
return false;
}
开发者ID:AlmuraDev,项目名称:AlmuraForgeBridge,代码行数:18,代码来源:UserUtil.java
示例2: addUserPermission
import org.anjocaido.groupmanager.GroupManager; //导入依赖的package包/类
public static boolean addUserPermission(Player player, String permission) {
OverloadedWorldHolder dataHolder = null;
if (player != null) {
dataHolder = ((GroupManager) Bukkit.getPluginManager().getPlugin("GroupManager")).getWorldsHolder().getWorldData(player);
}
if (dataHolder != null) {
User auxUser = dataHolder.getUser(player.getName());
if (!auxUser.hasSamePermissionNode(permission)) {
auxUser.addPermission(permission);
return true;
}
}
return false;
}
开发者ID:AlmuraDev,项目名称:AlmuraForgeBridge,代码行数:17,代码来源:UserUtil.java
示例3: playerAdd
import org.anjocaido.groupmanager.GroupManager; //导入依赖的package包/类
@Override
public boolean playerAdd(String worldName, String playerName, String permission) {
OverloadedWorldHolder owh;
if (worldName == null) {
owh = groupManager.getWorldsHolder().getWorldDataByPlayerName(playerName);
} else {
owh = groupManager.getWorldsHolder().getWorldData(worldName);
}
if (owh == null) {
return false;
}
User user = owh.getUser(playerName);
if (user == null) {
return false;
}
user.addPermission(permission);
Player p = Bukkit.getPlayer(playerName);
if (p != null) {
GroupManager.BukkitPermissions.updatePermissions(p);
}
return true;
}
开发者ID:Realmcraft,项目名称:Vault,代码行数:25,代码来源:Permission_GroupManager.java
示例4: playerRemove
import org.anjocaido.groupmanager.GroupManager; //导入依赖的package包/类
@Override
public boolean playerRemove(String worldName, String playerName, String permission) {
OverloadedWorldHolder owh;
if (worldName == null) {
owh = groupManager.getWorldsHolder().getWorldDataByPlayerName(playerName);
} else {
owh = groupManager.getWorldsHolder().getWorldData(worldName);
}
if (owh == null) {
return false;
}
User user = owh.getUser(playerName);
if (user == null) {
return false;
}
user.removePermission(permission);
Player p = Bukkit.getPlayer(playerName);
if (p != null) {
GroupManager.BukkitPermissions.updatePermissions(p);
}
return true;
}
开发者ID:Realmcraft,项目名称:Vault,代码行数:25,代码来源:Permission_GroupManager.java
示例5: onPlayerQuit
import org.anjocaido.groupmanager.GroupManager; //导入依赖的package包/类
@EventHandler(priority = EventPriority.LOWEST)
public void onPlayerQuit(PlayerQuitEvent event)
{
if (!GroupManager.isLoaded())
{
return;
}
Player player = event.getPlayer();
/*
* force remove any attachments as bukkit may not
*/
removeAttachment(player);
}
开发者ID:Curtis3321,项目名称:Essentials,代码行数:17,代码来源:BukkitPermissions.java
示例6: flagAsChanged
import org.anjocaido.groupmanager.GroupManager; //导入依赖的package包/类
public void flagAsChanged()
{
WorldDataHolder testSource = getDataSource();
String source = "";
if (testSource == null)
{
source = "GlobalGroups";
}
else
{
source = testSource.getName();
}
GroupManager.logger.finest("DataSource: " + source + " - DataUnit: " + getName() + " flagged as changed!");
// for(StackTraceElement st: Thread.currentThread().getStackTrace()){
// GroupManager.logger.finest(st.toString());
// }
sorted = false;
changed = true;
}
开发者ID:Curtis3321,项目名称:Essentials,代码行数:23,代码来源:DataUnit.java
示例7: flagAsSaved
import org.anjocaido.groupmanager.GroupManager; //导入依赖的package包/类
public void flagAsSaved()
{
WorldDataHolder testSource = getDataSource();
String source = "";
if (testSource == null)
{
source = "GlobalGroups";
}
else
{
source = testSource.getName();
}
GroupManager.logger.finest("DataSource: " + source + " - DataUnit: " + getName() + " flagged as saved!");
changed = false;
}
开发者ID:Curtis3321,项目名称:Essentials,代码行数:19,代码来源:DataUnit.java
示例8: addInherits
import org.anjocaido.groupmanager.GroupManager; //导入依赖的package包/类
/**
* @param inherit the inherits to set
*/
public void addInherits(Group inherit)
{
if (!isGlobal())
{
if (!this.getDataSource().groupExists(inherit.getName()))
{
getDataSource().addGroup(inherit);
}
if (!inherits.contains(inherit.getName().toLowerCase()))
{
inherits.add(inherit.getName().toLowerCase());
}
flagAsChanged();
if (GroupManager.isLoaded())
{
GroupManager.BukkitPermissions.updateAllPlayers();
GroupManagerEventHandler.callEvent(this, Action.GROUP_INHERITANCE_CHANGED);
}
}
}
开发者ID:Curtis3321,项目名称:Essentials,代码行数:25,代码来源:Group.java
示例9: setVariables
import org.anjocaido.groupmanager.GroupManager; //导入依赖的package包/类
/**
*
* @param varList
*/
public void setVariables(Map<String, Object> varList)
{
if (!isGlobal())
{
GroupVariables temp = new GroupVariables(this, varList);
variables.clearVars();
for (String key : temp.getVarKeyList())
{
variables.addVar(key, temp.getVarObject(key));
}
flagAsChanged();
if (GroupManager.isLoaded())
{
GroupManager.BukkitPermissions.updateAllPlayers();
GroupManagerEventHandler.callEvent(this, Action.GROUP_INFO_CHANGED);
}
}
}
开发者ID:Curtis3321,项目名称:Essentials,代码行数:24,代码来源:Group.java
示例10: removeSubGroup
import org.anjocaido.groupmanager.GroupManager; //导入依赖的package包/类
public boolean removeSubGroup(Group subGroup)
{
try
{
if (subGroups.remove(subGroup.getName()))
{
flagAsChanged();
if (GroupManager.isLoaded())
{
if (!GroupManager.BukkitPermissions.isPlayer_join())
{
GroupManager.BukkitPermissions.updatePlayer(getBukkitPlayer());
}
}
GroupManagerEventHandler.callEvent(this, Action.USER_SUBGROUP_CHANGED);
return true;
}
}
catch (Exception e)
{
}
return false;
}
开发者ID:Curtis3321,项目名称:Essentials,代码行数:25,代码来源:User.java
示例11: setVariables
import org.anjocaido.groupmanager.GroupManager; //导入依赖的package包/类
/**
*
* @param varList
*/
public void setVariables(Map<String, Object> varList)
{
//UserVariables temp = new UserVariables(this, varList);
variables.clearVars();
for (String key : varList.keySet())
{
variables.addVar(key, varList.get(key));
}
flagAsChanged();
if (GroupManager.isLoaded())
{
//if (!GroupManager.BukkitPermissions.isPlayer_join())
// GroupManager.BukkitPermissions.updatePlayer(this.getName());
GroupManagerEventHandler.callEvent(this, Action.USER_INFO_CHANGED);
}
}
开发者ID:Curtis3321,项目名称:Essentials,代码行数:22,代码来源:User.java
示例12: getWorldData
import org.anjocaido.groupmanager.GroupManager; //导入依赖的package包/类
/**
* Returns the dataHolder for the given world. If the world is not on the worlds list, returns the default world
* holder.
*
* Mirrors return their parent world data. If no mirroring data it returns the default world.
*
* @param worldName
* @return OverloadedWorldHolder
*/
public OverloadedWorldHolder getWorldData(String worldName)
{
String worldNameLowered = worldName.toLowerCase();
// Find this worlds data
if (worldsData.containsKey(worldNameLowered))
{
return getUpdatedWorldData(worldNameLowered);
}
// Oddly no data source was found for this world so return the default.
GroupManager.logger.finest("Requested world " + worldName + " not found or badly mirrored. Returning default world...");
return getDefaultWorld();
}
开发者ID:Curtis3321,项目名称:Essentials,代码行数:25,代码来源:WorldsHolder.java
示例13: verifyFirstRun
import org.anjocaido.groupmanager.GroupManager; //导入依赖的package包/类
private void verifyFirstRun()
{
Properties server = new Properties();
try
{
server.load(new FileInputStream(new File("server.properties")));
serverDefaultWorldName = server.getProperty("level-name").toLowerCase();
setupWorldFolder(serverDefaultWorldName);
}
catch (IOException ex)
{
GroupManager.logger.log(Level.SEVERE, null, ex);
}
}
开发者ID:Curtis3321,项目名称:Essentials,代码行数:17,代码来源:WorldsHolder.java
示例14: addUser
import org.anjocaido.groupmanager.GroupManager; //导入依赖的package包/类
/**
* Add a user to the list. If it already exists, overwrite the old.
*
* @param theUser the user you want to add to the permission list
*/
public void addUser(User theUser)
{
if (theUser.getDataSource() != this)
{
theUser = theUser.clone(this);
}
if (theUser == null)
{
return;
}
if ((theUser.getGroup() == null))
{
theUser.setGroup(groups.getDefaultGroup());
}
removeUser(theUser.getName());
getUsers().put(theUser.getName().toLowerCase(), theUser);
setUsersChanged(true);
if (GroupManager.isLoaded())
{
GroupManagerEventHandler.callEvent(theUser, Action.USER_ADDED);
}
}
开发者ID:Curtis3321,项目名称:Essentials,代码行数:29,代码来源:WorldDataHolder.java
示例15: removeUser
import org.anjocaido.groupmanager.GroupManager; //导入依赖的package包/类
/**
* Removes the user from the list. (he might become a default user)
*
* @param userName the username from the user to remove
* @return true if it had something to remove
*/
public boolean removeUser(String userName)
{
if (getUsers().containsKey(userName.toLowerCase()))
{
getUsers().remove(userName.toLowerCase());
setUsersChanged(true);
if (GroupManager.isLoaded())
{
GroupManagerEventHandler.callEvent(userName, GMUserEvent.Action.USER_REMOVED);
}
return true;
}
return false;
}
开发者ID:Curtis3321,项目名称:Essentials,代码行数:22,代码来源:WorldDataHolder.java
示例16: addGroup
import org.anjocaido.groupmanager.GroupManager; //导入依赖的package包/类
/**
* Add a group to the list
*
* @param groupToAdd
*/
public void addGroup(Group groupToAdd)
{
if (groupToAdd.getName().toLowerCase().startsWith("g:"))
{
GroupManager.getGlobalGroups().addGroup(groupToAdd);
GroupManagerEventHandler.callEvent(groupToAdd, GMGroupEvent.Action.GROUP_ADDED);
return;
}
if (groupToAdd.getDataSource() != this)
{
groupToAdd = groupToAdd.clone(this);
}
removeGroup(groupToAdd.getName());
getGroups().put(groupToAdd.getName().toLowerCase(), groupToAdd);
setGroupsChanged(true);
if (GroupManager.isLoaded())
{
GroupManagerEventHandler.callEvent(groupToAdd, GMGroupEvent.Action.GROUP_ADDED);
}
}
开发者ID:Curtis3321,项目名称:Essentials,代码行数:28,代码来源:WorldDataHolder.java
示例17: removeGroup
import org.anjocaido.groupmanager.GroupManager; //导入依赖的package包/类
/**
* Remove the group from the list
*
* @param groupName
* @return true if had something to remove. false the group was default or non-existant
*/
public boolean removeGroup(String groupName)
{
if (groupName.toLowerCase().startsWith("g:"))
{
return GroupManager.getGlobalGroups().removeGroup(groupName);
}
if (getDefaultGroup() != null && groupName.equalsIgnoreCase(getDefaultGroup().getName()))
{
return false;
}
if (getGroups().containsKey(groupName.toLowerCase()))
{
getGroups().remove(groupName.toLowerCase());
setGroupsChanged(true);
if (GroupManager.isLoaded())
{
GroupManagerEventHandler.callEvent(groupName.toLowerCase(), GMGroupEvent.Action.GROUP_REMOVED);
}
return true;
}
return false;
}
开发者ID:Curtis3321,项目名称:Essentials,代码行数:32,代码来源:WorldDataHolder.java
示例18: load
import org.anjocaido.groupmanager.GroupManager; //导入依赖的package包/类
/**
* Returns a NEW data holder containing data read from the files
*
* @param worldName
* @param groupsFile
* @param usersFile
*
* @throws FileNotFoundException
* @throws IOException
*/
public static WorldDataHolder load(String worldName, File groupsFile, File usersFile) throws FileNotFoundException, IOException
{
WorldDataHolder ph = new WorldDataHolder(worldName);
GroupManager.setLoaded(false);
if (groupsFile != null)
{
loadGroups(ph, groupsFile);
}
if (usersFile != null)
{
loadUsers(ph, usersFile);
}
GroupManager.setLoaded(true);
return ph;
}
开发者ID:Curtis3321,项目名称:Essentials,代码行数:29,代码来源:WorldDataHolder.java
示例19: removeOldFiles
import org.anjocaido.groupmanager.GroupManager; //导入依赖的package包/类
public static void removeOldFiles(GroupManager gm, File folder)
{
if (folder.isDirectory())
{
long oldTime = System.currentTimeMillis() - (((long)gm.getGMConfig().getBackupDuration() * 60 * 60) * 1000);
for (File olds : folder.listFiles())
{
if (olds.isFile())
{
if (olds.lastModified() < oldTime)
{
try
{
olds.delete();
}
catch (Exception e)
{
}
}
}
}
}
}
开发者ID:Curtis3321,项目名称:Essentials,代码行数:25,代码来源:Tasks.java
示例20: onWorldInit
import org.anjocaido.groupmanager.GroupManager; //导入依赖的package包/类
@EventHandler(priority = EventPriority.LOWEST)
public void onWorldInit(WorldInitEvent event)
{
String worldName = event.getWorld().getName();
if (GroupManager.isLoaded() && !plugin.getWorldsHolder().isInList(worldName))
{
GroupManager.logger.info("New world detected...");
GroupManager.logger.info("Creating data for: " + worldName);
plugin.getWorldsHolder().setupWorldFolder(worldName);
plugin.getWorldsHolder().loadWorld(worldName);
if (plugin.getWorldsHolder().isInList(worldName))
{
GroupManager.logger.info("Don't forget to configure/mirror this world in config.yml.");
}
else
{
GroupManager.logger.severe("Failed to configure this world.");
}
}
}
开发者ID:Curtis3321,项目名称:Essentials,代码行数:23,代码来源:GMWorldListener.java
注:本文中的org.anjocaido.groupmanager.GroupManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论