- function Brisk($crystal_filename) {
- $this->crystal_filename = $crystal_filename;
- $this->user = array();
- $this->table = array();
- $this->match = array();
+ function Brisk()
+ {
+ }
+
+ // constructor
+ static function create($crystal_filename)
+ {
+ if (($brisk_ser = @file_get_contents($crystal_filename)) != FALSE) {
+ if (($brisk = unserialize($brisk_ser)) != FALSE) {
+ fprintf(STDERR, "ROOM FROM FILE\n");
+ rename($crystal_filename, $crystal_filename.".old");
+
+ return($brisk);
+ }
+ }
+
+ fprintf(STDERR, "NEW ROOM\n");
+ $thiz = new Brisk();
+
+ $thiz->crystal_filename = $crystal_filename;
+ $thiz->user = array();
+ $thiz->table = array();
+ $thiz->match = array();