quocanhnguyen402 / SimpleOnlineGameSE02

SE02 final project
Other
0 stars 3 forks source link

Build Status

SimpleOnlineGameSE02

Mục đích

SimpleOnlineGame là một trang web chơi game online cho phép nhiều người có thể chơi 1 game với nhau thông qua Internet.

Dự án hướng tới việc tạo một cộng đồng giao lưu kết bạn. Mọi người có thể chơi trò chơi, giao lưu cùng với những người bạn của mình để tăng tình bạn bè, cũng có thể chơi và kết bạn, giao lưu với những người bạn mới.

Điều kiện

  1. Nodejs 10.15.0

  2. LAMP

  3. Composer

Hướng dẫn cài đặt

  1. Clone project về máy
    git clone https://github.com/Natashi402/SimpleOnlineGameSE02.git
  2. Chạy câu lệnh
    composer install
    php init //Chọn dev
  3. Tạo 1 db có tên mygame trong cơ sở dữ liệu
  4. Chạy các câu lệnh
    php yii migrate
    cd nodejs
    npm install
  5. Configure cho Apache Server

    • Thêm vào httpd-vhost.conf, với <Đường dẫn> thay bằng đường dẫn thực tế tới project

      <VirtualHost *:80>
              ServerName dev.mygame.com
              DocumentRoot "<Đường dẫn>/SimpleOnlineGameSE02/frontend/web"
      
              <Directory "<Đường dẫn>/SimpleOnlineGameSE02/frontend/web">
                  # use mod_rewrite for pretty URL support
                  RewriteEngine on
                  # If a directory or a file exists, use the request directly
                  RewriteCond %{REQUEST_FILENAME} !-f
                  RewriteCond %{REQUEST_FILENAME} !-d
                  # Otherwise forward the request to index.php
                  RewriteRule . index.php
      
                  # use index.php as index file
                  DirectoryIndex index.php
      
                  # ...other settings...
                  Require all granted
      
              </Directory>
          </VirtualHost>
    • Thêm vào file hosts

      127.0.0.1 dev.mygame.com

Khởi chạy websocket client server

cd nodejs
node server.js