diff --git a/client/Libs/bin.lua b/client/Libs/bin.lua index d519bc9..2c9aa92 100644 --- a/client/Libs/bin.lua +++ b/client/Libs/bin.lua @@ -598,6 +598,16 @@ function io.getFullName(name) end return temp end +function io.getName(file) + local name=io.getFullName(file) + name=string.reverse(name) + a,b=string.find(name,'.',1,true) + name=string.sub(name,a+1,-1) + return string.reverse(name) +end +function io.getPathName(path) + return path:sub(1,#path-#io.getFullName(path)) +end function table.merge(t1, t2) for k,v in pairs(t2) do if type(v) == 'table' then @@ -902,8 +912,184 @@ function randomGen:newND(a,b,s) return temp end --[[---------------------------------------- +LWZ +------------------------------------------]] +--~ bitM=2^8 +--~ bitS=2^7 +--~ lzw = {} +--~ local function enc_reset(dict, size) +--~ for k, _ in pairs(dict) do dict[k] = nil end +--~ for i = 0, size-1 do dict[string.char(i)] = i end +--~ return dict +--~ end +--~ local function dec_reset(dict, size) +--~ for k, _ in pairs(dict) do dict[k] = nil end +--~ for i = 0, size-1 do dict[i] = string.char(i) end +--~ return dict +--~ end +--~ lzw.encode = function(message) +--~ local w, result, size = "", {}, bitM +--~ local dict = enc_reset({}, size) +--~ for k in message:gmatch('.') do +--~ local wk = w .. k +--~ if dict[wk] then +--~ w = wk +--~ else +--~ result[#result+1] = dict[w] +--~ dict[wk] = size +--~ size = size + 1 +--~ w = k +--~ end +--~ end +--~ if w:len() > 0 then +--~ result[#result+1] = dict[w] +--~ end +--~ return result +--~ end +--~ lzw.short_encode = function(message) +--~ local w, result, size = "", {}, bitS +--~ local dict = enc_reset({}, size) +--~ for k in string.gmatch(message, '.') do +--~ local wk = w .. k +--~ if dict[wk] then +--~ w = wk +--~ else +--~ result[#result+1] = string.char(dict[w]) +--~ dict[wk] = size +--~ size = size + 1 +--~ if size == bitM then +--~ size = bitS +--~ enc_reset(dict, size) +--~ end +--~ w = k +--~ end +--~ end +--~ if w:len() > 0 then +--~ result[#result+1] = string.char(dict[w]) +--~ end +--~ return table.concat(result) +--~ end +--~ lzw.decode = function(cipher) +--~ local w, entry, result = "", "", {} +--~ local size = bitM +--~ local dict = dec_reset({}, size) +--~ w = string.char(cipher[1]) +--~ result[1] = w +--~ for i = 2, #cipher do +--~ local codeword = cipher[i] +--~ if dict[codeword] then +--~ entry = dict[codeword] +--~ else +--~ entry = w .. w:sub(1,1) +--~ end +--~ dict[size] = w .. entry:sub(1, 1) +--~ result[#result+1], w, size = entry, entry, size + 1 +--~ end +--~ return table.concat(result) +--~ end +--~ lzw.short_decode = function(cipher) +--~ local w, entry, result, size = "", "", {}, bitS +--~ local dict = dec_reset({}, size) +--~ w = cipher:sub(1, 1) +--~ result[1] = w +--~ for i = 2, cipher:len() do +--~ local k = string.byte(cipher:sub(i, i)) +--~ if dict[k] then +--~ entry = dict[k] +--~ else +--~ entry = w .. w:sub(1,1) +--~ end +--~ dict[size] = w .. entry:sub(1, 1) +--~ result[#result+1], w, size = entry, entry, size + 1 +--~ if size >= bitM then +--~ size = bitS +--~ dec_reset(dict, size) +--~ end +--~ end +--~ return table.concat(result) +--~ end +lzw = {} +function lzw.encode(uncompressed) -- string + local dictionary, result, dictSize, w, c = {}, {}, 255, "" + for i = 0, 255 do + dictionary[string.char(i)] = i + end + for i = 1, #uncompressed do + c = string.sub(uncompressed, i, i) + if dictionary[w .. c] then + w = w .. c + else + table.insert(result, dictionary[w]) + dictSize = dictSize + 1 + dictionary[w .. c] = dictSize + w = c + end + end + if w ~= "" then + table.insert(result, dictionary[w]) + end + return result +end + +function lzw.decode(compressed) -- table + local dictionary, dictSize, entry, result, w, k = {}, 255, "", "", "" + for i = 0, 255 do + dictionary[i] = string.char(i) + end + for i = 1, #compressed do + k = compressed[i] + if dictionary[k] then + entry = dictionary[k] + elseif k == dictSize then + entry = w .. string.sub(w, 1, 1) + else + return nil, i + end + result = result .. entry + dictionary[dictSize] = w .. string.sub(entry, 1, 1) + dictSize = dictSize + 1 + w = entry + end + return result +end +--[[---------------------------------------- BIN ------------------------------------------]] +function bin.compress(uncomp,n) + n=n or 9 + local cipher = lzw.encode(uncomp) + local dat={} + for i=1,#cipher do + local fix=bits.new(cipher[i]).data:match("0*(%d+)") + if cipher[i]==0 then + fix=string.rep("0",n) + end + fix=string.rep("0",n-#fix)..fix + table.insert(dat,fix) + end + str=table.concat(dat,"") + str=string.rep("0",8-#str%8)..str + comp={} + for i=0,(#str/8) do + table.insert(comp,bits.new(str:sub(i*8+1,i*8+8)):toSbytes()) + end + return table.concat(comp,"") +end +function bin.decompress(comp,n) + n=n or 9 + local tab={} + for i=1,#comp do + table.insert(tab,bits.new(comp:sub(i,i)).data) + end + tab=table.concat(tab,"") + tab=tab:match("0*(%d+)") + tab=string.rep("0",n-#tab%n)..tab + uncomp={} + for i=0,(#tab/n) do + table.insert(uncomp,tonumber(tab:sub(i*n+1,i*n+n),2)) + end + return lzw.decode(uncomp) +end function bin:getSize() return self:getlength() end @@ -2547,10 +2733,13 @@ end --[[---------------------------------------- BITS ------------------------------------------]] -function bits.new(n) +function bits.new(n,s) if type(n)=='string' then local t=tonumber(n,2) - if not t then + if t and #n<8 and not(s) then + t=nil + end + if not(t) then t={} for i=#n,1,-1 do table.insert(t,bits:conv(string.byte(n,i))) diff --git a/client/loading/image-0000001.png b/client/loading/image-0000001.png new file mode 100644 index 0000000..767c61d Binary files /dev/null and b/client/loading/image-0000001.png differ diff --git a/client/loading/image-0000002.png b/client/loading/image-0000002.png new file mode 100644 index 0000000..76a309e Binary files /dev/null and b/client/loading/image-0000002.png differ diff --git a/client/loading/image-0000003.png b/client/loading/image-0000003.png new file mode 100644 index 0000000..76a309e Binary files /dev/null and b/client/loading/image-0000003.png differ diff --git a/client/loading/image-0000004.png b/client/loading/image-0000004.png new file mode 100644 index 0000000..76a309e Binary files /dev/null and b/client/loading/image-0000004.png differ diff --git a/client/loading/image-0000005.png b/client/loading/image-0000005.png new file mode 100644 index 0000000..76a309e Binary files /dev/null and b/client/loading/image-0000005.png differ diff --git a/client/loading/image-0000006.png b/client/loading/image-0000006.png new file mode 100644 index 0000000..76a309e Binary files /dev/null and b/client/loading/image-0000006.png differ diff --git a/client/loading/image-0000007.png b/client/loading/image-0000007.png new file mode 100644 index 0000000..76a309e Binary files /dev/null and b/client/loading/image-0000007.png differ diff --git a/client/loading/image-0000008.png b/client/loading/image-0000008.png new file mode 100644 index 0000000..76a309e Binary files /dev/null and b/client/loading/image-0000008.png differ diff --git a/client/loading/image-0000009.png b/client/loading/image-0000009.png new file mode 100644 index 0000000..76a309e Binary files /dev/null and b/client/loading/image-0000009.png differ diff --git a/client/loading/image-0000010.png b/client/loading/image-0000010.png new file mode 100644 index 0000000..76a309e Binary files /dev/null and b/client/loading/image-0000010.png differ diff --git a/client/loading/image-0000011.png b/client/loading/image-0000011.png new file mode 100644 index 0000000..cc0f4c4 Binary files /dev/null and b/client/loading/image-0000011.png differ diff --git a/client/loading/image-0000012.png b/client/loading/image-0000012.png new file mode 100644 index 0000000..cc0f4c4 Binary files /dev/null and b/client/loading/image-0000012.png differ diff --git a/client/loading/image-0000013.png b/client/loading/image-0000013.png new file mode 100644 index 0000000..cc0f4c4 Binary files /dev/null and b/client/loading/image-0000013.png differ diff --git a/client/loading/image-0000014.png b/client/loading/image-0000014.png new file mode 100644 index 0000000..cc0f4c4 Binary files /dev/null and b/client/loading/image-0000014.png differ diff --git a/client/loading/image-0000015.png b/client/loading/image-0000015.png new file mode 100644 index 0000000..cc0f4c4 Binary files /dev/null and b/client/loading/image-0000015.png differ diff --git a/client/loading/image-0000016.png b/client/loading/image-0000016.png new file mode 100644 index 0000000..cc0f4c4 Binary files /dev/null and b/client/loading/image-0000016.png differ diff --git a/client/loading/image-0000017.png b/client/loading/image-0000017.png new file mode 100644 index 0000000..cc0f4c4 Binary files /dev/null and b/client/loading/image-0000017.png differ diff --git a/client/loading/image-0000018.png b/client/loading/image-0000018.png new file mode 100644 index 0000000..cc0f4c4 Binary files /dev/null and b/client/loading/image-0000018.png differ diff --git a/client/loading/image-0000019.png b/client/loading/image-0000019.png new file mode 100644 index 0000000..cc0f4c4 Binary files /dev/null and b/client/loading/image-0000019.png differ diff --git a/client/loading/image-0000020.png b/client/loading/image-0000020.png new file mode 100644 index 0000000..cc0f4c4 Binary files /dev/null and b/client/loading/image-0000020.png differ diff --git a/client/loading/image-0000021.png b/client/loading/image-0000021.png new file mode 100644 index 0000000..36ef60b Binary files /dev/null and b/client/loading/image-0000021.png differ diff --git a/client/loading/image-0000022.png b/client/loading/image-0000022.png new file mode 100644 index 0000000..36ef60b Binary files /dev/null and b/client/loading/image-0000022.png differ diff --git a/client/loading/image-0000023.png b/client/loading/image-0000023.png new file mode 100644 index 0000000..36ef60b Binary files /dev/null and b/client/loading/image-0000023.png differ diff --git a/client/loading/image-0000024.png b/client/loading/image-0000024.png new file mode 100644 index 0000000..36ef60b Binary files /dev/null and b/client/loading/image-0000024.png differ diff --git a/client/loading/image-0000025.png b/client/loading/image-0000025.png new file mode 100644 index 0000000..36ef60b Binary files /dev/null and b/client/loading/image-0000025.png differ diff --git a/client/loading/image-0000026.png b/client/loading/image-0000026.png new file mode 100644 index 0000000..36ef60b Binary files /dev/null and b/client/loading/image-0000026.png differ diff --git a/client/loading/image-0000027.png b/client/loading/image-0000027.png new file mode 100644 index 0000000..36ef60b Binary files /dev/null and b/client/loading/image-0000027.png differ diff --git a/client/loading/image-0000028.png b/client/loading/image-0000028.png new file mode 100644 index 0000000..36ef60b Binary files /dev/null and b/client/loading/image-0000028.png differ diff --git a/client/loading/image-0000029.png b/client/loading/image-0000029.png new file mode 100644 index 0000000..36ef60b Binary files /dev/null and b/client/loading/image-0000029.png differ diff --git a/client/loading/image-0000030.png b/client/loading/image-0000030.png new file mode 100644 index 0000000..36ef60b Binary files /dev/null and b/client/loading/image-0000030.png differ diff --git a/client/loading/image-0000031.png b/client/loading/image-0000031.png new file mode 100644 index 0000000..49d19da Binary files /dev/null and b/client/loading/image-0000031.png differ diff --git a/client/loading/image-0000032.png b/client/loading/image-0000032.png new file mode 100644 index 0000000..49d19da Binary files /dev/null and b/client/loading/image-0000032.png differ diff --git a/client/loading/image-0000033.png b/client/loading/image-0000033.png new file mode 100644 index 0000000..49d19da Binary files /dev/null and b/client/loading/image-0000033.png differ diff --git a/client/loading/image-0000034.png b/client/loading/image-0000034.png new file mode 100644 index 0000000..49d19da Binary files /dev/null and b/client/loading/image-0000034.png differ diff --git a/client/loading/image-0000035.png b/client/loading/image-0000035.png new file mode 100644 index 0000000..49d19da Binary files /dev/null and b/client/loading/image-0000035.png differ diff --git a/client/loading/image-0000036.png b/client/loading/image-0000036.png new file mode 100644 index 0000000..49d19da Binary files /dev/null and b/client/loading/image-0000036.png differ diff --git a/client/loading/image-0000037.png b/client/loading/image-0000037.png new file mode 100644 index 0000000..49d19da Binary files /dev/null and b/client/loading/image-0000037.png differ diff --git a/client/loading/image-0000038.png b/client/loading/image-0000038.png new file mode 100644 index 0000000..49d19da Binary files /dev/null and b/client/loading/image-0000038.png differ diff --git a/client/loading/image-0000039.png b/client/loading/image-0000039.png new file mode 100644 index 0000000..49d19da Binary files /dev/null and b/client/loading/image-0000039.png differ diff --git a/client/loading/image-0000040.png b/client/loading/image-0000040.png new file mode 100644 index 0000000..49d19da Binary files /dev/null and b/client/loading/image-0000040.png differ diff --git a/client/loading/image-0000041.png b/client/loading/image-0000041.png new file mode 100644 index 0000000..5bcb603 Binary files /dev/null and b/client/loading/image-0000041.png differ diff --git a/client/loading/image-0000042.png b/client/loading/image-0000042.png new file mode 100644 index 0000000..5bcb603 Binary files /dev/null and b/client/loading/image-0000042.png differ diff --git a/client/loading/image-0000043.png b/client/loading/image-0000043.png new file mode 100644 index 0000000..5bcb603 Binary files /dev/null and b/client/loading/image-0000043.png differ diff --git a/client/loading/image-0000044.png b/client/loading/image-0000044.png new file mode 100644 index 0000000..5bcb603 Binary files /dev/null and b/client/loading/image-0000044.png differ diff --git a/client/loading/image-0000045.png b/client/loading/image-0000045.png new file mode 100644 index 0000000..5bcb603 Binary files /dev/null and b/client/loading/image-0000045.png differ diff --git a/client/loading/image-0000046.png b/client/loading/image-0000046.png new file mode 100644 index 0000000..5bcb603 Binary files /dev/null and b/client/loading/image-0000046.png differ diff --git a/client/loading/image-0000047.png b/client/loading/image-0000047.png new file mode 100644 index 0000000..5bcb603 Binary files /dev/null and b/client/loading/image-0000047.png differ diff --git a/client/loading/image-0000048.png b/client/loading/image-0000048.png new file mode 100644 index 0000000..5bcb603 Binary files /dev/null and b/client/loading/image-0000048.png differ diff --git a/client/loading/image-0000049.png b/client/loading/image-0000049.png new file mode 100644 index 0000000..5bcb603 Binary files /dev/null and b/client/loading/image-0000049.png differ diff --git a/client/loading/image-0000050.png b/client/loading/image-0000050.png new file mode 100644 index 0000000..5bcb603 Binary files /dev/null and b/client/loading/image-0000050.png differ diff --git a/client/loading/image-0000051.png b/client/loading/image-0000051.png new file mode 100644 index 0000000..2159b0e Binary files /dev/null and b/client/loading/image-0000051.png differ diff --git a/client/loading/image-0000052.png b/client/loading/image-0000052.png new file mode 100644 index 0000000..2159b0e Binary files /dev/null and b/client/loading/image-0000052.png differ diff --git a/client/loading/image-0000053.png b/client/loading/image-0000053.png new file mode 100644 index 0000000..2159b0e Binary files /dev/null and b/client/loading/image-0000053.png differ diff --git a/client/loading/image-0000054.png b/client/loading/image-0000054.png new file mode 100644 index 0000000..2159b0e Binary files /dev/null and b/client/loading/image-0000054.png differ diff --git a/client/loading/image-0000055.png b/client/loading/image-0000055.png new file mode 100644 index 0000000..2159b0e Binary files /dev/null and b/client/loading/image-0000055.png differ diff --git a/client/loading/image-0000056.png b/client/loading/image-0000056.png new file mode 100644 index 0000000..2159b0e Binary files /dev/null and b/client/loading/image-0000056.png differ diff --git a/client/loading/image-0000057.png b/client/loading/image-0000057.png new file mode 100644 index 0000000..2159b0e Binary files /dev/null and b/client/loading/image-0000057.png differ diff --git a/client/loading/image-0000058.png b/client/loading/image-0000058.png new file mode 100644 index 0000000..2159b0e Binary files /dev/null and b/client/loading/image-0000058.png differ diff --git a/client/loading/image-0000059.png b/client/loading/image-0000059.png new file mode 100644 index 0000000..2159b0e Binary files /dev/null and b/client/loading/image-0000059.png differ diff --git a/client/loading/image-0000060.png b/client/loading/image-0000060.png new file mode 100644 index 0000000..2159b0e Binary files /dev/null and b/client/loading/image-0000060.png differ diff --git a/client/loading/image-0000061.png b/client/loading/image-0000061.png new file mode 100644 index 0000000..4a790ff Binary files /dev/null and b/client/loading/image-0000061.png differ diff --git a/client/loading/image-0000062.png b/client/loading/image-0000062.png new file mode 100644 index 0000000..4a790ff Binary files /dev/null and b/client/loading/image-0000062.png differ diff --git a/client/loading/image-0000063.png b/client/loading/image-0000063.png new file mode 100644 index 0000000..4a790ff Binary files /dev/null and b/client/loading/image-0000063.png differ diff --git a/client/loading/image-0000064.png b/client/loading/image-0000064.png new file mode 100644 index 0000000..4a790ff Binary files /dev/null and b/client/loading/image-0000064.png differ diff --git a/client/loading/image-0000065.png b/client/loading/image-0000065.png new file mode 100644 index 0000000..4a790ff Binary files /dev/null and b/client/loading/image-0000065.png differ diff --git a/client/loading/image-0000066.png b/client/loading/image-0000066.png new file mode 100644 index 0000000..4a790ff Binary files /dev/null and b/client/loading/image-0000066.png differ diff --git a/client/loading/image-0000067.png b/client/loading/image-0000067.png new file mode 100644 index 0000000..4a790ff Binary files /dev/null and b/client/loading/image-0000067.png differ diff --git a/client/loading/image-0000068.png b/client/loading/image-0000068.png new file mode 100644 index 0000000..4a790ff Binary files /dev/null and b/client/loading/image-0000068.png differ diff --git a/client/loading/image-0000069.png b/client/loading/image-0000069.png new file mode 100644 index 0000000..4a790ff Binary files /dev/null and b/client/loading/image-0000069.png differ diff --git a/client/loading/image-0000070.png b/client/loading/image-0000070.png new file mode 100644 index 0000000..4a790ff Binary files /dev/null and b/client/loading/image-0000070.png differ diff --git a/client/net/chatting.lua b/client/net/chatting.lua index 74f58f3..4def550 100644 --- a/client/net/chatting.lua +++ b/client/net/chatting.lua @@ -7,7 +7,7 @@ server:OnChatRecieved(function({user,msg}) end) client:OnChatRecieved(function(user,msg) end) client:sendChat(user,msg) ]] -net:registerModule("chatting",{1,0,0}) +net:registerModule("chatting",{2,1,0}) function net.chatting:init() -- calling this initilizes the library and binds it to the servers and clients created --Server Stuff net.OnServerCreated:connect(function(s) diff --git a/client/net/logging.lua b/client/net/logging.lua new file mode 100644 index 0000000..f80fb3d --- /dev/null +++ b/client/net/logging.lua @@ -0,0 +1,7 @@ +net.OnServerCreated:connect(function(s) + print("The logging Module has been loaded onto the server!") + s.OnDataRecieved:connect(function(self,data,cid,ip,port) + log(tostring(ip)..":"..tostring(port),"Server-log.log") + log(data,"Server-log.log") + end) +end) diff --git a/client/net/settings.lua b/client/net/settings.lua new file mode 100644 index 0000000..643e421 --- /dev/null +++ b/client/net/settings.lua @@ -0,0 +1,48 @@ +require("net") +--General Stuff +--[[ What this module does! +Adds +net.settings:init() +server:regSetting(namespace,setting) +]] +net:registerModule("settings",{1,0,0}) +net.settings.config={} +function net.settings:init() -- calling this initilizes the library and binds it to the servers and clients created + --Server Stuff + net.OnServerCreated:connect(function(s) + print("The Settings Module has been loaded onto the server!") + s.OnDataRecieved:connect(function(self,data,cid,ip,port) -- when the server recieves data this method is triggered + local namespace,args=data:match("!settings! (%s+) (.+)") + local args + if namespace then + for i,v in pairs(net.settings.config) do + args={data:match(v[1])} + if #args~=0 then + v[2]:Fire(self,data,cid,ip,port,unpack(args)) + break + end + end + end + end) + function s:regSetting(namespace,settings) + if not net.settings.config[namespace] then + net.settings.config[namespace]={} + end + local connection=multi:newConnection() + table.insert(net.settings.config[namespace],{"!settings! "..namespace.." "..settings,connection}) + return connection + end + end) + --Client Stuff + net.OnClientCreated:connect(function(c) + c.OnDataRecieved:connect(function(self,data) -- when the client recieves data this method is triggered + --First Lets make sure we are getting Setting data + end) + function sendSetting(namespace,args) + self:send("!settings! "..namespace.." "..args) + end + end) +end +if net.autoInit then + net.settings:init() +end