|
784 | 784 | -- All parameters the client sends will be passed to func when called
|
785 | 785 | -- Only one function can be a handler for one name (subject for change)
|
786 | 786 | function AIO.RegisterEvent(name, func)
|
787 |
| - assert(type(name) == "string", "name of the registered event string expected") |
| 787 | + assert(name ~= nil, "name of the registered event expected not nil") |
788 | 788 | assert(type(func) == "function", "callback function must be a function")
|
789 | 789 | assert(not AIO_BLOCKHANDLES[name], "an event is already registered for the name: "..name)
|
790 | 790 | AIO_BLOCKHANDLES[name] = func
|
|
796 | 796 | -- is received, the handlertable["HandlerName"] will be executed with player and additional params passed to the block.
|
797 | 797 | -- Returns the passed table
|
798 | 798 | function AIO.AddHandlers(name, handlertable)
|
799 |
| - assert(type(name) == 'string', "#1 string expected") |
| 799 | + assert(name ~= nil, "#1 expected not nil") |
800 | 800 | assert(type(handlertable) == 'table', "#2 a table expected")
|
801 | 801 |
|
802 | 802 | for k,v in pairs(handlertable) do
|
@@ -833,7 +833,7 @@ if AIO_SERVER then
|
833 | 833 | -- A shorthand for sending a message for a handler.
|
834 | 834 | function AIO.Handle(player, name, handlername, ...)
|
835 | 835 | assert(type(player) == 'userdata', "#1 player expected")
|
836 |
| - assert(type(name) == 'string', "#2 string expected") |
| 836 | + assert(name ~= nil, "#2 expected not nil") |
837 | 837 | return AIO.Msg():Add(name, handlername, ...):Send(player)
|
838 | 838 | end
|
839 | 839 |
|
|
947 | 947 |
|
948 | 948 | -- A shorthand for sending a message for a handler.
|
949 | 949 | function AIO.Handle(name, handlername, ...)
|
950 |
| - assert(type(name) == 'string', "#1 string expected") |
| 950 | + assert(name ~= nil, "#1 expected not nil") |
951 | 951 | return AIO.Msg():Add(name, handlername, ...):Send()
|
952 | 952 | end
|
953 | 953 |
|
|
0 commit comments