Beispiel #1
0
 private void Client_OnSetCourseInfo(object sender, CourseInfoArgs e)
 {
     // Authorize build
     if (BuildAuthorizedConnection((FFClient)sender))
     {
         FFTask task = new FFTask(FFTask.FFTaskType.Build_CourseInfo, (FFClient)sender, e);
         TaskProcessor.AddTask(task);
     }
 }
        void LootTableRanges_Init_Handler(Task t)
        {
            if (t.Query.Rows.Count > 0)
            {
                foreach (object[] row in t.Query.Rows)
                {
                    int rangeID = (int)row[0];
                    int ltID = (int)row[1];
                    float percentage = (float)row[2];

                    LootTable lt = _lootTables[ltID];

                    LootRange range = new LootRange();
                    range.Percentage = percentage;

                    lt.Ranges[rangeID] = range;

                    FFTask rangeTask = new FFTask(FFTask.FFTaskType.LootRange_Init, null, lt.ID);
                    AddDBQuery(string.Format("SELECT * FROM loot_range_templates WHERE loot_range_id={0};", rangeID), rangeTask);
                }
            }
        }
        void LoadCourses_Init_Handler(Task t)
        {
            foreach (object[] row in t.Query.Rows)
            {
                CourseInfo ci = new CourseInfo();

                ci.CourseID = (int)row[0];
                ci.ParTime = (double)row[1];
                ci.LootMarkers = (int)row[2];
                ci.MaxObstacleScore = (int)row[3];
                ci.FlightMode = (int)row[4];
                ci.TimeScoreBase = (int)row[5];
                ci.TimeScoreModifier = (int)row[6];
                ci.LootTable = (int)row[7];

                _courseInfo[ci.CourseID] = ci;

                FFTask lootTask = new FFTask(FFTask.FFTaskType.LootTable_Init);
                AddDBQuery(string.Format("SELECT * FROM loot_tables WHERE loot_table_id={0};", ci.LootTable), lootTask);
            }
        }
        void Build_PopulateLootTable_Handler(Task t)
        {
            LootTableArgs args = (LootTableArgs)t.Args;
            for( int i = 0; i < args.Ranges.Length; i++ )
            {
                LootTableArgs.Range range = args.Ranges[i];
                string sql = string.Format("INSERT INTO loot_ranges SET loot_table_id={0},percentage={1}; SELECT LAST_INSERT_ID();", args.TableID, range.Percentage);

                object[] targs = new object[2];
                targs[0] = i;
                targs[1] = args;
                FFTask task = new FFTask(FFTask.FFTaskType.Build_LootRangeCreated, null, targs);
                AddDBQuery(sql, task);
            }
        }
Beispiel #5
0
 private void Client_OnSetLootTable(object sender, LootTableArgs e)
 {
     if (BuildAuthorizedConnection((FFClient)sender))
     {
         FFTask task = new FFTask(FFTask.FFTaskType.Build_LootTableInfo, (FFClient)sender, e);
         TaskProcessor.AddTask(task);
     }
 }
Beispiel #6
0
 private void Client_OnCourseFinished(object sender, CourseFinishedArgs e)
 {
     FFTask task = new FFTask(FFTask.FFTaskType.CourseCompleted_Validate, (FFClient)sender, e);
     TaskProcessor.AddTask(task);
 }