Private
Public Access
1
0

debug the connections - no disconnect threatment and graphics design

This commit is contained in:
2017-01-24 23:00:51 +01:00
parent e8691f29bb
commit fe5378f69b
8 changed files with 154 additions and 209 deletions

View File

@@ -231,7 +231,7 @@ class MineseekerTopic implements TopicInterface
/** This checks it is a reconnection */
if (($one && ($red + $blue === 0)) || ($two && ($red + $blue === 1))) {
/** @var $users {array} w/ save users to database */
$users = $this->saveUserToDb($topic, $userName, $user, $topic->count());
$users = $this->saveUserToDb($playedGame, $userName, $user, $topic->count());
}
return $users;
@@ -240,20 +240,15 @@ class MineseekerTopic implements TopicInterface
/**
* Save user data to database
*
* @param $topic
* @param $playedGame
* @param $userName
* @param $user
* @param $count
* @return array
*/
private function saveUserToDb($topic, $userName, $user, $count)
private function saveUserToDb($playedGame, $userName, $user, $count)
{
$this->reConnect();
$gameAssoc = explode('/', $topic->getId())[2];
$playedGame = $this->em
->getRepository('MineSeekerBundle:PlayedGame')
->findOneByGameAssoc($gameAssoc);
/** the user is not anonym */
if (!is_string($user)) {