Added extra font support to some other commands, handle overflow on image api

This commit is contained in:
Essem 2021-12-06 01:25:38 -06:00
parent 2644ce2d4a
commit 30bcb7a969
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C
9 changed files with 44 additions and 11 deletions

View file

@ -152,7 +152,8 @@ class ImageConnection {
async do(op, data) {
const buf = Buffer.alloc(1 + 2);
const tag = this.tag++;
let tag = this.tag++;
if (tag > 65535) tag = this.tag = 0;
buf.writeUint8(op);
buf.writeUint16LE(tag, 1);
this.conn.send(Buffer.concat([buf, data]));

View file

@ -108,7 +108,8 @@ class ImageWorker extends BaseServiceWorker {
async run(object) {
if (process.env.API === "true") {
const num = this.nextID++;
let num = this.nextID++;
if (num > 4294967295) num = this.nextID = 0;
const currentServer = await this.getIdeal(object);
await currentServer.queue(num, object);
await currentServer.wait(num);