Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void handle(ClientOperations op, SeekableLittleEndianAccessor slea) {
- PacketOutputStream output = null;
- switch (op) {
- case PUBLIC_CHAT:
- slea.readInt();
- String text = slea.readMapleAsciiString();
- output = new PacketOutputStream(ServerOperations.PUBLIC_CHAT);
- output.writeInt(charId);
- output.writeByte(gmLevel != 0 ? 1 : 0);
- output.writeAsciiString(text);
- output.writeByte(slea.readByte()); // SHOW
- map.characters.broadcast(output.toByteArray());
- break;
- case FACE_EXPRESSION:
- int emote = slea.readInt();
- if (emote > 7) {
- // TODO: check if player has item
- output = new PacketOutputStream(ServerOperations.FACE_EXPRESSION);
- output.writeInt(charId);
- output.writeInt(emote);
- output.writeInt(-1);
- output.writeByte(0);
- }
- break;
- case DISTRIBUTE_SP:
- slea.skip(4);
- int skill = slea.readInt();
- if (remainingSp > 0) {
- remainingSp -= 1;
- if (hasExtendedSP) {
- spTable.addSPToTable(job, remainingSp);
- }
- }
- updateStats(new Statistics[]{Statistics.AvailableSp}, false);
- session.write(skills.getSkill(skill).updateSkill());
- break;
- case USE_SKILL:
- slea.readInt();
- int skillId = slea.readInt();
- Point pos = null;
- byte skillLevel = slea.readByte();
- if (slea.available() >= 4) {
- pos = new Point(slea.readShort(), slea.readShort());
- skills.useSkill(skillId, skillLevel, pos);
- }
- break;
- }
- if (output != null) {
- output = null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement