2023-07-27 16:03:49 +03:00
|
|
|
package pro.gravit.launcher.client;
|
2019-04-20 01:03:06 +03:00
|
|
|
|
|
|
|
import com.google.gson.GsonBuilder;
|
2023-07-27 16:03:49 +03:00
|
|
|
import pro.gravit.launcher.managers.GsonManager;
|
2019-08-26 14:22:24 +03:00
|
|
|
import pro.gravit.launcher.modules.events.PreGsonPhase;
|
2019-07-03 10:23:26 +03:00
|
|
|
import pro.gravit.launcher.request.websockets.ClientWebSocketService;
|
2019-04-20 01:03:06 +03:00
|
|
|
|
|
|
|
public class ClientGsonManager extends GsonManager {
|
2019-08-26 14:22:24 +03:00
|
|
|
private final ClientModuleManager moduleManager;
|
|
|
|
|
|
|
|
public ClientGsonManager(ClientModuleManager moduleManager) {
|
|
|
|
this.moduleManager = moduleManager;
|
|
|
|
}
|
|
|
|
|
2019-04-20 01:03:06 +03:00
|
|
|
@Override
|
|
|
|
public void registerAdapters(GsonBuilder builder) {
|
|
|
|
super.registerAdapters(builder);
|
2019-07-03 10:23:26 +03:00
|
|
|
ClientWebSocketService.appendTypeAdapters(builder);
|
2019-08-26 14:22:24 +03:00
|
|
|
moduleManager.invokeEvent(new PreGsonPhase(builder));
|
2019-04-20 01:03:06 +03:00
|
|
|
}
|
|
|
|
}
|