Game daemon - WINDOWS version

  

Game daemon - WINDOWS version, is written with VBS, for x86 and Windows
2003 X64 in Windows
2003.

The opening of the game program generally needs to be opened in the specified order. Here, the standard db-gs-gg architecture is taken as an example. The normal opening order is db-gs-gg, if the gg program is hung up. In general, our manual judgment process is to first determine whether the db program is normal, and then determine whether the gs program is normal, there is no problem, and then open the gg program, the script is processed according to the principle of the relationship relationship judgment.

All configuration information is stored in setting.ini

“Description

“Name configuration service or program, name, set to task manager Image name in

“type item configuration needs to be daemoned as S (service) or P (program)

‘the absolute path or service name of the process item configuration program, if The daemon and program are placed in the same directory. The relative path can be configured.

“The related item configuration is (Y)No(N)The associated program

“The log entry configuration log storage path, the default Deamon.log, store daemon directory

[Settings]

Name= EMeditor.exe

= S-type

Process= zhudongfangyu

Related = Y

LOGFILE =

relate_ip item configuration associated program, /service IP, local configurable local host

relate_port item configuration associated program, /The port number of the service currently only supports TCP port

[related]

relate_ip = 192.168.30.109

relate_port = 139

If the association is configured, That is, replace=y, the program will be automatically judged before the program is started. Is normal, use check_tcp, is a third-party judgment tcp port program that will check_tcp.zip the check_tcp.exe on setting.ini the same directory can be.

The main source code of the daemon is as follows:

Continue to the next step when error occurs

path=left (Wscript.ScriptFullName, LEN(Wscript.ScriptFullName)LEN(Wscript.ScriptName ))

‘Defining functions

GetFile(strPath, date contact)

Setting objFSO=CreateObject(“Scripting.FileSystemObject”)< Br>

Set objFile = objFSO.OpenTextFile(strpath 1)

Do it until objFile.AtEndOfStream

strLine = objFile.ReadLine

If INSTR(strLine, date Contact)

GETFILE = strLine

If the last

loop

objFile.Close

End of function

&lsquo ;End of function

Setting ObjFS=CreateObject(“Scripting.FileSystemObject”)

‘Read configuration file

settingfile =“setting.ini”

Name= GETFILE(name of settingfile“)

PTYPE = GETFILE(settingfile,“type=”)

Process = GETFILE(settingfile,“process= ”)

Involved = GETFILE(settingfile,“involved=”)

LOGFILE = GETFILE(settingfile“'s log file=)

RNAME = LCASE (right (name, LEN(name)-5) )

rtype = LCASE (Right (PTYP E, LEN(PTYP E)-5))

rprocess = LCASE (Right (in process, LEN(process)-8 ))

rrelate=right(correlation, LEN(involved)-7)

rlog=right (log, LEN(log)-8)

“ Whether the log directory is set

if rlog =“”, then

rlog“deamon.log”

If the last

determines whether the record exists < Br>

If objFS.fileExists(rlog)= FLASE then

objFS.CreateTextFile(rlog)

Set objNF1 = objFS.OpenTextFile(rlog 8)

Copyright © Windows knowledge All Rights Reserved