-
-
Notifications
You must be signed in to change notification settings - Fork 534
Ability to launch a secondary client #4574
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
Yes i saw but that looks unfinished or idk whats with that now. Isn't merged, has no update since june. |
|
How about running an unlimited number of clients? Or maybe up to 5-10? |
I think it’s doable if we completely scrap this whole “mutex” and “GUID” thing. Although for such a step, feedback from the MTA leadership would also be necessary. |
Client/loader/Utils.cpp
Outdated
| // Don't report GTA as running if CL2 is active (to allow coexistence) | ||
| HANDLE hCL2Mutex = OpenMutexA(SYNCHRONIZE, FALSE, MTA_GUID_CL2); | ||
| if (hCL2Mutex) | ||
| { | ||
| CloseHandle(hCL2Mutex); | ||
| return false; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should abstract this to a common IsSecondaryClientRunning
| /////////////////////////////////////////////////////////////// | ||
| void CServerIdManagerImpl::StaticSaveServerIdMap() | ||
| { | ||
| CXMLFile* pConfigFile = g_pCore->GetXML()->CreateXML(PathJoin(g_pClientGame->GetFileCacheRoot(), MTA_SERVERID_LOOKUP_XML)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non-blocking, we can address this in a future PR -- what if we just change the GetFileCacheRoot to return a different directory for cl2?
| if (CCore::GetSingleton().IsSecondaryClient()) | ||
| return; | ||
|
|
||
| #ifdef MTA_CL2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think we can remove these checks too in CVersionUpdater since is blocked already with CCore::GetSingleton().IsSecondaryClient
@qaisjp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or we need this?
#ifdef MTA_CL2
// Don't allow update if CL2 is running
HANDLE hCL2Mutex = OpenMutexA(SYNCHRONIZE, FALSE, "Global\\{4962AF5F-5D82-412D-9CCA-AB8BB9DBD354}");
if (hCL2Mutex)
{
CloseHandle(hCL2Mutex);
return;
}
#endifThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to check both IsSecondaryClient and IsSecondaryClientRunning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, but here is a small typo, AB8BB9DBD354 and you changed in Utils to AB8BB9DBD352 as i see
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah good point
Closes #3970, #3860
This PR allows you to launch a secondary client. Similar to FiveM, it can be accessed using the “-cl2” command line argument.
The secondary client uses its own configuration files and resource cache, avoiding any conflicts. Your serial remains the same, nothing changes there.
To use it, you need to disable the double-serial check in mtaserver.conf.
From a development perspective, if you have two monitors, it can be extremely helpful to test things like synchronization even before potentially publishing a script.
You can also be in two places at the same time, which is an advantage when working with multiple servers.
I hope this feature can be included, and that MTA server developers will be able to make use of the potential it offers.
Please let me know if you have any requests or ideas related to the change, and I’ll do my best to accommodate them.