• R/O
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javaandroidc++linuxc#objective-ccocoa誰得qtrubypythongamewindowsbathyscaphephpguic翻訳omegattwitterframeworktestbtronarduinovb.net計画中(planning stage)directxpreviewerゲームエンジンdom

密猟オンラインクライアントプログラム JAVAベース


Commit MetaInfo

Revision24 (tree)
Time2017-01-06 19:38:46
Authormanjihq

Log Message

管理者コマンドの数値パラメータが数値以外だと例外が発生しているのを修正

Change Summary

Incremental Difference

--- trunk/src/hunton/SendTask.java (revision 23)
+++ trunk/src/hunton/SendTask.java (revision 24)
@@ -1190,6 +1190,7 @@
11901190 public void doAdministratorCommand(String s) {
11911191 byte[] pusername;
11921192 byte[] ppassword;
1193+ long ptwork;
11931194 int nlen;
11941195 int n;
11951196 StringBuffer work = new StringBuffer();
@@ -1238,7 +1239,12 @@
12381239 n = 2;
12391240 buffer[0] = Hunt.HCLIT_ADMINCMD;
12401241 buffer[n++] = 1;
1241- Hunt.htonl(Long.parseLong(work.toString()), buffer, n);
1242+ try {
1243+ ptwork = Long.parseLong(work.toString());
1244+ } catch (NumberFormatException numberFormatException) {
1245+ return;
1246+ }
1247+ Hunt.htonl(ptwork, buffer, n);
12421248 n += 4;
12431249 if (session.send_packet_c(buffer, n) == false) {
12441250 System.out.println(Hunt.getBundle().
@@ -1252,7 +1258,12 @@
12521258 n = 2;
12531259 buffer[0] = Hunt.HCLIT_ADMINCMD;
12541260 buffer[n++] = 2;
1255- Hunt.htonl(Long.parseLong(work.toString()), buffer, n);
1261+ try {
1262+ ptwork = Long.parseLong(work.toString());
1263+ } catch (NumberFormatException numberFormatException) {
1264+ return;
1265+ }
1266+ Hunt.htonl(ptwork, buffer, n);
12561267 n += 4;
12571268 if (session.send_packet_c(buffer, n) == false) {
12581269 System.out.println(Hunt.getBundle().