Exemplo n.º 1
0
        public TestEngine(YmfasClient _client)
        {
            netClient = _client;

            // create the event manager
            eventMgr = new EventManager(netClient);
        }
Exemplo n.º 2
0
        public ServerShipManager(World serverWorld, EventManager eventManager, YmfasServer _server)
        {
            serverShipLog = Mogre.LogManager.Singleton.CreateLog("server-ship.log");
            serverShipLog.LogMessage("creating ssm");

            world = serverWorld;
            eventMgr = eventManager;
            server = _server;

            //init ships
            ShipTypeData curShipType = new ShipTypeData();
            curShipType.Class = ShipClass.Interceptor;
            curShipType.Model = ShipModel.MogreFighter;

            //player ships
            foreach (int id in server.PlayerIds )
            {
                Vector3 curPosition = Vector3.ZERO;//new Vector3(Mogre.Math.RangeRandom(-TestEngine.WorldSizeParam / 1.5f, TestEngine.WorldSizeParam / 1.5f), Mogre.Math.RangeRandom(-TestEngine.WorldSizeParam / 1.5f, TestEngine.WorldSizeParam / 1.5f), Mogre.Math.RangeRandom(-TestEngine.WorldSizeParam / 1.5f, TestEngine.WorldSizeParam / 1.5f));
                Quaternion curOrientation = Quaternion.IDENTITY;

                ShipInit curShipInit = new ShipInit(id, curShipType, curPosition, curOrientation,
                    server.GetPlayerName(id));
                eventMgr.SendEvent(curShipInit);

                Util.Log("sent init for ship " + id);

                //put them in world
                Ship s = new Ship(world, id, curPosition, curOrientation);
                shipTable.Add(id, s);
            }

            //init listeners
            ShipControlStatus.FiringEvent += new GameEventFiringHandler(handleShipControlStatus);
        }
Exemplo n.º 3
0
        public Shadow(EventManager eventManager, ServerShipManager shipManager, int sendRate)
        {
            eventMgr = eventManager;
            shipMgr = shipManager;
            msgRate = sendRate;
            processCtr = 0;

            //init ship stats
            playerStatsById = new Dictionary<StatBoardEnum, Dictionary<int, int>>();
            Dictionary<int, int> initPrimary = new Dictionary<int, int>();
            Dictionary<int, int> initPosTime = new Dictionary<int, int>();
            Dictionary<int, int> initNegTime = new Dictionary<int, int>();
            IEnumerator shipIds = shipManager.ShipTable.Keys.GetEnumerator();
            shipIds.Reset();
            while (shipIds.MoveNext()) {
                initPrimary.Add((int)shipIds.Current, 0);
                initPosTime.Add((int)shipIds.Current, 0);
                initNegTime.Add((int)shipIds.Current, 0);
            }

            playerStatsById.Add(StatBoardEnum.PrimaryScore, initPrimary);
            playerStatsById.Add(StatBoardEnum.PositiveTime, initPosTime);
            playerStatsById.Add(StatBoardEnum.NegativeTime, initNegTime);
        }
Exemplo n.º 4
0
 public GameModeFactory(EventManager eventManager, ServerShipManager serverShipManager)
 {
     eventMgr = eventManager;
     shipMgr = serverShipManager;
 }
Exemplo n.º 5
0
 public TestEngineServer(YmfasServer _server)
 {
     netServer = _server;
     eventMgr = new EventManager(_server);
 }