Skip to content
This repository has been archived by the owner on Aug 15, 2019. It is now read-only.

Commit

Permalink
Refined debug script.
Browse files Browse the repository at this point in the history
  • Loading branch information
leio zhang committed Feb 14, 2017
1 parent d5b0ad6 commit ea953a4
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 11 deletions.
23 changes: 15 additions & 8 deletions Mod/NplCefBrowser/NplCefBrowserManager.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ function NplCefBrowserManager:ReadNewVersionFromZipFile(zip_filename)
end
-- CheckVersion and unzip cef's dll so that npl could communicate with it.
function NplCefBrowserManager:CheckVersion()
if(self:IsDebug())then
LOG.std(nil, "info", "NplCefBrowserManager", "Debug mode ignored CheckVersion.");
return
end
LOG.std(nil, "info", "NplCefBrowserManager", "UnzipCefDll");
local filename = "Mod/NplCef3.zip";
local cef3_root = "nplcef3/mod/";
Expand Down Expand Up @@ -92,20 +96,23 @@ function NplCefBrowserManager:CheckVersion()

end
end
function NplCefBrowserManager:IsDebug()
local cefdebug = System.os.args("cefdebug", false)
if(cefdebug == "true" or cefdebug == "True" )then
return true;
end
return cefdebug;
end
-- Initialize cef plugin dll.
function NplCefBrowserManager:Init()
self.mRootWindows = {};
local cefroot = System.os.args("cefroot", "Mod/NplCef3/Mod/NplCef3/cef3")
local cefdebug = System.os.args("cefdebug", "false")
self.cefroot = cefroot;
self.is_start = false;
if(cefdebug == "true" or cefdebug == "True" )then
self.plugin_name = self.cefroot .. "/NplCefPlugin_d.dll";
self.process_name = self.cefroot .. "/NplCefProcess_d.exe";
else
self.plugin_name = self.cefroot .. "/NplCefPlugin.dll";
self.process_name = self.cefroot .. "/NplCefProcess.exe";
end

self.plugin_name = cefroot .. "/" .. System.os.args("cef_plugin", "NplCefPlugin.dll");
self.process_name = cefroot .. "/" .. System.os.args("cef_process", "NplCefProcess.exe");

self.default_id = "cef_default_window";

LOG.std(nil, "info", "NplCefBrowserManager", "===========================Init===========================");
Expand Down
1 change: 1 addition & 0 deletions NplCefBrowser.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@
<None Include="Mod\NplCefBrowser\pe_resizeable.lua" />
<None Include="Mod\NplCefBrowser\ResizeableControl.lua" />
<None Include="Mod\NplCefBrowser\test_nplcef_window.lua" />
<None Include="Run_debug.bat" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
Expand Down
1 change: 1 addition & 0 deletions NplCefBrowser.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,6 @@
<None Include="Mod\NplCefBrowser\pe_resizeable.lua">
<Filter>Mod\NplCefBrowser</Filter>
</None>
<None Include="Run_debug.bat" />
</ItemGroup>
</Project>
6 changes: 3 additions & 3 deletions NplCefBrowser.vcxproj.user
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LocalDebuggerCommand>F:\pe_git\ParaCraftSDK\redist\paraengineclient.exe</LocalDebuggerCommand>
<LocalDebuggerCommandArguments>mc="true" dev="$(SolutionDir)" mod="NplCefBrowser" isDevEv="true" world="worlds/DesignHouse/test" cefroot="../_mod/NplCefBrowser/cef3"</LocalDebuggerCommandArguments>
<LocalDebuggerWorkingDirectory>..\..\redist</LocalDebuggerWorkingDirectory>
<LocalDebuggerCommand>$(ProjectDir)..\..\redist\ParaEngineClient.exe</LocalDebuggerCommand>
<LocalDebuggerCommandArguments>mc="true" dev="$(SolutionDir)" mod="NplCefBrowser" isDevEv="true" cefroot="../_mod/NplCefBrowser/cef3" cefdebug="true" cef_plugin="NplCefPlugin.dll" cef_process="NplCefProcess.exe"</LocalDebuggerCommandArguments>
<LocalDebuggerWorkingDirectory>../../redist</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
</Project>
10 changes: 10 additions & 0 deletions Run_debug.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

@echo off
pushd "%~dp0../../redist/"
rem @param world:default paracraft world for test application immediately,if this world is not exist,please create it first.
rem @param cefroot:the dll path of cef.
rem @param cefdebug:if true we will ignore check version.
rem @param cef_plugin:the name of cef plugin.
rem @param cef_process:the name of cef process.
call "ParaEngineClient.exe" mc="true" dev="%~dp0" mod="NplCefBrowser" isDevEv="true" world="worlds/DesignHouse/test" cefroot="../_mod/NplCefBrowser/cef3" cefdebug="true" cef_plugin="NplCefPlugin.dll" cef_process="NplCefProcess.exe"
popd

0 comments on commit ea953a4

Please sign in to comment.