Reverse argument order for sendTo

It makes more sense to put the address first then have the large
structure to send as the second argument to sendTo.  The opposite order
was originally chosen to be similar to that of sendto in BSD sockets.
This commit is contained in:
Hornwitser committed 2023-07-27 00:24:24 +02:00
1 parent 183d2921a8
commit 295cc7543a
24 files changed
+87 -74

No files matched your search

+2 -2
View File
@@ -27,7 +27,7 @@ class InstancePlugin extends libPlugin.BaseInstancePlugin {
let response;
try {
response = await this.instance.sendTo(new FetchPlayerCodeRequest(event.player), "controller");
response = await this.instance.sendTo("controller", new FetchPlayerCodeRequest(event.player));
} catch (err) {
await this.sendRcon(`/web-login error ${event.player} ${err.message}`);
return;
@@ -36,7 +36,7 @@ class InstancePlugin extends libPlugin.BaseInstancePlugin {
} else if (event.type === "set_verify_code") {
try {
await this.instance.sendTo(new SetVerifyCodeRequest(event.player, event.verify_code), "controller");
await this.instance.sendTo("controller", new SetVerifyCodeRequest(event.player, event.verify_code));
} catch (err) {
await this.sendRcon(`/web-login error ${event.player} ${err.message}`);