当前位置: 首页>>代码示例>>C#>>正文


C# DataNew.GetFullPath方法代码示例

本文整理汇总了C#中DataNew.GetFullPath方法的典型用法代码示例。如果您正苦于以下问题:C# DataNew.GetFullPath方法的具体用法?C# DataNew.GetFullPath怎么用?C# DataNew.GetFullPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataNew的用法示例。


在下文中一共展示了DataNew.GetFullPath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: StartLocalGame

        void StartLocalGame(DataNew.Entities.Game game, string name, string password)
        {
            var hostport = new Random().Next(5000,6000);
            while (!Networking.IsPortAvailable(hostport)) hostport++;
            var hs = new HostedGame(hostport, game.Id, game.Version, game.Name, name, Password, new User(Username + "@" + Program.ChatServerPath), true);
            if (!hs.StartProcess())
            {
                throw new UserMessageException("Cannot start local game. You may be missing a file.");
            }
            Prefs.Nickname = Username;
            Program.LobbyClient.CurrentHostedGamePort = hostport;
            Program.GameSettings.UseTwoSidedTable = true;
            Program.Game = new Game(GameDef.FromO8G(game.GetFullPath()), Username, true);
            Program.IsHost = true;

            var ip = IPAddress.Parse("127.0.0.1");

            Program.Client = new Client(ip, hostport);
            Program.Client.Connect();
            SuccessfulHost = true;
        }
开发者ID:voidbeast,项目名称:OCTGN,代码行数:21,代码来源:HostGameSettings.xaml.cs

示例2: StartJoinGame

        private void StartJoinGame(HostedGameViewModel hostedGame, DataNew.Entities.Game game)
        {
            Program.IsHost = false;
            Program.Game = new Game(GameDef.FromO8G(game.GetFullPath()),Program.LobbyClient.Me.UserName);
            Program.CurrentOnlineGameName = hostedGame.Name;
            IPAddress hostAddress =  Dns.GetHostAddresses(Program.GameServerPath).FirstOrDefault();
            if(hostAddress == null)
                throw new UserMessageException("There was a problem with your DNS. Please try again.");

            try
            {
                Program.Client = new Client(hostAddress,hostedGame.Port);
                Program.Client.Connect();
            }
            catch (Exception)
            {
                throw new UserMessageException("Could not connect. Please try again.");
            }
        }
开发者ID:voidbeast,项目名称:OCTGN,代码行数:19,代码来源:CustomGames.xaml.cs


注:本文中的DataNew.GetFullPath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。