Skip to content

Commit

Permalink
Fixed a crash
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffery Boulanger authored and Jeffery Boulanger committed Mar 11, 2021
1 parent 31f3550 commit d732615
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ luac.out

/.vs/twitch2dcs/v15/.suo
/.vs/slnx.sqlite
/.vs
14 changes: 7 additions & 7 deletions Scripts/twitch/server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -75,25 +75,25 @@ function Server:receive()
else
local prefix, cmd, param = string.match(buffer, "^:([^ ]+) ([^ ]+)(.*)$")

param = string.sub(param,2)

local param1, param2 = string.match(param,"^([^:]+) :(.*)$")
local user, userhost = string.match(prefix,"^([^!]+)!(.*)$")

if cmd == "376" then
self:send("JOIN #"..self.username)
end

local handlers = self.commandHandlers[cmd]

if param ~= nil and handlers ~= nil then
param = string.sub(param,2)

local param1, param2 = string.match(param,"^([^:]+) :(.*)$")
local user, userhost = string.match(prefix,"^([^!]+)!(.*)$")

for i, handler in ipairs(handlers) do
handler({
prefix = prefix,
user = user,
userhost = userhost,
param1 = param1,
param2 = param2
param1 = param1,
param2 = param2
})
end
end
Expand Down

0 comments on commit d732615

Please sign in to comment.