B
B
babon2014-10-01 00:49:15
C++ / C#
babon, 2014-10-01 00:49:15

How to register an event object?

I want to write a plug-in for one socket server for the Starbound game, the C# language is used.
I can't figure out how to register an Event (A function that is called when some event occurs in the game).
Previously, the author allowed it to be done like this. 6028070.png
In one of the latest updates, the author changed the way of registering events, I searched for documentation, examples for a long time, looked at the source code of other plugins, but did not find anything.
As I understand it, now this is done by this method (github) , but I can’t figure out how to use it.
How to register an event?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
babon, 2014-10-01
@babon

Sorry, I figured it out myself, I just had to register events on a class, for example
RegisterEventObject(this);
and for the function use the attribute of the form
[PacketEvent(KnownPacket.ChatSent)]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question