Added extra font support to some other commands, handle overflow on image api
This commit is contained in:
parent
2644ce2d4a
commit
30bcb7a969
9 changed files with 44 additions and 11 deletions
|
@ -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]));
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue