Files
community_bridge/unit_tests/callbacks_test.lua
T

40 lines
1.8 KiB
Lua
Raw Normal View History

2025-01-09 09:40:40 -06:00
-- ▄▀▀ ▄▀▄ █ █ ██▄ ▄▀▄ ▄▀▀ █▄▀ ▄▀▀ ▄▀▀ █▄█ ▄▀▄ █▀▄ ██▀ █▀▄ █ █ █▄ █ █ ▀█▀ ▀█▀ ██▀ ▄▀▀ ▀█▀
-- ▀▄▄ █▀█ █▄▄ █▄▄ █▄█ █▀█ ▀▄▄ █ █ ▄█▀ ▄█▀ █ █ █▀█ █▀▄ █▄▄ █▄▀ ▀▄█ █ ▀█ █ █ █ █▄▄ ▄█▀ █
-- -- -- -- -- -- -- -- -- --
-- ▄▀▀ ██▀ █▀▄ █ █ ██▀ █▀▄
-- ▄█▀ █▄▄ █▀▄ ▀▄▀ █▄▄ █▀▄
-- -- -- -- -- -- -- -- -- --
if not IsDuplicityVersion() then goto client end
2025-06-02 22:19:42 -05:00
Bridge.Callbacks.Register('callback_test1_name_here', function(src, var1)
2025-03-31 03:43:08 -05:00
if var1 == "herpaderpa" then
print("this is a test")
end
return 'some random string', "some other string"
2025-01-09 09:40:40 -06:00
end)
2025-03-31 03:43:08 -05:00
RegisterCommand('callback_test2', function(source)
2025-06-02 22:19:42 -05:00
local someData, other = Bridge.Callbacks.Trigger('callback_test2_name_here', source, "herpaderpa")
2025-03-31 03:43:08 -05:00
print("Data From Client: ", someData, other)
end)
2025-01-09 09:40:40 -06:00
-- -- -- -- -- -- -- -- -- --
-- ▄▀▀ █ █ ██▀ █▄ █ ▀█▀
-- ▀▄▄ █▄▄ █ █▄▄ █ ▀█ █
-- -- -- -- -- -- -- -- -- --
if IsDuplicityVersion() then return end
::client::
2025-03-31 03:43:08 -05:00
RegisterCommand('callback_test1', function()
2025-06-02 22:19:42 -05:00
local somerandomstring, someotherrandomstring = Bridge.Callbacks.Trigger('callback_test1_name_here', "herpaderpa")
2025-03-31 03:43:08 -05:00
print("Data From Server: ", somerandomstring, someotherrandomstring)
2025-01-09 09:40:40 -06:00
end)
2025-03-31 03:43:08 -05:00
-- exports.community_bridge:RegisterRebound('callback_test1', function(src, cb, ftpcsftug)
-- print("this is a rebound to all players")
-- end)
2025-01-09 09:40:40 -06:00
2025-06-02 22:19:42 -05:00
Bridge.Callbacks.Register('callback_test2_name_here', function(ftpcsftug)
2025-03-31 03:43:08 -05:00
return ftpcsftug, 'TestyMcTesterton'
2025-01-09 09:40:40 -06:00
end)