add OnFinishLogin handling to packet inspector
This commit is contained in:
@@ -34,6 +34,7 @@ func (p *Proxy) Start() (err error) {
|
|||||||
p.Servee.RegisterCritical(p.OnAnything)
|
p.Servee.RegisterCritical(p.OnAnything)
|
||||||
|
|
||||||
p.Servee.RegisterCriticalUntilLatest(p.OnFinishConfiguration)
|
p.Servee.RegisterCriticalUntilLatest(p.OnFinishConfiguration)
|
||||||
|
p.Servee.RegisterCriticalUntilLatest(p.OnFinishLogin)
|
||||||
p.Servee.RegisterCriticalUntilLatest(p.OnHandshake)
|
p.Servee.RegisterCriticalUntilLatest(p.OnHandshake)
|
||||||
//p.Servee.RegisterCriticalUntilLatest(p.OnCompress)
|
//p.Servee.RegisterCriticalUntilLatest(p.OnCompress)
|
||||||
p.Client.RegisterCriticalUntilLatest(p.OnCompress)
|
p.Client.RegisterCriticalUntilLatest(p.OnCompress)
|
||||||
@@ -78,6 +79,17 @@ func (p *Proxy) OnFinishConfiguration(packet *v1_21_11.ConfigurationToServerPack
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (p *Proxy) OnFinishLogin(packet *v1_21_11.LoginToServerPacketLoginAcknowledged) (err error) {
|
||||||
|
err = p.Client.Send(packet)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
p.Servee.SetState(proto_base.Configuration)
|
||||||
|
p.Client.SetState(proto_base.Configuration)
|
||||||
|
err = event.DontForwardErr
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func (p *Proxy) OnHandshake(packet *v1_21_11.HandshakingToServerPacketSetProtocol) (err error) {
|
func (p *Proxy) OnHandshake(packet *v1_21_11.HandshakingToServerPacketSetProtocol) (err error) {
|
||||||
err = p.Client.Send(packet)
|
err = p.Client.Send(packet)
|
||||||
state := proto_base.State(packet.NextState)
|
state := proto_base.State(packet.NextState)
|
||||||
|
|||||||
Reference in New Issue
Block a user