forked from jmderuty/stormancer-test
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.cs
More file actions
30 lines (27 loc) · 1003 Bytes
/
App.cs
File metadata and controls
30 lines (27 loc) · 1003 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using Stormancer;
using Stormancer.Core;
using Stormancer.Matchmaking;
using Stormancer.Matchmaking.Default;
using System.Collections.Generic;
namespace Test
{
public class Startup
{
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'." } });
}
}
}