密猟オンラインクライアントプログラム JAVAベース
サーバーとの通信プロトコル変更への対応
(使用するエンコードがutf-8になった)
| @@ -7,7 +7,7 @@ | ||
| 7 | 7 | |
| 8 | 8 | public class Hunt { |
| 9 | 9 | |
| 10 | - public static final String SYSTEM_CHARSET = "EUC_JP"; | |
| 10 | + public static final String SYSTEM_CHARSET = "UTF-8"; | |
| 11 | 11 | |
| 12 | 12 | /* system const value */ |
| 13 | 13 | public static final int SENDMAP_CHUNK = 1000; |
| @@ -14,10 +14,10 @@ | ||
| 14 | 14 | public static final int DEFAULT_PORT = 10001; |
| 15 | 15 | public static final int VIEW_LIMIT = 5; |
| 16 | 16 | public static final int VIEW_WIDTH = 5; |
| 17 | - public static final int USERNAME_LEN = 16; | |
| 17 | + public static final int USERNAME_LEN = 24; | |
| 18 | 18 | public static final int PASSWORD_LEN = 16; |
| 19 | 19 | public static final int SCORE_LIMIT = 999999999; |
| 20 | - public static final int ANIMALNAME_LEN = 16; | |
| 20 | + public static final int ANIMALNAME_LEN = 24; | |
| 21 | 21 | public static final int WEAPON_MAX = 2; |
| 22 | 22 | public static final int WEAPONNAME_LEN = 32; |
| 23 | 23 | public static final int ITEM_MAX = 4; |
| @@ -402,6 +402,10 @@ | ||
| 402 | 402 | return n; |
| 403 | 403 | } |
| 404 | 404 | |
| 405 | + public static Frame getMainWnd() { | |
| 406 | + return mainWnd; | |
| 407 | + } | |
| 408 | + | |
| 405 | 409 | public static Component getMainView() { |
| 406 | 410 | return mainView; |
| 407 | 411 | } |
| @@ -87,7 +87,7 @@ | ||
| 87 | 87 | try { |
| 88 | 88 | return new String(detailBuffer, |
| 89 | 89 | (x + y * Hunt.VIEW_WIDTH) * Hunt.USERNAME_LEN, |
| 90 | - Hunt.USERNAME_LEN, "EUC-JP"); | |
| 90 | + Hunt.USERNAME_LEN, Hunt.SYSTEM_CHARSET); | |
| 91 | 91 | } catch (UnsupportedEncodingException e) { |
| 92 | 92 | return "?"; |
| 93 | 93 | } |
| @@ -56,6 +56,7 @@ | ||
| 56 | 56 | @Override |
| 57 | 57 | public void windowClosing(WindowEvent e) { |
| 58 | 58 | e.getWindow().dispose(); |
| 59 | + Hunt.getMainWnd().toFront(); | |
| 59 | 60 | } |
| 60 | 61 | } |
| 61 | 62 |
| @@ -67,6 +67,7 @@ | ||
| 67 | 67 | } |
| 68 | 68 | } |
| 69 | 69 | wnd.dispose(); |
| 70 | + Hunt.getMainWnd().toFront(); | |
| 70 | 71 | } |
| 71 | 72 | |
| 72 | 73 | } |
| @@ -29,8 +29,8 @@ | ||
| 29 | 29 | String wk = s.trim(); |
| 30 | 30 | FontMetrics fm = g.getFontMetrics(); |
| 31 | 31 | 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); | |
| 34 | 34 | g.setColor(bg); |
| 35 | 35 | if (w > (int) r.width) { |
| 36 | 36 | x -= (w - (int) r.width) / 2; |
| @@ -40,7 +40,7 @@ | ||
| 40 | 40 | x += ((int) r.width - w) / 2; |
| 41 | 41 | } |
| 42 | 42 | g.setColor(fg); |
| 43 | - g.drawString(s, x, y + fm.getHeight() - fm.getMaxDescent()); | |
| 43 | + g.drawString(wk, x, y + fm.getHeight() - fm.getMaxDescent()); | |
| 44 | 44 | } |
| 45 | 45 | } |
| 46 | 46 |