Skip to content

Commit

Permalink
Merge branch 'v3'
Browse files Browse the repository at this point in the history
  • Loading branch information
morozovsk committed Sep 5, 2015
2 parents 7afd3a0 + 11a4201 commit 897607b
Show file tree
Hide file tree
Showing 24 changed files with 21 additions and 457 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
Simple websocket server on php.

"composer require morozovsk/websocket"

###Features:
* server works with socket_select, pecl/event or pecl/libevent.
* you can run multiple processes (one master and several workers).
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"require": {
"php": ">=5.3.0"
},
"version": "2.0.0",
"version": "3.0.0",
"license": "MIT",
"homepage": "http://sharoid.ru/game.html",
"authors": [
Expand Down
4 changes: 2 additions & 2 deletions samples/chat/server/ChatWebsocketDaemonHandler.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace morozovsk\websocket;
namespace morozovsk\websocket\samples;

//пример реализации чата
class ChatWebsocketDaemonHandler extends Daemon
class ChatWebsocketDaemonHandler extends \morozovsk\websocket\Daemon
{
protected function onOpen($connectionId, $info) {//вызывается при соединении с новым клиентом

Expand Down
2 changes: 1 addition & 1 deletion samples/chat/server/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
}

$config = array(
'class' => 'morozovsk\websocket\ChatWebsocketDaemonHandler',
'class' => 'morozovsk\websocket\samples\ChatWebsocketDaemonHandler',
'pid' => '/tmp/websocket_chat.pid',
'websocket' => 'tcp://127.0.0.1:8000',
//'localsocket' => 'tcp://127.0.0.1:8010',
Expand Down
4 changes: 2 additions & 2 deletions samples/chat2/server/Chat2WebsocketMasterHandler.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace morozovsk\websocket;
namespace morozovsk\websocket\samples;

class Chat2WebsocketMasterHandler extends Daemon
class Chat2WebsocketMasterHandler extends \morozovsk\websocket\Daemon
{
protected $logins = array();

Expand Down
4 changes: 2 additions & 2 deletions samples/chat2/server/Chat2WebsocketWorkerHandler.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace morozovsk\websocket;
namespace morozovsk\websocket\samples;

//пример реализации чата
class Chat2WebsocketWorkerHandler extends Daemon
class Chat2WebsocketWorkerHandler extends \morozovsk\websocket\Daemon
{
protected $flud;

Expand Down
2 changes: 1 addition & 1 deletion samples/chat2/server/master.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
}

$config = array(
'class' => 'morozovsk\websocket\Chat2WebsocketMasterHandler',
'class' => 'morozovsk\websocket\samples\Chat2WebsocketMasterHandler',
'pid' => '/tmp/websocket_chat2_master.pid',
'websocket' => 'tcp://127.0.0.1:8011',
'localsocket' => 'tcp://127.0.0.1:8010',
Expand Down
2 changes: 1 addition & 1 deletion samples/chat2/server/worker.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
}

$config = array(
'class' => 'morozovsk\websocket\Chat2WebsocketWorkerHandler',
'class' => 'morozovsk\websocket\samples\Chat2WebsocketWorkerHandler',
'pid' => '/tmp/websocket_chat2_worker.pid',
'websocket' => 'tcp://127.0.0.1:8001',
//'localsocket' => 'tcp://127.0.0.1:8010',
Expand Down
4 changes: 2 additions & 2 deletions samples/chat3/server/Chat3WebsocketDaemonHandler.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace morozovsk\websocket;
namespace morozovsk\websocket\samples;

//пример реализации чата
class Chat3WebsocketDaemonHandler extends Daemon
class Chat3WebsocketDaemonHandler extends \morozovsk\websocket\Daemon
{
public $userIds = [];
protected function onOpen($connectionId, $info) {//вызывается при соединении с новым клиентом
Expand Down
2 changes: 1 addition & 1 deletion samples/chat3/server/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
}

$config = array(
'class' => 'morozovsk\websocket\Chat3WebsocketDaemonHandler',
'class' => 'morozovsk\websocket\samples\Chat3WebsocketDaemonHandler',
'pid' => '/tmp/websocket_chat.pid',
'websocket' => 'tcp://127.0.0.1:8004',
'localsocket' => 'tcp://127.0.0.1:8010',
Expand Down
4 changes: 2 additions & 2 deletions samples/game/server/GameWebsocketDaemonHandler.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace morozovsk\websocket;
namespace morozovsk\websocket\samples;

//пример реализации чата
class GameWebsocketDaemonHandler extends Daemon
class GameWebsocketDaemonHandler extends \morozovsk\websocket\Daemon
{
protected $tanks = array();
protected $bullets = array();
Expand Down
2 changes: 1 addition & 1 deletion samples/game/server/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
}

$config = array(
'class' => 'morozovsk\websocket\GameWebsocketDaemonHandler',
'class' => 'morozovsk\websocket\samples\GameWebsocketDaemonHandler',
'pid' => '/tmp/websocket_game.pid',
'websocket' => 'tcp://127.0.0.1:8002',
//'localsocket' => 'tcp://127.0.0.1:8010',
Expand Down
4 changes: 2 additions & 2 deletions samples/game2/server/Game2WebsocketDaemonHandler.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace morozovsk\websocket;
namespace morozovsk\websocket\samples;

//пример реализации чата
class Game2WebsocketDaemonHandler extends Daemon
class Game2WebsocketDaemonHandler extends \morozovsk\websocket\Daemon
{
protected $units = []; //массив юнитов
protected $items = []; //массив обьектов
Expand Down
2 changes: 1 addition & 1 deletion samples/game2/server/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
}

$config = array(
'class' => 'morozovsk\websocket\Game2WebsocketDaemonHandler',
'class' => 'morozovsk\websocket\samples\Game2WebsocketDaemonHandler',
'pid' => '/tmp/websocket_game2.pid',
'websocket' => 'tcp://127.0.0.1:8003',
//'localsocket' => 'tcp://127.0.0.1:8010',
Expand Down
9 changes: 0 additions & 9 deletions samples/yii/css/bootstrap.min.css

This file was deleted.

Loading

0 comments on commit 897607b

Please sign in to comment.