This commit is contained in:
calzoneman 2013-10-11 18:15:44 -05:00
parent fa9656432d
commit aad1c2995c
2 changed files with 5 additions and 10 deletions

View File

@ -13,6 +13,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
var fs = require("fs"); var fs = require("fs");
var path = require("path"); var path = require("path");
var url = require("url"); var url = require("url");
var Server = require("./server");
var Poll = require("./poll.js").Poll; var Poll = require("./poll.js").Poll;
var Media = require("./media.js").Media; var Media = require("./media.js").Media;
var Logger = require("./logger.js"); var Logger = require("./logger.js");
@ -124,7 +125,7 @@ var Channel = function(name) {
self.ipkey += "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[parseInt(Math.random() * 65)] self.ipkey += "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[parseInt(Math.random() * 65)]
} }
Server.db.loadChannelData(self, function (err) { Server.getServer().db.loadChannelData(self, function (err) {
if (err && err === "channel_dead") if (err && err === "channel_dead")
return; return;
else if (!err || err === "channel_unregistered") else if (!err || err === "channel_unregistered")

View File

@ -9,6 +9,7 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
const VERSION = "2.4.3";
var singleton = null; var singleton = null;
module.exports = { module.exports = {
@ -43,9 +44,6 @@ var Channel = require("./channel");
var User = require("./user"); var User = require("./user");
var $util = require("./utilities"); var $util = require("./utilities");
const VERSION = "2.4.3";
var Server = function (cfg) { var Server = function (cfg) {
var self = this; var self = this;
@ -68,10 +66,10 @@ var Server = function (cfg) {
// database init ------------------------------------------------------ // database init ------------------------------------------------------
var Database = require("./database"); var Database = require("./database");
self.db = new Database(self.cfg); self.db = new Database(self.cfg);
self.actionlog = require("./actionlog");
// webserver init -----------------------------------------------------
self.httplog = new Logger.Logger(path.join(__dirname, self.httplog = new Logger.Logger(path.join(__dirname,
"../httpaccess.log")); "../httpaccess.log"));
// webserver init -----------------------------------------------------
self.express = express(); self.express = express();
self.express.use(express.bodyParser()); self.express.use(express.bodyParser());
@ -162,10 +160,6 @@ var Server = function (cfg) {
// background tasks init ---------------------------------------------- // background tasks init ----------------------------------------------
require("./bgtask")(self); require("./bgtask")(self);
// media metadata retriever init --------------------------------------
// TODO make the constructor just accept cfg?
self.infogetter = require("./get-info");
}; };
Server.prototype.getHTTPIP = function (req) { Server.prototype.getHTTPIP = function (req) {