Class cleanup.
This commit is contained in:
@@ -1,11 +1,15 @@
|
||||
package engine.net.client.handlers;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.exception.MsgSendException;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.net.Dispatch;
|
||||
import engine.net.DispatchMessage;
|
||||
import engine.net.client.ClientConnection;
|
||||
import engine.net.client.msg.ClientNetMsg;
|
||||
import engine.net.client.msg.PetitionReceivedMsg;
|
||||
import engine.objects.Petition;
|
||||
import engine.objects.PlayerCharacter;
|
||||
|
||||
public class PetitionReceivedMsgHandler extends AbstractClientMsgHandler {
|
||||
|
||||
@@ -15,11 +19,19 @@ public class PetitionReceivedMsgHandler extends AbstractClientMsgHandler {
|
||||
|
||||
@Override
|
||||
protected boolean _handleNetMsg(ClientNetMsg msg, ClientConnection origin) throws MsgSendException {
|
||||
|
||||
if (msg == null)
|
||||
return false;
|
||||
return true;
|
||||
|
||||
PetitionReceivedMsg petitionReceivedMsg = (PetitionReceivedMsg) msg;
|
||||
|
||||
if (origin == null)
|
||||
return false;
|
||||
return true;
|
||||
|
||||
PlayerCharacter playerCharacter = origin.getPlayerCharacter();
|
||||
|
||||
if (playerCharacter == null)
|
||||
return true;
|
||||
|
||||
Petition petition = new Petition(msg, origin);
|
||||
|
||||
@@ -27,7 +39,11 @@ public class PetitionReceivedMsgHandler extends AbstractClientMsgHandler {
|
||||
return false;
|
||||
|
||||
try {
|
||||
petitionReceivedMsg.petition = 2;
|
||||
DbManager.PetitionQueries.WRITE_PETITION_TO_TABLE(petition);
|
||||
Dispatch dispatch = Dispatch.borrow(playerCharacter, msg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user