protected override void OnJoinRoomLocal(IOnlineConnection Sender, string RoomID, GameClientGroup ActiveGroup)
        {
            PVPRoomInformations    JoinedRoom            = (PVPRoomInformations)ActiveGroup.Room;
            List <BattleMapPlayer> ListJoiningPlayerInfo = JoinedRoom.GetOnlinePlayer(Sender);

            foreach (IOnlineConnection ActivePlayer in ActiveGroup.Room.ListOnlinePlayer)
            {
                if (ActivePlayer == Sender)
                {
                    continue;
                }

                ActivePlayer.Send(new PlayerJoinedScriptServer(ListJoiningPlayerInfo));
            }

            Dictionary <string, OnlineScript> DicNewScript = OnlineHelper.GetRoomScriptsServer(JoinedRoom, Owner);

            DicNewScript.Add(AskStartGameBattleScriptServer.ScriptName, new AskStartGameBattleScriptServer(JoinedRoom, (Online.BattleMapClientGroup)ActiveGroup, Owner));
            DicNewScript.Add(AskChangeRoomExtrasMissionScriptServer.ScriptName, new AskChangeRoomExtrasMissionScriptServer(JoinedRoom));

            Sender.AddOrReplaceScripts(DicNewScript);

            if (ActiveGroup.CurrentGame != null)
            {
            }

            Sender.Send(new JoinRoomLocalScriptServer(RoomID, JoinedRoom.CurrentDifficulty, ListJoiningPlayerInfo, ActiveGroup));
        }
 public CreateGameScriptClient(BattleMapOnlineClient Owner, List <GameScreen> ListGameScreen, PVPRoomInformations Room)
     : base(ScriptName)
 {
     this.Owner          = Owner;
     this.ListGameScreen = ListGameScreen;
     this.Room           = Room;
 }
 public AskStartGameBattleScriptServer(PVPRoomInformations Owner, BattleMapClientGroup CreatedGroup, GameServer OnlineServer)
     : base(ScriptName)
 {
     this.Owner        = Owner;
     this.CreatedGroup = CreatedGroup;
     this.OnlineServer = OnlineServer;
 }
Exemple #4
0
        protected override void Execute(IOnlineConnection Host)
        {
            OnlineGameClient.RoomID = RoomID;

            Dictionary <string, OnlineScript> DicNewGameServerScript = new Dictionary <string, OnlineScript>();
            RoomInformations NewRoom;

            //FightingZone NewFightingZone = null;

            if (HasGame)
            {
                /* NewFightingZone = new FightingZone(OnlineGameClient);
                 * NewFightingZone.ListGameScreen = ScreenOwner.ListGameScreen;
                 *
                 * DicNewGameServerScript = OnlineHelper.GetTripleThunderScriptsClient(OnlineGameClient);
                 * Host.IsGameReady = true;*/
            }
            PVPRoomInformations MissionRoom = new PVPRoomInformations(RoomID, RoomName, RoomType, RoomSubtype, CurrentDifficulty, MapPath, ListJoiningPlayerID, ScreenOwner.Content, RoomData);

            NewRoom = MissionRoom;

            NewScreen = new GamePreparationScreen(OnlineGameClient, OnlineCommunicationClient, MissionRoom);

            DicNewGameServerScript.Add(CreateGameScriptClient.ScriptName, new CreateGameScriptClient(OnlineGameClient, ScreenOwner.ListGameScreen, MissionRoom));
            DicNewGameServerScript.Add(ChangeRoomExtrasBattleScriptClient.ScriptName, new ChangeRoomExtrasMissionScriptClient(MissionRoom, NewScreen));

            if (HasGame)
            {
                //ScreenOwner.PushScreen(new LoadingScreen(NewFightingZone, OnlineGameClient));
            }

            DicNewGameServerScript.Add(PlayerJoinedScriptClient.ScriptName, new PlayerJoinedScriptClient(NewScreen));
            DicNewGameServerScript.Add(PlayerLeftScriptClient.ScriptName, new PlayerLeftScriptClient(NewRoom, OnlineGameClient, NewScreen));
            DicNewGameServerScript.Add(ChangeLoadoutScriptClient.ScriptName, new ChangeLoadoutScriptClient(NewRoom, NewScreen));
            DicNewGameServerScript.Add(ChangePlayerTypeScriptClient.ScriptName, new ChangePlayerTypeScriptClient(NewRoom, NewScreen));
            DicNewGameServerScript.Add(ChangeTeamScriptClient.ScriptName, new ChangeTeamScriptClient(NewRoom));
            DicNewGameServerScript.Add(ChangeMapScriptClient.ScriptName, new ChangeMapScriptClient(NewRoom, NewScreen));
            DicNewGameServerScript.Add(ChangeRoomSubtypeScriptClient.ScriptName, new ChangeRoomSubtypeScriptClient(NewScreen));

            Host.AddOrReplaceScripts(DicNewGameServerScript);

            if (OnlineCommunicationClient.Host != null)
            {
                OnlineCommunicationClient.Chat.InsertTab(RoomID, "Chat");
                OnlineCommunicationClient.Chat.CloseTab("Global");
                OnlineCommunicationClient.Host.Send(new CreateOrJoinCommunicationGroupScriptClient(RoomID, false));
                OnlineCommunicationClient.Host.Send(new LeaveCommunicationGroupScriptClient("Global"));
            }

            Host.Send(new AskChangeLoadoutScriptClient(PlayerManager.ListLocalPlayer[0]));

            OnlineGameClient.DelayOnlineScript(this);
        }
