Esempio n. 1
0
        public void TestKillNPCGroupContractServerClientCompativility()
        {
            ContractResource resource = new ContractResource();

            resource.Load("Data/contracts.xml");

            var generator = ContractGenerator.Create(Common.ContractCategory.killNPCGroup);
            var contract  = generator.Generate(Common.Race.Humans, 1, "H1", null, resource);
            var info      = contract.GetInfo();

            Console.WriteLine("Server:");
            Console.WriteLine(contract.ToString());
            Console.WriteLine("=====================");

            ExitGames.Client.Photon.Hashtable photonHash = new ExitGames.Client.Photon.Hashtable();
            foreach (System.Collections.DictionaryEntry entry in info)
            {
                photonHash.Add(entry.Key, entry.Value);
            }

            Nebula.Client.Contracts.ContractFactory clientFactory = new Nebula.Client.Contracts.ContractFactory();
            var clientContract = clientFactory.Create(photonHash);

            Console.WriteLine("Client:");
            Console.WriteLine(clientContract.ToString());
        }
Esempio n. 2
0
        public void TestContractGeneration()
        {
            ContractResource resource = new ContractResource();

            resource.Load("Data/contracts.xml");

            var generator = ContractGenerator.Create(Common.ContractCategory.killNPCGroup);

            Console.WriteLine("For criptizids of lvl 6:");
            for (int i = 0; i < 10; i++)
            {
                var contract = generator.Generate(Common.Race.Criptizoids, 6, "E1", null, resource);
                Console.WriteLine(contract.ToString());
                Console.WriteLine("---");
            }
            Console.WriteLine("=========");

            Console.WriteLine("For humans of lvl 2:");
            for (int i = 0; i < 10; i++)
            {
                var contract = generator.Generate(Common.Race.Humans, 2, "H15", null, resource);
                Console.WriteLine(contract.ToString());
                Console.WriteLine("---");
            }
            Console.WriteLine("=========");
        }
Esempio n. 3
0
        public void TestExploreLocationParsing()
        {
            ContractResource resource = new ContractResource();

            resource.Load("Data/contracts.xml");

            var data = resource.contracts.GetRandom(Common.ContractCategory.exploreLocation);
            ExploreLocationContractData exploreLocationData = data as ExploreLocationContractData;

            Console.WriteLine(exploreLocationData.GetCount(Common.Race.Humans));
        }
Esempio n. 4
0
        public void Load()
        {
            System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;

            //this.SkillStorage = LoadSkills();

            skillDropping = new SkillDropping();
            skillDropping.Load(basePath);

            this.WeaponSettings = new WeaponDropSettings();
            if (!this.WeaponSettings.Load(basePath))
            {
                throw new Exception("Error of loading weapon settings....");
            }



            this.ModuleSettings = new ModuleSettingsRes();
            if (!this.ModuleSettings.Load(basePath))
            {
                throw new Exception("exception: module settings loading error");
            }

            this.Sets = new ModuleSetRes();
            if (!this.Sets.Load(basePath))
            {
                throw new Exception("exception: error of loading module sets...");
            }


            this.ColorRes = new ColorInfoRes();
            this.ColorRes.Load(basePath);

            this.ModuleTemplates = new ModuleInfoStorage();
            this.ModuleTemplates.Load(basePath);

            this.ServerInputs = new ServerInputsRes();
            this.ServerInputs.Load(basePath, "Data/server_inputs.xml");

            //load materials
            this.Materials = new MaterialRes();
            this.Materials.Load(basePath);

            this.MiscItemDataRes = new MiscInventoryItemDataRes();
            this.MiscItemDataRes.Load(basePath);

            //load asteroids
            this.Asteroids = new AsteroidsRes();
            this.Asteroids.Load(basePath);

            this.Zones = new ZonesRes();
            this.Zones.Load(basePath);

            this.Skills = new SkillRes();
            this.Skills.Load(basePath);

            //this.NpcTypes = new NpcTypeDataRes();
            //if (false == this.NpcTypes.Load(basePath))
            //{
            //    throw new Exception("load npc types error");
            //}

            this.Weapons = new WeaponDataRes();
            this.Weapons.Load(basePath);

            this.Leveling = new Leveling();
            this.Leveling.Load(basePath);

            //this.Events = new ResEvents();
            //this.Events.Load(basePath);

            this.NpcGroups = new NpcGroupRes();
            this.NpcGroups.Load(basePath);
            if (!this.NpcGroups.Loaded)
            {
                throw new Exception("Npc Groups Resources loading error");
            }

            this.StartModules = new StartPlayerModuleRes();
            this.StartModules.Load(basePath);
            if (!this.StartModules.Loaded)
            {
                throw new Exception("StartModules loading error");
            }

            fractionResolver = new FractionResolver();
            fractionResolver.Load(basePath);

            CraftingMaterials = new ResSchemeCraftingMaterials();
            CraftingMaterials.Load(basePath);

            PassiveBonuses = new ResPassiveBonuses();
            PassiveBonuses.Load(basePath);

            colorLists = new ColorListCollection();
            colorLists.Load(Path.Combine(basePath, "Data/Drop/color_lists.xml"));

            dropLists = new DropListCollection();
            dropLists.Load(Path.Combine(basePath, "Data/Drop/drop_lists.xml"));

            petParameters = new PetParameters();
            petParameters.Load(Path.Combine(basePath, "Data/pets.xml"));

            petSkills = new PetSkillCollection();
            petSkills.Load(Path.Combine(basePath, "Data/pet_active_skills.xml"));

            petPassiveBonuses = new PetPassiveBonusCollection();
            (petPassiveBonuses as PetPassiveBonusCollection).Load(Path.Combine(basePath, "Data/passive_pet_bonuses.xml"));

            craftObjects = new CraftResourceObjectTable();
            craftObjects.Load(Path.Combine(basePath, "Data/Materials/craft_resource.xml"));

            playerConstructions = new ConstructionDataResource();
            playerConstructions.Load(Path.Combine(basePath, "Data/player_constructions.xml"));

            predefinedDropLists = new PredefinedDropLists();
            predefinedDropLists.Load(Path.Combine(basePath, "Data/Drop/predefined_dls.xml"));

            npcSkills = new NpcClassSkillsResource();
            npcSkills.Load(Path.Combine(basePath, "Data/npc_skill_table.xml"));

            m_ContractResource.Load(Path.Combine(basePath, "Data/contracts.xml"));

            contractItems = new ContractItemDataCollection();
            contractItems.Load(Path.Combine(basePath, "Data/contract_items.xml"));

            achievments = new AchievmentDataCollection();
            achievments.Load(Path.Combine(basePath, "Data/achievments.xml"));

            difficulty = new DifficultyRes();
            difficulty.Load(Path.Combine(basePath, "Data/Drop/difficulty.xml"));

            planetOreMap = new Planet2OreMapRes();
            planetOreMap.Load(Path.Combine(basePath, "Data/planet2oremap.xml"));

            Quests.Load(Path.Combine(basePath, "Data/quests.xml"));
            //quests = new QuestDataResource();
            //quests.Load(basePath);

            //dialogs = new DialogDataResource();
            //dialogs.Load(basePath);
        }
Esempio n. 5
0
 public static void ClassInit(TestContext context)
 {
     //MessageBox.Show("ClassInit");
     contractResource.Load("Data/contracts.xml");
 }