// Path: api/src/main/java/hirez/api/HiRezUtils.java
// public class HiRezUtils {
//     public static Date parse(String timestamp) {
//         timestamp = timestamp.replace("\\/", "/");
//         SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy hh:mm:ss a");
//         sdf.setTimeZone(TimeZone.getTimeZone(ZoneOffset.UTC));
//         try {
//             return sdf.parse(timestamp);
//         } catch (ParseException ignore) {
//             return null;
//         }
//     }
// }


import hirez.api.HiRezUtils;
import lombok.Data;
import java.util.Date;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
package hirez.api.object;



@Data
public class Ping {
    private final String rawMessage;

    private final String game;
    private final String version;
    private final String patchVersion;
    private final boolean pingReceived;
    private final Date timestamp;

    public Ping(String raw) {
        this.rawMessage = raw;

        Matcher matcher = Pattern.compile("^(?<game>.+)API \\(ver (?<version>(?:[0-9]+\\.){3}[0-9]+)\\)" + " \\[PATCH - (?<versionName>.+)] - (?<ping>.+)\\. Server Date:(?<timestamp>.+)$").matcher(raw);

        matcher.find();

        this.game = matcher.group("game");
        this.version = matcher.group("version");
        this.patchVersion = matcher.group("versionName");
        this.pingReceived = matcher.group("ping").contains("successful");
// Path: api/src/main/java/hirez/api/HiRezUtils.java
// public class HiRezUtils {
//     public static Date parse(String timestamp) {
//         timestamp = timestamp.replace("\\/", "/");
//         SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy hh:mm:ss a");
//         sdf.setTimeZone(TimeZone.getTimeZone(ZoneOffset.UTC));
//         try {
//             return sdf.parse(timestamp);
//         } catch (ParseException ignore) {
//             return null;
//         }
//     }
// }


// Path: api/src/main/java/hirez/api/object/Ping.java
import hirez.api.HiRezUtils;
import lombok.Data;
import java.util.Date;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

package hirez.api.object;



@Data
public class Ping {
    private final String rawMessage;

    private final String game;
    private final String version;
    private final String patchVersion;
    private final boolean pingReceived;
    private final Date timestamp;

    public Ping(String raw) {
        this.rawMessage = raw;

        Matcher matcher = Pattern.compile("^(?<game>.+)API \\(ver (?<version>(?:[0-9]+\\.){3}[0-9]+)\\)" + " \\[PATCH - (?<versionName>.+)] - (?<ping>.+)\\. Server Date:(?<timestamp>.+)$").matcher(raw);

        matcher.find();

        this.game = matcher.group("game");
        this.version = matcher.group("version");
        this.patchVersion = matcher.group("versionName");
        this.pingReceived = matcher.group("ping").contains("successful");
        this.timestamp = HiRezUtils.parse(matcher.group("timestamp"));