Skip to content

Commit

Permalink
Исправлены 3д головы для ников из цифр
Browse files Browse the repository at this point in the history
  • Loading branch information
xtrafrancyz committed Sep 7, 2020
1 parent 801d8fd commit 21dfb96
Showing 1 changed file with 38 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,44 +32,48 @@ public SkinApplication(SkinService service) {
}

// ### /head
GET("/head/{username: [a-zA-z0-9_-]+}\\.png", context -> {
String username = context.getParameter("username").toString();
writeImage(context, Humanizer.head(username, 160));
});
GET("/head/{username: [a-zA-z0-9_-]+}/{size: [0-9]+}\\.png", context -> {
int size = context.getParameter("size").toInt(160);
String username = context.getParameter("username").toString();
writeImage(context, Humanizer.head(username, size));
});
GET("/head/3d/{username: [a-zA-z0-9_-]+}\\.png", context -> {
String username = context.getParameter("username").toString();
writeImage(context, Perspective.head(username, 160, false));
});
GET("/head/3d/{username: [a-zA-z0-9_-]+}/{size: [0-9]+}\\.png", context -> {
int size = context.getParameter("size").toInt(160);
String username = context.getParameter("username").toString();
writeImage(context, Perspective.head(username, size, false));
addRouteGroup("/head", group -> {
group.GET("/3d/{username: [a-zA-z0-9_-]+}\\.png", context -> {
String username = context.getParameter("username").toString();
writeImage(context, Perspective.head(username, 160, false));
});
group.GET("/3d/{username: [a-zA-z0-9_-]+}/{size: [0-9]+}\\.png", context -> {
int size = context.getParameter("size").toInt(160);
String username = context.getParameter("username").toString();
writeImage(context, Perspective.head(username, size, false));
});
group.GET("/{username: [a-zA-z0-9_-]+}\\.png", context -> {
String username = context.getParameter("username").toString();
writeImage(context, Humanizer.head(username, 160));
});
group.GET("/{username: [a-zA-z0-9_-]+}/{size: [0-9]+}\\.png", context -> {
int size = context.getParameter("size").toInt(160);
String username = context.getParameter("username").toString();
writeImage(context, Humanizer.head(username, size));
});
});


// ### /helm
GET("/helm/{username: [a-zA-z0-9_-]+}\\.png", context -> {
String username = context.getParameter("username").toString();
writeImage(context, Humanizer.helm(username, 160));
});
GET("/helm/{username: [a-zA-z0-9_-]+}/{size: [0-9]+}\\.png", context -> {
int size = context.getParameter("size").toInt(160);
String username = context.getParameter("username").toString();
writeImage(context, Humanizer.helm(username, size));
});
GET("/helm/3d/{username: [a-zA-z0-9_-]+}\\.png", context -> {
String username = context.getParameter("username").toString();
writeImage(context, Perspective.head(username, 160, true));
});
GET("/helm/3d/{username: [a-zA-z0-9_-]+}/{size: [0-9]+}\\.png", context -> {
int size = context.getParameter("size").toInt(160);
String username = context.getParameter("username").toString();
writeImage(context, Perspective.head(username, size, true));
addRouteGroup("/helm", group -> {
group.GET("/3d/{username: [a-zA-z0-9_-]+}\\.png", context -> {
String username = context.getParameter("username").toString();
writeImage(context, Perspective.head(username, 160, true));
});
group.GET("/3d/{username: [a-zA-z0-9_-]+}/{size: [0-9]+}\\.png", context -> {
int size = context.getParameter("size").toInt(160);
String username = context.getParameter("username").toString();
writeImage(context, Perspective.head(username, size, true));
});
group.GET("/{username: [a-zA-z0-9_-]+}\\.png", context -> {
String username = context.getParameter("username").toString();
writeImage(context, Humanizer.helm(username, 160));
});
group.GET("/{username: [a-zA-z0-9_-]+}/{size: [0-9]+}\\.png", context -> {
int size = context.getParameter("size").toInt(160);
String username = context.getParameter("username").toString();
writeImage(context, Humanizer.helm(username, size));
});
});


Expand Down

0 comments on commit 21dfb96

Please sign in to comment.