日記システムをつくるための日記

About
Login
2 3 4 5 6 7 8 Next >> 

[hardware] 前に買ったマウス

http://www.amazon.co.jp/dp/B000G04TXS

Microsoft Comfort Optical Mouse 1000
1990円で緊急購入したけど、amazonの方がやすいなやっぱ

*
 
2010年4月11日 うみねこ、やる事が既に目的でなくなってきてるような

[ipod] 続・onscripter

前回、やってみてarc.nsaの圧縮をサボった為に画像がめりこみましたとか書きましたけど、今回はその辺なんとかしてみたいっす。
今の状況はこんな感じ。

 
% ls -lh
total 319M
-rw-rw-r-- 2 mobile mobile 314M Dec 24  2007 arc.nsa
-rwxr-xr-x 1 mobile mobile 2.8M Apr  7 01:30 default.ttf
-rw-rw-r-- 2 mobile mobile 2.3M Dec 23  2007 nscript.dat
-rw-r--r-- 1 mobile mobile  493 Apr  7 13:50 stderr.txt
-rw-r--r-- 1 mobile mobile   92 Apr  7 13:50 stdout.txt

これを行うには、どうしてもC&D Tools Win GUIっていうのがいるらしい
http://www.geocities.jp/stm_torm/ons/tool.html

ま、、ともあれarc.nsaをwin上にまたしても持ってきたりする。gui.exeのアイコンがおもいっきりVB6だったのでアレかなと思ってたんだけどやっぱりcomdlg32.ocxが無いとかいわれるので放りこむ。

デフォルトだとarc_c.nsaとかいう名前になるみたい。これを転送。

 
% ls -lh                                                 
total 352M
-rw-rw-r-- 2 mobile mobile 314M Dec 24  2007 arc.nsa
-rwxr-xr-x 1 mobile mobile  33M Apr 10 14:52 arc_c.nsa
-rwxr-xr-x 1 mobile mobile 2.8M Apr  7 01:30 default.ttf
-rw-rw-r-- 2 mobile mobile 2.3M Dec 23  2007 nscript.dat
-rw-r--r-- 1 mobile mobile  493 Apr  7 13:50 stderr.txt
-rw-r--r-- 1 mobile mobile   92 Apr  7 13:50 stdout.txt

おお、1/10くらいになりよった。これを上書きして起動してみる。

http://image.movapic.com/pic/m_201004101509574bc016358e4e5.png

よくなりましたね!

[ipod] うみねこonscripter on touchで音が鳴らない問題

とりあえずこんなんになってる。

 
drwxrwsr-x 2 mobile mobile   2176 Apr  7 00:57 BGM
drwxrwsr-x 2 mobile mobile    374 Apr  7 00:43 DirectX
drwxrwsr-x 2 mobile mobile    850 Apr  7 00:51 ME
-rw-rw-r-- 1 mobile mobile   4107 Dec 23  2007 Read_me.txt
drwxrwsr-x 2 mobile mobile   2210 Apr  7 00:53 SE
-rw-rw-r-- 1 mobile mobile     46 Jul 27  2007 autorun.inf
drwxrwsr-x 3 mobile mobile   1360 Apr  7 00:41 bgm_mode
-rw-rw-r-- 1 mobile mobile    873 Jul 31  2007 comment.txt
-rw-rw-r-- 1 mobile mobile    889 Dec 23  2007 filelist0.txt
drwxrwsr-x 2 mobile mobile    442 Apr  7 00:50 fullsrc
-rw-rw-r-- 1 mobile mobile   1215 Dec 23  2007 install.txt
-rw-rw-r-- 1 mobile mobile 196664 Dec 23  2007 installer.bmp
-rw-rw-r-- 1 mobile mobile  69632 Mar 29  2007 instsub.exe
-rw-rw-r-- 1 mobile mobile    479 Mar 29  2007 instsub.exe.manifest
-rw-rw-r-- 1 mobile mobile  49152 Mar 24  2007 launcher.exe
-rw-rw-r-- 1 mobile mobile    469 Mar 29  2007 launcher.exe.manifest
drwxrwsr-x 2 mobile mobile    136 Apr  7 00:52 movie
drwxrwsr-x 2 mobile mobile     68 Apr  7 00:52 screenshot
drwxrwsr-x 2 mobile mobile    884 Apr  7 00:53 sys_se
-rw-rw-r-- 1 mobile mobile   3315 Dec  8  2007 umineko.ico

