4 # ifndef _CRT_SECURE_NO_WARNINGS 5 # define _CRT_SECURE_NO_WARNINGS 14 #include "PluginAPI.h" 15 #include "PluginLoader.hpp" 19 #include "INPLRuntime.h" 20 #include "IParaEngineCore.h" 21 #include "IParaEngineApp.h" 23 #include "NPLInterface.hpp" 25 #include "util/Mutex.hpp" 26 #include "util/Semaphore.hpp" 52 ProgressMessage():m_eventType(AUP_NOT_STARTED),m_finishcount(0), m_allcount(0) {};
54 :m_eventType(eventType),m_finishcount(finishcount), m_allcount(allcount)
87 virtual int BeginUpdate(
const std::string& curVersion,
const char* sUpdaterName = NULL) = 0;
135 virtual int BeginUpdate(
const std::string& curVersion,
const char* sUpdaterName = NULL);
159 virtual const std::string& GetName()
const;
164 virtual int activate(
const char * sNPLFilename,
const char* sCode,
int nCodeLength=0,
int priority=2,
int reliability=4);
174 virtual NPLReturnCode Activate_async(
const std::string & filepath,
const char *
code = NULL,
int nLength=0,
int priority=0);
177 virtual NPLReturnCode ActivateLocal(
const char* filepath,
const char *
code = NULL,
int nLength=0,
int priority=0);
185 virtual NPLReturnCode Activate_async(NPLMessage_ptr& msg,
int priority=0);
195 virtual NPLReturnCode SendMessage(NPLMessage_ptr& msg,
int priority=0);
201 virtual int GetCurrentMsgLength();
211 virtual void WriteLog(
const char* text,
int nTextLen=0,
int nLogType = 0);
230 virtual bool SetTimer(
int nIDEvent,
float fElapse,
const char* sNeuronFile) {
return false;};
251 virtual bool ChangeTimer(
int nIDEvent,
int dueTime,
int period) {
return false;};
254 virtual void SetUpdateUrl(
const std::string& updateurl);
255 virtual void RegisterFile(
const char* sFilename,
INPLActivationFile* pFileHandler = NULL);
257 virtual void call(
const char * sNPLFilename,
const char* sCode,
int nCodeLength = 0);
NPL object proxy.
Definition: NPLInterface.hpp:1035
static string GetCurrentMsg(System.IntPtr npl_runtime_state)
Get the current incoming message of a npl_runtime_state.
virtual int BeginUpdate(const std::string &curVersion, const char *sUpdaterName=NULL)=0
start updating the client in the current working directory.
define this to enable debugging of NPL code in visual studio
Definition: INPL.h:9
virtual void ActivateAutoUpdater(const std::string &sMsg)=0
call the auto updater.
INPLRuntimeState interface for DLL interface.
Definition: INPLRuntimeState.h:27
std::queue< ProgressMessage > m_msgs
all messages
Definition: AutoUpdaterClient.h:280
virtual void ApplyPatch()=0
apply the recently downloaded patch
virtual bool PeekUpdaterMessage(ProgressMessage &msg)=0
Peek a progress message from the queue.
const char * m_current_msg
pointer to the current message.
Definition: AutoUpdaterClient.h:260
ParaEngine::CPluginLoader m_auto_updater_plugin
the Auto updater plugin
Definition: AutoUpdaterClient.h:272
a DLL/so plug-in loaded explicitly at runtime.
Definition: PluginLoader.hpp:51
virtual bool ChangeTimer(int nIDEvent, int dueTime, int period)
Changes the start time and the interval between method invocations for a timer, using 32-bit signed i...
Definition: AutoUpdaterClient.h:251
virtual AutoUpdaterProgress WaitForCompletion(IAutoUpdaterCallback *pCallback=0)=0
this function returns until auto updater is finished.
progress message
Definition: AutoUpdaterClient.h:50
cross platform condition variable.
Definition: Semaphore.hpp:21
virtual bool GetUpdaterMessage(ProgressMessage &msg)=0
Get a progress message from the queue.
virtual bool SetTimer(int nIDEvent, float fElapse, const char *sNeuronFile)
creates a timer with the specified time-out value [thread safe]
Definition: AutoUpdaterClient.h:230
cross platform mutex
Definition: Mutex.hpp:88
std::string m_session_dir
the directory where the downloaded core update files are cached.
Definition: AutoUpdaterClient.h:283
Definition: inftrees.h:24
virtual void OnMessageCallback(NPLInterface::NPLObjectProxy &msg)=0
this function is called whenever we receive a message from autoupdater.dll
Definition: INPLAcitvationFile.h:18
progress call back.
Definition: AutoUpdaterClient.h:66
std::string m_updateurl
get update url
Definition: AutoUpdaterClient.h:269
virtual void OnProgress(AutoUpdaterProgress eventType, const char *msg=NULL, int finishcount=0, int allcount=0)=0
This function is called for update progress.
static void activate(System.IntPtr npl_runtime_state, string file_name, string msg)
activate a local or remote file
std::string m_updater_plugin_path
autoupdater.dll file path.
Definition: AutoUpdaterClient.h:287
auto updater interface.
Definition: AutoUpdaterClient.h:31
std::string m_name
the name of this runtime state.
Definition: AutoUpdaterClient.h:266
virtual bool KillTimer(int nIDEvent)
Destroys the specified timer [thread safe].
Definition: AutoUpdaterClient.h:239
NPL Runtime Environment interface.
Definition: INPLRuntime.h:30
std::string m_sApplyPatchMsg
apply patch message
Definition: AutoUpdaterClient.h:285
AutoUpdaterProgress
auto update progress
Definition: AutoUpdaterClient.h:35
CAutoUpdaterClietn also implements a dummy INPL Runtime state, so that it can receive call back from ...
Definition: AutoUpdaterClient.h:117
int m_current_msg_length
length of the current message.
Definition: AutoUpdaterClient.h:263
virtual void ExitUpdater()=0
join all threads and unload dll.
virtual void SetUpdaterDllPath(const char *sDllPath=NULL)=0
set the autoupdater.dll file path