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


Java BuddylistPacket类代码示例

本文整理汇总了Java中tools.packet.CWvsContext.BuddylistPacket的典型用法代码示例。如果您正苦于以下问题:Java BuddylistPacket类的具体用法?Java BuddylistPacket怎么用?Java BuddylistPacket使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


BuddylistPacket类属于tools.packet.CWvsContext包,在下文中一共展示了BuddylistPacket类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateBuddies

import tools.packet.CWvsContext.BuddylistPacket; //导入依赖的package包/类
private static void updateBuddies(int characterId, int channel, int[] buddies, boolean offline) {
    for (int buddy : buddies) {
        int ch = Find.findChannel(buddy);
        if (ch > 0) {
            MapleCharacter chr = ChannelServer.getInstance(ch).getPlayerStorage().getCharacterById(buddy);
            if (chr != null) {
                BuddylistEntry ble = chr.getBuddylist().get(characterId);
                if (ble != null && ble.isVisible()) {
                    int mcChannel;
                    if (offline) {
                        ble.setChannel(-1);
                        mcChannel = -1;
                    } else {
                        ble.setChannel(channel);
                        mcChannel = channel - 1;
                    }
                    chr.getClient().getSession().write(BuddylistPacket.updateBuddyChannel(ble.getCharacterId(), mcChannel));
                }
            }
        }
    }
}
 
开发者ID:ergothvs,项目名称:Lucid2.0,代码行数:23,代码来源:World.java

示例2: buddyChanged

import tools.packet.CWvsContext.BuddylistPacket; //导入依赖的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;
            }
        }
    }
}
 
开发者ID:ergothvs,项目名称:Lucid2.0,代码行数:24,代码来源:World.java

示例3: addBuddyRequest

import tools.packet.CWvsContext.BuddylistPacket; //导入依赖的package包/类
public void addBuddyRequest(MapleClient c, int cidFrom, String nameFrom, int channelFrom, int levelFrom, int jobFrom, String groupName) {
    BuddylistEntry ble = new BuddylistEntry(nameFrom, cidFrom, groupName, channelFrom, false);
    put(ble);
    c.getSession().write(BuddylistPacket.requestBuddyAdd(false, cidFrom, c.getPlayer().getAccountID(),
            nameFrom, levelFrom, jobFrom, 0, ble));
}
 
开发者ID:ergothvs,项目名称:Lucid2.0,代码行数:7,代码来源:BuddyList.java

示例4: setBuddyCapacity

import tools.packet.CWvsContext.BuddylistPacket; //导入依赖的package包/类
public void setBuddyCapacity(byte capacity) {
    buddylist.setCapacity(capacity);
    client.getSession().write(BuddylistPacket.updateBuddyCapacity(capacity));
}
 
开发者ID:ergothvs,项目名称:Lucid2.0,代码行数:5,代码来源:MapleCharacter.java

示例5: addBuddyRequest

import tools.packet.CWvsContext.BuddylistPacket; //导入依赖的package包/类
public void addBuddyRequest(MapleClient c, int cidFrom, String nameFrom, int channelFrom, int levelFrom, int jobFrom) {
    put(new BuddylistEntry(nameFrom, cidFrom, "ETC", channelFrom, false));
    c.getSession().write(BuddylistPacket.requestBuddylistAdd(cidFrom, nameFrom, levelFrom, jobFrom));
}
 
开发者ID:Maxcloud,项目名称:Mushy,代码行数:5,代码来源:BuddyList.java

示例6: addBuddyRequest

import tools.packet.CWvsContext.BuddylistPacket; //导入依赖的package包/类
public void addBuddyRequest(MapleClient c, int cidFrom, String nameFrom, int channelFrom, int levelFrom, int jobFrom, int buddylist) {
    put(new BuddylistEntry(nameFrom, cidFrom, "ETC", channelFrom, false));
    c.getSession().write(BuddylistPacket.requestBuddylistAdd(cidFrom, nameFrom, levelFrom, jobFrom, buddylist));
}
 
开发者ID:skorch37,项目名称:Asteria,代码行数:5,代码来源:BuddyList.java


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