Iris2.de
http://iris2.de/forum/

OpenBrowser Packet Implementation
http://iris2.de/forum/viewtopic.php?f=15&t=1398
Page 1 of 1

Author:  Sehlor [ Mon May 18, 2009 6:56 am ]
Post subject:  OpenBrowser Packet Implementation

I See This Packet Is Not Implemented Then I Implement It:

Opens Default Web Browser
Tested In Windows Xp/Vista, Internet Explorer, FireFox

Code:
function gPacketHandler.kPacket_Web_Browser()
    local input = GetRecvFIFO()
    local id = input:PopNetUint8()
    local size = input:PopNetUint16()
    local url = FIFO_PopZeroTerminatedString(input, size)
    local file = io.open("tmp.url", "w")
    file:write("[InternetShortcut]\n")
    file:write("URL=" .. tostring(url) .. "\n")
    file:flush()
    file:close()
    io.popen(tostring("tmp.url"))
end


packet id = 0xA5
Staff Command: [ob www.iris2.de

Regards
Sehlor

Author:  ghoulsblade [ Mon May 18, 2009 9:38 am ]
Post subject: 

thanks =) there's also
main.lua:357: OpenBrowser(url)
but that's also not more reliable.

Author:  Sehlor [ Mon May 18, 2009 9:53 am ]
Post subject: 

and then, there is 2 way to choose :P

Code:
function gPacketHandler.kPacket_Web_Browser()
    local input = GetRecvFIFO()
    local id = input:PopNetUint8()
    local size = input:PopNetUint16()
    local url = FIFO_PopZeroTerminatedString(input, size)
    OpenBrowser(url)
end


which one is better ?

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/