hello world
sablog的代码高亮不怎么方便,换成新版的wp,感觉还不错。
旧BLOG:http://yuehei.37net.com/old/
更旧BLOG:http://hi.baidu.com/wooo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
| <?php
/**
* 探险
*
* @package exp
* @version $Id: ExpController.php 269 2009-09-24 01:31:11Z zhangguangzhong $
*/
class ExpController extends Core_Controller
{
// 有无正在进行中的探险
public function listAction()
{
$modelExp = new Model_Exp($this->_role);
$ret = $modelExp->listExp();
if ($ret === false) {
exit(json_encode(array('status' => 0)));
} else {
$timestamp = time();
$sec = strtotime($ret['end_time']) - $timestamp;
exit(json_encode(array('status' => 1, 'sec' => $sec, 'map_id' => $ret['map_id'])));
}
}
} |
<?php
/**
* 探险
*
* @package exp
* @version $Id: ExpController.php 269 2009-09-24 01:31:11Z zhangguangzhong $
*/
class ExpController extends Core_Controller
{
// 有无正在进行中的探险
public function listAction()
{
$modelExp = new Model_Exp($this->_role);
$ret = $modelExp->listExp();
if ($ret === false) {
exit(json_encode(array('status' => 0)));
} else {
$timestamp = time();
$sec = strtotime($ret['end_time']) - $timestamp;
exit(json_encode(array('status' => 1, 'sec' => $sec, 'map_id' => $ret['map_id'])));
}
}
}
1
2
3
4
5
6
7
8
| #!/usr/bin/python#Filename:socket_server.py
# coding=utf-8
# 聊天网关
from twisted.internet import protocol, reactor
import time, os, qing_game
PORT = 8888 |
#!/usr/bin/python#Filename:socket_server.py
# coding=utf-8
# 聊天网关
from twisted.internet import protocol, reactor
import time, os, qing_game
PORT = 8888
没有评论▼