Esempio n. 1
0
        public override void StartEvent(StartEventType e)
        {
            if (e == StartEventType.Loaded)
            {
                GameServer.gameServer.WantedScheme.Build();

                // Load player entities configuration
                foreach (var pm in GameServer.gameServer.playersInRoom.Select(p => p.Value.GetManager()))
                {
                    EntityData entityData = null;

                    pm.Army = tributeSystem.CreateActor <TributeArmyActor>(ActorConstants.ArmyOf + "|" + pm.Player.User.login, true);
                    if (GameServer.gameServer.WantedScheme.GetEntity(ActorConstants.ACScheme.UberHero) != null)
                    {
                        pm.UberHeroActor = entitySystem.CreateActor <EntityUnitActor>(ActorConstants.ArmyOf + "|" + pm.Player.User.login, true);
                        entityData       = PlayerManager.LoadoutOfAll[pm.Player].Where(ed => ed.SchemeID == "#uberheroarmy[uberhero,0]").First();
                    }

                    pm.UberHeroActor.Guid                 = ArenaExt.FindFreeGUID(entitySystem);
                    pm.UberHeroActor.Data                 = entityData;
                    pm.UberHeroActor.Tribute              = pm.Army;
                    pm.UberHeroActor.EntityPlus           = new EntityPlus();
                    pm.UberHeroActor.EntityPlus.Actor     = pm.UberHeroActor;
                    pm.UberHeroActor.EntityPlus.plManager = pm;
                    pm.UberHeroActor.PhysicBody           = new Body(World, new Microsoft.Xna.Framework.Vector2(0, 0.4377073f), 0, pm.UberHeroActor);
                    var fix = FixtureFactory.AttachRectangle(1.024947f, 1.70071f, 1, new Microsoft.Xna.Framework.Vector2(0, 0.4377073f), pm.UberHeroActor.PhysicBody, pm.UberHeroActor);

                    var sendMsg = CommunicateActorToClients(pm.UberHeroActor, pm.Player, false, Constants.EventOperation.Arena_SpawnAndSetEquipment);
                    // Send data
                    {
                        sendMsg.Write(entityData.SchemeID);
                        sendMsg.Write((byte)entityData.Type);
                        sendMsg.Write(entityData.ArmyIndex);
                        sendMsg.Write(entityData.CurrentClass);
                        sendMsg.Write(entityData.CurrentRarepon);
                        sendMsg.Write(entityData.ClassesInPossession[entityData.CurrentClass]);
                        if (entityData.CurrentRarepon != "none")
                        {
                            if (entityData.CurrentRarepon != "")
                            {
                                sendMsg.Write(entityData.RareponsInPossession[entityData.CurrentRarepon]);
                            }
                        }
                    }
                    GameServer.UsingPeer.SendMessage(sendMsg, GameServer.GetUserConnections(), Lidgren.Network.NetDeliveryMethod.ReliableOrdered, 0);
                }
            }
            if (e == StartEventType.SyncFinished)
            {
                //ArenaExt.UISendMessage(null, "Mission start!", PataponPhotonShared.Enums.UIMessageAlignement.VSBottom, 10);
                GameServer.RythmEngine.Start();
            }
        }
Esempio n. 2
0
 public StartEventArgs(ProfileConfiguration config)
 {
     this.type = StartEventType.Repeat;
     this.config = config;
 }
Esempio n. 3
0
 public StartEventArgs(StartEventType type, string detail)
 {
     this.type = type;
     this.detail = detail;
 }
Esempio n. 4
0
 public LinkItem(StartPage owner, string caption, string description, StartEventType type, string detail, int x, int y)
     : this(owner, caption, description, x, y)
 {
     Type = type;
     Detail = detail;
 }
Esempio n. 5
0
 public LinkItem(StartPage owner, string caption, StartEventType type, string detail, int x, int y)
     : this(owner, caption, null, type, detail, x, y)
 {
 }
Esempio n. 6
0
 public StartEventArgs(ProfileConfiguration config)
 {
     this.type   = StartEventType.Repeat;
     this.config = config;
 }
Esempio n. 7
0
 public StartEventArgs(StartEventType type, string detail)
 {
     this.type   = type;
     this.detail = detail;
 }
Esempio n. 8
0
 public LinkItem(StartPage owner, string caption, string description, StartEventType type, string detail, int x, int y) : this(owner, caption, description, x, y)
 {
     Type   = type;
     Detail = detail;
 }
Esempio n. 9
0
 public LinkItem(StartPage owner, string caption, StartEventType type, string detail, int x, int y) : this(owner, caption, null, type, detail, x, y)
 {
 }
Esempio n. 10
0
 public virtual void StartEvent(StartEventType e)
 {
 }