Beispiel #1
0
        public override void SendEntryData(HumanPlayer sendHere, bool warping, IShip playerShip)
        {
            var portEntryData = new PortEntryData(base.GetEntryData(sendHere.ActiveShipId, true, true))
            {
                Id       = Id,
                AreaName = AreaName,
                AreaSize = AreaSize
            };

            portEntryData.NewPlayerXPos = playerShip.PosX;
            portEntryData.NewPlayerYPos = playerShip.PosY;

            sendHere.SendMessage(portEntryData, MessageTypes.PortDockApproval);
        }
Beispiel #2
0
        /// <summary>
        /// Warping is true for landing on a planet, false for leaving a building
        /// </summary>
        /// <param name="sendHere"></param>
        /// <param name="warping"></param>
        /// <param name="playerShip"></param>
        public override void SendEntryData(HumanPlayer sendHere, bool warping, IShip playerShip)
        {
#if DEBUG
            //Legacy bug, probably fixed
            if (_model.ShipIDs.Count == 0)
            {
                ConsoleManager.WriteLine("ERROR: IShip wasn't in Planet.ships on warp. Probably a db error. Adding IShip to system.", ConsoleMessageType.Error);
                _model.ShipIDs.Add(playerShip.Id);
                _shipCache.Add(playerShip.Id, playerShip);
            }
#endif
            var data = GetEntryData(playerShip.Id, false, true);
            data.NewPlayerXPos = playerShip.PosX;
            data.NewPlayerYPos = playerShip.PosY;


            sendHere.SendMessage(new NetworkMessageContainer(data, MessageTypes.PlanetLandApproval));
        }
Beispiel #3
0
        public override void SendEntryData(HumanPlayer sendHere, bool warping, IShip playerShip)
        {
            //Legacy bug, probably fixed.
            if (_model.ShipIDs.Count == 0)
            {
                ConsoleManager.WriteLine("ERROR: IShip wasn't in PSystem.ships on warp. Probably a db error. Adding IShip to system.", ConsoleMessageType.Error);
                _model.ShipIDs.Add(playerShip.Id);
                _shipCache.Add(playerShip.Id, playerShip);
            }

            MessageTypes messageType;

            messageType = warping ? MessageTypes.WarpApproval : MessageTypes.StarSystemData;

            var s = GetEntryData(playerShip.Id, false, true);

            s.NewPlayerXPos = playerShip.PosX;
            s.NewPlayerYPos = playerShip.PosY;

            sendHere.SendMessage(s, messageType);
        }
Beispiel #4
0
 public override void SendEntryData(HumanPlayer sendHere, bool warping, IShip playerShip)
 {
     sendHere.SendMessage(new NetworkMessageContainer(new MessageEmptyMessage(), MessageTypes.EnterColony));
 }