Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var FiveRP;
- (function (FiveRP) {
- var Application = (function () {
- function Application() {
- }
- Application.run = function () {
- Application.loadConfig();
- Application.loadDatabase();
- Application.loadServerEvents();
- };
- Application.loadConfig = function () {
- Application.config = FiveRP.Utils.Config.load();
- console.log('###config:', Application.config);
- };
- Application.loadDatabase = function () {
- FiveRP.Manager.Database.initialize();
- };
- Application.loadServerEvents = function () {
- on('playerConnecting', function (playerName, setKickReason, deferrals) {
- console.log('###: ' + playerName);
- console.log(GetPlayerIdentifier(source));
- });
- };
- return Application;
- }());
- FiveRP.Application = Application;
- })(FiveRP || (FiveRP = {}));
- setTimeout(function () { return FiveRP.Application.run(); }, 200);
- var mysql = require('mysql');
- var FiveRP;
- (function (FiveRP) {
- var Manager;
- (function (Manager) {
- var Database = (function () {
- function Database() {
- }
- Database.initialize = function () {
- Database.db = mysql.createConnection({
- host: 'localhost',
- port: 3306,
- user: 'root',
- password: '',
- database: 'fivem'
- });
- Database.db.connect(function (err) {
- if (err)
- throw err;
- console.log("Connected!");
- });
- };
- return Database;
- }());
- Manager.Database = Database;
- })(Manager = FiveRP.Manager || (FiveRP.Manager = {}));
- })(FiveRP || (FiveRP = {}));
- var fs = require('fs');
- var FiveRP;
- (function (FiveRP) {
- var Utils;
- (function (Utils) {
- var Config = (function () {
- function Config() {
- }
- Config.load = function () {
- var path = GetResourcePath(GetCurrentResourceName());
- return JSON.parse(fs.readFileSync(path + "/config.json"));
- };
- return Config;
- }());
- Utils.Config = Config;
- })(Utils = FiveRP.Utils || (FiveRP.Utils = {}));
- })(FiveRP || (FiveRP = {}));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement