From 0f9ebe76fdadecb8d3d7d7712e6df6d192b0c259 Mon Sep 17 00:00:00 2001 From: Bill Date: Mon, 13 Dec 2021 00:39:51 -0500 Subject: [PATCH] Change sso to grab from "sso.ticket" --- .../demo/NitroCommunicationDemo.ts | 23 +++++++------------ 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/src/nitro/communication/demo/NitroCommunicationDemo.ts b/src/nitro/communication/demo/NitroCommunicationDemo.ts index a67dae46..70da702d 100644 --- a/src/nitro/communication/demo/NitroCommunicationDemo.ts +++ b/src/nitro/communication/demo/NitroCommunicationDemo.ts @@ -16,7 +16,6 @@ export class NitroCommunicationDemo extends NitroManager { private _communication: INitroCommunicationManager; - private _sso: string; private _handShaking: boolean; private _didConnect: boolean; @@ -28,7 +27,6 @@ export class NitroCommunicationDemo extends NitroManager this._communication = communication; - this._sso = null; this._handShaking = false; this._didConnect = false; @@ -66,7 +64,6 @@ export class NitroCommunicationDemo extends NitroManager connection.removeEventListener(SocketConnectionEvent.CONNECTION_ERROR, this.onConnectionErrorEvent); } - this._sso = null; this._handShaking = false; this.stopPonging(); @@ -117,9 +114,9 @@ export class NitroCommunicationDemo extends NitroManager private tryAuthentication(connection: IConnection): void { - if(!connection || !this._sso) + if(!connection || !this.getSSO()) { - if(!this._sso) + if(!this.getSSO()) { NitroLogger.log('Login without an SSO ticket is not supported'); } @@ -129,7 +126,7 @@ export class NitroCommunicationDemo extends NitroManager return; } - connection.send(new SSOTicketMessageComposer(this._sso, Nitro.instance.time)); + connection.send(new SSOTicketMessageComposer(this.getSSO(), Nitro.instance.time)); } private onClientPingEvent(event: ClientPingEvent): void @@ -147,18 +144,9 @@ export class NitroCommunicationDemo extends NitroManager this.dispatchCommunicationDemoEvent(NitroCommunicationDemoEvent.CONNECTION_AUTHENTICATED, event.connection); - //event.connection.send(new UserHomeRoomComposer(555)); - event.connection.send(new InfoRetrieveMessageComposer()); } - public setSSO(sso: string): void - { - if(!sso || (sso === '') || this._sso) return; - - this._sso = sso; - } - private startHandshake(connection: IConnection): void { this.dispatchCommunicationDemoEvent(NitroCommunicationDemoEvent.CONNECTION_HANDSHAKING, connection); @@ -202,4 +190,9 @@ export class NitroCommunicationDemo extends NitroManager { Nitro.instance.events.dispatchEvent(new NitroCommunicationDemoEvent(type, connection)); } + + private getSSO(): string + { + return Nitro.instance.getConfiguration('sso.ticket', null); + } }