Skip to content

Commit

Permalink
修改服务器混合监听方法为listen
Browse files Browse the repository at this point in the history
  • Loading branch information
jxy918 committed May 7, 2018
1 parent 2697686 commit 9e80925
Show file tree
Hide file tree
Showing 43 changed files with 556 additions and 10 deletions.
Empty file modified README.md
100644 → 100755
Empty file.
4 changes: 2 additions & 2 deletions bin/poker
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/sh
#!/bin/bash
function startgame()
{
printf "staring GameServer...\r\n"
/usr/bin/php run.php >> ../log/server.log 2>&1
/usr/local/bin/php run.php >> ../log/server.log 2>&1
printf $?
if [ $? == 0 ]; then
printf "GameServer start OK\r\n"
Expand Down
2 changes: 1 addition & 1 deletion bin/run.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@

require __DIR__ .'/../vendor/autoload.php';

GameServer::getInstance()->initServer()->start();
GameServer::getInstance()->initServer()->start();
Empty file modified client/Const.js
100644 → 100755
Empty file.
Empty file modified client/Init.js
100644 → 100755
Empty file.
Empty file modified client/Packet.js
100644 → 100755
Empty file.
Empty file modified client/Req.js
100644 → 100755
Empty file.
Empty file modified client/Resp.js
100644 → 100755
Empty file.
Empty file modified client/index.html
100644 → 100755
Empty file.
Empty file modified client/msgpack.js
100644 → 100755
Empty file.
Empty file modified composer.json
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion core/AStrategy.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ protected function Broadcast($serv, $data) {
$serv->push($fd, $data, WEBSOCKET_OPCODE_BINARY);
}
}
}
}
4 changes: 2 additions & 2 deletions core/BaseServer.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ abstract class BaseServer {
'max_request' => 0, //必须设置为0,否则会导致并发任务超时,don't change this number
'task_max_request' => 2000,

'daemonize'=>1,
// 'daemonize'=>1,
// 'log_level' => 2, //swoole 日志级别 Info
'backlog' => 3000,
'log_file' => '../log/sw_server.log',//swoole 系统日志,任何代码内echo都会在这里输出
Expand Down Expand Up @@ -117,7 +117,7 @@ public function initServer() {
//如果tcp端口有设置, 将开启tcp协议
if(!empty($this->tcpserver_port)) {
//tcp server
$this->tcpserver = $this->server->addListener($this->server_ip, $this->tcpserver_port, SWOOLE_SOCK_TCP);
$this->tcpserver = $this->server->listen($this->server_ip, $this->tcpserver_port, SWOOLE_SOCK_TCP);
//tcp只使用这几个个事件
$this->tcpserver->on('Connect', array($this, 'onConnect'));
$this->tcpserver->on('Receive', array($this, 'onReceive'));
Expand Down
Empty file modified core/Config.php
100644 → 100755
Empty file.
Empty file modified core/Const.php
100644 → 100755
Empty file.
Empty file modified core/Dispatch.php
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion core/GameServer.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@ public function doWork($serv, $task_id, $src_worker_id, $data) {
return 'http protocol';
}
}
}
}
2 changes: 1 addition & 1 deletion core/JokerPoker.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -610,4 +610,4 @@ public static function setRate($rate = array()) {
var_dump($key, $card, $obj->getCardType($key),$obj->getIsDoubleCard());
*/
*/
Empty file modified core/Packet.php
100644 → 100755
Empty file.
Empty file modified core/PdoDB.php
100644 → 100755
Empty file.
Empty file modified images/demo1.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified images/demo2.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified images/demo3.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified images/demo4.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified images/demo5.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified lib/CancelCard.php
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion lib/ChatMsg.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ public function exec() {
$data = \Game\Core\Packet::packEncode($data, \Game\Core\MainCmd::CMD_SYS, \Game\Core\SubCmdSys::CHAT_MSG_RESP);
return $data;
}
}
}
Empty file modified lib/GetCard.php
100644 → 100755
Empty file.
Empty file modified lib/GetSingerCard.php
100644 → 100755
Empty file.
Empty file modified lib/IsDouble.php
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion lib/SendCard.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ public function exec() {
$data = \Game\Core\Packet::packEncode($data, \Game\Core\MainCmd::CMD_SYS, \Game\Core\SubCmdSys::SEND_CARD_RESP);
return $data;
}
}
}
Empty file modified lib/TurnCard.php
100644 → 100755
Empty file.
Empty file modified log/server.log
100644 → 100755
Empty file.
546 changes: 546 additions & 0 deletions log/sw_server.log
100644 → 100755

Large diffs are not rendered by default.

Empty file modified vendor/autoload.php
100644 → 100755
Empty file.
Empty file modified vendor/composer/ClassLoader.php
100644 → 100755
Empty file.
Empty file modified vendor/composer/LICENSE
100644 → 100755
Empty file.
Empty file modified vendor/composer/autoload_classmap.php
100644 → 100755
Empty file.
Empty file modified vendor/composer/autoload_namespaces.php
100644 → 100755
Empty file.
Empty file modified vendor/composer/autoload_psr4.php
100644 → 100755
Empty file.
Empty file modified vendor/composer/autoload_real.php
100644 → 100755
Empty file.
Empty file modified vendor/composer/autoload_static.php
100644 → 100755
Empty file.
Empty file modified vendor/composer/installed.json
100644 → 100755
Empty file.

0 comments on commit 9e80925

Please sign in to comment.