Skip to content

Commit e69832a

Browse files
committed
Remove the updater for now
1 parent e1e0c4a commit e69832a

File tree

2 files changed

+198
-200
lines changed

2 files changed

+198
-200
lines changed

ProtocolLib/src/main/java/com/comphenix/protocol/CommandProtocol.java

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
* ProtocolLib - Bukkit server library that allows access to the Minecraft protocol.
33
* Copyright (C) 2012 Kristian S. Stangeland
44
*
5-
* This program is free software; you can redistribute it and/or modify it under the terms of the
6-
* GNU General Public License as published by the Free Software Foundation; either version 2 of
5+
* This program is free software; you can redistribute it and/or modify it under the terms of the
6+
* GNU General Public License as published by the Free Software Foundation; either version 2 of
77
* the License, or (at your option) any later version.
88
*
9-
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
10-
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
9+
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
10+
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1111
* See the GNU General Public License for more details.
1212
*
13-
* You should have received a copy of the GNU General Public License along with this program;
14-
* if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
13+
* You should have received a copy of the GNU General Public License along with this program;
14+
* if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1515
* 02111-1307 USA
1616
*/
1717

@@ -33,15 +33,15 @@
3333

3434
/**
3535
* Handles the "protocol" administration command.
36-
*
36+
*
3737
* @author Kristian
3838
*/
3939
class CommandProtocol extends CommandBase {
4040
/**
4141
* Name of this command.
4242
*/
4343
public static final String NAME = "protocol";
44-
44+
4545
private Plugin plugin;
4646
private Updater updater;
4747
private ProtocolConfig config;
@@ -52,18 +52,18 @@ public CommandProtocol(ErrorReporter reporter, Plugin plugin, Updater updater, P
5252
this.updater = updater;
5353
this.config = config;
5454
}
55-
55+
5656
@Override
5757
protected boolean handleCommand(CommandSender sender, String[] args) {
5858
String subCommand = args[0];
59-
59+
6060
// Only return TRUE if we executed the correct command
6161
if (subCommand.equalsIgnoreCase("config") || subCommand.equalsIgnoreCase("reload"))
6262
reloadConfiguration(sender);
6363
else if (subCommand.equalsIgnoreCase("check"))
6464
checkVersion(sender);
65-
else if (subCommand.equalsIgnoreCase("update"))
66-
updateVersion(sender);
65+
// else if (subCommand.equalsIgnoreCase("update"))
66+
// updateVersion(sender);
6767
else if (subCommand.equalsIgnoreCase("timings"))
6868
toggleTimings(sender, args);
6969
else if (subCommand.equalsIgnoreCase("listeners"))
@@ -72,19 +72,19 @@ else if (subCommand.equalsIgnoreCase("listeners"))
7272
return false;
7373
return true;
7474
}
75-
75+
7676
public void checkVersion(final CommandSender sender) {
7777
performUpdate(sender, UpdateType.NO_DOWNLOAD);
7878
}
79-
79+
8080
public void updateVersion(final CommandSender sender) {
8181
performUpdate(sender, UpdateType.DEFAULT);
8282
}
83-
83+
8484
// Display every listener on the server
8585
private void printListeners(final CommandSender sender, String[] args) {
8686
ProtocolManager manager = ProtocolLibrary.getProtocolManager();
87-
87+
8888
for (PacketListener listener : manager.getPacketListeners()) {
8989
sender.sendMessage(ChatColor.GOLD + "Packet listeners:");
9090
sender.sendMessage(ChatColor.GOLD + " " + listener);
@@ -95,35 +95,35 @@ private void printListeners(final CommandSender sender, String[] args) {
9595
sender.sendMessage(ChatColor.GOLD + " " + listener);
9696
}
9797
}
98-
98+
9999
private void performUpdate(final CommandSender sender, UpdateType type) {
100100
if (updater.isChecking()) {
101101
sender.sendMessage(ChatColor.RED + "Already checking for an update.");
102102
return;
103103
}
104-
104+
105105
// Perform on an async thread
106106
Runnable notify = new Runnable() {
107107
@Override
108108
public void run() {
109109
sender.sendMessage(ChatColor.YELLOW + "[ProtocolLib] " + updater.getResult());
110-
110+
111111
updater.removeListener(this);
112112
updateFinished();
113113
}
114114
};
115115
updater.start(type);
116116
updater.addListener(notify);
117117
}
118-
118+
119119
private void toggleTimings(CommandSender sender, String[] args) {
120120
TimedListenerManager manager = TimedListenerManager.getInstance();
121121
boolean state = !manager.isTiming(); // toggle
122-
122+
123123
// Parse the boolean parameter
124124
if (args.length == 2) {
125125
Boolean parsed = parseBoolean(toQueue(args, 2), "start");
126-
126+
127127
if (parsed != null) {
128128
state = parsed;
129129
} else {
@@ -134,7 +134,7 @@ private void toggleTimings(CommandSender sender, String[] args) {
134134
sender.sendMessage(ChatColor.RED + "Too many parameters.");
135135
return;
136136
}
137-
137+
138138
// Now change the state
139139
if (state) {
140140
if (manager.startTiming())
@@ -150,21 +150,21 @@ private void toggleTimings(CommandSender sender, String[] args) {
150150
}
151151
}
152152
}
153-
153+
154154
private void saveTimings(TimedListenerManager manager) {
155155
try {
156156
File destination = new File(plugin.getDataFolder(), "Timings - " + System.currentTimeMillis() + ".txt");
157157
TimingReportGenerator generator = new TimingReportGenerator();
158-
158+
159159
// Print to a text file
160160
generator.saveTo(destination, manager);
161161
manager.clear();
162-
162+
163163
} catch (IOException e) {
164164
reporter.reportMinimal(plugin, "saveTimings()", e);
165165
}
166166
}
167-
167+
168168
/**
169169
* Prevent further automatic updates until the next delay.
170170
*/
@@ -174,7 +174,7 @@ public void updateFinished() {
174174
config.setAutoLastTime(currentTime);
175175
config.saveAll();
176176
}
177-
177+
178178
public void reloadConfiguration(CommandSender sender) {
179179
plugin.reloadConfig();
180180
sender.sendMessage(ChatColor.YELLOW + "Reloaded configuration!");

0 commit comments

Comments
 (0)