Skip to content

Commit

Permalink
feat(server): add new metric methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Doxoh committed Feb 17, 2024
1 parent 3259320 commit 1831c4c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
15 changes: 15 additions & 0 deletions c-api/data/metric.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,19 @@ void Metric_End(alt::Metric* metric)
{
metric->End();
}

void Metric_End2(alt::Metric* metric)
{
metric->End2();
}

void Metric_Add(alt::Metric* metric, uint64_t value)
{
metric->Add(value);
}

void Metric_Inc(alt::Metric* metric)
{
metric->Inc();
}
#endif
5 changes: 4 additions & 1 deletion c-api/data/metric.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@ EXPORT_SERVER void Metric_SetValue(alt::Metric* metric, uint64_t value);
EXPORT_SERVER uint64_t Metric_GetValue(alt::Metric* metric);
EXPORT_SERVER void Metric_Begin(alt::Metric* metric);
EXPORT_SERVER void Metric_End(alt::Metric* metric);
EXPORT_SERVER const char* Metric_GetName(alt::Metric* metric, int32_t& size);
EXPORT_SERVER void Metric_End2(alt::Metric* metric);
EXPORT_SERVER const char* Metric_GetName(alt::Metric* metric, int32_t& size);
EXPORT_SERVER void Metric_Add(alt::Metric* metric, uint64_t value);
EXPORT_SERVER void Metric_Inc(alt::Metric* metric);
8 changes: 7 additions & 1 deletion c-api/func_table.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "func_table.h"

inline uint64_t capiHash = 18234026019486245283UL;
inline uint64_t capiHash = 78812385462098472UL;
inline uint64_t capiHashes[] = {
0,
#ifdef ALT_CLIENT_API
Expand Down Expand Up @@ -1438,10 +1438,13 @@ inline uint64_t capiHashes[] = {
12798418058428333585UL,
8026011842118229214UL,
18440396865533386791UL,
16053290375636538610UL,
2348810001298180138UL,
13016512038826983106UL,
18410039824979474410UL,
8652629169459184520UL,
16033500183040421617UL,
9564264321313118159UL,
13198892627580896636UL,
17585830173881425980UL,
16593704804065749058UL,
Expand Down Expand Up @@ -3216,10 +3219,13 @@ inline void* capiPointers[] = {
(void*) Entity_SetStreamSyncedMetaData,
(void*) Entity_SetVisible,
(void*) Event_WeaponDamageEvent_SetDamageValue,
(void*) Metric_Add,
(void*) Metric_Begin,
(void*) Metric_End,
(void*) Metric_End2,
(void*) Metric_GetName,
(void*) Metric_GetValue,
(void*) Metric_Inc,
(void*) Metric_SetValue,
(void*) Object_ActivatePhysics,
(void*) Object_PlaceOnGroundProperly,
Expand Down

0 comments on commit 1831c4c

Please sign in to comment.