Go Back   EQEmulator Home > EQEmulator Forums > General > General::General Discussion

General::General Discussion General discussion about EverQuest(tm), EQEMu, and related topics.
Do not post support topics here.

Reply
 
Thread Tools Display Modes
  #1  
Old 11-25-2010, 07:40 PM
enneract
Fire Beetle
 
Join Date: Nov 2010
Posts: 6
Default Multi-Client utility

I generally play on my laptop with a 64gb SSD, so disk space is at a premium. I also like to play on a couple different servers with different client requirements. As such, I created a small utility which can recursively symlink the files in a directory (not create 'directory junctions'), so that server-specific changes can be made, using a minimum amount of disk space (at most a few MB, instead of 4GB per client install).

For those not in the know, a symlink basically makes your computer think that a single file (stored in a specific space in physical memory), exists in multiple places in logical memory simultaneously. So, if symlinked, C:\Foo.txt and C:\Bar.txt have the same contents, and if you edit Foo.txt, Bar.txt will also be changed. The other consequence is that only 1 file's worth of storage is consumed.

Cleaned it up, here it is.

Command line, usage is
Code:
EQEClone -s <source> -d <destination>
Run the app, it will create the new folder, and symlink the contents. It will create a COPY of eqhosts.txt so that you can use a different login server. Copy over any server-specific alterations you might need, overwriting whatever. Note that EDITING any file that you havent overwritten in the clone folder will also CHANGE THE SOURCE FOLDER'S COPY. Renaming, deleting, etc, will not, though. I don't know what you'd edit besides eqhosts.txt, but keep it in mind.

Your antivirus might not like it due to being a packaged autoit macro. It isn't a virus.

source, for the paranoid for the above reason:

Code:
; Creates symlinked EQ:Titanium install for Project1999

#NoTrayIcon

#include <Array.au3>
#include <File.au3>


$srcName    = ""
$destName   = ""
readCmdLineParams()

If NOT FileExists($destName) Then
	DirCreate($destName)	
EndIf

getFileList($srcName)
ConsoleWrite("Directory cloning complete")

Func getFileList($folderName)
 Local $fileArray, $i, $fullFilePath, $fileAttributes

 $fileArray = _FileListToArray($folderName)

 For $i=1 To $fileArray[0]
	$fullFilePath = $folderName & "\" & $fileArray[$i] ;retrieve the full path
	$tempName     = StringReplace($fullFilePath, $srcName, $destName)
	$fileAttributes = FileGetAttrib($fullFilePath)
	If StringInStr($fileAttributes,"D") Then ;folder, have to explore
		ConsoleWrite("FOLDER - " & $fullFilePath & @CRLF)
		IF NOT FileExists($destname & "\" & $fileArray[$i]) Then
			DirCreate($tempName)
		EndIf
		getFileList($fullFilePath) ;recursive call
	ElseIf $fileArray[$i] = "eqhost.txt" Then
		ConsoleWrite("Skipping EQHosts.txt")
		FileCopy($fullFilePath, $tempName)
	Else ;file
		ConsoleWrite("FILE - " & $fullFilePath & @CRLF)
		ShellExecute("cmd" , "/c mklink /H " & $tempName & " " & $fullFilePath, "", "", @SW_HIDE)
	EndIf
 Next
EndFunc

Func readCmdLineParams() 	;Read in the optional switch set in the users profile and set a variable - used in case selection
 
	;;Loop through every arguement
	;;$cmdLine[0] is an integer that is eqaul to the total number of arguements that we passwed to the command line
	for $i = 1 to $cmdLine[0]
 
		select
			;;If the arguement equal -h
			case $CmdLine[$i] = "-s"
				;check for missing argument
				if $i == $CmdLine[0] Then cmdLineHelpMsg()
 
				;Make sure the next argument is not another paramter
				if StringLeft($cmdline[$i+1], 1) == "-" Then
					cmdLineHelpMsg()
				Else
					;;Stip white space from the begining and end of the input
					;;Not alway nessary let it in just in case
					$srcName = StringStripWS($CmdLine[$i + 1], 3)
				endif
 
			;;If the arguement equal  -b
			case $CmdLine[$i] = "-d"
 
				;check for missing arguement
				if $i == $CmdLine[0] Then cmdLineHelpMsg()
 
				;Make sure the next argument is not another paramter
				if StringLeft($cmdline[$i+1], 1) == "-" Then
					cmdLineHelpMsg()
				Else
					;;Stip white space from the begining and end of the input
					;;Not alway nessary let it in just in case
					$destName = StringStripWS($CmdLine[$i + 1], 3)
				EndIf
 
			;set the -x flag to True
			case $cmdLine[$i] = "-x"
				$flagX = "True"
 
			;set the -y flag to True
			case $cmdLine[$i] = "-y"
				$flagY = "True"
 
		EndSelect
 
	Next
 
	;Make sure required options are set and if not display the Help Message
	if $srcName == "" Or $destName == "" Then
		cmdLineHelpMsg()
	EndIf
 
EndFunc

Func cmdLineHelpMsg()
	ConsoleWrite('EQEmu Directory Cloning tool' & @LF & @LF & _
					'Syntax:' & @tab & 'eqeclone.exe [options]' & @LF & @LF & _
					'Default:' & @tab & 'Display help message.' & @LF & @LF & _
					'Required Options:' & @LF & _
					'-s [message]' & @tab & ' Source Folder' & @LF & _
					'-d [message]' & @tab & ' Destination Folder' & @LF)
	Exit
EndFunc
Reply With Quote
  #2  
Old 11-27-2010, 01:31 PM
steve
Discordant
 
Join Date: Jan 2002
Posts: 305
Default

Nice! I've been looking for something like this.

Does this work with Windows 7? Can this be used on Live installs? So I can have a LiveEQ, TestEQ, and BetaEQ folder, with just the changed contents?
Reply With Quote
  #3  
Old 11-27-2010, 01:38 PM
enneract
Fire Beetle
 
Join Date: Nov 2010
Posts: 6
Default

It probably ONLY works on windows 7. It might work on Vista too, but not sure.

As for working on live installs... Maybe? I don't know, I haven't tested it. The patcher may or may not bork the original install.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 09:03 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3