コード例 #1
0
        private PacketResult CertificationAck(Session arg1, Packet arg2)
        {
            var result = new PacketResult(PacketResultAction.Replace);

            _certificationManager.ReadAck(arg2);

            foreach (var redirect in this.Service.Settings.Redirections)
            {
                if (_certificationManager.NodeLinks.ContainsKey(redirect.CoordID))
                {
                    var link = _certificationManager.NodeLinks[redirect.CoordID];

                    var parentNode = _certificationManager.NodeData[link.ParentNodeID];

                    //SPOOF
                    //parentNode.NodeType = redirect.MachineID;
                    parentNode.Port = redirect.Port;

                    _certificationManager.NodeData[link.ParentNodeID] = parentNode;
                }
                else
                {
                    StaticLogger.Logger[this.Name].Fatal($"Coord({redirect.CoordID}) not found. Redirect impossible, please check Filter.xml!");
                }
            }

            var packet = new Packet(arg2.Opcode, arg2.Encrypted, arg2.Massive);

            _certificationManager.WriteAck(packet, true, true);

            result.Add(packet);

            return(result);
        }
コード例 #2
0
        private PacketResult CertificationReq(Session arg1, Packet arg2)
        {
            var result   = new PacketResult(PacketResultAction.Replace);
            var response = new Packet(arg2.Opcode, arg2.Encrypted, arg2.Massive);

            _certificationManager.ReadReq(arg2);

            //_certificationManager.RequestIP = "192.168.178.10";

            _certificationManager.WriteReq(response);

            result.Add(response);
            return(result);
        }