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


C# Player.getPackets方法代码示例

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


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

示例1: execute

        public void execute(Player player, string[] arguments)
        {
            if (arguments.Length == 0)
            {
                player.getPackets().sendMessage("[Switch magic command]: ::switch type (example ::switch 1)");
                return;
            }

            int type = 0;

            if (!int.TryParse(arguments[0], out type))
            {
                player.getPackets().sendMessage("[Switch magic command]: ::switch type (example ::switch 1)");
                return;
            }
            switch (type)
            {
                case 3:
                    player.setMagicType(3);
                    player.getPackets().sendTab(player.isHd() ? 99 : 89, 430);
                    break;
                case 2:
                    player.setMagicType(2);
                    player.getPackets().sendTab(player.isHd() ? 99 : 89, 193);
                    break;
                case 1:
                    player.setMagicType(1);
                    player.getPackets().sendTab(player.isHd() ? 99 : 89, 192);
                    break;
            }
        }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:31,代码来源:SwitchMagic.cs

示例2: useJewellery

	    public static bool useJewellery(Player p, int item, int slot, bool wearingItem) {
		    if (item == 1704 || item == 10362) { // Blank amulets
			    p.getPackets().sendMessage("This amulet has no charges remaining.");
			    return true;
		    }
		    if (p.getTemporaryAttribute("unmovable") != null || p.getTemporaryAttribute("cantDoAnything") != null) {
			    return true;
		    }
		    int index = getItemIndex(item);
		    if (index == -1) {
			    return false;
		    }
		    string s = index == 2 ? "ring" : "amulet";
		    p.getPackets().sendMessage("You rub the " + s + "...");
		    p.getPackets().closeInterfaces();
		    int interfaceId = index == 2 ? 230 : 235; 
		    int j = 2;
		    p.getPackets().modifyText("Teleport to where?", interfaceId, 1);
		    for (int i = 0; i < LOCATIONS[index].Length; i++) {
			    p.getPackets().modifyText(LOCATIONS[index][i], interfaceId, (i + j));
		    }
		    if (index == 2) {
			    p.getPackets().sendChatboxInterface2(interfaceId);
		    } else {
			    p.getPackets().sendChatboxInterface2(interfaceId);
		    }
		    JewellerySlot js = new JewelleryTeleport.JewellerySlot(index, slot, wearingItem);
		    p.setTemporaryAttribute("jewelleryTeleport", js);
		    return true;
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:30,代码来源:JewelleryTeleport.cs

示例3: tagPillar

	    public static void tagPillar(Player p, int pillarIndex) {
            AreaEvent tagPillarAreaEvent = new AreaEvent(p,  AGILITY_ARENA_PILLARS[pillarIndex][1]-1, AGILITY_ARENA_PILLARS[pillarIndex][2]-1, AGILITY_ARENA_PILLARS[pillarIndex][1]+1, AGILITY_ARENA_PILLARS[pillarIndex][2]+1);
            tagPillarAreaEvent.setAction(() => {
				if (p.getLocation().getZ() == 3) {
					p.setFaceLocation(new Location(AGILITY_ARENA_PILLARS[pillarIndex][1], AGILITY_ARENA_PILLARS[pillarIndex][2], 3));
					if (pillarIndex != currentPillar) {
						p.getPackets().sendMessage("You can only get a ticket when the flashing arrow is above the pillar!");
						return;
					}
                    if (p.isTaggedLastAgilityPillar())
                    {
						p.getPackets().sendMessage("You have already tagged this pillar, wait until the arrow moves again.");
						return;
					}
					int currentStatus = p.getAgilityArenaStatus();
					if (currentStatus == 0) {
						p.getPackets().sendConfig(309, 4);
						p.getPackets().sendMessage("You get tickets by tagging more than one pillar in a row. Tag the next pillar!");
					} else {
						p.getInventory().addItem(2996);
						p.getPackets().sendMessage("You recieve an Agility Arena ticket!");
					}
					p.setAgilityArenaStatus(currentStatus == 0 ? 1 : 1);
					p.setTaggedLastAgilityPillar(true);
				}
		    });
            Server.registerCoordinateEvent(tagPillarAreaEvent);
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:28,代码来源:AgilityArena.cs

示例4: execute

        public void execute(Player player, string[] arguments)
        {
            //TODO: Possible TODO.
            //I guess this command is for testing where object should be placed to spawnedObjects.cfg / objectLocations.cfg?
  	        //Err I don't like this command too much as the objects spawned are fake.. 
            //gotta maybe add to WorldObjects, like SpawnNPC :S later.

            if (arguments.Length < 2)
            {
                player.getPackets().sendMessage("[SpawnObject command]: ::obj objectId face");
                return;
            }

            int objectId = 0;
            int face = 0;

            if(!int.TryParse(arguments[0], out objectId)) {
                player.getPackets().sendMessage("[SpawnObject command]: objectId is not a number ::obj objectId face");
                return;
            }

            if(!int.TryParse(arguments[1], out face)) {
                player.getPackets().sendMessage("[SpawnObject command]: face is not a number ::obj objectId face");
                return;
            }

		    foreach(Player p in Server.getPlayerList()) {
			    p.getPackets().createObject(objectId, player.getLocation(), face, 10);
		    }
        }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:30,代码来源:SpawnObject.cs

示例5: execute

 public void execute(Player player, string[] arguments)
 {
     player.getPackets().sendMessage("Spawning all possible objects please wait..");
     for(int i = 0; i < 50000; i++)
         player.getPackets().createObject(i, player.getLocation(), 0, 10);
     player.getPackets().sendMessage("Dumping complete, now add dump to server.");
 }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:7,代码来源:ClientSideObjectDump.cs

示例6: handlePacket

        public void handlePacket(Player player, Packet packet) {
		    int size = packet.getLength();
		    if(packet.getPacketId() == PacketHandlers.PacketId.WALK_2) {
			    size -= 14;
		    }
            player.getWalkingQueue().resetWalkingQueue();
		    int steps = (size - 5) / 2;

            if (steps > WalkingQueue.MAX_WALKING_WAYPOINTS)
            {
                misc.WriteError("Warning: Walk command contains too many steps (" + steps + ") currently set to 50 [maybe need increase?]");
                return;
            }

            player.getWalkingQueue().setIsRunning(packet.readByteA() == 1);
		    bool following = false;
            if (!canWalk(player, packet, following))
            {
                player.getPackets().clearMapFlag();
                player.getWalkingQueue().resetWalkingQueue();
                return;
            }

            int firstX = packet.readUShort() - (player.getLocation().getRegionX() - 6) * 8;
            int firstY = packet.readShortA() - (player.getLocation().getRegionY() - 6) * 8;
		    player.getWalkingQueue().addToWalkingQueue(firstX, firstY);

            for (int i = 0; i < steps; i++) //all the waypoints.
                player.getWalkingQueue().addToWalkingQueue((packet.readByteA() + firstX), (packet.readByteS() + firstY));

            if (player.getTeleportTo() != null) //is teleporting?
                player.getWalkingQueue().resetWalkingQueue();


		    if (player.getTemporaryAttribute("homeTeleporting") != null) {
			    player.removeTemporaryAttribute("homeTeleporting");
		    }
		    SkillHandler.resetAllSkills(player);
		    if (player.getTrade() != null)
			    player.getTrade().decline();
            if (player.getDuel() != null) {
                if (player.getDuel().getStatus() < 4)
                    player.getDuel().declineDuel();
                else if (player.getDuel().getStatus() == 8)
                    player.getDuel().recieveWinnings(player);
            }
			if (player.getTarget() != null) {
				if (!following && player.getTarget().getAttacker() != null && player.getTarget().getAttacker().Equals(player))
					player.getTarget().setAttacker(null);
			}		    
            
            if (!following) {
			    player.getFollow().setFollowing(null);
				player.setTarget(null);
				player.removeTemporaryAttribute("autoCasting");
			    if (player.getEntityFocus() != 65535)
				    player.setEntityFocus(65535);
		    }
		    player.getPackets().closeInterfaces();
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:60,代码来源:Walk.cs

示例7: displayWildernessLeverOptions

	    public static void displayWildernessLeverOptions(Player p, int leverIndex) {
		    int dialogueIndex = 140 + leverIndex;
		    p.setTemporaryAttribute("dialogue", dialogueIndex);
		    string option1 = leverIndex == 0 ? "Edgeville" : "Home";
		    p.getPackets().modifyText(option1, 230, 2);
		    p.getPackets().modifyText("Mage bank", 230, 3);
		    p.getPackets().modifyText("Nowhere", 230, 4);
		    p.getPackets().sendChatboxInterface2(230);
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:9,代码来源:Wilderness.cs

示例8: execute

        public void execute(Player player, string[] arguments)
        {
            if (arguments.Length == 0)
            {
                player.getPackets().sendMessage("[Reload Ladders & Stairs XML File]: This command is only for server developers.");
                player.getPackets().sendMessage("Reloading... [Could crash server if populated, as all ladders get erased]");
                LaddersAndStairs.load();
                player.getPackets().sendMessage("Reloaded.");

            }
        }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:11,代码来源:ReloadLadderXml.cs

示例9: openInterface

 public static void openInterface(Player p)
 {
     p.getPackets().displayInterface(771);
     p.getPackets().sendPlayerHead(771, 79);
     p.getPackets().animateInterface(9804, 771, 79);
     p.getPackets().sendConfig(1262, p.getAppearance().getGender() == 2 ? 1 : 8);
     p.getAppearance().setTemporaryAppearance(new Appearance());
     p.getAppearance().getTemporaryAppearance().setColoursArray(p.getAppearance().getColoursArray());
     p.getAppearance().getTemporaryAppearance().setLookArray(p.getAppearance().getLookArray());
     p.getAppearance().getTemporaryAppearance().setGender(p.getAppearance().getGender());
     p.removeTemporaryAttribute("hairToggle");
 }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:12,代码来源:ConfigureAppearance.cs

示例10: leaveChannel

	    public void leaveChannel(Player p) {
		    foreach(Clan c in clans) {
			    if (c != null) {
				    if (c.getUser(p) != null) {
					    c.removeUser(p);
                        p.getPackets().resetClanInterface();
					    p.getPackets().sendMessage("You have left the channel. :clan:");
					    updateClan(c);
					    break;
				    }
			    }
		    }
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:13,代码来源:ClanManager.cs

示例11: showCanifisSailorDialogue

	    public static void showCanifisSailorDialogue(Player p, int status) {
		    int newStatus = -1;
		    p.getPackets().softCloseInterfaces();
		    if (p.getTemporaryAttribute("unmovable") != null) {
			    return;
		    }
		    switch(status) {
			    case 280:
				    p.getPackets().sendPlayerHead(64, 2);
				    p.getPackets().modifyText(p.getLoginDetails().getUsername(), 64, 3);
				    p.getPackets().modifyText("Could you take me back to Oo'glog please?", 64, 4);
				    p.getPackets().animateInterface(9827, 64, 2);
				    p.getPackets().sendChatboxInterface2(64);
				    newStatus = 281;
				    break;
				
			    case 281:
				    p.getPackets().sendNPCHead(1304, 241, 2);
				    p.getPackets().modifyText("Sailor", 241, 3);
				    p.getPackets().modifyText("As you wish, i'll fetch the boat.", 241, 4);
				    p.getPackets().animateInterface(9827, 241, 2);
				    p.getPackets().sendChatboxInterface2(241);
				    newStatus = 282;
				    break;
				
			    case 282:
				    travel(p, 0, true);
				    break;
		    }
		    if (newStatus != -1) {
			    p.setTemporaryAttribute("dialogue", newStatus);
		    }
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:33,代码来源:BoatOptions.cs

示例12: execute

        	public void execute(Player player, string[] arguments) {
                if (arguments.Length == 0)
                {
                    player.getPackets().sendMessage("[Pickup command]: ::item itemId amount or just ::item itemId");
                    return;
                }

                int itemId = 0;
                if (!int.TryParse(arguments[0], out itemId))
                    itemId = 0;
                int amount = 0;
                if(arguments.Length >= 2 && !int.TryParse(arguments[1], out amount))
                    amount = 0;
		        if (!player.inCombat()) {
                    if (amount > 1 && !ItemData.forId(itemId).isNoted() && !ItemData.forId(itemId).isStackable())
                    {
					    for (int i = 0; i < amount; i++) {
                            if (!player.getInventory().addItem(itemId))
                            {
							    break;
						    }
					    }
                    } else if(amount == 0) {
                        player.getInventory().addItem(itemId);
				    } else {
                        player.getInventory().addItem(itemId, amount);
				    }
		        }
	        }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:29,代码来源:Pickup.cs

示例13: addToStack

	    public bool addToStack(int id, int amount, Location location, Player p) {
		    if (!ItemData.forId(id).isStackable()) {
			    return false;
		    }
		    foreach(GroundItem i in items) {
			    if(i.getLocation().Equals(location) && i.getItemId() == id) {
				    if (!i.isGlobal() && i.getOwner().Equals(p)) {
					    i.setItemAmount(i.getItemAmount() + amount);
					    p.getPackets().clearGroundItem(i);
					    p.getPackets().createGroundItem(i);
					    return true;
				    }
			    }
		    }
		    return false;
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:16,代码来源:GroundItemManager.cs

示例14: handleScreenSettings

	    private void handleScreenSettings(Player player, Packet packet) {
		    int windowType = packet.readByte() & 0xff;
		    int windowWidth = packet.readUShort();
		    int windowHeight = packet.readUShort();
		    int junk = packet.readByte() & 0xff;
		    player.getPackets().configureGameScreen(windowType);
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:7,代码来源:ClientAction.cs

示例15: execute

        public void execute(Player player, string[] arguments)
        {
            if (arguments.Length == 0)
            {
                player.getPackets().sendMessage("[Height command]: ::height 0 [0,1,2,3] are possible");
                return;
            }

            int heightLevel = 0;
            if (!int.TryParse(arguments[0], out heightLevel))
            {
                player.getPackets().sendMessage("[Height command]: ::height 0 [0,1,2,3] are possible");
                return;
            }

            player.teleport(new Location(player.getLocation().getX(), player.getLocation().getY(), heightLevel));
        }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:17,代码来源:Height.cs


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