renamed the acme to mineseeker && handle when the user connection has been lost
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
# Topic Configuration
|
||||
acme_topic:
|
||||
channel: acme/channel/{game}
|
||||
mineseeker_topic:
|
||||
channel: mineseeker/channel/{game}
|
||||
handler:
|
||||
callback: 'acme.topic' #related to the getName() of your topic
|
||||
callback: 'mineseeker.topic' #related to the getName() of your topic
|
||||
# requirements:
|
||||
# method:
|
||||
# path: '[a-z1-9A-Z]+'
|
||||
|
||||
# Remote Procedure Call Configuration
|
||||
acme_rpc:
|
||||
channel: sample/{method}
|
||||
mineseeker_rpc:
|
||||
channel: mineseeker-rpc/{method}
|
||||
handler:
|
||||
callback: 'acme.rpc' #related to the getName() or your RPC service
|
||||
callback: 'mineseeker.rpc' #related to the getName() or your RPC service
|
||||
requirements:
|
||||
method:
|
||||
path: "[a-z_]+"
|
||||
|
||||
@@ -26,8 +26,8 @@ services:
|
||||
arguments:
|
||||
- "@doctrine_cache.providers.doctrine.orm.default_result_cache"
|
||||
|
||||
acme_hello.topic_sample_service:
|
||||
class: Mine\SeekerBundle\Topic\AcmeTopic
|
||||
mineseeker.topic_sample_service:
|
||||
class: Mine\SeekerBundle\Topic\MineseekerTopic
|
||||
tags:
|
||||
- { name: gos_web_socket.topic }
|
||||
arguments:
|
||||
@@ -35,15 +35,15 @@ services:
|
||||
doctrine: '@doctrine.orm.entity_manager'
|
||||
requestStack: '@request_stack'
|
||||
|
||||
acme_hello.rpc_sample_service:
|
||||
class: Mine\SeekerBundle\Rpc\AcmeRpc
|
||||
mineseeker.rpc_sample_service:
|
||||
class: Mine\SeekerBundle\Rpc\MineseekerRpc
|
||||
tags:
|
||||
- { name: gos_web_socket.rpc }
|
||||
arguments:
|
||||
doctrine: '@doctrine.orm.entity_manager'
|
||||
|
||||
gos_web_socket_server.client_event.listener:
|
||||
class: Mine\SeekerBundle\EventListener\AcmeClientEventListener
|
||||
class: Mine\SeekerBundle\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 }
|
||||
|
||||
@@ -7,7 +7,7 @@ class MineSeeker extends React.Component {
|
||||
super(props);
|
||||
|
||||
var gameAssoc = props.gameId !== '' ? props.gameId : this.makeGameAssoc(50);
|
||||
var channel = "acme/channel/" + gameAssoc;
|
||||
var channel = "mineseeker/channel/" + gameAssoc;
|
||||
|
||||
this.state = {
|
||||
gameInherited: props.gameId !== '',
|
||||
@@ -50,7 +50,7 @@ class MineSeeker extends React.Component {
|
||||
*/
|
||||
session
|
||||
.call(
|
||||
this.state.gameInherited ? "sample/connectGame" : "sample/startGame",
|
||||
this.state.gameInherited ? "mineseeker-rpc/connectGame" : "mineseeker-rpc/startGame",
|
||||
this.state.gameInherited ? this.state.gameAssoc : [Base64.encode(JSON.stringify(gridClient)), this.state.gameAssoc]
|
||||
)
|
||||
.then(
|
||||
@@ -115,6 +115,12 @@ class MineSeeker extends React.Component {
|
||||
});
|
||||
} else {
|
||||
console.info(payload.msg);
|
||||
|
||||
this.refs.gridControl.setState({
|
||||
overlay: true,
|
||||
overlayTitle: "The connection has been lost...",
|
||||
overlaySubTitle: "Please, restart the game!"
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user