question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature Request] Event args

See original GitHub issue

Heres an example: Instead of OnDamagedPlayer(Player player, Player attacker, (ref) float damage), use OnDamagedPlayer(OnDamagedPlayerArgs ev) where

public class OnDamagedPlayerArgs
{
    public Player Player { get; }
    public Player Attacker { get; }
    public float Damage { get; set; }
}

You could also include a bool Cancel { get; set; } for cancelling instead of using return values, which allows for other event handler to interact with already cancelled events. Similarly you can also use the set accessors to change variables such as damage without needing to declare variables as ref.

Issue Analytics

  • State:closed
  • Created 2 months ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
MapleEvecommented, Aug 9, 2023

not related to concurrent fork PR, it’s from @muji2498 's work,

1reaction
moddedmcplayercommented, Aug 6, 2023

I feel like this would add way too much latency, you got to remember this is an external api that is sent to a separate program via a TCP connection, if OnDamagedPlayer where to be added, every single time a player gets hit, it (the game server) would then have to send a packet to the api server then the api server would have to respond with an 👍or a 👎witch even with 0 ping, on the same hardware (server box) would at least take a few ms for the round trip, then times that by up to 250+ players and thats a loooooot of latency.

For something like this to work, you’d need to enable some kinda modding api and the game server itself would need to be able to load external code

‘Heres an example:’

Read more comments on GitHub >

github_iconTop Results From Across the Web

Feature request: Expand event filters to support multiple ...
Feature request : Expand event filters to support multiple events. ... filter. topics would be mutually exclusive with the current event / args...
Read more >
EventArgs Class (System)
Represents the base class for classes that contain event data, and provides a value to use for events that do not include event...
Read more >
SendingRequestEventArgs Class (Microsoft.OData.Client)
Event args for the event fired before executing a web request. Gives a chance to customize or replace the request object to be...
Read more >
Improve event handling - Feature Requests
If a plugin or platform generates an event, that should bubble up into HA and present as an HA event with all the...
Read more >
Showing the Feature Requests List
The following method can be used to display the Feature Requests page to your users. Once you display the page, the users can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found