当前位置: 首页>>代码示例>>C#>>正文


C# Player.getLoginDetails方法代码示例

本文整理汇总了C#中Player.getLoginDetails方法的典型用法代码示例。如果您正苦于以下问题:C# Player.getLoginDetails方法的具体用法?C# Player.getLoginDetails怎么用?C# Player.getLoginDetails使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Player的用法示例。


在下文中一共展示了Player.getLoginDetails方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: canThieveChest

 protected static bool canThieveChest(Player p, int index, ushort chestId, int x, int y)
 {
     if (p == null || p.isDead() || p.isDestroyed() || p.isDisconnected())
     {
         return false;
     }
     if (!Server.getGlobalObjects().objectExists(chestId, new Location(x, y, 0)))
     {
         Misc.WriteError(p.getLoginDetails().getUsername() + " tried to steal from a non existing chest!");
         return false;
     }
     if (p.getInventory().getTotalFreeSlots() < CHEST_REWARD[index].Length)
     {
         p.getPackets().sendMessage("You don't have enough free inventory space for the loot from that chest.");
         return false;
     }
     if (!Server.getGlobalObjects().originalObjectExists(chestId, new Location(x, y, 0)))
     {
         return false;
     }
     if (p.getSkills().getGreaterLevel(Skills.SKILL.THIEVING) < CHEST_LVL[index])
     {
         p.getPackets().sendMessage("You need a Thieving level of " + CHEST_LVL[index] + " to steal from this chest.");
         return false;
     }
     return true;
 }
开发者ID:ramatronics,项目名称:rsps,代码行数:27,代码来源:Thieving.cs

示例2: patchExists

 public Patch patchExists(Player p, int index)
 {
     foreach (Patch patch in patches)
     {
         if (patch.getOwnerName().Equals(p.getLoginDetails().getUsername()))
         {
             if (patch.getPatchIndex() == index)
             {
                 return patch;
             }
         }
     }
     return null;
 }
开发者ID:ramatronics,项目名称:rsps,代码行数:14,代码来源:FarmingPatches.cs

