Beispiel #1
0
        public void Deserialize(GenericReader reader)
        {
            state = PVPEventState.Setting;

            m_maker      = reader.ReadMobile();
            m_stone      = (PVPStone)reader.ReadItem();
            m_nom        = reader.ReadString();
            m_map        = PVPMap.Deserialize(reader);
            m_teams      = PVPTeamArrangement.Deserialize(reader, this);
            m_mode       = PVPMode.Deserialize(reader, this);
            m_debutEvent = reader.ReadDateTime();

            state = (PVPEventState)reader.ReadInt();

            debutTimer = new WaitingTimer(this);

            if (state >= PVPEventState.Preparing)
            {
                // Event commencé : Despawn et effaçage.
                teams.DespawnAll();
                StopEvent();
            }
            else if (m_debutEvent < DateTime.Now)
            {
                // Event surpassé : Effaçage.
                StopEvent();
            }
            else
            {
                // Event non débuté : Reboot.
                debutTimer.Start();
            }
        }
Beispiel #2
0
 public void Serialize(GenericWriter writer)
 {
     writer.Write(m_maker);
     writer.Write(m_stone);
     writer.Write(m_nom);
     PVPMap.Serialize(writer, m_map); // Important d'avoir la map avant le teamArrangement.
     PVPTeamArrangement.Serialize(writer, m_teams);
     PVPMode.Serialize(writer, m_mode);
     writer.Write(m_debutEvent);
     writer.Write((int)state); // Important de mettre le state à la fin.
 }
Beispiel #3
0
 public static void Serialize(GenericWriter writer, PVPMode mode)
 {
     if (mode != null)
     {
         for (int i = 0; i < ModeList.Count; i++)
         {
             if (ModeList.Keys.ElementAt(i) == mode.GetType())
             {
                 writer.Write(i);
                 break;
             }
         }
     }
     else
     {
         writer.Write(-1);
     }
 }
Beispiel #4
0
        private PVPEvent(Mobile maker, PVPStone stone)
        {
            debutTimer = new WaitingTimer(this);
            state      = PVPEventState.Setting;

            m_maker = maker;
            m_stone = stone;

            m_nom        = "";
            m_map        = null;
            m_mode       = null;
            m_teams      = null;
            m_debutEvent = DateTime.Now;

            if (m_InstancesList == null)
            {
                m_InstancesList = new ArrayList();
            }
            m_InstancesList.Add(this);
        }
Beispiel #5
0
 public TimeoutTimer(PVPMode mode)
     : base(mode.timeout)
 {
     m_mode = mode;
 }