Skip to content

Commit d42759e

Browse files
committed
* Updated Dependencies.
+ Added more analytics stuff.
1 parent 2e8b0b1 commit d42759e

File tree

4 files changed

+30
-4
lines changed

4 files changed

+30
-4
lines changed

pom.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@
104104
<artifactId>google-oauth-client</artifactId>
105105
<version>1.33.3</version>
106106
</dependency>
107-
108107
<dependency>
109108
<groupId>com.google.http-client</groupId>
110109
<artifactId>google-http-client-jackson2</artifactId>
@@ -134,7 +133,7 @@
134133
<dependency>
135134
<groupId>com.google.apis</groupId>
136135
<artifactId>google-api-services-youtube</artifactId>
137-
<version>v3-rev20220403-1.32.1</version>
136+
<version>v3-rev20220418-1.32.1</version>
138137
</dependency>
139138
<dependency>
140139
<groupId>com.google.code.gson</groupId>

src/main/java/de/presti/ree6/bot/util/Webhook.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ private Webhook() {
2828
* @param isLog is the Webhook Message a Log-Message?
2929
*/
3030
public static void sendWebhook(LogMessage loggerMessage, WebhookMessage message, long webhookId, String webhookToken, boolean isLog) {
31-
31+
Main.getInstance().getAnalyticsLogger().debug("Received a Webhook to send. (Log-Typ: {})", isLog ? loggerMessage != null ? loggerMessage.getType().name() : "NONE-LOG" : "NONE-LOG");
3232
// Check if the given data is valid.
3333
if (webhookToken.contains("Not setup!") || webhookId == 0) return;
3434

src/main/java/de/presti/ree6/sql/SQLWorker.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1946,7 +1946,10 @@ public void deleteAllData(String guildId) {
19461946
* @return The Result from the SQL-Server.
19471947
*/
19481948
public ResultSet querySQL(String sqlQuery, Object... objcObjects) {
1949-
if (!sqlConnector.isConnected()) return null;
1949+
if (!sqlConnector.isConnected()) {
1950+
sqlConnector.connectToSQLServer();
1951+
return querySQL(sqlQuery, objcObjects);
1952+
}
19501953

19511954
try (PreparedStatement preparedStatement = sqlConnector.getConnection().prepareStatement(sqlQuery)) {
19521955
int index = 1;

src/main/java/de/presti/ree6/utils/data/ImageCreationUtility.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,13 +246,26 @@ public static byte[] createHornyJailImage(User user) throws IOException {
246246
* @throws IOException if the link is not a valid Image.
247247
*/
248248
public static BufferedImage convertToCircleShape(URL url) throws IOException {
249+
long start = System.currentTimeMillis();
250+
long actionPerformance = System.currentTimeMillis();
251+
252+
Main.getInstance().getAnalyticsLogger().debug("Started User Image creation.");
249253

250254
BufferedImage mainImage = ImageIO.read(url);
251255

256+
Main.getInstance().getAnalyticsLogger().debug("Loading Image from URL. ({}ms)", System.currentTimeMillis() - actionPerformance);
257+
actionPerformance = System.currentTimeMillis();
258+
252259
BufferedImage output = new BufferedImage(mainImage.getWidth(), mainImage.getHeight(), BufferedImage.TYPE_INT_ARGB);
253260

261+
Main.getInstance().getAnalyticsLogger().debug("Creating Output BufferedImage. ({}ms)", System.currentTimeMillis() - actionPerformance);
262+
actionPerformance = System.currentTimeMillis();
263+
254264
Graphics2D g2 = output.createGraphics();
255265

266+
Main.getInstance().getAnalyticsLogger().debug("Created Graphics2D. ({}ms)", System.currentTimeMillis() - actionPerformance);
267+
actionPerformance = System.currentTimeMillis();
268+
256269
// This is what we want, but it only does hard-clipping, i.e. aliasing
257270
// g2.setClip(new RoundRectangle2D ...)
258271

@@ -261,15 +274,26 @@ public static BufferedImage convertToCircleShape(URL url) throws IOException {
261274
g2.setComposite(AlphaComposite.Src);
262275
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
263276
g2.setColor(Color.WHITE);
277+
Main.getInstance().getAnalyticsLogger().debug("Set Graphic Presets. ({}ms)", System.currentTimeMillis() - actionPerformance);
278+
actionPerformance = System.currentTimeMillis();
264279
g2.fill(new Ellipse2D.Float(0, 0, mainImage.getHeight(), mainImage.getHeight()));
280+
Main.getInstance().getAnalyticsLogger().debug("Filled Graphic Base with Image. ({}ms)", System.currentTimeMillis() - actionPerformance);
281+
actionPerformance = System.currentTimeMillis();
265282

266283
// ... then compositing the image on top,
267284
// using the white shape from above as alpha source
268285
g2.setComposite(AlphaComposite.SrcAtop);
269286
g2.drawImage(mainImage, 0, 0, null);
270287

288+
Main.getInstance().getAnalyticsLogger().debug("Drawing Image finished. ({}ms)", System.currentTimeMillis() - actionPerformance);
289+
actionPerformance = System.currentTimeMillis();
290+
271291
g2.dispose();
272292

293+
Main.getInstance().getAnalyticsLogger().debug("Disposing Graphics2D finished. ({}ms)", System.currentTimeMillis() - actionPerformance);
294+
actionPerformance = System.currentTimeMillis();
295+
296+
Main.getInstance().getAnalyticsLogger().debug("Finished creation. ({}ms)", System.currentTimeMillis() - start);
273297
return resize(output, 250, 250);
274298
}
275299

0 commit comments

Comments
 (0)