From 93181c8d8ab0a3c769964bde23d679661e40cbbe Mon Sep 17 00:00:00 2001 From: GZNGET FOSS Team Date: Thu, 2 Nov 2017 13:04:49 +0100 Subject: Forward NX window ID to client --- lib/Arctica/Telekinesis/Server.pm | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) (limited to 'lib/Arctica') diff --git a/lib/Arctica/Telekinesis/Server.pm b/lib/Arctica/Telekinesis/Server.pm index 63e6839..20996b6 100644 --- a/lib/Arctica/Telekinesis/Server.pm +++ b/lib/Arctica/Telekinesis/Server.pm @@ -113,13 +113,24 @@ sub c2s_service_neg { # If server side is newest, serverside must know if we are compatible. # If client side is newest, we expect client to tell us if we have a compatible pair. BugOUT(9,"Service Negotiation Step 1"); - $_[3]->server_send($_[2],'srvcneg',{ - step => 2, - services => { - multimedia => 1, - webcontent => 1, - }, + warn("WAITING FOR CLIENTNXWID VIA TEKICMD!!!!!"); + Glib::Timeout->add(100, sub { + if ($self->{'nx'}{'clientnxwid'} =~ /^([\da-zA-Z]{4,})$/) { + BugOUT(8,"Ok... Got clientnxwid!"); + $self->tekicli_send('srvcneg',{ + step => 2, + services => { + multimedia => 1, + webcontent => 1, + }, + clientnxwid => $self->{'nx'}{'clientnxwid'}, + }); + return 0; + } else { + return 1; + } }); + } elsif ($jdata->{'step'} eq 3) { BugOUT(9,"Service Negotiation Step 3"); # By this point we should be done negotiating... @@ -259,6 +270,15 @@ sub _app_reg { } } +sub set_client_nxwid { + my $self = $_[0]; + if ($_[1] =~ /([\da-zA-Z]{4,})/) { + $self->{'nx'}{'clientnxwid'} = $1; + } else { + $self->{'nx'}{'clientnxwid'} = 0; + } +} + sub tmp_socket_info { # TMP function to inform about socket ID. # A version of this may be done to provide this info when running TeKi outside of Arctica. -- cgit v1.2.3