• R/O
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

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


Commit MetaInfo

Revision14 (tree)
Time2016-12-21 18:17:02
Authormanjihq

Log Message

管理者コマンドのパスワード変更を追加

Change Summary

Incremental Difference

--- trunk/src/hunton/SendTask.java (revision 13)
+++ trunk/src/hunton/SendTask.java (revision 14)
@@ -1138,6 +1138,7 @@
11381138 /* parse administrator command */
11391139 public void doAdministratorCommand(String s) {
11401140 byte[] pusername;
1141+ byte[] ppassword;
11411142 int nlen;
11421143 int n;
11431144 StringBuffer work = new StringBuffer();
@@ -1257,6 +1258,47 @@
12571258 Hunt.abort();
12581259 }
12591260 break;
1261+ case 'C':
1262+ /* change password */
1263+ s = Hunt.getToken(s, ",", work);
1264+ try {
1265+ pusername = work.toString().getBytes(Hunt.SYSTEM_CHARSET);
1266+ } catch (UnsupportedEncodingException e) {
1267+ return;
1268+ }
1269+ nlen = Array.getLength(pusername);
1270+ n = 2;
1271+ buffer[0] = Hunt.HCLIT_ADMINCMD;
1272+ buffer[n++] = 3;
1273+ if (nlen > Hunt.USERNAME_LEN) {
1274+ nlen = Hunt.USERNAME_LEN;
1275+ }
1276+ System.arraycopy(pusername, 0, buffer, n, nlen);
1277+ n += nlen;
1278+ for (; nlen < Hunt.USERNAME_LEN; nlen++) {
1279+ buffer[n++] = ' ';
1280+ }
1281+ Hunt.getToken(s, ",", work);
1282+ try {
1283+ ppassword = work.toString().getBytes(Hunt.SYSTEM_CHARSET);
1284+ } catch (UnsupportedEncodingException e) {
1285+ return;
1286+ }
1287+ nlen = Array.getLength(ppassword);
1288+ if (nlen > Hunt.PASSWORD_LEN) {
1289+ nlen = Hunt.PASSWORD_LEN;
1290+ }
1291+ System.arraycopy(ppassword, 0, buffer, n, nlen);
1292+ n += nlen;
1293+ for (; nlen < Hunt.PASSWORD_LEN; nlen++) {
1294+ buffer[n++] = ' ';
1295+ }
1296+ if (session.send_packet_c(buffer, n) == false) {
1297+ System.out.println(Hunt.getBundle().
1298+ getString("ERRMESG_SENDPACKET"));
1299+ Hunt.abort();
1300+ }
1301+ break;
12601302
12611303 default:
12621304 /* illegal command */