예제 #1
0
        public void getShips(SpacegameServer.Core.Core _core, int _shipId, SpacegameServer.Core.User _user)
        {
            int DefaultUser = 0;

            int shipId1 = (int)_core.identities.shipLock.getNext();

            SpacegameServer.Core.Ship Ship1;
            Ship1 = new SpacegameServer.Core.Ship(shipId1);

            Ship1.userid = DefaultUser;
            Ship1.posX   = 5000;
            Ship1.posY   = 5000;

            _core.ships[shipId1] = Ship1;
            _core.addShipToField(Ship1);
            ((SpacegameServer.Core.User)_core.users[DefaultUser]).ships.Add(Ship1);


            shipId1 = (int)_core.identities.shipLock.getNext();
            Ship1   = new SpacegameServer.Core.Ship(shipId1);

            Ship1.userid = DefaultUser;
            Ship1.posX   = 5001;
            Ship1.posY   = 5001;

            _core.ships[shipId1] = Ship1;
            _core.addShipToField(Ship1);
            ((SpacegameServer.Core.User)_core.users[DefaultUser]).ships.Add(Ship1);
        }
예제 #2
0
        public void getShipTemplates(SpacegameServer.Core.Core _core, int templateId, SpacegameServer.Core.User _user)
        {
            var newTemplateId = (int)_core.identities.templateLock.getNext();
            var Template      = Mock.mockShipTemplate(newTemplateId, 0);

            _core.shipTemplate.TryAdd(newTemplateId, Template);
        }
예제 #3
0
        public void getUsersData(SpacegameServer.Core.Core _core)
        {
            getUsers(_core, 0);
            getUserStarMap(_core);
            getUserQuests(_core, null);
            getUserResearches(_core, null);

            getShipTemplates(_core, 0, null);
            getShipTemplatesModules(_core, null, false);

            getShips(_core, 0, null);
            getShipStock(_core, null, false);
            getShipModules(_core, null, false);
            getShipDirection(_core);
            getShipTranscension(_core);
            getShipTranscensionUsers(_core);

            getColonies(_core);
            getColonyStock(_core, null);
            getColonyBuildings(_core, null);

            getAlliances(_core, null);
            getAllianceMembers(_core);

            getDiplomaticEntityState(_core);
            getAllianceInvites(_core);
            getCommNodes(_core);
            getCommNodeUsers(_core);
            getCommunicationNodeMessage(_core);

            getCombat(_core);
            getCombatRounds(_core);
        }
예제 #4
0
        public void getResearchs(SpacegameServer.Core.Core _core)
        {
            Research research = Mock.mockResearch(researchid: 1, description: "BaseResearch");

            _core.Researchs[research.id] = research;

            research = Mock.mockResearch(researchid: 2, description: "Wasserkraftwerk");
            _core.Researchs[research.id] = research;

            research = Mock.mockResearch(researchid: 9, description: "Ecosytem Adaption I");
            _core.Researchs[research.id] = research;
        }
예제 #5
0
        public void getShipHulls(SpacegameServer.Core.Core _core)
        {
            SpacegameServer.Core.ShipHullsImage ShipHullsImage = new SpacegameServer.Core.ShipHullsImage();
            ShipHullsImage.id                     = 1;
            ShipHullsImage.shipHullId             = 1;
            ShipHullsImage.objectId               = 2;
            ShipHullsImage.templateImageId        = 2;
            ShipHullsImage.templateModulesXoffset = 3;
            ShipHullsImage.templateModulesYoffset = 3;

            //ShipHull.ShipHullsImages.Add(ShipHullsImage);
            _core.ShipHullsImages.Add(ShipHullsImage);
        }
예제 #6
0
        public void getGameData(SpacegameServer.Core.Core _core)
        {
            getGalaxyData(_core);
            getSpaceObjects(_core);
            getObjectsOnMap(_core);
            getObjectImages(_core);
            getObjectWeaponModificators(_core);

            getGoods(_core);

            getBuildings(_core);
            getBuildingProductions(_core);
            getBuildingCosts(_core);

            getPlanetTypes(_core);

            getShipHulls(_core);
            getShipHullsGain(_core);
            getShipHullsCosts(_core);
            getShipHullsModulePositions(_core);
            getShipHullsImages(_core);

            getModules(_core);
            getModulesGain(_core);
            getModulesCost(_core);

            getResearchQuestPrerequisites(_core);
            getSurfaceImages(_core);
            getSurfaceTiles(_core);
            getBuildOptions(_core);
            getQuests(_core);
            getResearchs(_core);
            getResearchsGain(_core);

            getObjectRelations(_core);

            getSurfaceDefaultMap(_core);

            getLanguages(_core);
            getLabels(_core);

            //MAP
            getStars(_core);
            getSolarSystemInstances(_core);
            getPlanetSurface(_core);
        }
