root/trunk/AE-go_GameServer/src/com/aionemu/gameserver/taskmanager/PacketBroadcaster.java

10021015
1
/*
1
/*
2
 * This file is part of aion-emu <aion-emu.com>.
2
 * This file is part of aion-unique <aion-unique.org>.
3
 *
3
 *
4
 *  aion-emu is free software: you can redistribute it and/or modify
4
 *  aion-unique is free software: you can redistribute it and/or modify
5
 *  it under the terms of the GNU General Public License as published by
5
 *  it under the terms of the GNU General Public License as published by
6
 *  the Free Software Foundation, either version 3 of the License, or
6
 *  the Free Software Foundation, either version 3 of the License, or
7
 *  (at your option) any later version.
7
 *  (at your option) any later version.
8
 *
8
 *
9
 *  aion-emu is distributed in the hope that it will be useful,
9
 *  aion-unique is distributed in the hope that it will be useful,
10
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
10
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 *  GNU General Public License for more details.
12
 *  GNU General Public License for more details.
13
 *
13
 *
14
 *  You should have received a copy of the GNU General Public License
14
 *  You should have received a copy of the GNU General Public License
15
 *  along with aion-emu.  If not, see <http://www.gnu.org/licenses/>.
15
 *  along with aion-unique.  If not, see <http://www.gnu.org/licenses/>.
16
 */
16
 */
17
package com.aionemu.gameserver.taskmanager;
17
package com.aionemu.gameserver.taskmanager;
18
18
19
import com.aionemu.gameserver.configs.Config;
19
import com.aionemu.gameserver.model.gameobjects.Creature;
20
import com.aionemu.gameserver.model.gameobjects.Creature;
20
import com.aionemu.gameserver.model.gameobjects.player.Player;
21
import com.aionemu.gameserver.model.gameobjects.player.Player;
22
import com.aionemu.gameserver.utils.PacketSendUtility;
21
23
22
/**
24
/**
23
 * @author lord_rex and MrPoke
25
 * @author lord_rex and MrPoke
...
...
47
			public void sendPacket(Creature creature)
49
			public void sendPacket(Creature creature)
48
			{
50
			{
49
				((Player) creature).getLifeStats().sendHpPacketUpdateImpl();
51
				((Player) creature).getLifeStats().sendHpPacketUpdateImpl();
52
				
53
				if(Config.DEBUG_PACKET_BROADCASTER)
54
					PacketSendUtility.sendMessage(((Player) creature), "PacketBroadcast: Your HP stat is updated.");
50
			}
55
			}
51
		},
56
		},
52
		UPDATE_PLAYER_MP_STAT {
57
		UPDATE_PLAYER_MP_STAT {
...
...
54
			public void sendPacket(Creature creature)
59
			public void sendPacket(Creature creature)
55
			{
60
			{
56
				((Player) creature).getLifeStats().sendMpPacketUpdateImpl();
61
				((Player) creature).getLifeStats().sendMpPacketUpdateImpl();
62
				
63
				if(Config.DEBUG_PACKET_BROADCASTER)
64
					PacketSendUtility.sendMessage(((Player) creature), "PacketBroadcast: Your MP stat is updated.");
57
			}
65
			}
58
		},
66
		},
59
		UPDATE_PLAYER_EFFECT_ICONS {
67
		UPDATE_PLAYER_EFFECT_ICONS {
60
			@Override
68
			@Override
61
			public void sendPacket(Creature creature)
69
			public void sendPacket(Creature creature)
62
			{
70
			{
63
				creature.getEffectController().updatePlayerEffectIconsImpl();
71
				((Player) creature).getEffectController().updatePlayerEffectIconsImpl();
72
				
73
				if(Config.DEBUG_PACKET_BROADCASTER)
74
					PacketSendUtility.sendMessage(((Player) creature), "PacketBroadcast: Your effect icons are updated.");
64
			}
75
			}
65
		},
76
		},
66
		UPDATE_NEARBY_QUEST_LIST {
77
		UPDATE_NEARBY_QUEST_LIST {
...
...
68
			public void sendPacket(Creature creature)
79
			public void sendPacket(Creature creature)
69
			{
80
			{
70
				((Player) creature).getController().updateNearbyQuestListImpl();
81
				((Player) creature).getController().updateNearbyQuestListImpl();
82
				
83
				if(Config.DEBUG_PACKET_BROADCASTER)
84
					PacketSendUtility.sendMessage(((Player) creature), "PacketBroadcast: Your quest list is updated.");
71
			}
85
			}
72
		},
86
		},
73
		// TODO: more packets
87
		// TODO: more packets