-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(devtools): add a server version of neteventlog #1748
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some suggestions.
@@ -130,6 +130,9 @@ class RESOURCES_CORE_EXPORT ResourceEventManagerComponent : public fwRefCountabl | |||
// | |||
fwEvent<const std::string&, const std::string&, const std::string&> OnQueueEvent; | |||
|
|||
// Arguments: eventName, eventPayloadSize, eventSource | |||
fwEvent<const std::string_view&, size_t&, const std::optional<std::string_view>&> OnClientEventTriggered; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A little odd as the concept of server->client events only exists on the server and is part of ServerResources - I wonder if there'd be a better place for this callout across components, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ServerEventComponent might be a better place to put something like this and just change the initialization to OnServerCreate
|
||
eventManager->OnClientEventTriggered.Connect([](const std::string_view& eventName, size_t& eventSize, const std::optional<std::string_view>& eventTarget) | ||
{ | ||
EventLog_Add(std::string{ eventName }, eventSize, true, std::string{ eventTarget.value_or("-1") }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of showing the target as a number, maybe showing their name (plus a shortcut to the citizen:server:gui
player list entry for them?) could work.
(similarly, instead of enabling this for the server in citizen:devtools
, one could just files
it in citizen:server:gui
using the COMPILING_CITIZEN_SERVER_IMPL define, solving the callout issue as well)
#include <ResourceEventComponent.h> | ||
#include <ResourceManager.h> | ||
|
||
#ifndef IS_FXSERVER |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For moving this to citizen:server:gui, instead of this, the global define guard would instead be like #if !defined(IS_FXSERVER) || defined(COMPILING_CITIZEN_SERVER_GUI)
.
|
||
ImGui::Text( | ||
#ifndef IS_FXSERVER | ||
(entry.out) ? "C->S" : "S->C" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One could rename out
to toServer
and flip it elsewhere.
So after some messing around, I'm not sure if this is really a viable solution at all, on higher population servers this will be relatively useless as there's anywhere from 20-100 events a second. I wonder if a file based solution would work better and have some external tool to go through the data, I'm not sure where would be a good place to discuss possible implementations though. |
Wouldn't it it be possible to implement some basic filters (include/exclude resources/players) in the ImGui window? |
Closing as I have no intentions of continuing this PR, if someone wants to continue it feel free to. |
This was long a long requested feature and might be useful for optimization, or finding exploits in resources
Tips on how this code might be cleaner would be appreciated, but I'm not sure if there is a way :\