golfsierra2 Posted June 2, 2010 Posted June 2, 2010 I'd like to address this proposal to the lua experts here in this forum (I know, there are some guys familiar with lua here): For the time beeing, the Integrity Check (IC) only compares selected files / folder retrieved from the client with those available at the server side. If both match, nothing happens. If both are different (likely because the client side was modified), the connection will be interupted and the client can not join the server. The workaround found to make this IC acceptable for clients using modified files (usually because of system performance or graphics issues) is, that some units operating servers provide a ModMan compatible Mod which has to be installed before the client can join. Those Mods contain the original game files that have to be installed on the client side in order to pass the IC. Now: The IC routine is called in the main.lua: local scripts_dir = "./Scripts/net/" local config_file= "./Config/network.cfg" package.path = scripts_dir..'?.lua;'..package.path server = require('server') client = require('client') -- load config file local function append(dest, src) local k,v local present = {} for k,v in ipairs(dest) do present[v] = true end for k,v in ipairs(src) do if not present[v] then table.append(dest, v) end end end local function merge(dest, src) local k,v for k,v in pairs(src) do local d = dest[k] if k == "integrity_check" then append(d, v) elseif type(v)=="table" and type(d)=="table" and v[1] == nil then merge(d, v) else dest[k] = v end end end local function load_env(filename, env) local file, err = loadfile(filename) local res = false if file then if env then setfenv(file, env) end res, err = pcall(file) end local msg if res then msg = "OK" else msg = err end log("loading "..filename.." : "..msg) return res, err end My sugesstion is to modify the server side main.lua. It should not only compare one set of client files with the server files, but also give the client a second (third, fourth ?) chance to pass the IC. This could be achieved by adding an "or" case to the IC routine, so that it would look in the standard directories of the server installation and compare those files with the client side, but then in another (and another and so on..) step also compares one ore more additional file sets with the client side. Those extra files should be stored under a dedicated path in a different directory on the server side. Those files will never be called by the server's FC2.0 installation, as it only operates with it's own files, however, one could built a 'library' of known and harmless modified files, which also would be allowed to pass the IC. I'm a lua noob, but this is my first Idea as how the main.lua portion could look like: local scripts_dir = "./Scripts/net/,Scripts2/net/," local config_file= "./Config/network.cfg,./Config2/network.cfg " package.path = scripts_dir..'?.lua;'..package.path server = require('server') client = require('client') -- load config file local function append(dest,src1,src2) local k,v local present = {} for k,v in ipairs(dest) do present[v] = true end for k,v in ipairs(src1) do if not present[v] then for k,v in ipairs(src2) do if not present[v] then table.append(dest, v) end end end local function merge(dest,src) local k,v for k,v in pairs(src1) do local d = dest[k] if k == "integrity_check" then for k,v in pairs(src2) do local d = dest[k] append(d, v) elseif type(v)=="table" and type(d)=="table" and v[1] == nil then merge(d, v) else dest[k] = v end end end local function load_env(filename, env) local file, err = loadfile(filename) local res = false if file then if env then setfenv(file, env) end res, err = pcall(file) end local msg if res then msg = "OK" else msg = err end log("loading "..filename.." : "..msg) return res, err end 1 kind regards, Raven.... [sigpic]http://www.crc-mindreader.de/CRT/images/Birds2011.gif[/sigpic]
Grimes Posted June 2, 2010 Posted June 2, 2010 If it works, I will be very happy. The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
Grimes Posted June 4, 2010 Posted June 4, 2010 anyone with lua knowledge able to comment on this? bueller? bueller? The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
Boberro Posted June 4, 2010 Posted June 4, 2010 IMHO good solution would be add list of files which are wrong and caused IC fail. Then you can revert original files. Reminder: Fighter pilots make movies. Bomber pilots make... HISTORY! :D | Also to be remembered: FRENCH TANKS HAVE ONE GEAR FORWARD AND FIVE BACKWARD :D ಠ_ಠ ツ
Recommended Posts