Skip to content

TheExeDEV/Kernel-Roblox-Framework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 

Repository files navigation

Kernel Framework

  • GithubLink - link
  • RobloxModel - link
  • version - 1.0.1

How To Use

  • Server Side Runtime
--Server Runtime
local Kernel = require(game:GetService("ReplicatedStorage").Kernel)

Kernel.SetServiceFolder(script.Services) --where will the services be taken from

Kernel.AddMiddleware(function(context, ...)
	print(string.format("[middleware] %s: %s.%s", context.Player.Name, context.Service, context.Method))
	return true
end)

Kernel.Start()
  • Client Side Runtime
--Client Runtime
local Kernel = require(game:GetService("ReplicatedStorage").Kernel)

Kernel.SetControllerFolder(script.Controllers) --where will the controllers be taken from
Kernel.Start()
  • Service & Controller Sides
--Test Service
local Kernel = require(game.ReplicatedStorage.Kernel)

local TestService = Kernel.CreateService({
	Name = "TestService",
	Client = {
		ping = Kernel.RemoteSignal(),

		hi = function(self, player: Player)
			return "hello: "..player.Name
		end,
	},
})

function TestService:KernelInit()
	print("im first started in server")
	
	self.Client.ping:Connect(function(player)
		print("ping", player.Name)
		self.Client.ping:Fire(player, "pong!")
	end)
end

function TestService:KernelStart()
	print("im second started")
end

return TestService
--Test Controller
local Kernel = require(game.ReplicatedStorage.Kernel)

local TestController = Kernel.CreateController({
	Name = "TestController",
})

function TestController:KernelInit()
	print("im first started in client")
	local TestService = Kernel.GetService("TestService")

	TestService.ping:Connect(function(msg)
		print("msg:", msg)
	end)
end

function TestController:KernelStart()
	print("im second started in client")
	local TestService = Kernel.GetService("TestService")
	print("Test controller server said:", TestService:hi())

	TestService.ping:Fire()
end

return TestController

why is it better than the Knit Framework:

  • Knit is an archived Framework
  • Knit has poor networking
  • Knit is quite old and needs to be updated

Contributors

- my first job

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages