Perfect World Dual-Core CPU Fixer (with src ofc)

Posts: 0 Arc User
edited August 2009 in Support Desk
SOURCE CODE AT END OF THE POST TO AVOID ANY FILE DOUBT

Added by darthpanda16 - DISCLAIMER: By using this player's software, please note that you DO SO AT YOUR OWN RISK and PWE claims no responsibility for any damages that could occur to your data, software or hardware.

Hello, I've made a little utility to help people having problems with dual/quad core processors aka all modern CPU's. The program is just a GUI for the following statement found the the FAQ:
I'm having issues with the game speeding up too fast. What can I do?

Please note the following was submitted to us by one of our community users who is a programmer from another online MMO. Use at your own risk.

These steps are for advanced users to help set the Affinity for PWI once, instead of having to set it themselves every time that you want to play. This will also allow users to play the game in Full Screen mode as it does
not require use of the Task Manager to perform during gameplay.

1.) Download imagecfg.exe from
this http://www16.brinkster.com/salvage/thief/imagecfg.zip link.

2.) Extract the file in the systemroot\system32 folder. (The default
directory for this is C:\Windows\system32 If you customized your Windows installation, this may be different..)

3.) Select Start > Run from the Windows Taskbar.

4.) At the Run prompt, type cmd.

5.) This will open the Windows Command Prompt. In the command console, nagivate to the directory in which you installed Perfect World. The default directory for this is C:\Program Files\Perfect World Entertainment\PerfectWorld International\element (If you changed your installation directory, this may be different.)

6.) Once inside that directory, type the following statement and press the Enter key afterwards.
This will set your program to run permanently on only the first processor in a multi-processor PC:
imagecfg -a 0x1 elementclient.exe

7.) You should see the following four lines returned after your press Enter:

elementclient.exe contains no configuration information
elementclient.exe contains a Subsystem Version of 4.0
elementclient.exe updated with the following configuration information:
Processor Affinity Mask: 00000001

8.) Launch the game client, and your problems with the Multi-Processor
support of PWI should be resolved.

Since the links in the FAQ were broken and that the process might be a bit complicated for novice users, i decided to code a simple and effective interface that covers all the patching process. Here's how it looks:
0180-0906-2705-3116_pwi_dc_fixer.bmp

Download here (This is not a virus, the source code is posted below..)

The program is really simple, extract the archive, launch PWI_DC_Fixer.exe then Browse to pw directory, (default=C:\Program Files\Perfect World Entertainment\Perfect World International), it will confirm its the good directory, then click Patch, wait 2 sec and you're done! Click the Play button to launch the game..

To avoid any doubt about the file here's the source code (Delphi 7), youre free to improve it if u wish.
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ComCtrls, StdCtrls, FileCtrl, ShellApi;

type
  TPW2CoreFixer = class(TForm)
    PathEdit: TEdit;
    PW2CoreFixerFrame: TGroupBox;
    ImageCFGMemo: TMemo;
    BrowseBtn: TButton;
    PatchBtn: TButton;
    PlayBtn: TButton;
    procedure BrowseBtnClick(Sender: TObject);
    procedure PatchBtnClick(Sender: TObject);
    procedure PlayBtnClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  PW2CoreFixer: TPW2CoreFixer;

implementation

{$R *.dfm}

procedure TextToTStrings(const List : TStrings; const FileName : String);
begin
  with List do begin
    Clear;
    LoadFromFile(FileName);
  end;
end;

procedure TPW2CoreFixer.BrowseBtnClick(Sender: TObject);
var
  Dir:String;
  DirChecker:String;
begin
  If SelectDirectory('Perfect World International directory', '', Dir) Then PathEdit.Text:=Dir;
  ImageCFGMemo.Lines.Add('Scanning '+Dir+' ...');
  DirChecker := Dir+'\element\'+'elementclient.exe';
  If FileExists(DirChecker) Then ImageCFGMemo.Lines.Add('Successful. Click the Patch button.')
  Else ImageCFGMemo.Lines.Add('Wrong directory. Click the Browse button.');
end;

procedure TPW2CoreFixer.PatchBtnClick(Sender: TObject);
label
EmptyPath;
var
  LogFile0:String;
  LogPath:String;
begin
  If PathEdit.Text = '' Then
    Begin
      ImageCFGMemo.Lines.Add('Click Browse and navigate to the Perfect World International folder.');
      GoTo EmptyPath;
    end;
  ShellExecute(Handle, 'open', PChar('cmd.exe'), PChar(' /k copy IMAGECFG.EXE %systemroot%\system32\IMAGECFG.EXE && imagecfg -a 0x1 '+'"'+PathEdit.Text+'\element\elementclient.exe'+'"'+' > tmp0.log'), nil, SW_HIDE);
  LogPath := ExtractFilePath(Application.ExeName)+'tmp0.log';
  While not FileExists(LogPath) Do
    Begin
      ImageCFGMemo.Lines.Text := 'Patching elementclient.exe ...';
    end;
  LogFile0 := 'tmp0.log';
  sleep(1000);
  TextToTStrings(ImageCFGMemo.Lines, LogFile0);
  ImageCFGMemo.Lines.Add('');
  ImageCFGMemo.Lines.Add('Patching process done. Click the Play button.');
  DeleteFile(LogPath);
  EmptyPath:
