mirror of
https://github.com/billsonnn/nitro-react.git
synced 2025-01-31 18:32:36 +01:00
changes
This commit is contained in:
parent
cd3ffcd272
commit
7f0a194b34
@ -1,4 +1,4 @@
|
|||||||
import { ConfigurationEvent, LegacyExternalInterface, Nitro, NitroCommunicationDemoEvent, NitroEvent, NitroLocalizationEvent, NitroVersion, RoomEngineEvent, WebGL } from '@nitrots/nitro-renderer';
|
import { ConfigurationEvent, HabboWebTools, LegacyExternalInterface, Nitro, NitroCommunicationDemoEvent, NitroEvent, NitroLocalizationEvent, NitroVersion, RoomEngineEvent, WebGL } from '@nitrots/nitro-renderer';
|
||||||
import { FC, useCallback, useState } from 'react';
|
import { FC, useCallback, useState } from 'react';
|
||||||
import { GetCommunication, GetConfiguration, GetNitroInstance } from './api';
|
import { GetCommunication, GetConfiguration, GetNitroInstance } from './api';
|
||||||
import { useConfigurationEvent } from './hooks/events/core/configuration/configuration-event';
|
import { useConfigurationEvent } from './hooks/events/core/configuration/configuration-event';
|
||||||
@ -68,6 +68,8 @@ export const App: FC<{}> = props =>
|
|||||||
setMessage('Finishing Up');
|
setMessage('Finishing Up');
|
||||||
|
|
||||||
GetNitroInstance().init();
|
GetNitroInstance().init();
|
||||||
|
|
||||||
|
if(LegacyExternalInterface.available) LegacyExternalInterface.call('legacyTrack', 'authentication', 'authok', []);
|
||||||
return;
|
return;
|
||||||
case NitroCommunicationDemoEvent.CONNECTION_ERROR:
|
case NitroCommunicationDemoEvent.CONNECTION_ERROR:
|
||||||
setIsError(true);
|
setIsError(true);
|
||||||
@ -79,7 +81,7 @@ export const App: FC<{}> = props =>
|
|||||||
setIsError(true);
|
setIsError(true);
|
||||||
setMessage('Connection Error');
|
setMessage('Connection Error');
|
||||||
|
|
||||||
LegacyExternalInterface.call('disconnect', -1, 'client.init.handshake.fail');
|
HabboWebTools.send(-1, 'client.init.handshake.fail');
|
||||||
return;
|
return;
|
||||||
case RoomEngineEvent.ENGINE_INITIALIZED:
|
case RoomEngineEvent.ENGINE_INITIALIZED:
|
||||||
setIsReady(true);
|
setIsReady(true);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { GenericErrorEvent, GetGuestRoomResultEvent, NavigatorCategoriesComposer, NavigatorCategoriesEvent, NavigatorHomeRoomEvent, NavigatorMetadataEvent, NavigatorSearchEvent, NavigatorSettingsComposer, RoomCreatedEvent, RoomDataParser, RoomDoorbellAcceptedEvent, RoomDoorbellEvent, RoomDoorbellRejectedEvent, RoomEntryInfoMessageEvent, RoomForwardEvent, RoomInfoComposer, RoomSettingsUpdatedEvent, UserInfoEvent } from '@nitrots/nitro-renderer';
|
import { GenericErrorEvent, GetGuestRoomResultEvent, LegacyExternalInterface, NavigatorCategoriesComposer, NavigatorCategoriesEvent, NavigatorHomeRoomEvent, NavigatorMetadataEvent, NavigatorSearchEvent, NavigatorSettingsComposer, RoomCreatedEvent, RoomDataParser, RoomDoorbellAcceptedEvent, RoomDoorbellEvent, RoomDoorbellRejectedEvent, RoomEntryInfoMessageEvent, RoomForwardEvent, RoomInfoComposer, RoomSettingsUpdatedEvent, UserInfoEvent } from '@nitrots/nitro-renderer';
|
||||||
import { FC, useCallback } from 'react';
|
import { FC, useCallback } from 'react';
|
||||||
import { CreateRoomSession, GetSessionDataManager } from '../../api';
|
import { CreateRoomSession, GetSessionDataManager } from '../../api';
|
||||||
import { UpdateDoorStateEvent } from '../../events';
|
import { UpdateDoorStateEvent } from '../../events';
|
||||||
@ -41,6 +41,8 @@ export const NavigatorMessageHandler: FC<NavigatorMessageHandlerProps> = props =
|
|||||||
});
|
});
|
||||||
|
|
||||||
SendMessageHook(new RoomInfoComposer(parser.roomId, true, false));
|
SendMessageHook(new RoomInfoComposer(parser.roomId, true, false));
|
||||||
|
|
||||||
|
if(LegacyExternalInterface.available) LegacyExternalInterface.call('legacyTrack', 'navigator', 'private', [ parser.roomId ]);
|
||||||
}, [ navigatorState, dispatchNavigatorState ]);
|
}, [ navigatorState, dispatchNavigatorState ]);
|
||||||
|
|
||||||
const onGetGuestRoomResultEvent = useCallback((event: GetGuestRoomResultEvent) =>
|
const onGetGuestRoomResultEvent = useCallback((event: GetGuestRoomResultEvent) =>
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import { MouseEventType } from '@nitrots/nitro-renderer';
|
import { MouseEventType } from '@nitrots/nitro-renderer';
|
||||||
import { FC, useCallback, useEffect, useRef, useState } from 'react';
|
import { FC, useCallback, useEffect, useRef, useState } from 'react';
|
||||||
import { AddEventLinkTracker, CreateLinkEvent, GetConfiguration, RemoveLinkEventTracker } from '../../api';
|
import { AddEventLinkTracker, GetConfiguration, RemoveLinkEventTracker } from '../../api';
|
||||||
import { NitroCardContentView, NitroCardHeaderView, NitroCardView } from '../../layout';
|
import { NitroCardContentView, NitroCardHeaderView, NitroCardView } from '../../layout';
|
||||||
|
import { NotificationUtilities } from '../notification-center/common/NotificationUtilities';
|
||||||
|
|
||||||
const newLineRegex = /\n\r|\n|\r/mg;
|
const newLineRegex = /\n\r|\n|\r/mg;
|
||||||
const internalLinkPrefix = 'event:';
|
|
||||||
export const NitropediaView: FC<{}> = props =>
|
export const NitropediaView: FC<{}> = props =>
|
||||||
{
|
{
|
||||||
const [ content, setContent ] = useState<string>(null);
|
const [ content, setContent ] = useState<string>(null);
|
||||||
@ -40,17 +40,7 @@ export const NitropediaView: FC<{}> = props =>
|
|||||||
{
|
{
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
const link = event.target.href;
|
const link = event.target.href;
|
||||||
|
NotificationUtilities.openUrl(link);
|
||||||
if(link.startsWith(internalLinkPrefix))
|
|
||||||
{
|
|
||||||
const internalLink = link.substring(internalLinkPrefix.length);
|
|
||||||
CreateLinkEvent(internalLink);
|
|
||||||
}
|
|
||||||
|
|
||||||
else
|
|
||||||
{
|
|
||||||
window.open(link);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
},[]);
|
},[]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user