예제 #7
0
        public void getCommNodes(SpacegameServer.Core.Core _core)
        {
            var commNodeId  = (int)_core.identities.commNode.getNext();
            int DefaultUser = 0;

            CommunicationNode node = new CommunicationNode(commNodeId);

            node.userId    = DefaultUser;
            node.positionX = 5000;
            node.positionY = 5000;

            node.sysX = null;
            node.sysY = null;

            node.connectionType  = 0;
            node.connectionId    = _core.ships.First().Key;
            node.activ           = true;
            node.unformattedName = "";
            node.name            = "";

            _core.commNodes.TryAdd(commNodeId, node);
            SpacegameServer.Core.NodeQuadTree.Field commNodeField = new SpacegameServer.Core.NodeQuadTree.Field(node.positionX, node.positionY);
            _core.nodeQuadTree.insertNode(commNodeField, node.id);


            commNodeId     = (int)_core.identities.commNode.getNext();
            node           = new CommunicationNode(commNodeId);
            node.userId    = DefaultUser;
            node.positionX = 5001;
            node.positionY = 5001;

            node.sysX = null;
            node.sysY = null;

            node.connectionType  = 0;
            node.connectionId    = _core.ships[1].id;
            node.activ           = true;
            node.unformattedName = "";
            node.name            = "";

            _core.commNodes.TryAdd(commNodeId, node);
            commNodeField = new SpacegameServer.Core.NodeQuadTree.Field(node.positionX, node.positionY);
            _core.nodeQuadTree.insertNode(commNodeField, node.id);
        }
예제 #8
0
        //GetAll.cs
        public void getAll(SpacegameServer.Core.Core _core)
        {
            //save the TestDataConnector
            DataConnector connectorTest = _core.dataConnection;

            //Read Game Data with sql connector
            DataConnector connector = new SpacegameServer.DataConnectors.SqlConnector();

            _core.dataConnection = connector;
            _core.dataConnection.getGameData(_core);

            //important: Set Data COnnection back to TestDataconnection, so that following write2DB are just skipped
            _core.dataConnection = connectorTest;

            //TestDataConnector will Mock user data for player 0
            _core.dataConnection.getUsersData(_core);

            //User Data Contains some Data of player 0
        }
예제 #9
0
        public void TestLockable()
        {
            SpacegameServer.Core.Core Instance = SpacegameServer.Core.Core.Instance;


            SpacegameServer.Core.User x = Mock.MockUserAndAdd(Instance);

            int shipId1 = (int)Instance.identities.shipLock.getNext();
            int shipId2 = (int)Instance.identities.shipLock.getNext();

            SpacegameServer.Core.Ship Ship1, Ship2;
            Ship1 = new SpacegameServer.Core.Ship(shipId1);
            Ship2 = new SpacegameServer.Core.Ship(shipId2);

            SpacegameServer.Core.Colony Colony1;
            Colony1 = new SpacegameServer.Core.Colony(1);

            //Object can only be locked once
            Assert.IsTrue(Ship1.setLock());
            Assert.IsFalse(Ship1.setLock());

            //LockAll of Ships can only be set once
            Assert.IsTrue(SpacegameServer.Core.Ship.setLockAll());
            Assert.IsFalse(SpacegameServer.Core.Ship.setLockAll());

            //ships can't be lcoked anymore, colonies can
            Assert.IsFalse(Ship1.setLock());
            Assert.IsFalse(Ship2.setLock());
            Assert.IsTrue(Colony1.setLock());
            Ship1.removeLock();
            Colony1.removeLock();

            //after removing LockAll, all is lockable again
            SpacegameServer.Core.Ship.removeLockAll();
            Assert.IsTrue(Ship1.setLock());
            Assert.IsTrue(Ship2.setLock());
            Assert.IsTrue(Colony1.setLock());
        }
예제 #10
0
 public void getGalaxyData(SpacegameServer.Core.Core _core)
 {
 }
예제 #11
0
 public void getSpaceObjects(SpacegameServer.Core.Core _core)
 {
 }
예제 #12
0
 public void getUsersData(SpacegameServer.Core.Core _core)
 {
 }
예제 #13
0
 public void getUsersRefresh(SpacegameServer.Core.Core _core)
 {
 }
예제 #14
0
 public void getBuildings(SpacegameServer.Core.Core _core)
 {
 }
예제 #15
0
 public void getMessageHeads(SpacegameServer.Core.Core _core)
 {
 }
예제 #16
0
 public void saveResearch(SpacegameServer.Core.Core instance, SpacegameServer.Core.Research research = null)
 {
 }
예제 #17
0
 public void getObjectWeaponModificators(SpacegameServer.Core.Core _core)
 {
 }
예제 #18
0
 public void getChatLog(SpacegameServer.Core.Core _core)
 {
 }
예제 #19
0
 public void getCombatRounds(SpacegameServer.Core.Core _core)
 {
 }
예제 #20
0
 public void getShipRefits(SpacegameServer.Core.Core _core)
 {
 }
예제 #21
0
 public void getMessageBody(SpacegameServer.Core.Core _core)
 {
 }
예제 #22
0
 public void getMessageParticipants(SpacegameServer.Core.Core _core)
 {
 }
예제 #23
0
 public void getObjectsOnMap(SpacegameServer.Core.Core _core)
 {
 }
예제 #24
0
 public void SaveUserResearch(SpacegameServer.Core.Core instance, SpacegameServer.Core.User user, List <SpacegameServer.Core.UserResearch> NewUserResearch, List <SpacegameServer.Core.UserQuest> NewQuests)
 {
 }
예제 #25
0
 public void getObjectImages(SpacegameServer.Core.Core _core)
 {
 }
예제 #26
0
 //GetAll.cs
 public void getAll(SpacegameServer.Core.Core _core)
 {
 }
예제 #27
0
 public void getGoods(SpacegameServer.Core.Core _core)
 {
 }
예제 #28
0
 public void GetTurnEvaluations(SpacegameServer.Core.Core _core)
 {
 }
예제 #29
0
 public void SaveUserQuests(SpacegameServer.Core.Core instance, List <SpacegameServer.Core.UserQuest> quests)
 {
 }
예제 #30
0
 public void getCommunicationNodeMessage(SpacegameServer.Core.Core _core)
 {
 }