mirror of
https://github.com/edubart/otclient.git
synced 2025-10-14 19:44:54 +02:00
Progress updating to cv981/pv973:
* Implemented the new client AND protocol version methods. * Implemented the new speed laws added in cv980 (http://www.tibia.com/news/?subtopic=newsarchive&id=2251). * Added more missing bytea to login packets (client version/type and some unknown bytes). * Fixed the InputMessage::getDouble method. * Cleaned up some of the const values. * Started on the pending state features. TODO: * Pending game state feature. * Ensure version compatibility hasn't been compromised.
This commit is contained in:
@@ -29,7 +29,7 @@ function string:trim()
|
||||
end
|
||||
|
||||
function string:explode(sep, limit)
|
||||
if(type(sep) ~= 'string' or tostring(self):len() == 0 or sep:len() == 0) then
|
||||
if type(sep) ~= 'string' or tostring(self):len() == 0 or sep:len() == 0 then
|
||||
return {}
|
||||
end
|
||||
|
||||
@@ -40,7 +40,7 @@ function string:explode(sep, limit)
|
||||
pos = e + 1
|
||||
|
||||
i = i + 1
|
||||
if(limit ~= nil and i == limit) then
|
||||
if limit ~= nil and i == limit then
|
||||
break
|
||||
end
|
||||
end
|
||||
@@ -49,3 +49,4 @@ function string:explode(sep, limit)
|
||||
table.insert(t, tmp)
|
||||
return t
|
||||
end
|
||||
|
||||
|
@@ -92,3 +92,18 @@ function table.empty(t)
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
function table.toString(t)
|
||||
local maxn = #t
|
||||
local str = ""
|
||||
for k,v in pairs(t) do
|
||||
if k == maxn and k ~= 1 then
|
||||
str = str .. " and " .. v
|
||||
elseif maxn > 1 and k ~= 1 then
|
||||
str = str .. ", " .. v
|
||||
else
|
||||
str = str .. " " .. v
|
||||
end
|
||||
end
|
||||
return str
|
||||
end
|
||||
|
Reference in New Issue
Block a user