summaryrefslogtreecommitdiff
path: root/src/Message/Welcome.php
diff options
context:
space:
mode:
authorFbenas <philbeansburton@gmail.com>2017-03-12 23:57:42 +0000
committerFbenas <philbeansburton@gmail.com>2017-03-12 23:57:42 +0000
commit1eee94d2604fb43b5a4a21c281c72ad356906a88 (patch)
tree23c095b5db60c48dae443356392f5a5eb8a9c9f2 /src/Message/Welcome.php
parentedfd095021ee5d89f53da4fd78d7dea7346d7617 (diff)
Added identify form and Ratchet websockets test stuff
Diffstat (limited to 'src/Message/Welcome.php')
-rw-r--r--src/Message/Welcome.php62
1 files changed, 62 insertions, 0 deletions
diff --git a/src/Message/Welcome.php b/src/Message/Welcome.php
new file mode 100644
index 0000000..8a121f4
--- /dev/null
+++ b/src/Message/Welcome.php
@@ -0,0 +1,62 @@
+<?php
+
+namespace App\Message;
+
+use App\Message\Base;
+
+/**
+ * Welcome message
+ *
+ * @author Phil Burton <phil@pgburton.com>
+ */
+class Welcome extends Base
+{
+ /**
+ * The list of vars we need to inject
+ *
+ * @var array
+ */
+ protected $injects = ['name', 'gameCode'];
+
+ /**
+ * The array of important vars
+ *
+ * @var string
+ */
+ protected $important = ['name', 'gameCode'];
+
+ /**
+ * Inject
+ * @var string
+ */
+ public $name;
+
+ /**
+ * Second inject
+ *
+ * @var string
+ */
+ public $gameCode;
+
+ /**
+ * Construct to set any inject vars from functions if required
+ *
+ * @author Phil Burton <phil@pgburton.com>
+ */
+ public function __construct(Handler $handler)
+ {
+ $this->inject = $this->getInject();
+ parent::__construct($handler);
+ }
+
+ /**
+ * Get our inject value
+ *
+ * @author Phil Burton <phil@pgburton.com>
+ * @return string
+ */
+ public function getInject()
+ {
+ return (string) time();
+ }
+}