new: usr: add mineseeker game to the symfony 4 project #3
This commit is contained in:
@@ -17,6 +17,7 @@ return [
|
||||
Sonata\EasyExtendsBundle\SonataEasyExtendsBundle::class => ['all' => true],
|
||||
FOS\UserBundle\FOSUserBundle::class => ['all' => true],
|
||||
Sonata\UserBundle\SonataUserBundle::class => ['all' => true],
|
||||
App\Application\Sonata\UserBundle\ApplicationSonataUserBundle::class => ['all' => true],
|
||||
Sonata\DoctrineORMAdminBundle\SonataDoctrineORMAdminBundle::class => ['all' => true],
|
||||
Gos\Bundle\PubSubRouterBundle\GosPubSubRouterBundle::class => ['all' => true],
|
||||
Gos\Bundle\WebSocketBundle\GosWebSocketBundle::class => ['all' => true],
|
||||
|
||||
@@ -31,3 +31,4 @@ doctrine:
|
||||
alias: App
|
||||
SonataUserBundle: ~
|
||||
FOSUserBundle: ~
|
||||
ApplicationSonataUserBundle: ~
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
fos_user:
|
||||
db_driver: orm # can be orm or odm
|
||||
firewall_name: main
|
||||
user_class: Sonata\UserBundle\Entity\BaseUser
|
||||
user_class: App\Application\Sonata\UserBundle\Entity\User
|
||||
group:
|
||||
group_class: Sonata\UserBundle\Entity\BaseGroup
|
||||
group_class: App\Application\Sonata\UserBundle\Entity\Group
|
||||
group_manager: sonata.user.orm.group_manager # If you're using doctrine orm (use sonata.user.mongodb.group_manager for mongodb)
|
||||
service:
|
||||
user_manager: sonata.user.orm.user_manager
|
||||
|
||||
@@ -1,4 +1,27 @@
|
||||
#doctrine_cache:
|
||||
# providers:
|
||||
# redis_cache:
|
||||
# redis:
|
||||
# host: localhost
|
||||
# port: 6379
|
||||
# database: 3
|
||||
# websocket_cache_client:
|
||||
# type: redis
|
||||
# alias: gos_web_socket.client_storage.driver.redis
|
||||
|
||||
gos_web_socket:
|
||||
server:
|
||||
port: 8080 #The port the socket server will listen on
|
||||
host: 127.0.0.1 #The host ip to bind to
|
||||
host: 0.0.0.0
|
||||
port: "%mineseeker.websocket%"
|
||||
router:
|
||||
resources:
|
||||
- '%kernel.project_dir%/config/pubsub/routing.yaml'
|
||||
client:
|
||||
firewall: secured_area
|
||||
# session_handler: "@session.handler.pdo"
|
||||
# storage:
|
||||
# driver: "@gos_web_socket.client_storage.driver.predis"
|
||||
# ttl: 28800 #(optionally) time to live if you use redis driver
|
||||
# prefix: client #(optionally) prefix if you use redis driver, create key "client:1" instead key "1"
|
||||
periodic:
|
||||
- '@mineseeker.periodic'
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
sonata_user:
|
||||
security_acl: false
|
||||
manager_type: orm # can be orm or mongodb
|
||||
class:
|
||||
user: App\Application\Sonata\UserBundle\Entity\User
|
||||
group: App\Application\Sonata\UserBundle\Entity\Group
|
||||
|
||||
@@ -2,3 +2,8 @@ twig:
|
||||
paths: ['%kernel.project_dir%/templates']
|
||||
debug: '%kernel.debug%'
|
||||
strict_variables: '%kernel.debug%'
|
||||
globals:
|
||||
version: "0.37.18 (beta7)"
|
||||
facebook_api: "%facebook.api%"
|
||||
facebook_scope: "%facebook.scope%"
|
||||
facebook_api_version: "%facebook.version%"
|
||||
|
||||
17
config/pubsub/routing.yaml
Normal file
17
config/pubsub/routing.yaml
Normal file
@@ -0,0 +1,17 @@
|
||||
## Topic Configuration
|
||||
mineseeker_topic:
|
||||
channel: mineseeker/channel/{game}
|
||||
handler:
|
||||
callback: 'mineseeker.topic' #related to the getName() of your topic
|
||||
# requirements:
|
||||
# method:
|
||||
# path: '[a-z1-9A-Z]+'
|
||||
|
||||
# Remote Procedure Call Configuration
|
||||
mineseeker_rpc:
|
||||
channel: mineseeker-rpc/{method}
|
||||
handler:
|
||||
callback: 'mineseeker.rpc' #related to the getName() or your RPC service
|
||||
requirements:
|
||||
method:
|
||||
path: "[a-z_]+"
|
||||
27
config/routes/mineseeker.yaml
Normal file
27
config/routes/mineseeker.yaml
Normal file
@@ -0,0 +1,27 @@
|
||||
MineSeekerBundle_homepage:
|
||||
path: /
|
||||
controller: App\Controller\GameController:index
|
||||
|
||||
MineSeekerBundle_gamePlay:
|
||||
path: /play
|
||||
controller: App\Controller\GameController:play
|
||||
|
||||
MineSeekerBundle_gamePlayWId:
|
||||
path: /play/{gameAssoc}
|
||||
controller: App\Controller\GameController:play
|
||||
|
||||
MineSeekerBundle_terms:
|
||||
path: /terms-of-service
|
||||
controller: App\Controller\GameController:terms
|
||||
|
||||
MineSeekerBundle_privacy:
|
||||
path: /privacy-policy
|
||||
controller: App\Controller\GameController:privacy
|
||||
|
||||
MineSeekerBundle_contact:
|
||||
path: /contact
|
||||
controller: App\Controller\GameController:contact
|
||||
|
||||
MineSeekerBundle_landing:
|
||||
path: /landing-page
|
||||
controller: App\Controller\GameController:landing
|
||||
@@ -2,6 +2,11 @@
|
||||
# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
|
||||
parameters:
|
||||
locale: 'en'
|
||||
facebook.api: 320599508311862
|
||||
facebook.api-secret: 18d4f48cdd274bccee2678e5eff3f557
|
||||
facebook.version: 'v2.8'
|
||||
facebook.scope: 'public_profile,email,user_friends'
|
||||
mineseeker.websocket: 6450
|
||||
|
||||
services:
|
||||
# default configuration for services in *this* file
|
||||
@@ -26,3 +31,38 @@ services:
|
||||
|
||||
# add more service definitions when explicit configuration is needed
|
||||
# please note that last definitions always *replace* previous ones
|
||||
|
||||
mineseeker.periodic:
|
||||
class: App\Periodic\MinePeriodic
|
||||
tags:
|
||||
- { name: gos_web_socket.periodic }
|
||||
arguments:
|
||||
- '@gos_web_socket.pdo.periodic_ping'
|
||||
|
||||
# mineseeker.topic_sample_service:
|
||||
# class: App\Topic\MineseekerTopic
|
||||
# tags:
|
||||
# - { name: gos_web_socket.topic }
|
||||
# arguments:
|
||||
# - "@gos_web_socket.websocket.client_manipulator"
|
||||
# - '@doctrine.orm.entity_manager'
|
||||
# - '@request_stack'
|
||||
# - '@logger'
|
||||
#
|
||||
# mineseeker.rpc_sample_service:
|
||||
# class: App\Rpc\MineseekerRpc
|
||||
# public: true
|
||||
# tags:
|
||||
# - { name: gos_web_socket.rpc }
|
||||
# arguments:
|
||||
# - '@doctrine.orm.entity_manager'
|
||||
# - '@logger'
|
||||
|
||||
gos_web_socket_server.client_event.listener:
|
||||
class: App\EventListener\MineseekerClientEventListener
|
||||
tags:
|
||||
- { name: kernel.event_listener, event: 'gos_web_socket.client_connected', method: onClientConnect }
|
||||
- { name: kernel.event_listener, event: 'gos_web_socket.client_disconnected', method: onClientDisconnect }
|
||||
- { name: kernel.event_listener, event: 'gos_web_socket.client_error', method: onClientError }
|
||||
- { name: kernel.event_listener, event: 'gos_web_socket.server_launched', method: onServerStart }
|
||||
- { name: kernel.event_listener, event: 'gos_web_socket.client_rejected', method: onClientRejected }
|
||||
|
||||
Reference in New Issue
Block a user