public void Deserialize(ImgeneusPacket packetStream)
 {
     MoveTownId     = packetStream.ReadByte();
     MoveTownInfoId = packetStream.ReadByte();
     Bag            = packetStream.ReadByte();
     Slot           = packetStream.ReadByte();
 }
Esempio n. 2
0
        public void SelectServerSuccess(LoginClient client, byte[] worldIp)
        {
            using var packet = new ImgeneusPacket(PacketType.SELECT_SERVER);

            packet.Write((sbyte)SelectServer.Success);
            packet.Write(worldIp);

            client.Send(packet);
        }
Esempio n. 3
0
        public void SelectServerFailed(LoginClient client, SelectServer error)
        {
            using var packet = new ImgeneusPacket(PacketType.SELECT_SERVER);

            packet.Write((sbyte)error);
            packet.Write(new byte[4]);

            client.Send(packet);
        }
Esempio n. 4
0
        public void AuthenticationFailed(LoginClient client, AuthenticationResult result)
        {
            using var packet = new ImgeneusPacket(PacketType.LOGIN_REQUEST);

            packet.Write((byte)result);
            packet.Write(new byte[21]);

            client.Send(packet);
        }
Esempio n. 5
0
        public void SendLoginHandshake(LoginClient client)
        {
            using var packet = new ImgeneusPacket(PacketType.LOGIN_HANDSHAKE);

            packet.Write <byte>(0);
            packet.Write((byte)client.CryptoManager.RSAPublicExponent.Length); // Exponent length
            packet.Write((byte)client.CryptoManager.RSAModulus.Length);
            packet.WritePaddedBytes(client.CryptoManager.RSAPublicExponent, 64);
            packet.WritePaddedBytes(client.CryptoManager.RSAModulus, 128);

            client.Send(packet, false);
        }
Esempio n. 6
0
        public void Deserialize(ImgeneusPacket packetStream)
        {
            TimeInterval = packetStream.Read <short>();
            var messageLength = packetStream.Read <byte>();

            // Message always ends with an empty character
#if EP8_V2 || SHAIYA_US
            Message = packetStream.ReadString(messageLength, Encoding.Unicode);
#else
            Message = packetStream.ReadString(messageLength);
#endif
        }
Esempio n. 7
0
        public void AuthenticationSuccess(LoginClient client, AuthenticationResult result, DbUser user, bool isAdmin)
        {
            using var packet = new ImgeneusPacket(PacketType.LOGIN_REQUEST);

            packet.Write((byte)result);
            packet.Write(user.Id);
            packet.Write(isAdmin ? (byte)0 : (byte)255);
            packet.Write(client.Id.ToByteArray());

            client.Send(packet);

            SendServerList(client);
        }
Esempio n. 8
0
        /// <summary>
        /// Sends a notice to a player
        /// </summary>
        /// <param name="character">Receiver character</param>
        /// <param name="noticeType">Notice type</param>
        /// <param name="message">Notice's message text</param>
        private void SendNoticeToPlayer(Character character, PacketType noticeType, string message)
        {
            using var packet = new ImgeneusPacket(noticeType);

            packet.WriteByte((byte)message.Length);

#if EP8_V2 || SHAIYA_US
            packet.WriteString(message, message.Length, Encoding.Unicode);
#else
            packet.WriteString(message);
#endif

            character.GameSession.Client.Send(packet);
        }
Esempio n. 9
0
        public void SendServerList(LoginClient client)
        {
            using var packet = new ImgeneusPacket(PacketType.SERVER_LIST);

            var worlds = _server.GetConnectedWorlds();

            packet.Write((byte)worlds.Count());

            foreach (var world in worlds)
            {
                packet.Write(world.Id);
                packet.Write((byte)world.WorldStatus);
                packet.Write(world.ConnectedUsers);
                packet.Write(world.MaxAllowedUsers);
                packet.WriteString(world.Name, 32);
            }

            client.Send(packet);
        }
Esempio n. 10
0
 public void Deserialize(ImgeneusPacket packetStream)
 {
     // This is empty packet. Needed for server.
 }
Esempio n. 11
0
 public void Deserialize(ImgeneusPacket packetStream)
 {
     MobId = packetStream.Read <int>();
 }