示例#1
0
 private void API_onResourceStart()
 {
     API.requestIpl("SP1_10_real_interior");
     MySqlInsightDbProvider.RegisterProvider();
     _database       = new MySqlConnectionStringBuilder("server=localhost;user=root;database=gtanserver;port=3306;password=;");
     _userRepository = _database.Connection().As <IUserRepository>();
 }
        public void Init(string connectionString, DatabaseProvider databaseType)
        {
            DatabaseProvider = databaseType;

            conn = DatabaseProvider.GetAndConfigureConnection(connectionString, (dbConnection, dbtype) =>
            {
                switch (dbtype)
                {
                case DatabaseProvider.MySqlData:
                    MySqlInsightDbProvider.RegisterProvider();
                    break;

                case DatabaseProvider.Npgsql:
                    PostgreSQLInsightDbProvider.RegisterProvider();
                    break;

                case DatabaseProvider.SystemData:
                case DatabaseProvider.MicrosoftData:
                    SqlInsightDbProvider.RegisterProvider();
                    break;

                case DatabaseProvider.MySqlConnector:
                    MySqlConnectorInsightDbProvider.RegisterProvider();
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }

                return(dbConnection);
            });
        }
示例#3
0
        private void ResourceStart()
        {
            MySqlInsightDbProvider.RegisterProvider();

            _database = new SqlConnectionStringBuilder("server=localhost;user=root;database=newserver;port=3306;password=;");

            _userRepository = _database.Connection().As <IUserRepository>();
        }
示例#4
0
        private void myResourceStart()
        {
            API.consoleOutput("[------------------------------------------]");
            API.consoleOutput("[            Frosty Cops n Robbers         ]");
            API.consoleOutput("[                Version 0.0.1             ]");
            API.consoleOutput("[           Created by VirtualFrost        ]");
            API.consoleOutput("[------------------------------------------]");

            MySqlInsightDbProvider.RegisterProvider();
            _database       = new MySqlConnectionStringBuilder("server=localhost;user=root;database=frosty-cnr;port=3306;password=;");
            _userRepository = _database.Connection().As <IUserRepository>();
        }
示例#5
0
        public void API_onResourceStart()
        {
            MySqlInsightDbProvider.RegisterProvider();
            _database       = new MySqlConnectionStringBuilder("server=localhost;user=root;database=gamemode;port=3306;password=;");
            _userRepository = _database.Connection().As <IUserRepository>();
            ContextFactory.SetConnectionParameters("127.0.0.1", "root", "", "gamemode");
            var uniqueUsers = ContextFactory.Instance.Users.Count();

            API.consoleOutput("Unique Accounts: " + uniqueUsers);
            var uniqueChars = ContextFactory.Instance.Characters.Count();

            API.consoleOutput("Character Count: " + uniqueChars);
        }
示例#6
0
        public void OnResourceStart()
        {
            // set up database connection
            MySqlInsightDbProvider.RegisterProvider();
            _database           = new MySqlConnectionStringBuilder("server=localhost;user=root;database=gtanserver;port=3306;password="******"GAS_STATION");

            // get delivery locations, convert to Vector3's, and create col shapes
            // also save id in colshape entity data
            foreach (var station in gasStations)
            {
                dynamic d     = API.fromJson(station.DeliverLocation);
                Vector3 pos   = new Vector3((float)d.X, (float)d.Y, (float)(d.Z - 1));
                var     shape = API.createCylinderColShape(pos, 4, 8);
                shape.setData("ID", station.Id);

                // add shapes to list
                deliveryColShapes.Add(shape);
            }

            // initailize list of tanker models
            tankerModels.Add(-730904777);
            tankerModels.Add(1956216962);
            tankerModels.Add(-1207431159);

            // synchronize list of contracts
            contracts = ArrayList.Synchronized(contractsAsync);

            // set up start job start blip, shape, etc...
            var jobStartPos     = new Vector3(1383.331, -2079.071, 51.99853 + 1);
            var jobStartTextPos = new Vector3(1383.331, -2079.071, 51.99853 + 1.5);

            jobStartShape = API.createSphereColShape(jobStartPos, 3f);

            var jobStartMarker    = API.createMarker(20, jobStartPos, new Vector3(), new Vector3(180, 0, -25), new Vector3(1, 1, 1), 150, 0, 0, 255, 0);
            var jobStartTextLabel = API.createTextLabel("~b~ Trucking Job: Gas", jobStartTextPos, 100f, 0.3f, true);

            var jobStartBlip = API.createBlip(jobStartMarker);

            API.setBlipSprite(jobStartBlip, 477);
            API.setBlipColor(jobStartBlip, 26);
            API.setBlipName(jobStartBlip, "Trucking Job: Gas");

            // create job return shape
            jobEndPos   = new Vector3(1361, -2066, 52);
            jobEndShape = API.createSphereColShape(jobEndPos, 4f);
        }
示例#7
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
                app.UseHsts();
                app.UseHttpsRedirection();
            }
            app.UseAuthentication();

            app.UseMvc();

            MySqlInsightDbProvider.RegisterProvider();
        }
示例#8
0
 private void API_onResourceStart()
 {
     MySqlInsightDbProvider.RegisterProvider();
     _database       = new MySqlConnectionStringBuilder("server=x;user=x;database=x;password=x");
     _userRepository = _database.Connection().As <IUserRepository>();
 }
示例#9
0
 public void OnResourceStart()
 {
     MySqlInsightDbProvider.RegisterProvider();
     _database          = new MySqlConnectionStringBuilder("server=localhost;user=root;database=gtanserver;port=3306;password=;");
     _vehicleRepository = _database.Connection().As <IVehicleRepository>();
 }