You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I decided to make a console application that simplifies handling the API, decided not to take the source code, but to overlay it on top.
I decided to just run it .exe by passing the startup arguments there.
private static Process StartMCC(string nick)
{
// Проверяем, что компилятор существует
string compilerPath = PathHelper.GetCompilerPath(0);
if (!File.Exists(compilerPath))
{
Console.WriteLine($"[Launcher] {compilerPath} не найден.");
return null;
}
try
{
// Аргументы по порядку: логин, пароль (-), сервер (берётся из .ini, поэтому пропускаем), команда
string arguments = $"{nick} - /script {ScriptName}";
Console.WriteLine($"[Launcher] Аргументы: {arguments}");
var psi = new ProcessStartInfo
{
FileName = compilerPath,
Arguments = arguments,
UseShellExecute = true, // Запуск через оболочку, как при ручном запуске
WorkingDirectory = PathHelper.DirecDir()
};
Process proc = Process.Start(psi);
if (proc != null)
{
Console.WriteLine($"[Launcher] ✓ Запущен PID={proc.Id}, ник={nick}");
return proc;
}
else
{
Console.WriteLine($"[Launcher] Ошибка: Process.Start вернул null для {nick}");
return null;
}
}
catch (Exception ex)
{
Console.WriteLine($"[Launcher] Ошибка запуска: {ex.Message}");
return null;
}
}
When running manually, everything works, but when running through the method above, the bot refuses to connect.
"
Вы выбрали запуск в автономном режиме.
Получение информации о сервере...
System.Net.Sockets.SocketException: Сделана попытка доступа к сокету методом, запрещенным правами доступа. [::ffff:50.114.4.222]:25565
Сервер не сообщает версию своего протокола, автоопределение не работает.
Не удалось выполнить ping этого IP.
Ожидание 3 секунд перед перезапуском...
"
This is what the console outputs when running through StartMCC
(I'm from Russia, the console log is in Russian)
I asked the AI, and he claims that in the case of the method, he is trying to open an IPv4 address using the IPv6 protocol (if I understood correctly). But IPv6 is not even enabled in my router settings, and the ini file does not contain anything about IPv4 and IPv6.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I decided to make a console application that simplifies handling the API, decided not to take the source code, but to overlay it on top.
I decided to just run it .exe by passing the startup arguments there.
When running manually, everything works, but when running through the method above, the bot refuses to connect.
"
Вы выбрали запуск в автономном режиме.
Получение информации о сервере...
System.Net.Sockets.SocketException: Сделана попытка доступа к сокету методом, запрещенным правами доступа. [::ffff:50.114.4.222]:25565
Сервер не сообщает версию своего протокола, автоопределение не работает.
Не удалось выполнить ping этого IP.
Ожидание 3 секунд перед перезапуском...
"
This is what the console outputs when running through StartMCC
(I'm from Russia, the console log is in Russian)
I asked the AI, and he claims that in the case of the method, he is trying to open an IPv4 address using the IPv6 protocol (if I understood correctly). But IPv6 is not even enabled in my router settings, and the ini file does not contain anything about IPv4 and IPv6.
All reactions