Comments (12)
Заменил функцию const char *Game::getRunningModName
на такое
String Game::GetCurrentWorkingDirectory()
{
auto getDirPath = [&] (String &args) {
size_t slash = args.findLastOf ("\\/");
if (slash != String::InvalidIndex) {
args = args.substr (0, slash + 1);
}
// args = args.trim (" \\/");
return args;
};
String dir;
#ifdef _WIN32
char baseDirBuf[255];
char moduleDirBuf[255];
HMODULE hModule = nullptr;
GetModuleFileName(hModule, baseDirBuf, sizeof baseDirBuf);
GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, (LPCTSTR)product.name.chars(), &hModule);
GetModuleFileName(hModule, moduleDirBuf, sizeof moduleDirBuf);
String baseDir (baseDirBuf);
baseDir=getDirPath(baseDir.lowercase());
String moduleDir (moduleDirBuf);
moduleDir=getDirPath(moduleDir.lowercase());
logger.error("baseDir %s", baseDir.chars());
logger.error("moduleDir %s", moduleDir.chars());
dir.assign((moduleDir.substr(baseDir.length())));
dir=dir.substr(0,dir.findFirstOf("\\/"));
logger.error("CWD %s", dir.chars());
#else
... тут __linux__ версия ...
#endif
return dir;
}
Боты установлены как cstrike_addon\yapb\bin\yapb.dll
Теперь при запуске CS создаются файлы в cstrike_addon\addon\yapb\{data,conf}
что не совсем правильно :( Тут файлы должны создаваться относительно ..\bin\yapb.dll
Буду думать дальше.
Так же игра не может запуститься тк не может найти cstrike_addon\dlls\mp.dll
В общем патч должен быть более глубоким, необходим класс который будет проверять запрашиваемые файлы в cstrike_addon и делать fallback на cstrike.
Тк файлы запрашиваются через Game::getRunningModName
а далее join, exists и прочее, то переделывать почти все запросы к файлам.
from yapb.
On Android the library is stored in this path:
/data/app/package.name/lib/cpu_arch/libyapb.so
Where package.name is the package name of Android app.
And cpu_arch is a folder with the name of CPU architecture (arm, arm64, x86 etc.)
And after this commit, the YaPB compiled for Android in the CS16Client launcher cannot load configs, download or save graphs.
It's trying to download or save autogenerated graphs to lib folder which is read-only.
from yapb.
Сейчас если установить в Half-Life\cstrike_addon\addons\yapb
то боты принудительно создают как минимум Half-Life\cstrike\addons\yapb\{conf,data}
from yapb.
Should work with latest commit.
from yapb.
Bot is almost unusable when in symlinks on linux, needs a better way...
from yapb.
.. and loading configs and other things works just fine ?
from yapb.
.. and loading configs and other things works just fine ?
Нет, я же написал что конфиги тоже не грузятся.
Меню только на английском языке, и в консоли пишется что не удалось загрузить конфиги, используются стандартные захардкоденные значения.
Из-за этого бот вообще не пригоден к игре, ничего толком не работает нормально.
from yapb.
Для андроида может надо вернуть загрузку кофигов и графов с папки gamedir/addons/yapb? Т.к. там саму библиотеку бота всё равно никуда невозможно переставить.
Она может хранится только в одном конкретном недоступном для пользователя месте (различие только в названиях папок под разные архитектуры процессора), в отличие от винды или линукса, где пользователь может сам переименовать папку где находится .dll/.so библиотека бота.
from yapb.
И да, я это проверял на своём кастомном билде CS16Client, где я обновил YaPB.
В репозитории от Velaron пока ещё находится CS16Client со старым билдом бота.
from yapb.
да, для андройда realtive-location не подходит.
from yapb.
можешь проверить на последнем коммите ? честно-гвооря не тестировал.
from yapb.
можешь проверить на последнем коммите ? честно-гвооря не тестировал.
Всё работает. Конфиги и графы грузятся успешно, боты присоедняются к игре.
from yapb.
Related Issues (20)
- [Feature request] yb_difficulty_auto only for the team with humans
- [Feature request] Bots switch team option
- Bot chatter, some bugs HOT 4
- Бот сообщает о том, что он спасает заложников, когда находится на узле с флагом RESCUE и при этом не ведя за собой заложников. HOT 4
- Боты неправильно прыгают HOT 2
- Can't build yapb.so.p/src_message.cpp in Alpine Linux HOT 11
- Block the flashlight on zombie bots HOT 14
- Bots that can hear the enemy but cannot predict the enemy HOT 2
- c4 defuse animation for yapb HOT 2
- При вводе команды yb kill_ct, yb kill ct или yb kill 2, умирают террористы а не КТшники HOT 3
- Failure of enemy predictions in some circumstances HOT 2
- yb_enable_fake_steamids 1 doesn't work HOT 5
- Ошибка в коде? HOT 1
- yb_show_latency also alters player pings HOT 3
- Повышение прозрачности и доверия в отношении ботов HOT 14
- logs bots HOT 6
- [Feature request] Прицеливание ботов на модели с кастомным model index HOT 5
- Bots can't walk up slopes, even small ones have to jump on them. HOT 6
- Боты перестают стрелять из снайперок когда враг находится слишком близко HOT 4
- Последовательность логики у Bot::filterTasks для ZombieMod HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yapb.