Exemple #5
0
        public static Dictionary <string, OnlineScript> GetRoomScriptsServer(PVPRoomInformations NewRoom, GameServer Owner)
        {
            Dictionary <string, OnlineScript> DicNewScript = new Dictionary <string, OnlineScript>();

            DicNewScript.Add(AskChangeLoadoutScriptServer.ScriptName, new AskChangeLoadoutScriptServer(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));

            return(DicNewScript);
        }
Exemple #6
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);
            }
        }
        protected override void Execute(IOnlineConnection Host)
        {
            OnlineGameClient.RoomID = RoomID;

            Dictionary <string, OnlineScript> DicNewGameServerScript = new Dictionary <string, OnlineScript>();
            GamePreparationScreen             NewMissionSelectScreen;

            PVPRoomInformations MissionRoom = new PVPRoomInformations(RoomID, RoomName, RoomType, RoomSubtype, MinNumberOfPlayer, MaxNumberOfPlayer);

            GamePreparationScreen NewMissionSelect = new GamePreparationScreen(OnlineGameClient, OnlineCommunicationClient, MissionRoom);

            NewScreen = NewMissionSelect;
            NewMissionSelectScreen = NewMissionSelect;

            DicNewGameServerScript.Add(CreateGameScriptClient.ScriptName, new CreateGameScriptClient(OnlineGameClient, ScreenOwner.ListGameScreen, MissionRoom));
            DicNewGameServerScript.Add(ChangeRoomExtrasMissionScriptClient.ScriptName, new ChangeRoomExtrasMissionScriptClient(MissionRoom, NewMissionSelectScreen));

            DicNewGameServerScript.Add(PlayerJoinedScriptClient.ScriptName, new PlayerJoinedScriptClient(NewMissionSelectScreen));
            DicNewGameServerScript.Add(PlayerLeftScriptClient.ScriptName, new PlayerLeftScriptClient(MissionRoom, OnlineGameClient, NewMissionSelectScreen));
            DicNewGameServerScript.Add(ChangeLoadoutScriptClient.ScriptName, new ChangeLoadoutScriptClient(MissionRoom, NewMissionSelectScreen));
            DicNewGameServerScript.Add(ChangePlayerTypeScriptClient.ScriptName, new ChangePlayerTypeScriptClient(MissionRoom, NewMissionSelectScreen));
            DicNewGameServerScript.Add(ChangeTeamScriptClient.ScriptName, new ChangeTeamScriptClient(MissionRoom));
            DicNewGameServerScript.Add(ChangeMapScriptClient.ScriptName, new ChangeMapScriptClient(MissionRoom, NewMissionSelectScreen));
            DicNewGameServerScript.Add(ChangeRoomSubtypeScriptClient.ScriptName, new ChangeRoomSubtypeScriptClient(NewMissionSelectScreen));

            Host.AddOrReplaceScripts(DicNewGameServerScript);

            if (OnlineCommunicationClient.Host != null)
            {
                Dictionary <string, OnlineScript> DicNewCommunicationServerScript = new Dictionary <string, OnlineScript>();
                DicNewCommunicationServerScript.Add(ReceiveGroupMessageScriptClient.ScriptName, new ReceiveGroupMessageScriptClient(OnlineCommunicationClient));
                OnlineCommunicationClient.Host.AddOrReplaceScripts(DicNewCommunicationServerScript);

                OnlineCommunicationClient.Chat.InsertTab(RoomID, "Chat");
                OnlineCommunicationClient.Chat.CloseTab("Global");
                OnlineCommunicationClient.Host.Send(new CreateOrJoinCommunicationGroupScriptClient(RoomID, false));
                OnlineCommunicationClient.Host.Send(new LeaveCommunicationGroupScriptClient("Global"));
            }

            Host.Send(new AskChangeLoadoutScriptClient(PlayerManager.ListLocalPlayer[0]));

            ScreenOwner.RemoveScreen(ScreenOwner);

            OnlineGameClient.DelayOnlineScript(this);
        }
Exemple #8
0
        public IRoomInformations GenerateNewRoom(string RoomName, string RoomType, string RoomSubtype, string Password, string OwnerServerIP, int OwnerServerPort, byte MinNumberOfPlayer, byte MaxNumberOfPlayer)
        {
            DateTimeOffset CurrentTime = DateTimeOffset.Now;

            RoomInformations NewRoom = new PVPRoomInformations(RoomIDCount++.ToString(), RoomName, RoomType, RoomSubtype, Password, OwnerServerIP, OwnerServerPort, MinNumberOfPlayer, MaxNumberOfPlayer);

            if (ListRoom.ContainsKey(CurrentTime))
            {
                ListRoom[CurrentTime].Add(NewRoom);
            }
            else
            {
                ListRoom.Add(CurrentTime, new List <RoomInformations>()
                {
                    NewRoom
                });
            }

            return(NewRoom);
        }
Exemple #9
0
 public AskChangeRoomExtrasMissionScriptServer(PVPRoomInformations Owner)
     : base(ScriptName)
 {
     this.Owner = Owner;
 }
Exemple #10
0
 public ChangeRoomExtrasMissionScriptClient(PVPRoomInformations Owner, GamePreparationScreen MissionSelectScreen)
     : base(ScriptName)
 {
     this.Owner = Owner;
     this.MissionSelectScreen = MissionSelectScreen;
 }
Exemple #11
0
 public AskChangeMapScriptServer(PVPRoomInformations Owner, GameServer OnlineServer)
     : base(ScriptName)
 {
     this.Owner        = Owner;
     this.OnlineServer = OnlineServer;
 }