コード例 #1
0
 public void TryGetValue(string warpName, out Warp warp)
 {
     warps.TryGetValue(warpName, out warp);
 }
コード例 #2
0
 public void Add(string warpName, Warp warp)
 {
     warps.Add(warpName, warp);
 }
コード例 #3
0
        public void writePersonalWarp(Player player, string warpName)
        {
            Passport passport = passportManager.getPassport(player);

            // must be logged in to save a personal warp
            if (passport == null) {
                player.sendMessage("Error: Must be logged in to Passport to create a personal warp.", 255, 255f, 0f, 0f);
                return;
            }

            if (personalWarpExists(player, warpName)) {
                player.sendMessage("Error: Personal warp <" + warpName + "> exists.", 255, 255f, 0f, 0f);
                return;
            }

            User user = passport.getUser();
            Warp warp = new Warp();
            warp.type = WarpType.PERSONAL;
            warp.name = warpName;
            warp.owner = user.username; // use Account username here
            warp.loc.X = player.Location.X;
            warp.loc.Y = player.Location.Y;

            WarpList personalWarpList = getPersonalWarpList(player);
            try {
                personalWarpList.Add(warp.name, warp);
                vault.store(personalWarpList);
            } catch (Exception e) {

            }

            player.sendMessage("Personal warp <" + warpName + "> created.", 255, 0f, 255f, 255f);
            warpDrivePlugin.Log(player.Name + " created personal warp " + warpName + " at " + warp.loc.X + "," + warp.loc.Y);
        }
コード例 #4
0
 // Warps the player to the warp
 private void warpPlayerTo(Player player, Warp warp)
 {
     player.teleportTo(warp.loc.X, warp.loc.Y);
     player.sendMessage("Warped to " + warp.type + " warp <" + warp.name + ">.", 255, 0f, 255f, 255f);
     warpDrivePlugin.Log(player.Name + " used /warp " + warp.name);
 }
コード例 #5
0
        public void writeGlobalWarp(Player player, string warpName)
        {
            Passport passport = passportManager.getPassport(player);

            // must be logged in to save a personal warp
            if (passport == null) {
                player.sendMessage("Error: Must be logged in to Passport to create a global warp.", 255, 255f, 0f, 0f);
                return;
            }

            if (globalWarpExists(warpName)) {
                player.sendMessage("Error: Global warp <" + warpName + "> exists.", 255, 255f, 0f, 0f);
                return;
            }

            User user = passport.getUser();
            Warp warp = new Warp();
            warp.type = WarpType.GLOBAL;
            warp.name = warpName;
            warp.owner = user.username;
            warp.loc.X = player.Location.X;
            warp.loc.Y = player.Location.Y;

            globalWarpList.Add(warpName, warp);
            vault.store(globalWarpList);
            player.sendMessage("Global warp <" + warpName + "> created.", 255, 0f, 255f, 255f);
            warpDrivePlugin.Log(player.Name + " created global warp " + warpName + " at " + warp.loc.X + "," + warp.loc.Y);
        }