Skip to content

Commit

Permalink
Merge pull request #183 from mateusfavarin/main
Browse files Browse the repository at this point in the history
Username from command line arg
  • Loading branch information
mateusfavarin authored Jul 14, 2024
2 parents 7ed0af4 + a414c06 commit 52b4fdc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
29 changes: 15 additions & 14 deletions mods/Windows/OnlineCTR/Network_PC/Client/CL_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
//=============================================================
/*
* Author: TheUbMunster
*
*
* This comment was written for documenting the changes & ideology that PINE implementation
* brings to the table since it replaced direct memory access.
*
Expand Down Expand Up @@ -892,7 +892,7 @@ void StatePC_Launch_PickRoom()
{
countFrame = 0;

// send junk data,
// send junk data,
// this triggers server response
CG_MessageRoom mr;
mr.type = CG_JOINROOM;
Expand Down Expand Up @@ -1228,17 +1228,18 @@ int main(int argc, char *argv[])
MoveWindow(console, r.left, r.top, 800, 480 + 35, TRUE);
SetConsoleOutputCP(CP_UTF8); // force the output to be unicode (UTF-8)

PrintBanner(DONT_SHOW_NAME);

if (argc >= 3)
if (argc == 2)
{
printf("Program was reset due to: %s\n", argv[2]);
memcpy(name, argv[1], strlen(argv[1]));
}
else
{
PrintBanner(DONT_SHOW_NAME);
// ask for the users online identification
printf("Input: Enter Your Online Name: ");
scanf_s("%s", name, (int)sizeof(name));
name[NAME_LEN] = 0; // truncate the name (0 based)
}

// ask for the users online identification
printf("Input: Enter Your Online Name: ");
scanf_s("%s", name, (int)sizeof(name));
name[NAME_LEN] = 0; // truncate the name (0 based)

// show a welcome message
system("cls");
Expand Down Expand Up @@ -1298,7 +1299,7 @@ int main(int argc, char *argv[])
DisconSELECT();

StartAnimation();

// Wait for PSX to have P1 data,
// which is set at octr->sleepControl
void FrameStall(); FrameStall();
Expand Down Expand Up @@ -1338,10 +1339,10 @@ int main(int argc, char *argv[])
// delay GPU between SEND and RECV
if (enableDeferredGPU == 1)
usleep(sleepCount);

// now check for new RECV message
ProcessNewMessages();

// allow PSX to resume
octr.get()->sleepControl = 0;

Expand Down
4 changes: 2 additions & 2 deletions tools/Launcher/ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ void UI::Render(int width, int height)
else
{
g_dataManager.SaveData();
std::string clientCommand = "start /b " + std::filesystem::current_path().string() + "/" + GetClientPath(m_version) + " &";
std::string clientCommand = "start /b " + std::filesystem::current_path().string() + "/" + GetClientPath(m_version) + " " + m_username + " &";
std::system(clientCommand.c_str());
const std::string duckCommand = "start /b " + m_duckPath + " " + s_patchedPath;
const std::string duckCommand = "start /b " + m_duckPath + " " + s_patchedPath + " &";
std::system(duckCommand.c_str());
}
}
Expand Down

0 comments on commit 52b4fdc

Please sign in to comment.