示例3: doGemDialogue

        private static void doGemDialogue(Player p, int dialogueStatus)
        {
            int newStatus = -1;
            int index = -1;
            for (int i = 0; i < SLAYER_MASTERS.Length; i++) {
                if (p.getSkills().getCombatLevel() >= (int)SLAYER_MASTERS[i][1]) {
                    index = i;
                }
            }
            switch(dialogueStatus) {
                case 1051:
                    p.getPackets().sendNPCHead((int)SLAYER_MASTERS[index][0], 241, 2);
                    p.getPackets().modifyText((string)SLAYER_MASTERS[index][2], 241, 3);
                    p.getPackets().modifyText("Hello there " + p.getLoginDetails().getUsername() + "! what can i help you with?", 241, 4);
                    p.getPackets().animateInterface(9827, 241, 2);
                    p.getPackets().sendChatboxInterface2(241);
                    newStatus = 1052;
                    break;

                case 1052:
                    p.getPackets().modifyText("How am i doing so far?.", 238, 1);
                    p.getPackets().modifyText("Who are you?", 238, 2);
                    p.getPackets().modifyText("Where are you?", 238, 3);
                    p.getPackets().modifyText("Got any tips for me?", 238, 4);
                    p.getPackets().modifyText("Nevermind.", 238, 5);
                    p.getPackets().sendChatboxInterface2(238);
                    newStatus = 1053;
                    break;

                case 1053:
                    p.getPackets().sendPlayerHead(64, 2);
                    p.getPackets().modifyText(p.getLoginDetails().getUsername(), 64, 3);
                    p.getPackets().modifyText("How am i doing so far?", 64, 4);
                    p.getPackets().animateInterface(9827, 64, 2);
                    p.getPackets().sendChatboxInterface2(64);
                    newStatus = 1054;
                    break;

                case 1054:
                    if (p.getSlayerTask() != null) {
                        SlayerTask task = p.getSlayerTask();
                        object[][] data = getMasterData(task.getMasterIndex());
                        p.getPackets().sendNPCHead((int)SLAYER_MASTERS[index][0], 242, 2);
                        p.getPackets().modifyText((string)SLAYER_MASTERS[index][2], 242, 3);
                        p.getPackets().modifyText("You're currently assigned to kill " + (string) data[task.getMonsterIndex()][0] + "; only", 242, 4);
                        p.getPackets().modifyText(task.getAmount() + " more to go.", 242, 5);
                        p.getPackets().animateInterface(9827, 242, 2);
                        p.getPackets().sendChatboxInterface2(242);
                    } else {
                        p.getPackets().sendNPCHead((int)SLAYER_MASTERS[index][0], 242, 2);
                        p.getPackets().modifyText((string)SLAYER_MASTERS[index][2], 242, 3);
                        p.getPackets().modifyText("You're aren't assigned anything to kill, perhaps", 242, 4);
                        p.getPackets().modifyText("you should come and see me soon.", 242, 5);
                        p.getPackets().animateInterface(9827, 242, 2);
                        p.getPackets().sendChatboxInterface2(242);
                    }
                    newStatus = 1052;
                    break;

                case 1055:
                    p.getPackets().sendPlayerHead(64, 2);
                    p.getPackets().modifyText(p.getLoginDetails().getUsername(), 64, 3);
                    p.getPackets().modifyText("Who are you?", 64, 4);
                    p.getPackets().animateInterface(9827, 64, 2);
                    p.getPackets().sendChatboxInterface2(64);
                    newStatus = 1056;
                    break;

                case 1056:
                    p.getPackets().sendNPCHead((int)SLAYER_MASTERS[index][0], 242, 2);
                    p.getPackets().modifyText((string)SLAYER_MASTERS[index][2], 242, 3);
                    p.getPackets().modifyText("My name is " + (string)SLAYER_MASTERS[index][2] + ", i am the Slayer", 242, 4);
                    p.getPackets().modifyText("master most suited to your combat level.", 242, 5);
                    p.getPackets().animateInterface(9827, 242, 2);
                    p.getPackets().sendChatboxInterface2(242);
                    newStatus = 1052;
                    break;

                case 1057:
                    p.getPackets().sendPlayerHead(64, 2);
                    p.getPackets().modifyText(p.getLoginDetails().getUsername(), 64, 3);
                    p.getPackets().modifyText("Where are you?", 64, 4);
                    p.getPackets().animateInterface(9827, 64, 2);
                    p.getPackets().sendChatboxInterface2(64);
                    newStatus = 1058;
                    break;

                case 1058:
                    p.getPackets().sendNPCHead((int)SLAYER_MASTERS[index][0], 242, 2);
                    p.getPackets().modifyText((string)SLAYER_MASTERS[index][2], 242, 3);
                    p.getPackets().modifyText("I am in " + (string)SLAYER_MASTERS[index][5], 242, 4);
                    p.getPackets().modifyText((string)SLAYER_MASTERS[index][6], 242, 5);
                    p.getPackets().animateInterface(9827, 242, 2);
                    p.getPackets().sendChatboxInterface2(242);
                    newStatus = 1052;
                    break;

                case 1059:
                    p.getPackets().sendPlayerHead(64, 2);
                    p.getPackets().modifyText(p.getLoginDetails().getUsername(), 64, 3);
//.........这里部分代码省略.........
开发者ID:Krill156,项目名称:SharpEMU,代码行数:101,代码来源:Slayer.cs

示例4: doDialogue

        public static void doDialogue(Player p, int dialogueStatus)
        {
            int newStatus = -1;
            p.getPackets().softCloseInterfaces();
            if (dialogueStatus > 1050) {
                doGemDialogue(p, dialogueStatus);
            }
            if (p.getTemporaryAttribute("slayerMaster") == null) {
                return;
            }
            int index = (int)p.getTemporaryAttribute("slayerMaster");
            switch(dialogueStatus) {
                case 1000:
                    p.getPackets().sendNPCHead((int)SLAYER_MASTERS[index][0], 241, 2);
                    p.getPackets().modifyText((string)SLAYER_MASTERS[index][2], 241, 3);
                    p.getPackets().modifyText("Hello, what can i help you with?", 241, 4);
                    p.getPackets().animateInterface(9827, 241, 2);
                    p.getPackets().sendChatboxInterface2(241);
                    newStatus = 1001;
                    break;

                case 1001:
                    p.getPackets().modifyText("I need another Slayer assignment.", 238, 1);
                    p.getPackets().modifyText("Could i see your supplies?", 238, 2);
                    p.getPackets().modifyText("I'd like to discuss Slayer points.", 238, 3);
                    p.getPackets().modifyText("I'd like a Slayer Skillcape.", 238, 4);
                    p.getPackets().modifyText("Er...nothing...", 238, 5);
                    p.getPackets().sendChatboxInterface2(238);
                    newStatus = 1002;
                    break;

                case 1002: // New assignment
                    p.getPackets().sendPlayerHead(64, 2);
                    p.getPackets().modifyText(p.getLoginDetails().getUsername(), 64, 3);
                    p.getPackets().modifyText("I need a new assignment.", 64, 4);
                    p.getPackets().animateInterface(9827, 64, 2);
                    p.getPackets().sendChatboxInterface2(64);
                    newStatus = 1003;
                    break;

                case 1003: // Say they should go to a new master depending on lvl
                    if (p.getSlayerTask() != null) {
                        SlayerTask task = p.getSlayerTask();
                        object[][] data = getMasterData(task.getMasterIndex());
                        if (index > 0) {
                            p.getPackets().sendNPCHead((int)SLAYER_MASTERS[index][0], 243, 2);
                            p.getPackets().modifyText((string)SLAYER_MASTERS[index][2], 243, 3);
                            p.getPackets().modifyText("You are still hunting " + (string) data[task.getMonsterIndex()][0] + ", finish that task then", 243, 4);
                            p.getPackets().modifyText("come back to see me, if you are struggling with your task", 243, 5);
                            p.getPackets().modifyText("then go and see Turael in Burthorpe.", 243, 6);
                            p.getPackets().animateInterface(9827, 243, 2);
                            p.getPackets().sendChatboxInterface2(243);
                            break;
                        } else {
                            p.getPackets().sendNPCHead((int)SLAYER_MASTERS[index][0], 242, 2);
                            p.getPackets().modifyText((string)SLAYER_MASTERS[index][2], 242, 3);
                            p.getPackets().modifyText("You are still hunting " + (string) data[task.getMonsterIndex()][0] + ", although i suppose", 242, 4);
                            p.getPackets().modifyText("i could change it for you.", 242, 5);
                            p.getPackets().animateInterface(9827, 242, 2);
                            p.getPackets().sendChatboxInterface2(242);
                            newStatus = 1016;
                            break;
                        }
                    } else {
                        if (index == 4) {
                            p.getPackets().sendNPCHead((int)SLAYER_MASTERS[index][0], 242, 2);
                            p.getPackets().modifyText((string)SLAYER_MASTERS[index][2], 242, 3);
                            p.getPackets().modifyText("Excellent, you're doing great, your new task is to kill", 242, 4);
                            p.getPackets().modifyText(getTask(p, index), 242, 5);
                            p.getPackets().animateInterface(9827, 242, 2);
                            p.getPackets().sendChatboxInterface2(242);
                            newStatus = 1008;
                            break;
                        }
                        if (p.getSkills().getCombatLevel() >= (int)SLAYER_MASTERS[index + 1][1]) {
                            p.getPackets().sendNPCHead((int)SLAYER_MASTERS[index][0], 242, 2);
                            p.getPackets().modifyText((string)SLAYER_MASTERS[index][2], 242, 3);
                            p.getPackets().modifyText("You're actually very strong. Are you sure you don't", 242, 4);
                            p.getPackets().modifyText("want " + (string)SLAYER_MASTERS[index + 1][2] + " in " + (string)SLAYER_MASTERS[index + 1][7] + " to assign you a task?", 242, 5);
                            p.getPackets().animateInterface(9827, 242, 2);
                            p.getPackets().sendChatboxInterface2(242);
                            newStatus = 1004;
                            break;
                        }
                    }
                    break;

                case 1004:
                    p.getPackets().modifyText("No, that's ok, i'll get a task from you", 557, 2);
                    p.getPackets().modifyText("Oh, ok then, i'll go talk to " + (string)SLAYER_MASTERS[index + 1][2], 557, 3);
                    p.getPackets().sendChatboxInterface2(557);
                    newStatus = 1005;
                    break;

                case 1005:
                    p.getPackets().sendPlayerHead(64, 2);
                    p.getPackets().modifyText(p.getLoginDetails().getUsername(), 64, 3);
                    p.getPackets().modifyText("Oh ok then, i'll go talk to " + (string)SLAYER_MASTERS[index + 1][2] + ".", 64, 4);
                    p.getPackets().animateInterface(9827, 64, 2);
                    p.getPackets().sendChatboxInterface2(64);
//.........这里部分代码省略.........
开发者ID:Krill156,项目名称:SharpEMU,代码行数:101,代码来源:Slayer.cs

示例5: canThieveStall

 private static bool canThieveStall(Player p, int index, ushort stallId, int x, int y)
 {
     if (p == null || p.isDead() || p.isDestroyed() || p.isDisconnected()) {
         return false;
     }
     if (!Server.getGlobalObjects().objectExists(stallId, new Location(x, y, 0))) {
         misc.WriteError(p.getLoginDetails().getUsername() + " tried to steal from a non existing stall!");
         return false;
     }
     if (p.getInventory().findFreeSlot() == -1) {
         p.getPackets().sendMessage("You need a free inventory space for any potential loot.");
         return false;
     }
     if (!Server.getGlobalObjects().originalObjectExists(stallId, new Location(x, y, 0))) {
         return false;
     }
     if (p.getSkills().getGreaterLevel(Skills.SKILL.THIEVING) < STALL_LVL[index]) {
         p.getPackets().sendMessage("You need a Thieving level of " + STALL_LVL[index] + " to steal from this stall.");
         return false;
     }
     return true;
 }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:22,代码来源:Thieving.cs

示例6: tendToPatch

 protected static void tendToPatch(Player p, Location patchLocation, int item, int i)
 {
     Patch patch = null;
     i = getPatchIndex(patchLocation, i);
     if (i == -1) {
         return;
     }
     patch = Server.getGlobalObjects().getFarmingPatches().patchExists(p, i);
     if (patch == null) {
         patch = new Patch(p.getLoginDetails().getUsername(), (PatchType)PATCHES[i][0], i, (int)PATCHES[i][7], (int)PATCHES[i][6]);
         patch.setConfigArray(WEEDS_CONFIG);
         Server.getGlobalObjects().getFarmingPatches().addPatch(patch);
         rakePatch(p, patch);
     } else {
         if (!patch.patchOccupied() && (item == -1 || item == TOOLS[0])) {
             rakePatch(p, patch);
         } else if (patch.isBlankPatch() && item != -1) {
             plantCrop(p, patch, item);
         } else if (patch.isFullyGrown() && (item == -1 || item == TOOLS[3])) {
             harvestCrop(p, patch);
         } else if (patch.isFruitTree() && patch.getStatus() >= 6 && patch.getStatus() <= 11) {
             harvestFruit(p, patch);
         } else if ((patch.isTree() || patch.isFruitTree()) && patch.getStatus() == patch.checkHealthStatus() && !patch.isHealthChecked()) {
             checkTreeHealth(p, patch);
         } else if ((patch.isTree() || patch.isFruitTree()) && patch.getStatus() == patch.chopStatus() && patch.isHealthChecked()) {
             chopTree(p, patch);
         } else if ((patch.isTree() || patch.isFruitTree()) && patch.getStatus() == patch.stumpStatus() && patch.isHealthChecked() && item == TOOLS[3]) {
             digUpTree(p, patch);
         } else if (patch.isFruitTree() && patch.getStatus() == patch.stumpStatus() && !patch.isHealthChecked()) {
             p.getPackets().sendMessage("You must check the tree's health before you can chop it down.");
         } else {
             p.getPackets().sendMessage("Nothing interesting happens.");
         }
     }
 }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:35,代码来源:Farming.cs

示例7: refreshPatches

 public static void refreshPatches(Player p)
 {
     int[] configs = {502, 503, 504, 505, 508, 515};
     for (int i = 0; i < configs.Length; i++) {
         Patch patch = new Patch(p.getLoginDetails().getUsername(), 0);
         patch.setConfig(configs[i]);
         setConfig(p, patch);
     }
 }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:9,代码来源:Farming.cs

示例8: plantSapling

 public static bool plantSapling(Player p, int itemUsed, int usedWith)
 {
     if (itemUsed != TOOLS[4] && usedWith != TOOLS[4]) {
         return false;
     }
     int itemOne = itemUsed;
     int itemTwo = usedWith;
     for (int i = 0; i < 2; i++) {
         if (i == 1) {
             itemOne = usedWith;
             itemTwo = itemUsed;
         }
         for (int j = 0; j < SAPLING_DATA.Length; j++) {
             if (itemOne == (int)SAPLING_DATA[j][0] && itemTwo == TOOLS[4]) {
                 if (!p.getInventory().hasItem(TOOLS[2])) {
                     p.getPackets().sendMessage("You don't have a trowel.");
                     return true;
                 }
                 if (!p.getInventory().hasItem(TOOLS[4])) {
                     p.getPackets().sendMessage("You need a plant pot filled with compost to do this.");
                     return true;
                 }
                 string s = j == 0 ? "" : "seed";
                 if (p.getInventory().deleteItem((int)SAPLING_DATA[j][0])) {
                     Patch patch = new Patch(p.getLoginDetails().getUsername(), j);
                     Server.getGlobalObjects().getFarmingPatches().addPatch(patch);
                     p.getInventory().replaceSingleItem(TOOLS[4], (int)SAPLING_DATA[j][1]);
                     p.getPackets().sendMessage("You place the " + (string)SAPLING_DATA[j][3] + " " + s + " into the plant pot and cover it with soil...now wait.");
                 }
                 return true;
             }
         }
     }
     return false;
 }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:35,代码来源:Farming.cs


注:本文中的Player.getLoginDetails方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。