add created, updated field to db && improve graph design
This commit is contained in:
@@ -41,7 +41,7 @@ twig:
|
|||||||
debug: "%kernel.debug%"
|
debug: "%kernel.debug%"
|
||||||
strict_variables: "%kernel.debug%"
|
strict_variables: "%kernel.debug%"
|
||||||
globals:
|
globals:
|
||||||
version: "0.34.18 (beta6)"
|
version: "0.36.18 (beta6)"
|
||||||
facebook_api: "%facebook.api%"
|
facebook_api: "%facebook.api%"
|
||||||
facebook_scope: "%facebook.scope%"
|
facebook_scope: "%facebook.scope%"
|
||||||
facebook_api_version: "%facebook.version%"
|
facebook_api_version: "%facebook.version%"
|
||||||
|
|||||||
@@ -153,9 +153,23 @@ header section h3.or {
|
|||||||
}
|
}
|
||||||
|
|
||||||
header section #id_welcome {
|
header section #id_welcome {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
margin-bottom: 115px;
|
margin-bottom: 115px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
header section #id_welcome > div {
|
||||||
|
padding-right: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
header section #id_welcome img {
|
||||||
|
width: 100px;
|
||||||
|
border: 5px solid #414040;
|
||||||
|
|
||||||
|
-webkit-border-radius: 50%;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
header section .buttons,
|
header section .buttons,
|
||||||
header section form {
|
header section form {
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
@@ -307,6 +321,12 @@ footer nav ul li a:hover {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 1100px) {
|
@media screen and (max-width: 1100px) {
|
||||||
|
header section #id_welcome {
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin-top: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
header section .form-input,
|
header section .form-input,
|
||||||
header section .form-check {
|
header section .form-check {
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
@@ -325,9 +345,17 @@ footer nav ul li a:hover {
|
|||||||
header section div.buttons > a.slack-login {
|
header section div.buttons > a.slack-login {
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
main div.txt {
|
||||||
|
padding: 0 20px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 550px) {
|
@media screen and (max-width: 550px) {
|
||||||
|
header section #id_welcome {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
header section {
|
header section {
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -187,4 +187,28 @@ class Gamer
|
|||||||
{
|
{
|
||||||
return $this->userAgent;
|
return $this->userAgent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set connTimestamp
|
||||||
|
*
|
||||||
|
* @param \DateTime $connTimestamp
|
||||||
|
*
|
||||||
|
* @return Gamer
|
||||||
|
*/
|
||||||
|
public function setConnTimestamp($connTimestamp)
|
||||||
|
{
|
||||||
|
$this->connTimestamp = $connTimestamp;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get connTimestamp
|
||||||
|
*
|
||||||
|
* @return \DateTime
|
||||||
|
*/
|
||||||
|
public function getConnTimestamp()
|
||||||
|
{
|
||||||
|
return $this->connTimestamp;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,6 +105,20 @@ class PlayedGame
|
|||||||
*/
|
*/
|
||||||
private $resign;
|
private $resign;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var \DateTime
|
||||||
|
*
|
||||||
|
* @ORM\Column(name="created", type="datetime", nullable=true)
|
||||||
|
*/
|
||||||
|
private $created;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var \DateTime
|
||||||
|
*
|
||||||
|
* @ORM\Column(name="updated", type="datetime", nullable=true)
|
||||||
|
*/
|
||||||
|
private $updated;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Step
|
* @var Step
|
||||||
*
|
*
|
||||||
@@ -429,4 +443,52 @@ class PlayedGame
|
|||||||
{
|
{
|
||||||
return $this->resign;
|
return $this->resign;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set created
|
||||||
|
*
|
||||||
|
* @param \DateTime $created
|
||||||
|
*
|
||||||
|
* @return PlayedGame
|
||||||
|
*/
|
||||||
|
public function setCreated($created)
|
||||||
|
{
|
||||||
|
$this->created = $created;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get created
|
||||||
|
*
|
||||||
|
* @return \DateTime
|
||||||
|
*/
|
||||||
|
public function getCreated()
|
||||||
|
{
|
||||||
|
return $this->created;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set updated
|
||||||
|
*
|
||||||
|
* @param \DateTime $updated
|
||||||
|
*
|
||||||
|
* @return PlayedGame
|
||||||
|
*/
|
||||||
|
public function setUpdated($updated)
|
||||||
|
{
|
||||||
|
$this->updated = $updated;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get updated
|
||||||
|
*
|
||||||
|
* @return \DateTime
|
||||||
|
*/
|
||||||
|
public function getUpdated()
|
||||||
|
{
|
||||||
|
return $this->updated;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,6 +105,20 @@ class PlayedGame
|
|||||||
*/
|
*/
|
||||||
private $resign;
|
private $resign;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var \DateTime
|
||||||
|
*
|
||||||
|
* @ORM\Column(name="created", type="datetime", nullable=true)
|
||||||
|
*/
|
||||||
|
private $created;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var \DateTime
|
||||||
|
*
|
||||||
|
* @ORM\Column(name="updated", type="datetime", nullable=true)
|
||||||
|
*/
|
||||||
|
private $updated;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Step
|
* @var Step
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -49,6 +49,13 @@ class Step
|
|||||||
*/
|
*/
|
||||||
private $playedGame;
|
private $playedGame;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var \DateTime
|
||||||
|
*
|
||||||
|
* @ORM\Column(name="created", type="datetime", nullable=true)
|
||||||
|
*/
|
||||||
|
private $created;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get id
|
* Get id
|
||||||
@@ -155,4 +162,28 @@ class Step
|
|||||||
{
|
{
|
||||||
return $this->wBomb;
|
return $this->wBomb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set created
|
||||||
|
*
|
||||||
|
* @param \DateTime $created
|
||||||
|
*
|
||||||
|
* @return Step
|
||||||
|
*/
|
||||||
|
public function setCreated($created)
|
||||||
|
{
|
||||||
|
$this->created = $created;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get created
|
||||||
|
*
|
||||||
|
* @return \DateTime
|
||||||
|
*/
|
||||||
|
public function getCreated()
|
||||||
|
{
|
||||||
|
return $this->created;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,6 +49,13 @@ class Step
|
|||||||
*/
|
*/
|
||||||
private $playedGame;
|
private $playedGame;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var \DateTime
|
||||||
|
*
|
||||||
|
* @ORM\Column(name="created", type="datetime", nullable=true)
|
||||||
|
*/
|
||||||
|
private $created;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get id
|
* Get id
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ header section > img {
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
width: 1300px;
|
width: 1300px;
|
||||||
height: 1300px;
|
height: 1300px;
|
||||||
right: -10%;
|
right: -20%;
|
||||||
top: -10%;
|
top: -10%;
|
||||||
|
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
@@ -149,7 +149,6 @@ header section div.buttons > a.small:hover {
|
|||||||
}
|
}
|
||||||
|
|
||||||
header section div.buttons > a {
|
header section div.buttons > a {
|
||||||
padding: 25px 5px;
|
|
||||||
margin: 0 auto 20px auto;
|
margin: 0 auto 20px auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -167,10 +166,10 @@ header section div.buttons > a.small:hover {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 500px) {
|
@media screen and (max-width: 500px) {
|
||||||
header {
|
/*header {*/
|
||||||
min-height: 100%;
|
/*min-height: 100%;*/
|
||||||
height: auto;
|
/*height: auto;*/
|
||||||
}
|
/*}*/
|
||||||
|
|
||||||
header section {
|
header section {
|
||||||
width: auto;
|
width: auto;
|
||||||
@@ -182,5 +181,6 @@ header section div.buttons > a.small:hover {
|
|||||||
|
|
||||||
header section div.buttons > a {
|
header section div.buttons > a {
|
||||||
display: block;
|
display: block;
|
||||||
|
padding: 25px 5px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,8 @@
|
|||||||
<meta property="og:type" content="website"/>
|
<meta property="og:type" content="website"/>
|
||||||
<meta property="og:title" content="MineSeeker"/>
|
<meta property="og:title" content="MineSeeker"/>
|
||||||
<meta property="og:description" content="A multiplayer minesweeper game"/>
|
<meta property="og:description" content="A multiplayer minesweeper game"/>
|
||||||
<meta property="og:image" content="{{ app.request.getSchemeAndHttpHost() }}{{ asset('bundles/mineseeker/images/mine-1600x627.png') }}"/>
|
<meta property="og:image"
|
||||||
|
content="{{ app.request.getSchemeAndHttpHost() }}{{ asset('bundles/mineseeker/images/mine-1600x627.png') }}"/>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block header %}
|
{% block header %}
|
||||||
@@ -19,15 +20,25 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div id="id_welcome">
|
<div id="id_welcome"{% if app.user.facebookId is defined and app.user.facebookId is not null %} style="margin-bottom:50px"{% endif %}>
|
||||||
{% if is_granted("IS_AUTHENTICATED_REMEMBERED") %}
|
{% if is_granted("IS_AUTHENTICATED_REMEMBERED") %}
|
||||||
<h2>
|
{% if app.user.facebookId is not null %}
|
||||||
Hello, {{ app.user.realName is not null ? app.user.realName : app.user.username }}!
|
<div>
|
||||||
</h2>
|
<img src="http://graph.facebook.com/{{ app.user.facebookId }}/picture?type=square&width=100&height=100"
|
||||||
<h1>Let's play!! :D</h1>
|
alt="Facebook profile" border="0"/>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
<div>
|
||||||
|
<h2{% if app.user.facebookId is defined and app.user.facebookId is not null %} style="margin-top:0"{% endif %}>
|
||||||
|
Hello, {{ app.user.realName is not null ? app.user.realName : app.user.username }}!
|
||||||
|
</h2>
|
||||||
|
<h1>Let's play!! :D</h1>
|
||||||
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
<h2>A minesweeper game rethought...</h2>
|
<div>
|
||||||
<h1>...and you can play w/o register!!</h1>
|
<h2>A minesweeper game rethought...</h2>
|
||||||
|
<h1>...and you can play w/o register!!</h1>
|
||||||
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
@@ -54,11 +65,13 @@
|
|||||||
<div class="txt">
|
<div class="txt">
|
||||||
<div class="technologies">
|
<div class="technologies">
|
||||||
<h1>Used technologies</h1>
|
<h1>Used technologies</h1>
|
||||||
<img src="{{ asset('bundles/mineseeker/images/technologies/websocket.png') }}" alt="Used Websocket" border="0"/>
|
<img src="{{ asset('bundles/mineseeker/images/technologies/websocket.png') }}" alt="Used Websocket"
|
||||||
|
border="0"/>
|
||||||
<img src="{{ asset('bundles/mineseeker/images/technologies/react.png') }}" alt="Used React.js" border="0"/>
|
<img src="{{ asset('bundles/mineseeker/images/technologies/react.png') }}" alt="Used React.js" border="0"/>
|
||||||
<img src="{{ asset('bundles/mineseeker/images/technologies/symfony.png') }}" alt="Used Symfony" border="0"/>
|
<img src="{{ asset('bundles/mineseeker/images/technologies/symfony.png') }}" alt="Used Symfony" border="0"/>
|
||||||
<img src="{{ asset('bundles/mineseeker/images/technologies/jquery.png') }}" alt="Used jQuery" border="0"/>
|
<img src="{{ asset('bundles/mineseeker/images/technologies/jquery.png') }}" alt="Used jQuery" border="0"/>
|
||||||
<img src="{{ asset('bundles/mineseeker/images/technologies/lets-encrypt.png') }}" alt="Used Let's Encrypt" border="0"/>
|
<img src="{{ asset('bundles/mineseeker/images/technologies/lets-encrypt.png') }}" alt="Used Let's Encrypt"
|
||||||
|
border="0"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -150,6 +150,8 @@ class MineseekerRpc implements RpcInterface
|
|||||||
/** Save PlayedGame */
|
/** Save PlayedGame */
|
||||||
$playedGame->setGameAssoc($data[1]);
|
$playedGame->setGameAssoc($data[1]);
|
||||||
$playedGame->setGrid($grid);
|
$playedGame->setGrid($grid);
|
||||||
|
$playedGame->setCreated(new \DateTime());
|
||||||
|
$playedGame->setUpdated(new \DateTime());
|
||||||
$this->em->persist($playedGame);
|
$this->em->persist($playedGame);
|
||||||
|
|
||||||
$this->em->flush();
|
$this->em->flush();
|
||||||
|
|||||||
@@ -167,12 +167,14 @@ class MineseekerTopic implements TopicInterface
|
|||||||
$step->setCol($event['coords'][1]);
|
$step->setCol($event['coords'][1]);
|
||||||
$step->setWBomb($event['bomb']);
|
$step->setWBomb($event['bomb']);
|
||||||
$step->setPlayedGame($playedGame);
|
$step->setPlayedGame($playedGame);
|
||||||
|
$step->setCreated(new \DateTime());
|
||||||
$this->em->persist($step);
|
$this->em->persist($step);
|
||||||
|
|
||||||
$playedGame->setBluePoints($event['bluePoints']);
|
$playedGame->setBluePoints($event['bluePoints']);
|
||||||
$playedGame->setRedPoints($event['redPoints']);
|
$playedGame->setRedPoints($event['redPoints']);
|
||||||
$playedGame->setBlueExplodedBomb($event['blueExplodedBomb'] ? true : null);
|
$playedGame->setBlueExplodedBomb($event['blueExplodedBomb'] ? true : null);
|
||||||
$playedGame->setRedExplodedBomb($event['redExplodedBomb'] ? true : null);
|
$playedGame->setRedExplodedBomb($event['redExplodedBomb'] ? true : null);
|
||||||
|
$playedGame->setUpdated(new \DateTime());
|
||||||
$this->em->persist($playedGame);
|
$this->em->persist($playedGame);
|
||||||
|
|
||||||
$this->em->flush();
|
$this->em->flush();
|
||||||
|
|||||||
Reference in New Issue
Block a user