Beispiel #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);
 }
Beispiel #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);
         }
     }
 }
Beispiel #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);
            }
        }
Beispiel #4
0
 public void RemovePlayer(DSPlayer player)
 {
     this.Players.Remove(player.CID);
     player.Ship = null;
     this.SyncAllDSMemberStatus();
 }
Beispiel #5
0
 public void RemovePlayer(DSPlayer player)
 {
     this.Members.Remove(player.CID);
     player.WaitingParty = null;
 }