chore: checkpoint current work
@@ -14,7 +14,6 @@ export const App: FC<{}> = props =>
|
||||
const [ isReady, setIsReady ] = useState(false);
|
||||
const [ errorMessage, setErrorMessage ] = useState('');
|
||||
const [ homeUrl, setHomeUrl ] = useState('');
|
||||
|
||||
const showSessionExpired = useCallback(() =>
|
||||
{
|
||||
const baseUrl = window.location.origin + '/';
|
||||
@@ -37,6 +36,8 @@ export const App: FC<{}> = props =>
|
||||
|
||||
useEffect(() =>
|
||||
{
|
||||
let heartbeatInterval: number = null;
|
||||
|
||||
const prepare = async (width: number, height: number) =>
|
||||
{
|
||||
try
|
||||
@@ -51,6 +52,11 @@ export const App: FC<{}> = props =>
|
||||
return;
|
||||
}
|
||||
|
||||
const rawUseBackBuffer = window.NitroConfig['renderer.useBackBuffer'];
|
||||
const useBackBuffer = (rawUseBackBuffer === undefined)
|
||||
? true
|
||||
: ((rawUseBackBuffer === true) || (rawUseBackBuffer === 'true'));
|
||||
|
||||
const renderer = await PrepareRenderer({
|
||||
width: Math.floor(width),
|
||||
height: Math.floor(height),
|
||||
@@ -61,7 +67,7 @@ export const App: FC<{}> = props =>
|
||||
eventMode: 'none',
|
||||
failIfMajorPerformanceCaveat: false,
|
||||
roundPixels: true,
|
||||
useBackBuffer: true // Enable back buffer for blend filters
|
||||
useBackBuffer // Keep disabled by default unless explicitly enabled in NitroConfig
|
||||
});
|
||||
|
||||
await GetConfiguration().init();
|
||||
@@ -93,7 +99,7 @@ export const App: FC<{}> = props =>
|
||||
|
||||
HabboWebTools.sendHeartBeat();
|
||||
|
||||
setInterval(() => HabboWebTools.sendHeartBeat(), 10000);
|
||||
heartbeatInterval = window.setInterval(() => HabboWebTools.sendHeartBeat(), 10000);
|
||||
|
||||
GetTicker().add(ticker => GetRoomEngine().update(ticker));
|
||||
GetTicker().add(ticker => renderer.render(GetStage()));
|
||||
@@ -109,6 +115,11 @@ export const App: FC<{}> = props =>
|
||||
};
|
||||
|
||||
prepare(window.innerWidth, window.innerHeight);
|
||||
|
||||
return () =>
|
||||
{
|
||||
if(heartbeatInterval !== null) window.clearInterval(heartbeatInterval);
|
||||
};
|
||||
}, []);
|
||||
|
||||
return (
|
||||
@@ -120,4 +131,4 @@ export const App: FC<{}> = props =>
|
||||
<Base id="draggable-windows-container" />
|
||||
</Base>
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
@@ -8,6 +8,7 @@ export class MessengerThread
|
||||
{
|
||||
public static MESSAGE_RECEIVED: string = 'MT_MESSAGE_RECEIVED';
|
||||
public static THREAD_ID: number = 0;
|
||||
private static MAX_CHATS: number = 250;
|
||||
|
||||
private _threadId: number;
|
||||
private _participant: MessengerFriend;
|
||||
@@ -38,6 +39,7 @@ export class MessengerThread
|
||||
const chat = new MessengerThreadChat(senderId, message, secondsSinceSent, extraData, type);
|
||||
|
||||
group.addChat(chat);
|
||||
this.pruneChats();
|
||||
|
||||
this._lastUpdated = new Date();
|
||||
|
||||
@@ -46,6 +48,27 @@ export class MessengerThread
|
||||
return chat;
|
||||
}
|
||||
|
||||
private pruneChats(): void
|
||||
{
|
||||
let totalChats = this._groups.reduce((total, current) => (total + current.chats.length), 0);
|
||||
|
||||
while(totalChats > MessengerThread.MAX_CHATS)
|
||||
{
|
||||
const firstGroup = this._groups[0];
|
||||
|
||||
if(!firstGroup) break;
|
||||
|
||||
if(firstGroup.chats.length) firstGroup.chats.shift();
|
||||
|
||||
if(!firstGroup.chats.length)
|
||||
{
|
||||
this._groups.shift();
|
||||
}
|
||||
|
||||
totalChats--;
|
||||
}
|
||||
}
|
||||
|
||||
private getLastGroup(userId: number): MessengerThreadChatGroup
|
||||
{
|
||||
let group = this._groups[(this._groups.length - 1)];
|
||||
|
||||
|
After Width: | Height: | Size: 1010 B |
|
After Width: | Height: | Size: 676 B |
|
After Width: | Height: | Size: 255 B |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 8.4 KiB |
|
After Width: | Height: | Size: 206 B |
|
After Width: | Height: | Size: 133 B |
|
After Width: | Height: | Size: 547 B |
|
After Width: | Height: | Size: 322 B |
|
After Width: | Height: | Size: 211 B |
|
After Width: | Height: | Size: 265 B |
|
After Width: | Height: | Size: 274 B |
|
After Width: | Height: | Size: 198 B |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 7.3 KiB |
|
After Width: | Height: | Size: 113 B |
|
After Width: | Height: | Size: 299 B |
|
After Width: | Height: | Size: 293 B |
|
After Width: | Height: | Size: 153 B |
|
After Width: | Height: | Size: 147 B |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 442 B |
|
After Width: | Height: | Size: 426 B |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 443 B |
|
After Width: | Height: | Size: 423 B |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 437 B |
|
After Width: | Height: | Size: 598 B |
|
After Width: | Height: | Size: 428 B |
|
After Width: | Height: | Size: 428 B |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 358 B |
|
After Width: | Height: | Size: 286 B |
|
After Width: | Height: | Size: 174 B |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 445 B |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 447 B |
|
After Width: | Height: | Size: 452 B |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 430 B |
|
After Width: | Height: | Size: 430 B |
|
After Width: | Height: | Size: 138 B |
|
After Width: | Height: | Size: 431 B |
|
After Width: | Height: | Size: 430 B |
|
After Width: | Height: | Size: 426 B |
|
After Width: | Height: | Size: 431 B |
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 182 B |
|
After Width: | Height: | Size: 175 B |
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 441 B |
|
After Width: | Height: | Size: 447 B |
|
After Width: | Height: | Size: 455 B |
|
After Width: | Height: | Size: 430 B |
|
After Width: | Height: | Size: 213 B |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 4.3 KiB |