Skip to content

Commit a10f30f

Browse files
committed
slight improvement to auto-login detection
auto-login detection is slightly better but still odd, best to not use it
1 parent c1519c8 commit a10f30f

2 files changed

Lines changed: 65 additions & 19 deletions

File tree

FFXI-Launcher.cpp

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -525,24 +525,7 @@ void launchAccount(const AccountConfig& account, const GlobalConfig& config) {
525525
std::cerr << "Failed to read login_w.bin, using default slot selection\n";
526526
}
527527

528-
// Check for auto-login status
529-
std::ifstream loginWFile(polPath + "\\usr\\all\\login_w.bin", std::ios::binary);
530-
bool autoLoginEnabled = false;
531-
if (loginWFile) {
532-
loginWFile.seekg(0x6F);
533-
unsigned char autoLoginValue;
534-
loginWFile.read(reinterpret_cast<char*>(&autoLoginValue), 1);
535-
autoLoginEnabled = (autoLoginValue != 0x00);
536-
537-
// If auto-login is enabled, check if the slot matches
538-
if (autoLoginEnabled && loginWValue != -1 && loginWValue != account.slot) {
539-
std::cout << "\nWARNING: Auto-login is enabled for slot " << loginWValue
540-
<< " but you selected slot " << account.slot << ".\n"
541-
<< "The wrong character may be logged in.\n"
542-
<< "Waiting 5 seconds before continuing...\n";
543-
Sleep(5000);
544-
}
545-
}
528+
546529

547530
// Wait for the window to have a title bar (WS_CAPTION)
548531
int waitTitleBar = 0;
@@ -574,6 +557,31 @@ void launchAccount(const AccountConfig& account, const GlobalConfig& config) {
574557
SetFocus(hwnd);
575558
BringWindowToTop(hwnd);
576559

560+
561+
// Check for auto-login status
562+
std::ifstream loginWFile(polPath + "\\usr\\all\\login_w.bin", std::ios::binary);
563+
bool autoLoginEnabled = false;
564+
if (loginWFile) {
565+
loginWFile.seekg(0x6F);
566+
unsigned char autoLoginValue;
567+
loginWFile.read(reinterpret_cast<char*>(&autoLoginValue), 1);
568+
autoLoginEnabled = (autoLoginValue != 0x00);
569+
570+
// If auto-login is enabled, check if the slot matches
571+
if (autoLoginEnabled && loginWValue != -1 && loginWValue != account.slot) {
572+
std::cout << "\nWARNING: Auto-login is enabled for slot " << loginWValue
573+
<< " but you selected slot " << account.slot << ".\n";
574+
575+
autoLoginEnabled = false;
576+
577+
// Press ESC to cancel auto-login
578+
simulateKey(VK_ESCAPE);
579+
Sleep(1300);
580+
581+
}
582+
}
583+
584+
577585
// Adjust slot selection based on login_w.bin value
578586
if (loginWValue != -1) {
579587
int targetSlot = account.slot;
@@ -916,7 +924,7 @@ void removeHostsEntry() {
916924
// Update main to remove hosts entry before exiting
917925
int main(int argc, char* argv[]) {
918926
std::cout << "Created by: jaku | https://twitter.com/jaku\n";
919-
std::cout << "Version: 0.0.10 | https://github.com/jaku/FFXI-autoPOL\n";
927+
std::cout << "Version: 0.0.12 | https://github.com/jaku/FFXI-autoPOL\n";
920928

921929
// Clean up any existing hosts file entries at startup
922930
removeHostsEntry();

README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,42 @@ If you're on the Phoenix server, my main on there is Jakubowski, just waving hi
106106

107107
---
108108

109+
## Troubleshooting
110+
111+
### Login Issues
112+
113+
- **Partial Character Entry**: If the program only enters some characters of your password, try increasing the delay in your configuration. Start by adding 1-2 seconds at a time until it works reliably.
114+
- **Controller Interference**: Some users have reported that having the controller enabled can cause key entry issues. Try disabling controller support to see if the error persists. (Controller support should work)
115+
- **Auto-Login in POL**: While the program supports auto-login, it's recommended to disable auto-login in the POL window as it can be unreliable. The program will handle the login process more reliably without auto-login.
116+
- **Locked keyboard/mouse**: If the application locks your keyboard and mouse and you can't control it after a long time, you can always press CTRL+ALT+DEL to regain control.
117+
118+
### Linux/Steam Deck Users
119+
120+
If you're using Linux or Steam Deck, you'll need to manually add an entry to your hosts file to get the autoPOL login to fully log you into the game after entering your password:
121+
122+
```bash
123+
sudo echo "127.0.0.1 wh000.pol.com" >> /etc/hosts
124+
```
125+
126+
To remove this entry when you no longer want to use the program:
127+
128+
```bash
129+
sudo sed -i '/wh000.pol.com/d' /etc/hosts
130+
```
131+
132+
Note: While this entry is in your hosts file, you must use this program to log in, or login will fail.
133+
134+
Windows users do not need to do this.
135+
136+
### Reporting Issues
137+
138+
When reporting issues, please include:
139+
- Your version of autoPOL (try to use the latest version)
140+
- Your configuration details (delay settings, etc.)
141+
- Your operating system (Windows/Linux/Steam Deck)
142+
- What you've tried to resolve the issue
143+
- Any error messages you've received
144+
145+
---
146+
109147
Enjoy!

0 commit comments

Comments
 (0)