Files
prestonbane/src/engine/net/client/handlers/PetitionReceivedMsgHandler.java
T

96 lines
3.6 KiB
Java
Raw Normal View History

2023-08-13 13:45:07 -05:00
package engine.net.client.handlers;
import engine.exception.MsgSendException;
import engine.gameManager.DbManager;
import engine.math.Vector3fImmutable;
2023-08-13 13:45:07 -05:00
import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.PetitionReceivedMsg;
import org.pmw.tinylog.Logger;
2023-08-13 13:45:07 -05:00
public class PetitionReceivedMsgHandler extends AbstractClientMsgHandler {
2023-08-13 15:45:11 -05:00
public PetitionReceivedMsgHandler() {
super(PetitionReceivedMsg.class);
2023-08-13 13:45:07 -05:00
}
@Override
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;
2023-08-13 13:45:07 -05:00
switch(((PetitionReceivedMsg) msg).getType()){
case 1: // TYPE_GENERAL_HELP
primaryReportType = "GENERAL";
2023-08-13 13:45:07 -05:00
break;
case 2: // TYPE_FEEDBACK
primaryReportType = "FEEDBACK";
2023-08-13 13:45:07 -05:00
break;
case 3: // TYPE_STUCK
primaryReportType = "STUCK";
2023-08-13 13:45:07 -05:00
break;
case 4: // TYPE_HARASSMENT
primaryReportType = "HARASSMENT";
2023-08-13 13:45:07 -05:00
break;
case 5: // TYPE_EXPLOIT
primaryReportType = "EXPLOIT";
2023-08-13 13:45:07 -05:00
break;
case 6: // TYPE_BUG
primaryReportType = "BUG";
2023-08-13 13:45:07 -05:00
break;
case 7: // TYPE_GAME_STOPPER
primaryReportType = "GAME STOPPER";
2023-08-13 13:45:07 -05:00
break;
case 8: // TYPE_TECH_SUPPORT
primaryReportType = "TECH SUPPORT";
2023-08-13 13:45:07 -05:00
break;
default: // INVALID_TYPE cannot process this
primaryReportType = "NONE";
2023-08-13 13:45:07 -05:00
return false;
}
String subType;
2023-08-13 13:45:07 -05:00
switch (((PetitionReceivedMsg)msg).getSubType()) {
case 1: // SUBTYPE_EXPLOIT_DUPE
subType = "DUPE";
2023-08-13 13:45:07 -05:00
break;
case 2: // SUBTYPE_EXPLOIT_LEVELING
subType = "LEVELLING";
2023-08-13 13:45:07 -05:00
break;
case 3: // SUBTYPE_EXPLOIT_SKILL_GAIN
subType = "SKILL GAIN";
2023-08-13 13:45:07 -05:00
break;
case 4: // SUBTYPE_EXPLOIT_KILLING
subType = "KILLING";
2023-08-13 13:45:07 -05:00
break;
case 5: // SUBTYPE_EXPLOIT_POLICY
subType = "POLICY";
2023-08-13 13:45:07 -05:00
break;
case 6: // SUBTYPE_EXPLOIT_OTHER
subType = "OTHER";
2023-08-13 13:45:07 -05:00
break;
case 7: // SUBTYPE_TECH_VIDEO
subType = "VIDEO";
2023-08-13 13:45:07 -05:00
break;
case 8: // SUBTYPE_TECH_SOUND
subType = "SOUND";
2023-08-13 13:45:07 -05:00
break;
case 9: // SUBTYPE_TECH_NETWORK
subType = "NETWORK";
2023-08-13 13:45:07 -05:00
break;
case 10: // SUBTYPE_TECH_OTHER
subType = "OTHER";
2023-08-13 13:45:07 -05:00
break;
default: // INVALID_SUB_TYPE
subType = "NONE";
2023-08-13 13:45:07 -05:00
break;
}
String report = "ACCOUNT: " + originAccount + " CHARACTER: " + originCharacter + " LOCATION: " + playerLocation + " PRIMARY TYPE: " + primaryReportType + " SUB TYPE: " + subType + " MESSAGE: " + ((PetitionReceivedMsg) msg).getMessage();
Logger.info(report);
2023-08-13 13:45:07 -05:00
return true;
}
private void logBugReport(PetitionReceivedMsg msg){
}
2023-08-13 13:45:07 -05:00
}