You've already forked Nitro_Render_V3
mirror of
https://github.com/duckietm/Nitro_Render_V3.git
synced 2026-06-19 15:06:20 +00:00
Merge remote-tracking branch 'fork/main'
# Conflicts: # packages/communication/src/NitroMessages.ts
This commit is contained in:
@@ -0,0 +1,43 @@
|
|||||||
|
name: Safe Sync - Nitro_Render_V3
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 0 * * *'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
sync-safe:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout Fork
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Configure Git Credentials
|
||||||
|
run: |
|
||||||
|
git config --global user.name "github-actions[bot]"
|
||||||
|
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||||
|
|
||||||
|
- name: Fetch and Merge Upstream
|
||||||
|
run: |
|
||||||
|
git remote add upstream https://github.com/duckietm/Nitro_Render_V3.git
|
||||||
|
git fetch upstream
|
||||||
|
|
||||||
|
for branch in $(git branch -r | grep 'upstream/' | grep -v 'HEAD'); do
|
||||||
|
local_branch=${branch#upstream/}
|
||||||
|
echo "Elaborazione branch: $local_branch"
|
||||||
|
|
||||||
|
git checkout $local_branch || git checkout -b $local_branch upstream/$local_branch
|
||||||
|
|
||||||
|
if git merge upstream/$local_branch --no-edit; then
|
||||||
|
echo "Merge completato con successo per $local_branch. Invio gli aggiornamenti..."
|
||||||
|
git push origin $local_branch
|
||||||
|
else
|
||||||
|
echo "Rilevato conflitto di merge su $local_branch! Il tuo lavoro è al sicuro. Salto il push per questo branch."
|
||||||
|
git merge --abort
|
||||||
|
fi
|
||||||
|
done
|
||||||
File diff suppressed because one or more lines are too long
@@ -117,6 +117,8 @@ export class IncomingHeader
|
|||||||
public static MESSENGER_REQUESTS = 280;
|
public static MESSENGER_REQUESTS = 280;
|
||||||
public static MESSENGER_SEARCH = 973;
|
public static MESSENGER_SEARCH = 973;
|
||||||
public static MESSENGER_UPDATE = 2800;
|
public static MESSENGER_UPDATE = 2800;
|
||||||
|
public static CONSOLE_READ_RECEIPT = 4086;
|
||||||
|
public static FRIEND_TYPING = 4088;
|
||||||
public static MODERATION_REPORT_DISABLED = 1651;
|
public static MODERATION_REPORT_DISABLED = 1651;
|
||||||
public static MODERATION_TOOL = 2696;
|
public static MODERATION_TOOL = 2696;
|
||||||
public static MODERATION_USER_INFO = 2866;
|
public static MODERATION_USER_INFO = 2866;
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
import { IMessageEvent } from '@nitrots/api';
|
||||||
|
import { MessageEvent } from '@nitrots/events';
|
||||||
|
import { ConsoleReadReceiptParser } from '../../parser';
|
||||||
|
|
||||||
|
export class ConsoleReadReceiptEvent extends MessageEvent implements IMessageEvent
|
||||||
|
{
|
||||||
|
constructor(callBack: Function)
|
||||||
|
{
|
||||||
|
super(callBack, ConsoleReadReceiptParser);
|
||||||
|
}
|
||||||
|
|
||||||
|
public getParser(): ConsoleReadReceiptParser
|
||||||
|
{
|
||||||
|
return this.parser as ConsoleReadReceiptParser;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
import { IMessageEvent } from '@nitrots/api';
|
||||||
|
import { MessageEvent } from '@nitrots/events';
|
||||||
|
import { FriendIsTypingParser } from '../../parser';
|
||||||
|
|
||||||
|
export class FriendIsTypingEvent extends MessageEvent implements IMessageEvent
|
||||||
|
{
|
||||||
|
constructor(callBack: Function)
|
||||||
|
{
|
||||||
|
super(callBack, FriendIsTypingParser);
|
||||||
|
}
|
||||||
|
|
||||||
|
public getParser(): FriendIsTypingParser
|
||||||
|
{
|
||||||
|
return this.parser as FriendIsTypingParser;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
export * from './AcceptFriendResultEvent';
|
export * from './AcceptFriendResultEvent';
|
||||||
|
export * from './ConsoleReadReceiptEvent';
|
||||||
|
export * from './FriendIsTypingEvent';
|
||||||
export * from './FindFriendsProcessResultEvent';
|
export * from './FindFriendsProcessResultEvent';
|
||||||
export * from './FollowFriendFailedEvent';
|
export * from './FollowFriendFailedEvent';
|
||||||
export * from './FriendListFragmentEvent';
|
export * from './FriendListFragmentEvent';
|
||||||
|
|||||||
@@ -130,6 +130,12 @@ export class OutgoingHeader
|
|||||||
public static SEND_ROOM_INVITE = 1276;
|
public static SEND_ROOM_INVITE = 1276;
|
||||||
public static HABBO_SEARCH = 1210;
|
public static HABBO_SEARCH = 1210;
|
||||||
public static FRIEND_LIST_UPDATE = 1419;
|
public static FRIEND_LIST_UPDATE = 1419;
|
||||||
|
public static ADD_FRIEND_CATEGORY = 4081;
|
||||||
|
public static RENAME_FRIEND_CATEGORY = 4082;
|
||||||
|
public static REMOVE_FRIEND_CATEGORY = 4083;
|
||||||
|
public static MOVE_FRIEND_TO_CATEGORY = 4084;
|
||||||
|
public static MARK_CONSOLE_READ = 4085;
|
||||||
|
public static CONSOLE_TYPING = 4087;
|
||||||
public static MOD_TOOL_USER_INFO = 3295;
|
public static MOD_TOOL_USER_INFO = 3295;
|
||||||
public static GET_USER_FLAT_CATS = 3027;
|
public static GET_USER_FLAT_CATS = 3027;
|
||||||
public static NAVIGATOR_INIT = 2110;
|
public static NAVIGATOR_INIT = 2110;
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
import { IMessageComposer } from '@nitrots/api';
|
||||||
|
|
||||||
|
export class AddFriendCategoryComposer implements IMessageComposer<ConstructorParameters<typeof AddFriendCategoryComposer>>
|
||||||
|
{
|
||||||
|
private _data: ConstructorParameters<typeof AddFriendCategoryComposer>;
|
||||||
|
|
||||||
|
constructor(name: string)
|
||||||
|
{
|
||||||
|
this._data = [ name ];
|
||||||
|
}
|
||||||
|
|
||||||
|
public getMessageArray()
|
||||||
|
{
|
||||||
|
return this._data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public dispose(): void
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
import { IMessageComposer } from '@nitrots/api';
|
||||||
|
|
||||||
|
export class ConsoleTypingComposer implements IMessageComposer<ConstructorParameters<typeof ConsoleTypingComposer>>
|
||||||
|
{
|
||||||
|
private _data: ConstructorParameters<typeof ConsoleTypingComposer>;
|
||||||
|
|
||||||
|
constructor(peerId: number, isTyping: boolean)
|
||||||
|
{
|
||||||
|
this._data = [ peerId, isTyping ];
|
||||||
|
}
|
||||||
|
|
||||||
|
public getMessageArray()
|
||||||
|
{
|
||||||
|
return this._data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public dispose(): void
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
import { IMessageComposer } from '@nitrots/api';
|
||||||
|
|
||||||
|
export class MarkConsoleReadComposer implements IMessageComposer<ConstructorParameters<typeof MarkConsoleReadComposer>>
|
||||||
|
{
|
||||||
|
private _data: ConstructorParameters<typeof MarkConsoleReadComposer>;
|
||||||
|
|
||||||
|
constructor(peerId: number)
|
||||||
|
{
|
||||||
|
this._data = [ peerId ];
|
||||||
|
}
|
||||||
|
|
||||||
|
public getMessageArray()
|
||||||
|
{
|
||||||
|
return this._data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public dispose(): void
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
+21
@@ -0,0 +1,21 @@
|
|||||||
|
import { IMessageComposer } from '@nitrots/api';
|
||||||
|
|
||||||
|
export class MoveFriendToCategoryComposer implements IMessageComposer<ConstructorParameters<typeof MoveFriendToCategoryComposer>>
|
||||||
|
{
|
||||||
|
private _data: ConstructorParameters<typeof MoveFriendToCategoryComposer>;
|
||||||
|
|
||||||
|
constructor(friendId: number, categoryId: number)
|
||||||
|
{
|
||||||
|
this._data = [ friendId, categoryId ];
|
||||||
|
}
|
||||||
|
|
||||||
|
public getMessageArray()
|
||||||
|
{
|
||||||
|
return this._data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public dispose(): void
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
+21
@@ -0,0 +1,21 @@
|
|||||||
|
import { IMessageComposer } from '@nitrots/api';
|
||||||
|
|
||||||
|
export class RemoveFriendCategoryComposer implements IMessageComposer<ConstructorParameters<typeof RemoveFriendCategoryComposer>>
|
||||||
|
{
|
||||||
|
private _data: ConstructorParameters<typeof RemoveFriendCategoryComposer>;
|
||||||
|
|
||||||
|
constructor(categoryId: number)
|
||||||
|
{
|
||||||
|
this._data = [ categoryId ];
|
||||||
|
}
|
||||||
|
|
||||||
|
public getMessageArray()
|
||||||
|
{
|
||||||
|
return this._data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public dispose(): void
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
+21
@@ -0,0 +1,21 @@
|
|||||||
|
import { IMessageComposer } from '@nitrots/api';
|
||||||
|
|
||||||
|
export class RenameFriendCategoryComposer implements IMessageComposer<ConstructorParameters<typeof RenameFriendCategoryComposer>>
|
||||||
|
{
|
||||||
|
private _data: ConstructorParameters<typeof RenameFriendCategoryComposer>;
|
||||||
|
|
||||||
|
constructor(categoryId: number, name: string)
|
||||||
|
{
|
||||||
|
this._data = [ categoryId, name ];
|
||||||
|
}
|
||||||
|
|
||||||
|
public getMessageArray()
|
||||||
|
{
|
||||||
|
return this._data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public dispose(): void
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
+28
@@ -0,0 +1,28 @@
|
|||||||
|
import { describe, expect, it } from 'vitest';
|
||||||
|
import { AddFriendCategoryComposer } from '../AddFriendCategoryComposer';
|
||||||
|
import { RenameFriendCategoryComposer } from '../RenameFriendCategoryComposer';
|
||||||
|
import { RemoveFriendCategoryComposer } from '../RemoveFriendCategoryComposer';
|
||||||
|
import { MoveFriendToCategoryComposer } from '../MoveFriendToCategoryComposer';
|
||||||
|
|
||||||
|
describe('friend category composers', () =>
|
||||||
|
{
|
||||||
|
it('AddFriendCategoryComposer carries the name', () =>
|
||||||
|
{
|
||||||
|
expect(new AddFriendCategoryComposer('Best friends').getMessageArray()).toEqual([ 'Best friends' ]);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('RenameFriendCategoryComposer carries id + name', () =>
|
||||||
|
{
|
||||||
|
expect(new RenameFriendCategoryComposer(5, 'Staff').getMessageArray()).toEqual([ 5, 'Staff' ]);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('RemoveFriendCategoryComposer carries the id', () =>
|
||||||
|
{
|
||||||
|
expect(new RemoveFriendCategoryComposer(7).getMessageArray()).toEqual([ 7 ]);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('MoveFriendToCategoryComposer carries friendId + categoryId', () =>
|
||||||
|
{
|
||||||
|
expect(new MoveFriendToCategoryComposer(42, 3).getMessageArray()).toEqual([ 42, 3 ]);
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -1,4 +1,7 @@
|
|||||||
export * from './AcceptFriendMessageComposer';
|
export * from './AcceptFriendMessageComposer';
|
||||||
|
export * from './MarkConsoleReadComposer';
|
||||||
|
export * from './ConsoleTypingComposer';
|
||||||
|
export * from './AddFriendCategoryComposer';
|
||||||
export * from './DeclineFriendMessageComposer';
|
export * from './DeclineFriendMessageComposer';
|
||||||
export * from './FindNewFriendsMessageComposer';
|
export * from './FindNewFriendsMessageComposer';
|
||||||
export * from './FollowFriendMessageComposer';
|
export * from './FollowFriendMessageComposer';
|
||||||
@@ -6,7 +9,10 @@ export * from './FriendListUpdateComposer';
|
|||||||
export * from './GetFriendRequestsComposer';
|
export * from './GetFriendRequestsComposer';
|
||||||
export * from './HabboSearchComposer';
|
export * from './HabboSearchComposer';
|
||||||
export * from './MessengerInitComposer';
|
export * from './MessengerInitComposer';
|
||||||
|
export * from './MoveFriendToCategoryComposer';
|
||||||
|
export * from './RemoveFriendCategoryComposer';
|
||||||
export * from './RemoveFriendComposer';
|
export * from './RemoveFriendComposer';
|
||||||
|
export * from './RenameFriendCategoryComposer';
|
||||||
export * from './RequestFriendComposer';
|
export * from './RequestFriendComposer';
|
||||||
export * from './SendMessageComposer';
|
export * from './SendMessageComposer';
|
||||||
export * from './SendRoomInviteComposer';
|
export * from './SendRoomInviteComposer';
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||||
|
|
||||||
|
export class ConsoleReadReceiptParser implements IMessageParser
|
||||||
|
{
|
||||||
|
private _readerId: number;
|
||||||
|
|
||||||
|
public flush(): boolean
|
||||||
|
{
|
||||||
|
this._readerId = 0;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public parse(wrapper: IMessageDataWrapper): boolean
|
||||||
|
{
|
||||||
|
if(!wrapper) return false;
|
||||||
|
|
||||||
|
this._readerId = wrapper.readInt();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get readerId(): number
|
||||||
|
{
|
||||||
|
return this._readerId;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||||
|
|
||||||
|
export class FriendIsTypingParser implements IMessageParser
|
||||||
|
{
|
||||||
|
private _senderId: number;
|
||||||
|
private _isTyping: boolean;
|
||||||
|
|
||||||
|
public flush(): boolean
|
||||||
|
{
|
||||||
|
this._senderId = 0;
|
||||||
|
this._isTyping = false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public parse(wrapper: IMessageDataWrapper): boolean
|
||||||
|
{
|
||||||
|
if(!wrapper) return false;
|
||||||
|
|
||||||
|
this._senderId = wrapper.readInt();
|
||||||
|
this._isTyping = wrapper.readBoolean();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get senderId(): number
|
||||||
|
{
|
||||||
|
return this._senderId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get isTyping(): boolean
|
||||||
|
{
|
||||||
|
return this._isTyping;
|
||||||
|
}
|
||||||
|
}
|
||||||
+27
@@ -0,0 +1,27 @@
|
|||||||
|
import { describe, expect, it } from 'vitest';
|
||||||
|
import { BinaryReader, BinaryWriter } from '@nitrots/utils';
|
||||||
|
import { ConsoleReadReceiptParser } from '../ConsoleReadReceiptParser';
|
||||||
|
|
||||||
|
class TestWrapper
|
||||||
|
{
|
||||||
|
constructor(private reader: BinaryReader) {}
|
||||||
|
readByte() { return this.reader.readByte(); }
|
||||||
|
readShort() { return this.reader.readShort(); }
|
||||||
|
readInt() { return this.reader.readInt(); }
|
||||||
|
readString() { const len = this.reader.readShort(); return this.reader.readBytes(len).toString(); }
|
||||||
|
header = 0;
|
||||||
|
get bytesAvailable() { return this.reader.remaining() > 0; }
|
||||||
|
}
|
||||||
|
|
||||||
|
describe('ConsoleReadReceiptParser', () =>
|
||||||
|
{
|
||||||
|
it('parses the reader id', () =>
|
||||||
|
{
|
||||||
|
const w = new BinaryWriter();
|
||||||
|
w.writeInt(42);
|
||||||
|
const parser = new ConsoleReadReceiptParser();
|
||||||
|
parser.flush();
|
||||||
|
parser.parse(new TestWrapper(new BinaryReader(w.getBuffer())) as any);
|
||||||
|
expect(parser.readerId).toBe(42);
|
||||||
|
});
|
||||||
|
});
|
||||||
+39
@@ -0,0 +1,39 @@
|
|||||||
|
import { describe, expect, it } from 'vitest';
|
||||||
|
import { BinaryReader, BinaryWriter } from '@nitrots/utils';
|
||||||
|
import { FriendIsTypingParser } from '../FriendIsTypingParser';
|
||||||
|
|
||||||
|
class TestWrapper
|
||||||
|
{
|
||||||
|
constructor(private reader: BinaryReader) {}
|
||||||
|
readByte() { return this.reader.readByte(); }
|
||||||
|
readBoolean() { return this.reader.readByte() === 1; }
|
||||||
|
readShort() { return this.reader.readShort(); }
|
||||||
|
readInt() { return this.reader.readInt(); }
|
||||||
|
readString() { const len = this.reader.readShort(); return this.reader.readBytes(len).toString(); }
|
||||||
|
header = 0;
|
||||||
|
get bytesAvailable() { return this.reader.remaining() > 0; }
|
||||||
|
}
|
||||||
|
|
||||||
|
describe('FriendIsTypingParser', () =>
|
||||||
|
{
|
||||||
|
it('parses senderId + isTyping=true', () =>
|
||||||
|
{
|
||||||
|
const w = new BinaryWriter();
|
||||||
|
w.writeInt(42); w.writeByte(1);
|
||||||
|
const parser = new FriendIsTypingParser();
|
||||||
|
parser.flush();
|
||||||
|
parser.parse(new TestWrapper(new BinaryReader(w.getBuffer())) as any);
|
||||||
|
expect(parser.senderId).toBe(42);
|
||||||
|
expect(parser.isTyping).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('parses isTyping=false', () =>
|
||||||
|
{
|
||||||
|
const w = new BinaryWriter();
|
||||||
|
w.writeInt(42); w.writeByte(0);
|
||||||
|
const parser = new FriendIsTypingParser();
|
||||||
|
parser.flush();
|
||||||
|
parser.parse(new TestWrapper(new BinaryReader(w.getBuffer())) as any);
|
||||||
|
expect(parser.isTyping).toBe(false);
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
export * from './AcceptFriendFailureData';
|
export * from './AcceptFriendFailureData';
|
||||||
|
export * from './ConsoleReadReceiptParser';
|
||||||
|
export * from './FriendIsTypingParser';
|
||||||
export * from './AcceptFriendResultParser';
|
export * from './AcceptFriendResultParser';
|
||||||
export * from './FindFriendsProcessResultParser';
|
export * from './FindFriendsProcessResultParser';
|
||||||
export * from './FollowFriendFailedParser';
|
export * from './FollowFriendFailedParser';
|
||||||
|
|||||||
Reference in New Issue
Block a user