Ejemplo n.º 1
0
 public override void Dispatch(InPacket inPacket)
 {
     using (OutPacket outPacket = new OutPacket(inPacket))
     {
         if (ServerSession.Instance != null)
         {
             ServerSession.Instance.Send(outPacket.ToArray());
         }
     }
 }
Ejemplo n.º 2
0
        public byte[] GetHashPacket()
        {
            using (OutPacket outPacket = new OutPacket(0x0999))
            {
                foreach (string path in Directory.GetFiles(this.Config.MapleStoryPath))
                {
                    string extension = Path.GetExtension(path);
                    string name = Path.GetFileNameWithoutExtension(path);

                    if (extension.ToLower().Contains("wz"))
                    {
                        outPacket.WriteString(name);
                        outPacket.WriteString(HashUtilities.GetMD5HashFromFile(path));
                    }
                }

                return outPacket.ToArray();
            }
        }
Ejemplo n.º 3
0
        public void Handshake(ServerInfo serverInfo)
        {
            _encryptIV = new byte[4];
            rnd.NextBytes(_encryptIV);
            _decryptIV = new byte[4];
            rnd.NextBytes(_decryptIV);

            using (OutPacket outPacket = new OutPacket())
            {
                outPacket.WriteUShort(serverInfo.Version);
                outPacket.WriteString(serverInfo.Subversion);
                outPacket.WriteBytes(_decryptIV);
                outPacket.WriteBytes(_encryptIV);
                outPacket.WriteByte((byte)serverInfo.Localisation);
                outPacket.WriteByte(); // NOTE: Unknown, added in v.160.1.

                this.Send(outPacket.ToArray());
            }

            Session.AssignUserKey(this.ServerInfo);
        }
Ejemplo n.º 4
0
        public void Handshake(ServerInfo serverInfo)
        {
            _encryptIV = new byte[4];
            rnd.NextBytes(_encryptIV);
            _decryptIV = new byte[4];
            rnd.NextBytes(_decryptIV);

            using (OutPacket outPacket = new OutPacket())
            {
                outPacket.WriteUShort(serverInfo.Version);
                outPacket.WriteString(serverInfo.Subversion);
                outPacket.WriteBytes(_decryptIV);
                outPacket.WriteBytes(_encryptIV);
                outPacket.WriteByte((byte)serverInfo.Localisation);
                outPacket.WriteByte(); // NOTE: Unknown, added in v.160.1.

                this.Send(outPacket.ToArray());
            }

            Session.AssignUserKey(this.ServerInfo);
        }