本文整理汇总了Java中client.BuddyList.BuddyOperation类的典型用法代码示例。如果您正苦于以下问题:Java BuddyOperation类的具体用法?Java BuddyOperation怎么用?Java BuddyOperation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BuddyOperation类属于client.BuddyList包,在下文中一共展示了BuddyOperation类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buddyChanged
import client.BuddyList.BuddyOperation; //导入依赖的package包/类
public void buddyChanged(int cid, int cidFrom, String name, int channel, BuddyOperation operation) {
MapleCharacter addChar = getPlayerStorage().getCharacterById(cid);
if (addChar != null) {
BuddyList buddylist = addChar.getBuddylist();
switch (operation) {
case ADDED:
if (buddylist.contains(cidFrom)) {
buddylist.put(new BuddylistEntry(name, "Default Group", cidFrom, channel, true));
addChar.getClient().announce(MaplePacketCreator.updateBuddyChannel(cidFrom, (byte) (channel - 1)));
}
break;
case DELETED:
if (buddylist.contains(cidFrom)) {
buddylist.put(new BuddylistEntry(name, "Default Group", cidFrom, (byte) -1, buddylist.get(cidFrom).isVisible()));
addChar.getClient().announce(MaplePacketCreator.updateBuddyChannel(cidFrom, (byte) -1));
}
break;
}
}
}
示例2: buddyChanged
import client.BuddyList.BuddyOperation; //导入依赖的package包/类
public static void buddyChanged(int cid, int cidFrom, String name, int channel, BuddyOperation operation, String group) {
int ch = Find.findChannel(cid);
if (ch > 0) {
final MapleCharacter addChar = ChannelServer.getInstance(ch).getPlayerStorage().getCharacterById(cid);
if (addChar != null) {
final BuddyList buddylist = addChar.getBuddylist();
switch (operation) {
case ADDED:
if (buddylist.contains(cidFrom)) {
buddylist.put(new BuddylistEntry(name, cidFrom, group, channel, true));
addChar.getClient().getSession().write(BuddylistPacket.updateBuddyChannel(cidFrom, channel - 1));
}
break;
case DELETED:
if (buddylist.contains(cidFrom)) {
buddylist.put(new BuddylistEntry(name, cidFrom, group, -1, buddylist.get(cidFrom).isVisible()));
addChar.getClient().getSession().write(BuddylistPacket.updateBuddyChannel(cidFrom, -1));
}
break;
}
}
}
}
示例3: notifyRemoteChannel
import client.BuddyList.BuddyOperation; //导入依赖的package包/类
private static void notifyRemoteChannel(final MapleClient c, final int remoteChannel, final int otherCid, final String group, final BuddyOperation operation) {
final MapleCharacter player = c.getPlayer();
if (remoteChannel > 0) {
World.Buddy.buddyChanged(otherCid, player.getId(), player.getName(), c.getChannel(), operation, group);
}
}
示例4: notifyRemoteChannel
import client.BuddyList.BuddyOperation; //导入依赖的package包/类
private void notifyRemoteChannel(MapleClient c, int remoteChannel, int otherCid, BuddyOperation operation) {
MapleCharacter player = c.getPlayer();
if (remoteChannel != -1) {
c.getWorldServer().buddyChanged(otherCid, player.getId(), player.getName(), c.getChannel(), operation);
}
}
示例5: buddyChanged
import client.BuddyList.BuddyOperation; //导入依赖的package包/类
public void buddyChanged(int cid, int cidFrom, String name, int channel, BuddyOperation op) throws RemoteException;