Ejemplo n.º 1
0
        protected override void Execute(IOnlineConnection Sender)
        {
            TextGame NewGame = new TextGame(CreatedGroup);

            CreatedGroup.CurrentGame = NewGame;

            foreach (IOnlineConnection ActivePlayer in CreatedGroup.Room.ListOnlinePlayer)
            {
                ActivePlayer.Send(new CreateGameScriptServer());
            }

            foreach (IOnlineConnection ActivePlayer in CreatedGroup.Room.ListOnlinePlayer)
            {
                PlayerWithID NewGamePlayer = NewGame.AddPlayer();
                //Add Game Specific scripts
                Dictionary <string, OnlineScript> DicNewScript = new Dictionary <string, OnlineScript>();
                DicNewScript.Add(SendSquareScriptServer.ScriptName, new SendSquareScriptServer(CreatedGroup, NewGamePlayer));
                DicNewScript.Add(SendCircleScriptServer.ScriptName, new SendCircleScriptServer(CreatedGroup, NewGamePlayer));
                DicNewScript.Add(FinishedLoadingScriptServer.ScriptName, new FinishedLoadingScriptServer(CreatedGroup, NewGamePlayer));
                ActivePlayer.AddOrReplaceScripts(DicNewScript);

                //Send created Player to all Players.
                foreach (IOnlineConnection ActivePlayerInRoom in CreatedGroup.Room.ListOnlinePlayer)
                {
                    ActivePlayerInRoom.Send(new CreatePlayerScriptServer(NewGamePlayer.ID, ActivePlayer == ActivePlayerInRoom));
                }
            }
        }
Ejemplo n.º 2
0
        protected override void Execute(IOnlineConnection Sender)
        {
            base.Execute(Sender);

            RoomInformations NewRoom = (RoomInformations)CreatedGroup.Room;

            foreach (IOnlineConnection ActivePlayer in CreatedGroup.Room.ListOnlinePlayer)
            {
                //Add Game Specific scripts
                Dictionary <string, OnlineScript> DicNewScript = new Dictionary <string, OnlineScript>();
                if (NewRoom.RoomType == RoomInformations.RoomTypeMission)
                {
                    MissionRoomInformations MissionRoom = (MissionRoomInformations)NewRoom;

                    DicNewScript.Add(AskStartGameMissionScriptServer.ScriptName, new AskStartGameMissionScriptServer(MissionRoom, (TripleThunderClientGroup)CreatedGroup, Owner));
                    DicNewScript.Add(AskChangeRoomExtrasMissionScriptServer.ScriptName, new AskChangeRoomExtrasMissionScriptServer(MissionRoom));
                }
                else if (NewRoom.RoomType == RoomInformations.RoomTypeBattle)
                {
                    BattleRoomInformations BattleRoom = (BattleRoomInformations)NewRoom;

                    DicNewScript.Add(AskStartGameMissionScriptServer.ScriptName, new AskStartGameBattleScriptServer(BattleRoom, (TripleThunderClientGroup)CreatedGroup, Owner));
                    DicNewScript.Add(AskChangeRoomExtrasBattleScriptServer.ScriptName, new AskChangeRoomExtrasBattleScriptServer(BattleRoom));
                }

                DicNewScript.Add(AskChangeCharacterScriptServer.ScriptName, new AskChangeCharacterScriptServer(NewRoom));
                DicNewScript.Add(AskChangePlayerTypeScriptServer.ScriptName, new AskChangePlayerTypeScriptServer(NewRoom));
                DicNewScript.Add(AskChangeTeamScriptServer.ScriptName, new AskChangeTeamScriptServer(NewRoom));
                DicNewScript.Add(AskChangeMapScriptServer.ScriptName, new AskChangeMapScriptServer(NewRoom, Owner));
                DicNewScript.Add(AskChangeRoomSubtypeScriptServer.ScriptName, new AskChangeRoomSubtypeScriptServer(NewRoom));
                DicNewScript.Add(LeaveRoomScriptServer.ScriptName, new LeaveRoomScriptServer(NewRoom, Owner));
                ActivePlayer.AddOrReplaceScripts(DicNewScript);
            }
        }
        protected override void Execute(IOnlineConnection Sender)
        {
            base.Execute(Sender);

            RoomInformations NewRoom = (RoomInformations)CreatedGroup.Room;

            foreach (IOnlineConnection ActivePlayer in CreatedGroup.Room.ListOnlinePlayer)
            {
                //Add Game Specific scripts
                Dictionary <string, OnlineScript> DicNewScript = new Dictionary <string, OnlineScript>();
                DicNewScript.Add(AskStartGameScriptServer.ScriptName, new AskStartGameScriptServer(CreatedGroup));
                DicNewScript.Add(LeaveRoomScriptServer.ScriptName, new LeaveRoomScriptServer(NewRoom, Owner.OnlineServer));
                ActivePlayer.AddOrReplaceScripts(DicNewScript);
            }

            AddRoom();
        }
Ejemplo n.º 4
0
        protected override void Execute(IOnlineConnection Sender)
        {
            base.Execute(Sender);

            PVPRoomInformations NewRoom = (PVPRoomInformations)CreatedGroup.Room;

            foreach (IOnlineConnection ActivePlayer in CreatedGroup.Room.ListOnlinePlayer)
            {
                //Add Game Specific scripts
                Dictionary <string, OnlineScript> DicNewScript = OnlineHelper.GetRoomScriptsServer(NewRoom, Owner);

                DicNewScript.Add(AskStartGameBattleScriptServer.ScriptName, new AskStartGameBattleScriptServer(NewRoom, (BattleMapClientGroup)CreatedGroup, Owner));
                DicNewScript.Add(AskChangeRoomExtrasMissionScriptServer.ScriptName, new AskChangeRoomExtrasMissionScriptServer(NewRoom));

                ActivePlayer.AddOrReplaceScripts(DicNewScript);
            }
        }