'use strict';

const rethinkDB = require('rethinkdb');
const program = require('commander');
const common = require('./common');


if (require.main === module) {
  rethinkDB.connect( {host: 'localhost', port: 28015}, function(err) {
    if (err) throw err;

  });
}

@@ -123,16 +123,44 @@
 mon');%0A%0A
+var worldDB = 'labyrinth';%0A%0A
 %0Aif (req
@@ -250,16 +250,22 @@
 tion(err
+, conn
 ) %7B%0A    
@@ -285,16 +285,558 @@
 w err;%0A%0A
+    rethinkDB%0A      .dbList()%0A      .run(conn, (err, dbList) =%3E %7B%0A        if (err) throw err;%0A%0A        for (let i = 0; i %3C dbList.length; i++) %7B%0A          if (dbList%5Bi%5D === worldDB) %7B%0A            common.log(%60The world is exist. %60%0A              + %60If you really want create a new world, %60%0A              + %60delete the database %22$%7BworldDB%7D%22.%60);%0A%0A            process.exit(1);%0A          %7D%0A        %7D%0A%0A        rethinkDB%0A          .dbCreate(worldDB)%0A          .run(this.conn, (err, res) =%3E %7B%0A            if (err) throw err;%0A%0A%0A          %7D);%0A      %7D);%0A
   %7D);%0A%7D%0A

Check the database