예제 #1
0
        public void Configure(IEcsBuilder builder)
        {
            builder.EnableSampEvents()
            .EnablePlayerCommands()
            .EnableRconCommands()
            .EnableEventScope("OnPlayerConnect")
            .EnableEventScope("OnPlayerText");

            builder.EnableEvent <int, int>("TestCallback");

            // Load middleware:
            // Can also be loaded by systems which are IConfiguringSystem
            builder.UseMiddleware("OnGameModeInit", (ctx, next) =>
            {
                Console.WriteLine("I am middleware for OnGameModeInit!");
                return(next());
            });

            builder.UseMiddleware("OnPlayerText", (ctx, next) =>
            {
                if (ctx.Arguments[1] is string txt && txt.Contains("I dislike SampSharp"))
                {
                    return(null);
                }
                return(next());
            });
        public void Configure(IEcsBuilder builder)
        {
            // TODO: Enable desired ECS system features

            builder.EnableSampEvents()
            .EnablePlayerCommands()
            .EnableRconCommands();
        }
예제 #3
0
 public void Configure(IEcsBuilder builder)
 {
     builder.EnableSampEvents()
     .EnablePlayerCommands();
 }