Exemple #1
0
def PlayCharacter(slot):
    p = PacketWriter(0x5d)
    p.uint(0)
    p.fixstring("", 30)
    p.ushort(0)
    p.uint(0)
    p.fixstring("", 24)
    p.uint(slot)
    p.uint(0xdeadbeef)
    return p.finish()
Exemple #2
0
def PlayCharacter(slot):
    p = PacketWriter(0x5d)
    p.uint(0)
    p.fixstring("", 30)
    p.ushort(0)
    p.uint(0)
    p.fixstring("", 24)
    p.uint(slot)
    p.uint(0xdeadbeef)
    return p.finish()
Exemple #3
0
def TalkUnicode(text, keyword, type=0xc0, hue=0x34, font=1):
    p = PacketWriter(0xad)
    p.byte(type)
    p.ushort(hue)
    p.ushort(font)
    p.fixstring('Eng', 4)
    p.byte(0x00)
    p.byte(0x10)
    p.byte(keyword)
    p.cstring(text)
    return p.finish()
Exemple #4
0
def TalkUnicode(text, keyword, type=0xc0, hue=0x34, font=1):
    p = PacketWriter(0xad)
    p.byte(type)
    p.ushort(hue)
    p.ushort(font)
    p.fixstring('Eng', 4)
    p.byte(0x00)
    p.byte(0x10)
    p.byte(keyword)
    p.cstring(text)
    return p.finish()
Exemple #5
0
    def to_data(self):
        packet = PacketWriter(0xA8, self.packet_length)
        packet.byte(self.server_list.sys_info_flag)
        packet.ushort(self.server_list.count)

        for server in self.server_list.servers:
            packet.ushort(server.index)
            packet.fixstring(server.name, 32)
            packet.byte(server.percent_full)
            packet.byte(server.timezone)
            packet.ipv4(server.ip, True)

        return packet.finish()
Exemple #6
0
def TalkUnicode(text, keyword=None, type=0, hue=0x34, font=1):
    assert (type & 0xc0) == 0

    if keyword is not None:
        type |= 0xc0

    p = PacketWriter(0xad)
    p.byte(type)
    p.ushort(hue)
    p.ushort(font)
    p.fixstring('Eng', 4)

    if keyword is not None:
        p.byte(0x00)
        p.byte(0x10 | (keyword >> 8))
        p.byte(keyword)

    p.ucstring(text)
    return p.finish()
Exemple #7
0
def CreateCharacter(name):
    p = PacketWriter(0x00)
    p.uint(0xedededed)
    p.uint(0xffffffff)
    p.byte(0x00)
    p.fixstring(name, 30)
    p.ushort(0x0000)
    p.uint(0x0000003f)  # flags
    p.uint(0x00000001)
    p.uint(0x0000000f)
    p.byte(0x00)  # profession
    p.byte(0x00)
    p.byte(0x00)
    p.byte(0x00)
    p.uint(0x00000000)
    p.uint(0x00000000)
    p.byte(0x02)  # male?
    p.byte(0x3c)  # str
    p.byte(0x0a)  # dex
    p.byte(0x0a)  # int
    p.byte(0x19)  # is1
    p.byte(0x27)  # vs1
    p.byte(0x2c)  # is2
    p.byte(0x0b)  # vs2
    p.byte(0x0b)  # is3
    p.byte(0x32)  # vs3
    p.ushort(0x03ea)  # hue
    p.ushort(0x2047)  # hair
    p.ushort(0x044e)  # hair hue
    p.ushort(0x204b)  # facial hair
    p.ushort(0x044e)  # facial hair hue
    p.byte(0x00)
    p.byte(0x00)  # city
    p.uint(0x00000000)  # char slot
    p.uint(0xdeadbeef)  # client ip
    p.ushort(0x00e0)  # shirt hue
    p.ushort(0x01a1)  # pants hue
    return p.finish()
Exemple #8
0
def GameLogin(username, password, auth_id):
    p = PacketWriter(0x91)
    p.uint(auth_id)
    p.fixstring(username, 30)
    p.fixstring(password, 30)
    return p.finish()
Exemple #9
0
def AccountLogin(username, password):
    p = PacketWriter(0x80)
    p.fixstring(username, 30)
    p.fixstring(password, 30)
    p.byte(0)
    return p.finish()
Exemple #10
0
def GameLogin(username, password, auth_id):
    p = PacketWriter(0x91)
    p.uint(auth_id)
    p.fixstring(username, 30)
    p.fixstring(password, 30)
    return p.finish()
Exemple #11
0
def AccountLogin(username, password):
    p = PacketWriter(0x80)
    p.fixstring(username, 30)
    p.fixstring(password, 30)
    p.byte(0)
    return p.finish()