-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor event handlers, update example resource (#110)
* Refactor event handlers, rename attributes, update SampleResource * Refactor async event handlers, rename async attributes, update EventAttribute, update SampleResource * Fix warnings in Alt.RegisterEvents & AltAsync.RegisterEvents, fix implicitly called closures in AsyncModule, update example resource
- Loading branch information
1 parent
7dc3d43
commit dcabd2e
Showing
22 changed files
with
3,341 additions
and
1,483 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System; | ||
|
||
namespace AltV.Net.Async | ||
{ | ||
[Obsolete("This attribute is obsolete. Use AsyncServerEventAttribute or AsyncClientEventAttribute instead.")] | ||
[AttributeUsage(AttributeTargets.Method)] | ||
public sealed class AsyncEventAttribute : Attribute | ||
{ | ||
public string Name { get; } | ||
|
||
public AsyncEventAttribute(string name = null) | ||
{ | ||
Name = name; | ||
} | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
28 changes: 14 additions & 14 deletions
28
api/AltV.Net.Async/AsyncScriptEvent.cs → ...tV.Net.Async/AsyncScriptEventAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
using System; | ||
|
||
namespace AltV.Net.Async | ||
{ | ||
[AttributeUsage(AttributeTargets.Method)] | ||
public class AsyncScriptEvent : Attribute | ||
{ | ||
public ScriptEventType EventType { get; } | ||
|
||
public AsyncScriptEvent(ScriptEventType eventType) | ||
{ | ||
EventType = eventType; | ||
} | ||
} | ||
using System; | ||
|
||
namespace AltV.Net.Async | ||
{ | ||
[AttributeUsage(AttributeTargets.Method)] | ||
public sealed class AsyncScriptEventAttribute : Attribute | ||
{ | ||
public ScriptEventType EventType { get; } | ||
|
||
public AsyncScriptEventAttribute(ScriptEventType eventType) | ||
{ | ||
EventType = eventType; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System; | ||
|
||
namespace AltV.Net.Async | ||
{ | ||
[AttributeUsage(AttributeTargets.Method)] | ||
public sealed class AsyncServerEventAttribute : Attribute | ||
{ | ||
public string Name { get; } | ||
|
||
public AsyncServerEventAttribute(string name = null) | ||
{ | ||
Name = name; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.