end;

procedure TPW2CoreFixer.PlayBtnClick(Sender: TObject);
label
EmptyPath;
begin
  If PathEdit.Text = '' Then
    Begin
      ImageCFGMemo.Lines.Add('Click Browse and navigate to the Perfect World International folder.');
      GoTo EmptyPath;
    end;
ShellExecute(Handle, 'open', PChar('"'+PathEdit.Text+'\patcher\patcher.exe'+'"'), nil, nil, SW_SHOWNORMAL) ;
EmptyPath:
end;

end.

Please post any bug or feedback in this topic. thx !
Post edited by b0rgy2k9 on

Welcome!

It looks like you're new here. Sign in or register to get started.

Comments

  • Posts: 197 Arc User
    edited June 2009
    havent checked it out myself considering I don't have that issue with my dual core machine, but that got me interesting in writing some more command lines. I think you'll be surprised how easy it can be to extrapolate the location of the games installation and run that necessary command through just the console. check it out:
    for /f "tokens=1,2 delims=:" %a in ('dir /s elementclient.exe ^| findstr "Directory"') do @set elementpath=%b
    cd %elementpath%
    imagecfg -a 0x1 elementclient.exe
    

    this of course assumes the commands are executed from the drive on which the game is installed. ie.. if the game is installed on D drive and the command is executed from C drive - it wont find the game. that can be executed as a batch file as well by doubling the % signs on the a and b tokens. i may look into a regquery command to see about extracting the exact install root from there (if present in the registry).

    anyhow, I have no clue how to read your code that you used since I'm not familiar with it - but it looks like you give the user the option to browse for the install location.
    I'm a man
  • Posts: 0 Arc User
    edited June 2009
    Thx for looking at the program mate, yes of course the user is given the choice to browse for his pwi installation directory, just try the program youll see for yourself, btw this is Delphi code not simple Batch, if you want to compile it you need a Delphi compiler Turbo Pascal is a free one. Youre right this can be done really easily with a VBS/BATCH script, but i kinda like make GUI programs and this one's not totally useless since you can define where the pwi folder is, and it autochecks if its the right directory.
  • Posts: 9,471 Arc User
    edited June 2009
    We will have our engineers look into this, and I will pass it along to those that can approve and check it out too. Thanks! b:pleased

    Disclaimer: please note PWE does not officially support any outside modifications to our games. You do so at your own risk!
    Do you need help learning about patching the game, installing it, changing antivirus/firewall settings, changing network settings, learn how to use a computer, keeping your PC maintained and more?
    Visit our BRAND NEW Knowledge Base & Support Website! - Tech Support Flowchart - Panda Caught on Camera
  • Posts: 0 Arc User
    edited July 2009
    thx darthpanda, it might be useful for those who are lazy guys b:chuckle
  • Posts: 0 Arc User
    edited August 2009
    Hi, link to dl the program is dead, sucky rapidshare :D btw one can download PWI d/c fixer at www.b0rgy2k9.tk
  • Posts: 0 Arc User
    edited August 2009
    Yeah, my game just RECENTLY started doing this. Do you think you could re-upload the fix? RapidShare seems to have decided it wants to hate on all of us. :/

    Thank you for the fix, though. ♥

    [EDIT] Neeevermind, thanks for puttin' it on your site. ♥
    And another Edit: It keeps freezing on me whenever I try to use it. :/ any suggestions?
  • Posts: 0 Arc User
    edited August 2009
    this is weird, it worked for me. I'm using winXP tho, if you use vista try running it in admin mode, since it copies the imagecfg.exe file to system32 also does it freeze at start or when you click patch?
    edit: uh wait are you speaking about the program or the game ?
  • Posts: 0 Arc User
    edited August 2009
    Was talking about the program, but I did manage to get the game to work the way it normally does. :] Thank you!
  • Posts: 25 Arc User
    edited August 2009
    ever since I used this..
    to see if it worked or not, everytime I try to check the affinity of Elementclient.exe it says access denied

    any idea on why this is happening?
  • Posts: 3,378 Perfect World Employee
    edited August 2009
    If you're using a limited user account or have UAC turned on in Windows Vista, it will not allow you to change the affinity settings.
    ==/Senior QA Lead/==

    Surtr from the south wielding fire
    The gods' swords shine in the darkness, like stars in the night
    Mountains collapse into rubble and fiends shall fall
    Man walks the road to ruin as the sky splits in two

  • Posts: 9,471 Arc User
    edited August 2009
    I put the disclaimer on here for the business side of things. If it works well for some of you guys, great! b:pleased
    Do you need help learning about patching the game, installing it, changing antivirus/firewall settings, changing network settings, learn how to use a computer, keeping your PC maintained and more?
    Visit our BRAND NEW Knowledge Base & Support Website! - Tech Support Flowchart - Panda Caught on Camera
This discussion has been closed.