Skip to content

Commit

Permalink
Handler names to allow types other than strings.
Browse files Browse the repository at this point in the history
  • Loading branch information
SaiFi0102 committed Aug 23, 2015
1 parent bc56f00 commit c7bf8ef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions AIO_Client/AIO.lua
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ end
-- is received, the handlertable["HandlerName"] will be executed with player and additional params passed to the block.
-- Returns the passed table
function AIO.AddHandlers(name, handlertable)
assert(type(name) == 'string', "#1 string expected")
assert(name ~= nil, "#1 expected not nil")
assert(type(handlertable) == 'table', "#2 a table expected")

for k,v in pairs(handlertable) do
Expand Down Expand Up @@ -833,7 +833,7 @@ if AIO_SERVER then
-- A shorthand for sending a message for a handler.
function AIO.Handle(player, name, handlername, ...)
assert(type(player) == 'userdata', "#1 player expected")
assert(type(name) == 'string', "#2 string expected")
assert(name ~= nil, "#2 expected not nil")
return AIO.Msg():Add(name, handlername, ...):Send(player)
end

Expand Down Expand Up @@ -947,7 +947,7 @@ else

-- A shorthand for sending a message for a handler.
function AIO.Handle(name, handlername, ...)
assert(type(name) == 'string', "#1 string expected")
assert(name ~= nil, "#1 expected not nil")
return AIO.Msg():Add(name, handlername, ...):Send()
end

Expand Down
6 changes: 3 additions & 3 deletions AIO_Server/AIO.lua
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ end
-- is received, the handlertable["HandlerName"] will be executed with player and additional params passed to the block.
-- Returns the passed table
function AIO.AddHandlers(name, handlertable)
assert(type(name) == 'string', "#1 string expected")
assert(name ~= nil, "#1 expected not nil")
assert(type(handlertable) == 'table', "#2 a table expected")

for k,v in pairs(handlertable) do
Expand Down Expand Up @@ -833,7 +833,7 @@ if AIO_SERVER then
-- A shorthand for sending a message for a handler.
function AIO.Handle(player, name, handlername, ...)
assert(type(player) == 'userdata', "#1 player expected")
assert(type(name) == 'string', "#2 string expected")
assert(name ~= nil, "#2 expected not nil")
return AIO.Msg():Add(name, handlername, ...):Send(player)
end

Expand Down Expand Up @@ -947,7 +947,7 @@ else

-- A shorthand for sending a message for a handler.
function AIO.Handle(name, handlername, ...)
assert(type(name) == 'string', "#1 string expected")
assert(name ~= nil, "#1 expected not nil")
return AIO.Msg():Add(name, handlername, ...):Send()
end

Expand Down

0 comments on commit c7bf8ef

Please sign in to comment.