forked from MagicBane/Server
investigate serialization of petition message
This commit is contained in:
@@ -1,9 +1,12 @@
|
|||||||
package engine.net.client.handlers;
|
package engine.net.client.handlers;
|
||||||
|
|
||||||
import engine.exception.MsgSendException;
|
import engine.exception.MsgSendException;
|
||||||
|
import engine.gameManager.DbManager;
|
||||||
|
import engine.math.Vector3fImmutable;
|
||||||
import engine.net.client.ClientConnection;
|
import engine.net.client.ClientConnection;
|
||||||
import engine.net.client.msg.ClientNetMsg;
|
import engine.net.client.msg.ClientNetMsg;
|
||||||
import engine.net.client.msg.PetitionReceivedMsg;
|
import engine.net.client.msg.PetitionReceivedMsg;
|
||||||
|
import org.pmw.tinylog.Logger;
|
||||||
|
|
||||||
public class PetitionReceivedMsgHandler extends AbstractClientMsgHandler {
|
public class PetitionReceivedMsgHandler extends AbstractClientMsgHandler {
|
||||||
|
|
||||||
@@ -13,69 +16,80 @@ public class PetitionReceivedMsgHandler extends AbstractClientMsgHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean _handleNetMsg(ClientNetMsg msg, ClientConnection origin) throws MsgSendException {
|
protected boolean _handleNetMsg(ClientNetMsg msg, ClientConnection origin) throws MsgSendException {
|
||||||
|
String originAccount = origin.getAccount().getUname();
|
||||||
|
String originCharacter = origin.getPlayerCharacter().getName();
|
||||||
|
Vector3fImmutable playerLocation = origin.getPlayerCharacter().getLoc();
|
||||||
|
String primaryReportType;
|
||||||
switch(((PetitionReceivedMsg) msg).getType()){
|
switch(((PetitionReceivedMsg) msg).getType()){
|
||||||
case 1: // TYPE_GENERAL_HELP
|
case 1: // TYPE_GENERAL_HELP
|
||||||
|
primaryReportType = "GENERAL";
|
||||||
break;
|
break;
|
||||||
case 2: // TYPE_FEEDBACK
|
case 2: // TYPE_FEEDBACK
|
||||||
|
primaryReportType = "FEEDBACK";
|
||||||
break;
|
break;
|
||||||
case 3: // TYPE_STUCK
|
case 3: // TYPE_STUCK
|
||||||
|
primaryReportType = "STUCK";
|
||||||
break;
|
break;
|
||||||
case 4: // TYPE_HARASSMENT
|
case 4: // TYPE_HARASSMENT
|
||||||
|
primaryReportType = "HARASSMENT";
|
||||||
break;
|
break;
|
||||||
case 5: // TYPE_EXPLOIT
|
case 5: // TYPE_EXPLOIT
|
||||||
|
primaryReportType = "EXPLOIT";
|
||||||
break;
|
break;
|
||||||
case 6: // TYPE_BUG
|
case 6: // TYPE_BUG
|
||||||
|
primaryReportType = "BUG";
|
||||||
break;
|
break;
|
||||||
case 7: // TYPE_GAME_STOPPER
|
case 7: // TYPE_GAME_STOPPER
|
||||||
|
primaryReportType = "GAME STOPPER";
|
||||||
break;
|
break;
|
||||||
case 8: // TYPE_TECH_SUPPORT
|
case 8: // TYPE_TECH_SUPPORT
|
||||||
|
primaryReportType = "TECH SUPPORT";
|
||||||
break;
|
break;
|
||||||
default: // INVALID_TYPE cannot process this
|
default: // INVALID_TYPE cannot process this
|
||||||
|
primaryReportType = "NONE";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
String subType;
|
||||||
switch (((PetitionReceivedMsg)msg).getSubType()) {
|
switch (((PetitionReceivedMsg)msg).getSubType()) {
|
||||||
case 1: // SUBTYPE_EXPLOIT_DUPE
|
case 1: // SUBTYPE_EXPLOIT_DUPE
|
||||||
|
subType = "DUPE";
|
||||||
break;
|
break;
|
||||||
case 2: // SUBTYPE_EXPLOIT_LEVELING
|
case 2: // SUBTYPE_EXPLOIT_LEVELING
|
||||||
|
subType = "LEVELLING";
|
||||||
break;
|
break;
|
||||||
case 3: // SUBTYPE_EXPLOIT_SKILL_GAIN
|
case 3: // SUBTYPE_EXPLOIT_SKILL_GAIN
|
||||||
|
subType = "SKILL GAIN";
|
||||||
break;
|
break;
|
||||||
case 4: // SUBTYPE_EXPLOIT_KILLING
|
case 4: // SUBTYPE_EXPLOIT_KILLING
|
||||||
|
subType = "KILLING";
|
||||||
break;
|
break;
|
||||||
case 5: // SUBTYPE_EXPLOIT_POLICY
|
case 5: // SUBTYPE_EXPLOIT_POLICY
|
||||||
|
subType = "POLICY";
|
||||||
break;
|
break;
|
||||||
case 6: // SUBTYPE_EXPLOIT_OTHER
|
case 6: // SUBTYPE_EXPLOIT_OTHER
|
||||||
|
subType = "OTHER";
|
||||||
break;
|
break;
|
||||||
case 7: // SUBTYPE_TECH_VIDEO
|
case 7: // SUBTYPE_TECH_VIDEO
|
||||||
|
subType = "VIDEO";
|
||||||
break;
|
break;
|
||||||
case 8: // SUBTYPE_TECH_SOUND
|
case 8: // SUBTYPE_TECH_SOUND
|
||||||
|
subType = "SOUND";
|
||||||
break;
|
break;
|
||||||
case 9: // SUBTYPE_TECH_NETWORK
|
case 9: // SUBTYPE_TECH_NETWORK
|
||||||
|
subType = "NETWORK";
|
||||||
break;
|
break;
|
||||||
case 10: // SUBTYPE_TECH_OTHER
|
case 10: // SUBTYPE_TECH_OTHER
|
||||||
|
subType = "OTHER";
|
||||||
break;
|
break;
|
||||||
default: // INVALID_SUB_TYPE
|
default: // INVALID_SUB_TYPE
|
||||||
|
subType = "NONE";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
String report = "ACCOUNT: " + originAccount + " CHARACTER: " + originCharacter + " LOCATION: " + playerLocation + " PRIMARY TYPE: " + primaryReportType + " SUB TYPE: " + subType + " MESSAGE: " + ((PetitionReceivedMsg) msg).getMessage();
|
||||||
|
Logger.info(report);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
private void logBugReport(PetitionReceivedMsg msg){
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user