package Ġrs . d us k . social . network . client . codec . identification . handle Ċ Ċ import Ġcom . github . m ichael bull . logging . Inline Logger Ċ import Ġio . netty . channel . Channel HandlerContext Ċ import Ġrs . d us k . core . network . codec . Codec Repository Ċ import Ġrs . d us k . core . network . codec . set Codec Ċ import Ġrs . d us k . core . network . getClient Ċ import Ġrs . d us k . core . network . model . session . getSession Ċ import Ġrs . d us k . core . network . model . session . set Session Ċ import Ġrs . d us k . social . network . client . Social Client Ċ import Ġrs . d us k . social . network . codec . identification . Identification MessageHandler Ċ import Ġrs . d us k . social . network . codec . identification . message . Identification Response Message Ċ import Ġrs . d us k . social . network . codec . relay . Relay Codec Ċ import Ġrs . d us k . social . network . codec . relay . message . friend . Private Chat Status Change Message Ċ import Ġrs . d us k . social . network . session . Relay Session Ċ import Ġrs . d us k . social . utility . inject Ċ import Ġkotlin . system . exit Process Ċ Ċ /** Ċ Ġ* Ġ@ author ĠTy lu ur Ġ< contact @ k ia ira . tech > Ċ Ġ* Ġ@ since ĠMay Ġ 1 3 , Ġ 2 0 2 0 Ċ Ġ*/ Ċ class ĠIdent ification Response MessageHandler Ġ: ĠIdent ification MessageHandler < Identification Response Message >() Ġ{ ĊĉĊ ĉ private Ġval Ġlogger Ġ= ĠInline Logger () ĊĉĊ ĉ /** Ċĉ Ġ* ĠThe Ġrepository Ġto Ġfind Ġcodecs Ġfrom Ċĉ Ġ*/ Ċ ĉ private Ġval Ġrepository Ġ: ĠCodec Repository Ġby Ġinject () ĊĉĊ ĉ override Ġfun Ġhandle ( ctx Ġ: ĠChannel HandlerContext , Ġmsg Ġ: ĠIdent ification Response Message ) Ġ= Ġwith ( msg ) Ġ{ Ċĉ ĉ val Ġchannel Ġ= Ġctx . channel () ĊĉĉĊĉ ĉ if Ġ(! successful ) Ġ{ Ċĉĉ ĉ logger . debug Ġ{ Ġ" Identification Ġwas Ġun successful , Ġterminating Ġconnection ..." Ġ} Ċĉĉ ĉ channel . close () Ċĉĉ ĉ exit Process ( 0 ) Ċĉ ĉ } Ċĉ ĉ val Ġworld Id Ġ= Ġ( channel . getClient () Ġas ĠSocial Client ). configuration . world Id Ċĉ ĉ val Ġsession Ġ= ĠRelay Session ( world Id , Ġchannel ) ĊĉĉĊĉ ĉ // Ġchange Ġattributes Ċĉ ĉ channel . set Codec ( repository . get ( Relay Codec :: class )) Ċĉ ĉ channel . set Session ( session ) ĊĉĉĊĉ ĉ logger . debug Ġ{ Ġ" Identification Ġwas Ġsuccessful , Ġwe Ġhave Ġtransferred Ġover Ġto Ġthe Ġrelay Ġstate ." Ġ} Ċ ĉ } Ċĉ Ċ }