ExtChangeProfile

Change current profile to profile with name ProfileName.

Keep in mind then following:

If the profile is successful, the function returns 0, otherwise returns an error code:

Pascal

function ExtChangeProfile(ProfileName : String;ShardName : String = '';CharName : String = '') : Integer;

Python

ExtChangeProfile(PName, ShardName, CharName): -> integer

Example

function def_Connect(fProfileName, fShardName, fCharName : String) : Integer;
var
  i : Integer;
begin
  Result := -1;
  if Connected and (ShardName <> fShardName) then
    begin
	  Disconnect;
	  Wait(5000);
	end;
  i := ExtChangeProfile(ProfileName, fShardName, fCharName);
  case i of
    -1 : AddToSystemJournal('Internal error connecting to ' + fShardName + ' ' + fCharName);
	-2 : AddToSystemJournal('Char connected error ' + fShardName + ' ' + fCharName);
	-4 : AddToSystemJournal('No such profile found ' + ProfileName + ' ' + fShardName + ' ' + fCharName);
  end;
  
  if i < 0 then
    Exit;
  
  Connect;
end;