本文整理汇总了C#中IAppBuilder.SceneTemplate方法的典型用法代码示例。如果您正苦于以下问题:C# IAppBuilder.SceneTemplate方法的具体用法?C# IAppBuilder.SceneTemplate怎么用?C# IAppBuilder.SceneTemplate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAppBuilder
的用法示例。
在下文中一共展示了IAppBuilder.SceneTemplate方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Run
public void Run(IAppBuilder builder)
{
builder.SceneTemplate("empty", scene => { });
var userConfig = new Users.UserManagementConfig() { SceneIdRedirect = "main" /*Constants.MATCHMAKER_NAME*/ };
userConfig.AuthenticationProviders.Add(new LoginPasswordAuthenticationProvider());
userConfig.AuthenticationProviders.Add(new SteamAuthenticationProvider());
builder.AddPlugin(new UsersManagementPlugin(userConfig));
}
示例2: Run
//The runtime calls this method on startup to initialize the server.
public void Run(IAppBuilder builder)
{
//Declares a scene template called "hello"
builder.SceneTemplate("hello", scene =>
{
//Adds an handler executed whenever a peer connects to the scene.
scene.Connected.Add(async peer =>
{
//Sends the string "hello world!" to the peer that just connected.
peer.Send("msg", "hello world!");
});
});
}
示例3: Run
public void Run(IAppBuilder builder)
{
builder.AddPlugin(new MatchmakingPlugin(MatchmakingFactory.Create(
new DefaultMatchmakingDataExtractor(),
new DefaultMatchmaker(),
new DefaultMatchmakingResolver()
)));
builder.SceneTemplate("test-template", scene =>
{
scene.AddRoute("echo.in", p =>
{
scene.Broadcast("echo.out", s => p.Stream.CopyTo(s, (int)p.Stream.Length), PacketPriority.MEDIUM_PRIORITY, PacketReliability.RELIABLE);
});
},
new Dictionary<string, string> { { "description", "Broadcasts data sent to the route 'echo.in' to all connected users on the route 'echo.out'." } });
}
示例4: Run
public void Run(IAppBuilder builder)
{
builder.SceneTemplate("ChatRoom", scene => scene.AddChat());
}
示例5: Run
public void Run(IAppBuilder builder)
{
builder.SceneTemplate("tester", scene => TesterBehavior.AddTesterBehaviorToScene(scene));
}
示例6: Run
public void Run(IAppBuilder builder)
{
builder.SceneTemplate("interpolator_scene", (scene) => new InterpolatorScene(scene));
}
示例7: Run
public void Run(IAppBuilder builder)
{
builder.SceneTemplate("main", scene => new Main(scene));
}
示例8: Run
public void Run(IAppBuilder builder)
{
builder.SceneTemplate("Lobby", scene => scene.addServerLogic());
builder.SceneTemplate("Game", scene => scene.addGameLogic());
}