aim: do not reduce prediction for grenades

refactor: standardize access to bot files
graph: allow to specify graph upload url via cvar
graph. do not spam if extensions files  are not found
This commit is contained in:
jeefo 2023-04-13 03:05:35 +03:00
commit 9c73a070b7
No known key found for this signature in database
GPG key ID: 927BCA0779BEA8ED
11 changed files with 160 additions and 86 deletions

View file

@ -343,8 +343,8 @@ public:
bool loadGraphData ();
bool canDownload ();
template <typename U> bool saveStorage (StringRef ext, StringRef name, StorageOption options, StorageVersion version, const SmallArray <U> &data, ExtenHeader *exten);
template <typename U> bool loadStorage (StringRef ext, StringRef name, StorageOption options, StorageVersion version, SmallArray <U> &data, ExtenHeader *exten, int32_t *outOptions);
template <typename U> bool saveStorage (StringRef name, StorageOption options, StorageVersion version, const SmallArray <U> &data, ExtenHeader *exten);
template <typename U> bool loadStorage (StringRef name, StorageOption options, StorageVersion version, SmallArray <U> &data, ExtenHeader *exten, int32_t *outOptions);
template <typename ...Args> bool raiseLoadingError (bool isGraph, MemFile &file, const char *fmt, Args &&...args);
void saveOldFormat ();
@ -389,9 +389,6 @@ public:
void showStats ();
void showFileInfo ();
const char *getDataDirectory (bool isMemoryFile = false);
const char *getOldFormatGraphName (bool isMemoryFile = false);
IntArray getNarestInRadius (float radius, const Vector &origin, int maxCount = -1);
const IntArray &getNodesInBucket (const Vector &pos);
@ -490,7 +487,11 @@ public:
// helper for reporting load errors
template <typename ...Args> bool BotGraph::raiseLoadingError (bool isGraph, MemFile &file, const char *fmt, Args &&...args) {
auto result = strings.format (fmt, cr::forward <Args> (args)...);
logger.error (result);
// display error only for graph file
if (isGraph || cv_debug.bool_ ()) {
logger.error (result);
}
// if graph reset paths
if (isGraph) {

View file

@ -7,6 +7,16 @@
#pragma once
CR_DECLARE_SCOPED_ENUM_TYPE (BotFile, uint32_t,
Vistable = 0,
LogFile = 1,
Practice = 2,
Graph = 3,
Pathmatrix = 4,
PodbotPWF = 5,
EbotEWP = 6
)
class BotSupport final : public Singleton <BotSupport> {
private:
bool m_needToSendWelcome {};
@ -96,6 +106,12 @@ public:
// get the current date and time as string
String getCurrentDateTime ();
// builds the filename to requested filename
String buildPath (int32_t type, bool isMemoryLoad = false);
// converts storage option to stroage filename
int32_t storageToBotFile (StorageOption options);
public:
// re-show welcome after changelevel ?

View file

@ -1211,6 +1211,7 @@ extern ConVar cv_debug_goal;
extern ConVar cv_save_bots_names;
extern ConVar cv_random_knife_attacks;
extern ConVar cv_rotate_bots;
extern ConVar cv_graph_url_upload;
extern ConVar mp_freezetime;
extern ConVar mp_roundtime;