forked from MagicBane/Server
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
898 B
35 lines
898 B
package engine.net.client.handlers; |
|
|
|
import engine.exception.MsgSendException; |
|
import engine.net.client.ClientConnection; |
|
import engine.net.client.msg.ClientNetMsg; |
|
import engine.net.client.msg.PetitionReceivedMsg; |
|
import engine.objects.Petition; |
|
|
|
public class PetitionReceivedMsgHandler extends AbstractClientMsgHandler { |
|
|
|
public PetitionReceivedMsgHandler() { |
|
super(PetitionReceivedMsg.class); |
|
} |
|
|
|
@Override |
|
protected boolean _handleNetMsg(ClientNetMsg msg, ClientConnection origin) throws MsgSendException { |
|
if (msg == null) |
|
return false; |
|
|
|
if (origin == null) |
|
return false; |
|
|
|
Petition report = new Petition(msg, origin); |
|
|
|
if (report == null) |
|
return false; |
|
|
|
try { |
|
report.updateDatabase(); |
|
} catch (Exception e) { |
|
return false; |
|
} |
|
return true; |
|
} |
|
}
|
|
|