Show confirmation after note is sent
This commit is contained in:
13
src/main/java/net/packet/out/SendNoteSuccessPacket.java
Normal file
13
src/main/java/net/packet/out/SendNoteSuccessPacket.java
Normal file
@@ -0,0 +1,13 @@
|
||||
package net.packet.out;
|
||||
|
||||
import net.opcodes.SendOpcode;
|
||||
import net.packet.ByteBufOutPacket;
|
||||
|
||||
public final class SendNoteSuccessPacket extends ByteBufOutPacket {
|
||||
|
||||
public SendNoteSuccessPacket() {
|
||||
super(SendOpcode.MEMO_RESULT);
|
||||
|
||||
writeByte(4);
|
||||
}
|
||||
}
|
||||
@@ -38,6 +38,7 @@ import constants.id.MapId;
|
||||
import constants.inventory.ItemConstants;
|
||||
import net.AbstractPacketHandler;
|
||||
import net.packet.InPacket;
|
||||
import net.packet.out.SendNoteSuccessPacket;
|
||||
import net.server.Server;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -367,6 +368,7 @@ public final class UseCashItemHandler extends AbstractPacketHandler {
|
||||
boolean sendSuccess = noteService.sendNormal(msg, player.getName(), sendTo);
|
||||
if (sendSuccess) {
|
||||
remove(c, position, itemId);
|
||||
c.sendPacket(new SendNoteSuccessPacket());
|
||||
}
|
||||
} else if (itemType == 510) {
|
||||
player.getMap().broadcastMessage(PacketCreator.musicChange("Jukebox/Congratulation"));
|
||||
|
||||
@@ -43,6 +43,12 @@ public class NoteService {
|
||||
}
|
||||
|
||||
private boolean send(Note note) {
|
||||
// TODO: handle the following cases (originally listed at PacketCreator#noteError)
|
||||
/*
|
||||
* 0 = Player online, use whisper
|
||||
* 1 = Check player's name
|
||||
* 2 = Receiver inbox full
|
||||
*/
|
||||
try {
|
||||
noteDao.save(note);
|
||||
return true;
|
||||
|
||||
@@ -5403,12 +5403,6 @@ public class PacketCreator {
|
||||
return p;
|
||||
}
|
||||
|
||||
public static Packet noteSendMsg() {
|
||||
OutPacket p = OutPacket.create(SendOpcode.MEMO_RESULT);
|
||||
p.writeByte(4);
|
||||
return p;
|
||||
}
|
||||
|
||||
/*
|
||||
* 0 = Player online, use whisper
|
||||
* 1 = Check player's name
|
||||
|
||||
Reference in New Issue
Block a user