Search in sources :

Example 46 with MaplePacketLittleEndianWriter

use of tools.data.output.MaplePacketLittleEndianWriter in project HeavenMS by ronancpl.

the class MaplePacketCreator method removeNPC.

public static byte[] removeNPC(int oid) {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
    mplew.writeShort(SendOpcode.REMOVE_NPC.getValue());
    mplew.writeInt(oid);
    return mplew.getPacket();
}
Also used : MaplePacketLittleEndianWriter(tools.data.output.MaplePacketLittleEndianWriter)

Example 47 with MaplePacketLittleEndianWriter

use of tools.data.output.MaplePacketLittleEndianWriter in project HeavenMS by ronancpl.

the class MaplePacketCreator method lockUI.

public static byte[] lockUI(boolean enable) {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter(3);
    mplew.writeShort(SendOpcode.LOCK_UI.getValue());
    mplew.write(enable ? 1 : 0);
    return mplew.getPacket();
}
Also used : MaplePacketLittleEndianWriter(tools.data.output.MaplePacketLittleEndianWriter)

Example 48 with MaplePacketLittleEndianWriter

use of tools.data.output.MaplePacketLittleEndianWriter in project HeavenMS by ronancpl.

the class MaplePacketCreator method showThread.

public static byte[] showThread(int localthreadid, ResultSet threadRS, ResultSet repliesRS) throws SQLException, RuntimeException {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
    mplew.writeShort(SendOpcode.GUILD_BBS_PACKET.getValue());
    mplew.write(0x07);
    mplew.writeInt(localthreadid);
    mplew.writeInt(threadRS.getInt("postercid"));
    mplew.writeLong(getTime(threadRS.getLong("timestamp")));
    mplew.writeMapleAsciiString(threadRS.getString("name"));
    mplew.writeMapleAsciiString(threadRS.getString("startpost"));
    mplew.writeInt(threadRS.getInt("icon"));
    if (repliesRS != null) {
        int replyCount = threadRS.getInt("replycount");
        mplew.writeInt(replyCount);
        int i;
        for (i = 0; i < replyCount && repliesRS.next(); i++) {
            mplew.writeInt(repliesRS.getInt("replyid"));
            mplew.writeInt(repliesRS.getInt("postercid"));
            mplew.writeLong(getTime(repliesRS.getLong("timestamp")));
            mplew.writeMapleAsciiString(repliesRS.getString("content"));
        }
        if (i != replyCount || repliesRS.next()) {
            throw new RuntimeException(String.valueOf(threadRS.getInt("threadid")));
        }
    } else {
        mplew.writeInt(0);
    }
    return mplew.getPacket();
}
Also used : MaplePacketLittleEndianWriter(tools.data.output.MaplePacketLittleEndianWriter) Point(java.awt.Point)

Example 49 with MaplePacketLittleEndianWriter

use of tools.data.output.MaplePacketLittleEndianWriter in project HeavenMS by ronancpl.

the class MaplePacketCreator method enableReport.

public static byte[] enableReport() {
    // by snow
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter(3);
    mplew.writeShort(SendOpcode.CLAIM_STATUS_CHANGED.getValue());
    mplew.write(1);
    return mplew.getPacket();
}
Also used : MaplePacketLittleEndianWriter(tools.data.output.MaplePacketLittleEndianWriter)

Example 50 with MaplePacketLittleEndianWriter

use of tools.data.output.MaplePacketLittleEndianWriter in project HeavenMS by ronancpl.

the class MaplePacketCreator method sendAllianceInvitation.

public static byte[] sendAllianceInvitation(int allianceid, MapleCharacter chr) {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
    mplew.writeShort(SendOpcode.ALLIANCE_OPERATION.getValue());
    mplew.write(0x03);
    mplew.writeInt(allianceid);
    mplew.writeMapleAsciiString(chr.getName());
    mplew.writeShort(0);
    return mplew.getPacket();
}
Also used : MaplePacketLittleEndianWriter(tools.data.output.MaplePacketLittleEndianWriter)

Aggregations

MaplePacketLittleEndianWriter (tools.data.output.MaplePacketLittleEndianWriter)431 Point (java.awt.Point)44 MaplePlayerShopItem (server.maps.MaplePlayerShopItem)15 Item (client.inventory.Item)11 SpecialCashItem (server.CashShop.SpecialCashItem)11 MapleShopItem (server.MapleShopItem)11 MapleMapItem (server.maps.MapleMapItem)11 CashItem (server.CashShop.CashItem)10 MapleCharacter (client.MapleCharacter)8 MapleBuffStat (client.MapleBuffStat)4 MaplePet (client.inventory.MaplePet)3 MTSItemInfo (server.MTSItemInfo)3 MapleDisease (client.MapleDisease)2 SQLException (java.sql.SQLException)2 ArrayList (java.util.ArrayList)2 LinkedHashMap (java.util.LinkedHashMap)2 Channel (net.server.channel.Channel)2 MapleGuild (net.server.guild.MapleGuild)2 MapleMonster (server.life.MapleMonster)2 BuddylistEntry (client.BuddylistEntry)1