Remove rust

This commit is contained in:
Hri7566 2023-10-17 02:05:30 -04:00
parent 93a31b87be
commit b1d7477889
5 changed files with 20 additions and 10 deletions

2
.gitignore vendored
View File

@ -1,3 +1,5 @@
/build
# Based on https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore
# Logs

View File

@ -1,4 +0,0 @@
#[no_mangle]
pub extern "C" fn handleCommand(argc: isize, argv: ) {
}

View File

View File

@ -8,7 +8,7 @@ export class ServiceLoader {
public static loadServices() {
const testAgent = new MPPAgent(
"wss://smnmpp.hri7566.info:8448",
"wss://mppclone.com:8443",
env.MPPNET_TOKEN
);

View File

@ -1,12 +1,17 @@
import Client from "mpp-client-net";
import { ServiceAgent } from "../ServiceAgent";
import { ptr } from "bun:ffi";
let p;
export class MPPAgent extends ServiceAgent<Client> {
public desiredUser = {
name: "🟇 𝙎𝙪𝙥𝙚𝙧 Cosmic (*help)",
name: "🟇 𝙎𝙪𝙥𝙚𝙧 Cosmic (no commands yet)",
color: "#1d0054"
};
public desiredChannel = "nothing";
constructor(uri: string, token: string) {
const cl = new Client(uri, token);
super(cl);
@ -14,8 +19,6 @@ export class MPPAgent extends ServiceAgent<Client> {
public start() {
this.client.start();
// TODO get rid of this gay shit
this.client.setChannel("blackmidi (huge lag)");
}
public stop() {
@ -27,23 +30,32 @@ export class MPPAgent extends ServiceAgent<Client> {
this.client.on("hi", msg => {
this.emit("log", msg.u);
this.client.setChannel(this.desiredChannel);
console.log(
msg.u.name !== this.desiredUser.name ||
msg.u.color !== this.desiredUser.color
);
if (
msg.u.name !== this.desiredUser.name ||
msg.u.color !== this.desiredUser.color
) {
// setTimeout(() => {
this.client.sendArray([
{
m: "userset",
set: this.desiredUser
}
]);
// }, 1000);
}
});
this.client.on("a", msg => {
const argv = msg.a.split(" ");
const argc = argv.length;
p = ptr(new TextEncoder().encode(msg.a).buffer);
// handleCommand(p);
console.log(`${msg.p.name}: ${msg.a}`);
});
}
}