• 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

Revision3 (tree)
Time2016-01-24 23:38:40
Authormanjihq

Log Message

サーバーとの通信プロトコル変更への対応
(使用するエンコードがutf-8になった)

Change Summary

Incremental Difference

--- trunk/src/hunton/Hunt.java (revision 2)
+++ trunk/src/hunton/Hunt.java (revision 3)
@@ -7,7 +7,7 @@
77
88 public class Hunt {
99
10- public static final String SYSTEM_CHARSET = "EUC_JP";
10+ public static final String SYSTEM_CHARSET = "UTF-8";
1111
1212 /* system const value */
1313 public static final int SENDMAP_CHUNK = 1000;
@@ -14,10 +14,10 @@
1414 public static final int DEFAULT_PORT = 10001;
1515 public static final int VIEW_LIMIT = 5;
1616 public static final int VIEW_WIDTH = 5;
17- public static final int USERNAME_LEN = 16;
17+ public static final int USERNAME_LEN = 24;
1818 public static final int PASSWORD_LEN = 16;
1919 public static final int SCORE_LIMIT = 999999999;
20- public static final int ANIMALNAME_LEN = 16;
20+ public static final int ANIMALNAME_LEN = 24;
2121 public static final int WEAPON_MAX = 2;
2222 public static final int WEAPONNAME_LEN = 32;
2323 public static final int ITEM_MAX = 4;
@@ -402,6 +402,10 @@
402402 return n;
403403 }
404404
405+ public static Frame getMainWnd() {
406+ return mainWnd;
407+ }
408+
405409 public static Component getMainView() {
406410 return mainView;
407411 }
--- trunk/src/hunton/HuntMainView.java (revision 2)
+++ trunk/src/hunton/HuntMainView.java (revision 3)
@@ -87,7 +87,7 @@
8787 try {
8888 return new String(detailBuffer,
8989 (x + y * Hunt.VIEW_WIDTH) * Hunt.USERNAME_LEN,
90- Hunt.USERNAME_LEN, "EUC-JP");
90+ Hunt.USERNAME_LEN, Hunt.SYSTEM_CHARSET);
9191 } catch (UnsupportedEncodingException e) {
9292 return "?";
9393 }
--- trunk/src/hunton/HuntReadWnd.java (revision 2)
+++ trunk/src/hunton/HuntReadWnd.java (revision 3)
@@ -56,6 +56,7 @@
5656 @Override
5757 public void windowClosing(WindowEvent e) {
5858 e.getWindow().dispose();
59+ Hunt.getMainWnd().toFront();
5960 }
6061 }
6162
--- trunk/src/hunton/HuntWriteWnd.java (revision 2)
+++ trunk/src/hunton/HuntWriteWnd.java (revision 3)
@@ -67,6 +67,7 @@
6767 }
6868 }
6969 wnd.dispose();
70+ Hunt.getMainWnd().toFront();
7071 }
7172
7273 }
--- trunk/src/hunton/HuntImg.java (revision 2)
+++ trunk/src/hunton/HuntImg.java (revision 3)
@@ -29,8 +29,8 @@
2929 String wk = s.trim();
3030 FontMetrics fm = g.getFontMetrics();
3131 draw(g, r);
32- if (s.length() > 0) {
33- int w = fm.stringWidth(s);
32+ if (wk.length() > 0) {
33+ int w = fm.stringWidth(wk);
3434 g.setColor(bg);
3535 if (w > (int) r.width) {
3636 x -= (w - (int) r.width) / 2;
@@ -40,7 +40,7 @@
4040 x += ((int) r.width - w) / 2;
4141 }
4242 g.setColor(fg);
43- g.drawString(s, x, y + fm.getHeight() - fm.getMaxDescent());
43+ g.drawString(wk, x, y + fm.getHeight() - fm.getMaxDescent());
4444 }
4545 }
4646