必要そうなのはこれくらいか。

  • BGM
  • ME
  • SE
  • bgm_mode
  • filelist0.txt
  • movie
  • sys_se

これらをゲームディレクトリに置いて、 apt-get install oggしたら音はなるようになった、が、BGMが一部鳴らない。多分日本語のファイル名のエンコーディングなんだと思うんだが、今はEUCになっているの、かな、よくわからないな。いろいろと試行錯誤してみます

*
 
2010年4月7日 May he R.I.P.

[php] Auth Componentを読み解く

とかいうなんか本末転倒に面倒な作業が発生してしもたので、やるしかない。
実体はcake/libs/controller/components/auth.php

function login() {} に関しては前回記述した通りだが、もう少しつっつくと

 
        function login($data = null) {
                $this->__setDefaults();
                $this->_loggedIn = false;
 
                if (empty($data)) {
                        $data = $this->data;
                }
 
                if ($user = $this->identify($data)) {
                        $this->Session->write($this->sessionKey, $user);
                        $this->_loggedIn = true;
                }
                return $this->_loggedIn;
        }

$dataには以下のようなものが入っているようだ。

 
Array
(
    [User.username] => test1
    [User.password] => beeae1c2ca024afd7afd522612f5a778c1ba601f
)

loginフォームで送信されたユーザ名と、ハッシュ化済みのパスワードが入っている。これをidentifyメソッドに渡して、中身があればtrueとし、なければfalseのまま返す、つまり返却値はfalseまたはデータというPHP的なmixedと表現されるものである。

identify

 
function identify($user = null, $conditions = null) {}

こんな具合。ただし呼び出し元をみるとわかるように、通常のログインでは$user利用しない。続いてこの$conditionsの初期を行っている

 
                if ($conditions === false) {
                        $conditions = null;
                } elseif (is_array($conditions)) {
                        $conditions = array_merge((array)$this->userScope, $conditions);
                } else {
                        $conditions = $this->userScope;
                }

この場合は$conditionsがnullなので$this->userScopeが参照されるはず。開いてみるとこんな感じ。

 
array(0) { }

つまり空配列。

続いてuserの初期化

 
                if (empty($user)) {
                        $user = $this->user();
                        if (empty($user)) {
                                return null;
                        }
                } elseif (is_object($user) && is_a($user, 'Model')) {
                        if (!$user->exists()) {
                                return null;
                        }
                        $user = $user->read();
                        $user = $user[$this->userModel];
                } elseif (is_array($user) && isset($user[$this->userModel])) {
                        $user = $user[$this->userModel];
                }

この場合、諦めてnullを返却してしまう事もあるのだけど、基本的にはどのブロックもくぐらずに落ちる。

続いてこんな長いif文だらけでわけのわからない所だけど

 
 $model =& $this->getModel();
 $data = $model->find(array_merge($find, $conditions), null, null, 0);

ここまでは問題なく来れるみたい。で、要するに、ここで$dataとしてユーザデータが掘れるか掘れないかというだけの事で、$findの条件文としては以下のような具合になっている。

 
Array
(
    [User.username] => test1
    [User.password] => 658a82424e8dbcbe9fef73f71a19546e4fdd35dc
)

もうそのまんまですね。

*
 
2 3 4 5 6 7 8 Next >> 
日記システムをつくるための日記 Version: trunk