Skip to content

Commit b3cf91f

Browse files
committed
1 parent b9f0f30 commit b3cf91f

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

resources/irc/scripts/irccommands.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
------------------------------------
88
-- IRC Commands
99
------------------------------------
10-
addEventHandler("onResourceStart",resourceRoot,
10+
addEvent("onIRCResourceStart")
11+
addEventHandler("onIRCResourceStart",root,
1112
function ()
1213
function say (server,channel,user,command,...)
1314
local message = table.concat({...}," ")

resources/irc/scripts/loading.lua

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,7 @@ local adTimer
1313
------------------------------------
1414
addEventHandler("onResourceStart",resourceRoot,
1515
function ()
16-
-- Is the sockets module loaded?
17-
if not sockOpen then
18-
outputServerLog("IRC: could not start resource, the sockets module isn't loaded!")
19-
outputServerLog("IRC: restart the resource to retry")
20-
return
21-
end
22-
23-
-- Parse rights file.
16+
-- Parse rights file.
2417
local rightsFile = fileOpen("scripts/rights.txt",true)
2518
if rightsFile then
2619
local missingRights = {}
@@ -98,6 +91,7 @@ addEventHandler("onResourceStart",resourceRoot,
9891
return
9992
end
10093

94+
-- parse acl file
10195
local aclFile = xmlLoadFile("acl.xml")
10296
if aclFile then
10397
local i = 0
@@ -115,6 +109,13 @@ addEventHandler("onResourceStart",resourceRoot,
115109
return
116110
end
117111

112+
-- Is the sockets module loaded?
113+
if not sockOpen then
114+
outputServerLog("IRC: could not start resource, the sockets module isn't loaded!")
115+
outputServerLog("IRC: restart the resource to retry")
116+
return
117+
end
118+
118119
-- start irc addons
119120
for i,resource in ipairs (getResources()) do
120121
local info = getResourceInfo(resource,"addon")
@@ -123,6 +124,7 @@ addEventHandler("onResourceStart",resourceRoot,
123124
end
124125
end
125126

127+
triggerEvent("onIRCResourceStart",root)
126128
internalConnect()
127129
end
128130
)

0 commit comments

Comments
 (0)