本文整理汇总了C#中DataNew类的典型用法代码示例。如果您正苦于以下问题:C#DataNew类的具体用法?C#DataNew怎么用?C#DataNew使用的例子?这里精选的类代码示例或许可以为您提供帮助。
示例1:StartLocalGame
voidStartLocalGame(DataNew.Entities.Gamegame,stringname,stringpassword)
{
varhs=newHostedGame(HostPort,game.Id,game.Version,game.Name,name,null,newUser(Prefs.Nickname+"@"+AppConfig.ChatServerPath),true);
if(!hs.StartProcess())
{
thrownewUserMessageException("Cannotstartlocalgame.Youmaybemissingafile.");
}
Program.LobbyClient.CurrentHostedGamePort=HostPort;
Program.GameSettings.UseTwoSidedTable=HostGame.UseTwoSidedTable;
Program.IsHost=true;
Program.GameEngine=newGameEngine(game,Prefs.Nickname,password,true);
varip=IPAddress.Parse("127.0.0.1");
for(vari=0;i<5;i++)
{
try
{
Program.Client=newOctgn.Networking.ClientSocket(ip,HostPort);
Program.Client.Connect();
return;
}
catch(Exceptione)
{
Log.Warn("Startlocalgameerror",e);
if(i==4)throw;
}
Thread.Sleep(2000);
}
thrownewUserMessageException("Cannotstartlocalgame.Youmaybemissingafile.");
}
原文链接:
http://www.jxszl.com/biancheng/C/556869.html