private void OnSuccessfulChange(int mapId, int mobileId, int containerID, int itemId, ServerWorldState worldState) { foreach (int characterId in worldState.GetMapCharacters(mapId)) { if (characterId == mobileId) { continue; } ServerCharacter characterToUpdate = ((ServerCharacter)worldState.GetCharacter(characterId)); NetState clientSendTo = characterToUpdate.Owner; clientSendTo.Send(new MoveItemServerPacket(itemId, mobileId, containerID)); } }
protected override void OnHandle(IPacket packet, NetState netState, ServerWorldState worldState) { PerformAbilityPacket incomingPacket = (PerformAbilityPacket)packet; ServerCharacter mobileToUpdate = (ServerCharacter)worldState.GetCharacter(netState.WorldId); if (mobileToUpdate != null) { if (worldState.PerformAbility(incomingPacket.AbilityUsed, mobileToUpdate)) { foreach (int characterId in worldState.GetMapCharacters(mobileToUpdate.CurrentMapId)) { if (characterId == mobileToUpdate.Id) { continue; } ServerCharacter characterToUpdate = ((ServerCharacter)worldState.GetCharacter(characterId)); NetState clientSendTo = characterToUpdate.Owner; clientSendTo.Send(incomingPacket); } } } }