Commit 5d39163e authored by mercury233's avatar mercury233 Committed by nanahira

update

parent a307a522
...@@ -1018,10 +1018,10 @@ void Game::RefreshBot() { ...@@ -1018,10 +1018,10 @@ void Game::RefreshBot() {
if(linebuf[0] == '!') { if(linebuf[0] == '!') {
BotInfo newinfo; BotInfo newinfo;
sscanf(linebuf, "!%240[^\n]", strbuf); sscanf(linebuf, "!%240[^\n]", strbuf);
BufferIO::DecodeUTF8(strbuf, newinfo.internalname); BufferIO::DecodeUTF8(strbuf, newinfo.name);
fgets(linebuf, 256, fp); fgets(linebuf, 256, fp);
sscanf(linebuf, "%240[^\n]", strbuf); sscanf(linebuf, "%240[^\n]", strbuf);
BufferIO::DecodeUTF8(strbuf, newinfo.name); BufferIO::DecodeUTF8(strbuf, newinfo.command);
fgets(linebuf, 256, fp); fgets(linebuf, 256, fp);
sscanf(linebuf, "%240[^\n]", strbuf); sscanf(linebuf, "%240[^\n]", strbuf);
BufferIO::DecodeUTF8(strbuf, newinfo.desc); BufferIO::DecodeUTF8(strbuf, newinfo.desc);
......
...@@ -75,8 +75,8 @@ struct DuelInfo { ...@@ -75,8 +75,8 @@ struct DuelInfo {
}; };
struct BotInfo { struct BotInfo {
wchar_t internalname[256];
wchar_t name[32]; wchar_t name[32];
wchar_t command[256];
wchar_t desc[256]; wchar_t desc[256];
int flag; int flag;
}; };
......
...@@ -257,7 +257,9 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) { ...@@ -257,7 +257,9 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
si.cb = sizeof(si); si.cb = sizeof(si);
ZeroMemory(&pi, sizeof(pi)); ZeroMemory(&pi, sizeof(pi));
LPTSTR cmd = new TCHAR[MAX_PATH]; LPTSTR cmd = new TCHAR[MAX_PATH];
myswprintf(cmd, L"Bot.exe \"%s\" %d %d", mainGame->botInfo[sel].internalname, (mainGame->chkBotHand->isChecked() ? 1 : 0), mainGame->gameConf.serverport); int flag = 0;
flag += (mainGame->chkBotHand->isChecked() ? 0x1 : 0);
myswprintf(cmd, L"Bot.exe \"%ls\" %d %d", mainGame->botInfo[sel].command, flag, mainGame->gameConf.serverport);
if(!CreateProcess(NULL, cmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) if(!CreateProcess(NULL, cmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
{ {
NetServer::StopServer(); NetServer::StopServer();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment