Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Commit

Permalink
#
Browse files Browse the repository at this point in the history
  • Loading branch information
Kamesuta committed Sep 12, 2016
1 parent b0e287d commit 722b16c
Showing 1 changed file with 15 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,21 @@ public void run() {
if (!StringUtils.isEmpty(info.private_msg)) {
InputStream input1 = null;
try {
final String msgurl = info.private_msg
.replace("%name%", Client.name)
.replace("%id%", Client.id)
.replace("%mcversion%", Client.mcversion)
.replace("%forgeversion%", Client.forgeversion)
.replace("%modmcversion%", Reference.MINECRAFT)
.replace("%modforgeversion%", Reference.FORGE)
.replace("%modversion%", Reference.VERSION);
final HttpUriRequest req1 = new HttpGet(new URI(msgurl));
final HttpResponse response1 = Downloader.downloader.client.execute(req1);
final HttpEntity entity1 = response1.getEntity();
input1 = entity1.getContent();
state.privateMsg = gson.fromJson(new JsonReader(new InputStreamReader(input1, CharEncoding.UTF_8)), Info.PrivateMsg.class);
if (!StringUtils.isEmpty(Client.name) && !StringUtils.isEmpty(Client.id)) {
final String msgurl = info.private_msg
.replace("%name%", Client.name)
.replace("%id%", Client.id)
.replace("%mcversion%", Client.mcversion)
.replace("%forgeversion%", Client.forgeversion)
.replace("%modmcversion%", Reference.MINECRAFT)
.replace("%modforgeversion%", Reference.FORGE)
.replace("%modversion%", Reference.VERSION);
final HttpUriRequest req1 = new HttpGet(new URI(msgurl));
final HttpResponse response1 = Downloader.downloader.client.execute(req1);
final HttpEntity entity1 = response1.getEntity();
input1 = entity1.getContent();
state.privateMsg = gson.fromJson(new JsonReader(new InputStreamReader(input1, CharEncoding.UTF_8)), Info.PrivateMsg.class);
}
} catch(final Exception e1) {
} finally {
IOUtils.closeQuietly(input1);
Expand Down

0 comments on commit 722b16c

Please sign in to comment.