예제 #1
0
        public async override void Start(object param = null)
        {
            base.Start();
            announcedGames = new Dictionary <string, AceGameInfo>();

            settings = appl.frontend.GetUserSettings();
            appl.AddAppCore(null);

            try {
                appl.ConnectToNetwork(kNetConnectionString);
                await appl.JoinGameNetworkAsync(kNetworkName);

                logger.Info("Local splash network joined");

                AceGameInfo gameInfo = appl.aceGameNet.CreateAceGameInfo(
                    kApianGroupName,
                    SinglePeerGroupManager.kGroupType,
                    2, // maxPlayers
                    0, // min validators
                    kValidatorWaitMs
                    );

                SplashAppCore = CreateCorePair(gameInfo);
                appl.AddAppCore(SplashAppCore);
                SplashAppCore.PlayerJoinedEvt += _OnPlayerJoinedEvt;
                SplashAppCore.Start(AceCoreModeFactory.kStart);

                LocalPeerJoinedGameData joinData = await appl.CreateAndJoinGameAsync(gameInfo, SplashAppCore);
            } catch (Exception ex) {
                ExitAbruptly($"{ex.Message}");

                return;
            }
        }
예제 #2
0
        private AceAppCore _SetupCorePair(AceGameInfo gameInfo)
        {
            if (gameInfo == null)
            {
                ExitAbruptly($"_SetupCorePair(): null gameInfo");
            }

            AceAppCore appCore = CreateCorePair(gameInfo);

            appl.AddAppCore(appCore);
            appCore.PlayerJoinedEvt += _OnPlayerJoinedEvt;
            appCore.Start(AceCoreModeFactory.kStart);
            return(appCore);
        }