Exemplo n.º 1
0
 public void Launch()
 {
     if (this.ShipState == DSShipState.Initial)
     {
         long frontendID = -1L;
         if (!this.DSWaitingQueue.IsGiantRaid)
         {
             using (Dictionary <long, DSPlayer> .ValueCollection.Enumerator enumerator = this.Players.Values.GetEnumerator())
             {
                 if (enumerator.MoveNext())
                 {
                     DSPlayer dsplayer = enumerator.Current;
                     frontendID = dsplayer.FID;
                 }
             }
         }
         this.ShipState = DSShipState.Launching;
         this.DSWaitingSystem.ExternalOperation.LaunchShip(this.DSInfo.ServiceID, this.DSInfo.DSID, this.QuestID, this.MicroPlayID, this.PartyID, frontendID, this.DSWaitingQueue.IsGiantRaid, this.IsAdultMode, delegate(bool result)
         {
             if (!result)
             {
                 this.ShipState = DSShipState.LaunchFail;
                 Log <DSShip> .Logger.ErrorFormat("launch fail : {0}", this.DSInfo.DSID);
             }
         });
         return;
     }
     Log <DSShip> .Logger.ErrorFormat("launch fail : {0}", this.DSInfo.DSID);
 }
Exemplo n.º 2
0
 public void UnregisterPlayer(DSPlayer player)
 {
     if (player.WaitingParty != null)
     {
         DSWaitingParty waitingParty = player.WaitingParty;
         waitingParty.RemovePlayer(player);
         if (waitingParty.Members.Count == 0)
         {
             this.WaitingParties.Remove(waitingParty.Node);
             if (FeatureMatrix.IsEnable("DSDynamicLoad") && this.WaitingParties.Count == 0)
             {
                 DSService.Instance.DSEntityMakerSystem.Dequeue(this.ID, this.DSType);
             }
         }
         this.Process(this.WaitingParties.First);
         return;
     }
     if (player.Ship != null)
     {
         DSShip ship = player.Ship;
         ship.RemovePlayer(player);
         if (ship.HasEmptySlot)
         {
             this.Process(this.WaitingParties.First);
         }
     }
 }
Exemplo n.º 3
0
        public void Unregister(long cid, bool byUser)
        {
            DSPlayer dsplayer = this.DSPlayerDict.TryGetValue(cid);

            if (dsplayer != null)
            {
                if (byUser && !dsplayer.IsGiantRaid)
                {
                    if (dsplayer.Ship != null && dsplayer.Ship.ShipState >= DSShipState.Launching)
                    {
                        Log <DSWaitingSystem> .Logger.WarnFormat("Cannot unregister user after launching: - {0}", cid);

                        return;
                    }
                    if (dsplayer.FrontendConn != null)
                    {
                        CancelStartGame op = new CancelStartGame();
                        dsplayer.FrontendConn.RequestOperation(op);
                    }
                }
                DSLog.AddLog(-1, dsplayer.DSWaitingQueue.QuestID, -1L, -1, "Unregister", cid.ToString());
                dsplayer.DSWaitingQueue.UnregisterPlayer(dsplayer);
                this.DSPlayerDict.Remove(cid);
            }
        }
Exemplo n.º 4
0
 public void RemovePlayer(DSPlayer player)
 {
     this.Players.Remove(player.CID);
     player.Ship = null;
     this.SyncAllDSMemberStatus();
 }
Exemplo n.º 5
0
 public void RemovePlayer(DSPlayer player)
 {
     this.Members.Remove(player.CID);
     player.WaitingParty = null;
 }