Callbacks update
Callbacks: Client to server to client -> has ability to trigger on all clients Server to client to server Unit test Moved tables from use to utilities
This commit is contained in:
1 parent
52af741ed8
commit
fc2bb50939
3 files changed
+189
No files matched your search
@@ -0,0 +1,44 @@
|
||||
-- ▄▀▀ ▄▀▄ █ █ ██▄ ▄▀▄ ▄▀▀ █▄▀ ▄▀▀ ▄▀▀ █▄█ ▄▀▄ █▀▄ ██▀ █▀▄ █ █ █▄ █ █ ▀█▀ ▀█▀ ██▀ ▄▀▀ ▀█▀
|
||||
-- ▀▄▄ █▀█ █▄▄ █▄▄ █▄█ █▀█ ▀▄▄ █ █ ▄█▀ ▄█▀ █ █ █▀█ █▀▄ █▄▄ █▄▀ ▀▄█ █ ▀█ █ █ █ █▄▄ ▄█▀ █
|
||||
|
||||
-- -- -- -- -- -- -- -- -- --
|
||||
-- ▄▀▀ ██▀ █▀▄ █ █ ██▀ █▀▄
|
||||
-- ▄█▀ █▄▄ █▀▄ ▀▄▀ █▄▄ █▀▄
|
||||
-- -- -- -- -- -- -- -- -- --
|
||||
if not IsDuplicityVersion() then goto client end
|
||||
exports.community_bridge:RegisterCallback('ClientToServerToClient', function(src, cb, ftpcsftug)
|
||||
cb(ftpcsftug, 'some random string')
|
||||
end)
|
||||
|
||||
RegisterCommand('cb_server_test', function(source)
|
||||
local someData = exports.community_bridge:TriggerCallback('ServerToClientToServer', source, function(ftpcsftug, derpa)
|
||||
print(ftpcsftug, derpa)
|
||||
return "This data gets passed up the chain"
|
||||
end,"herpaderpa")
|
||||
print("print", someData)
|
||||
end)
|
||||
|
||||
|
||||
|
||||
-- -- -- -- -- -- -- -- -- --
|
||||
-- ▄▀▀ █ █ ██▀ █▄ █ ▀█▀
|
||||
-- ▀▄▄ █▄▄ █ █▄▄ █ ▀█ █
|
||||
-- -- -- -- -- -- -- -- -- --
|
||||
if IsDuplicityVersion() then return end
|
||||
::client::
|
||||
|
||||
|
||||
RegisterCommand('cb_client_test', function()
|
||||
local someData = exports.community_bridge:TriggerCallback('ClientToServerToClient', function(ftpcsftug, derpa)
|
||||
print(ftpcsftug, derpa, "This will fire on the player who triggered the event")
|
||||
end,"herpaderpa")
|
||||
print(someData)
|
||||
end)
|
||||
|
||||
exports.community_bridge:RegisterRebound('ClientToServerToClient', function(src, cb, ftpcsftug)
|
||||
print("this is a rebound from another player or himself")
|
||||
end)
|
||||
|
||||
exports.community_bridge:RegisterCallback('ServerToClientToServer', function(cb, ftpcsftug)
|
||||
cb(ftpcsftug, 'TestyMcTesterton')
|
||||
end)
|
||||
Reference in new issue
Block a user