本文整理汇总了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;
}
示例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.");
}
}