Jump to content

CEF: How to deal with it?


Jusonex

Recommended Posts

  • Scripting Moderators

I have problem when trying to start MTA:

"The procedure entry point K32EnumProcessModules could not be located in the dynamic link library KERNEL32.dll"

"Failed to load: 'D:\Program Files\MTA San Andreas 1.4 Test\mta\loader.dll'"

Help? :(

Link to comment

Its Awesome. something which Mta really needs (as i think). i have so many plans for using it.

Great job @jusonex!!

@Woovie, When i first read jusonex's post i thought of making inside mta browser

but after that i see you already did(oh yeah).

Gonna Test Soon! (So excited!!)

Well, I have a Question,

Can we somehow remove browser address and allow only video to be visible ?

Link to comment
Would it be possible to open a HTML page on your local machine? C:\html\index.html

Yes, but more like resource:file.html. Nothing should have access outside of its own resource unless exported somehow.

Oh yeah, I said a stupid question. It's using fetchRemote lol.

Its Awesome. something which Mta really needs (as i think)

Needs? No, MTA doesn't need it. MTA needs bug fixes, then super new radical features.

Link to comment
Its Awesome. something which Mta really needs (as i think)

Needs? No, MTA doesn't need it. MTA needs bug fixes, then super new radical features.

Oh sorry, I was referring to Person and to the script. I was saying Mta really needs more developers and creative minds.

But really there is 'as i think' which means its my opinion and by 'mta' i want to say my public server.

Link to comment

I have some ideas in mind wich i want to keep them private for now with this, and i've got a few ideas to add:

-Event to detect when a page was finished loading, containing the url, weight, etc.

-Basically, you can click with mouse with injectBrowserMouseDown, isnt it possible (and relatively easy) to clone this into keyboard?, if you can provide a way to inject keys, i can manage to make in lua an inject to each key with some IFs over there.

-Why is a webpage unloaded while minimizing MTA?, i'm also unsure if there's an event in mta to check if a client minimized MTA.

-How is this "loading" actually done? via going to server side and server loading and then coming back to the client, or is it direct from client>webpage? a way to block them, was to let the server "overwatch" what the client does (loads, etc), and be able to cancel it, like the server would be notified when a client starts loading a page, and if it doesnt like it, tell the client to stop it loading (eg. cancelEvent)

Also, does it need a big "performance" jump? like, will my FPS have any hard blow using this web pages?

And finally, pages like a youtube videos, the video needs to be downloaded first, or is it just streamed?

EDIT: Randomly did this, could fix the issue where minimizing unloads them:

  
Pages = {} 
Unloaded = {} 
function onClientMinimize() 
if Pages then 
---Add Unloaded 
--Unload Pages (Aka remove them) 
end 
end 
addEventHandler("onClientMinimize", getRootElement(), onClientMinimize) 
  
function onClientRestore() 
if Unloaded then 
--Load Pages back (Aka add them to Pages) 
end 
end 
addEventHandler("onClientRestore", getRootElement(), onClientRestore) 
  

Link to comment
Event to detect when a page was finished loading, containing the url, weight, etc.

There's already the function "isBrowserLoading", but an event is also a good idea.

Basically, you can click with mouse with injectBrowserMouseDown, isnt it possible (and relatively easy) to clone this into keyboard?, if you can provide a way to inject keys, i can manage to make in lua an inject to each key with some IFs over there.

I updated https://wiki.multitheftauto.com/wiki/User:Jusonex right now. (These functions are not included in the testbuild though)

Why is a webpage unloaded while minimizing MTA?, i'm also unsure if there's an event in mta to check if a client minimized MTA.

Does that happen to the entire webpage or only to the flash player?

How is this "loading" actually done? via going to server side and server loading and then coming back to the client, or is it direct from client>webpage? a way to block them, was to let the server "overwatch" what the client does (loads, etc), and be able to cancel it, like the server would be notified when a client starts loading a page, and if it doesnt like it, tell the client to stop it loading (eg. cancelEvent)

The client loads the webpage directly. If you'd like to monitor the webtraffic, there will be an event named 'onClientWebBrowserNavigate' or something. But you won't be able to modify the source due to security issues (something like that would be similar to XSS attacks).

Also, does it need a big "performance" jump? like, will my FPS have any hard blow using this web pages?

Awesomium and CEF (Chromium Embedded Framework) are both based on Chromium which uses a multi-process architecture. That means every webpage you loaded is rendered in its own process and doesn't influence MTA's performance directly.

And finally, pages like a youtube videos, the video needs to be downloaded first, or is it just streamed?

Since this is going to be a full-fledged webbrowser, YouTube videos are streamed in the same way as in your webbrowser.

Link to comment

Somenone can test this?

  
  
function playerPressedKey(key, press) 
    if webBrowser then 
        if (press) then 
            injectBrowserKeyDown(webBrowser, key) 
            else 
            injectBrowserKeyUp(webBrowser, key) 
        end 
    end 
end 
addEventHandler("onClientKey", root, playerPressedKey) 

PD: Could you make just like the rest of the wiki, "functions to be added"? as we know if they're aviable yet. (And also specify the testbuild version)

Link to comment
Hey i'm unsure, in the code you pasted up there in the start post, how you defined RenderTarget?

Oops, I edited the example. You can find better examples here tho: https://wiki.multitheftauto.com/wiki/User:Jusonex

Could you make just like the rest of the wiki, "functions to be added"? as we know if they're aviable yet. (And also specify the testbuild version)

I added a testbuild of the last revision now. All functions that are listed on my wikipage exist.

Downloadlink: https://github.com/Jusonex/mtasa-awesom ... ium0.2.zip

Link to comment

No. onClientKey is the lower level API since it doesn't differentiate between lowercase and uppercase characters and doesn't take localised keyboards into account.

In contrast onClientCharacter provides the exact (unicode) character.

In conclusion injectKeyboardCharacter + onClientCharacter should be used for character input and injectKeyboardKeyDown/-Up + onClientKey for control input.

Link to comment

Great work, i think youre a bit too much obsessed with security though. Some windows requesting access to sites would be just annoying in my opinion. We can already download anything to the client and display it pr whatever.. so i dont think that its such an issue, and no popular servers would misuse it as players might leave.

Link to comment
No. onClientKey is the lower level API since it doesn't differentiate between lowercase and uppercase characters and doesn't take localised keyboards into account.

In contrast onClientCharacter provides the exact (unicode) character.

In conclusion injectKeyboardCharacter + onClientCharacter should be used for character input and injectKeyboardKeyDown/-Up + onClientKey for control input.

But wont that make it go twice? since they will be both triggered.

Link to comment
Great work, i think youre a bit too much obsessed with security though. Some windows requesting access to sites would be just annoying in my opinion. We can already download anything to the client and display it pr whatever.. so i dont think that its such an issue, and no popular servers would misuse it as players might leave.

LOL. Security is the #1 concern. Let's say if someone managed to exploit the browser to download a file thanks to a completely open backend with no white/blacklist. That file hits your PC and it's a virus that can spread to the server and back to every player on it. Soon it spreads to everyone in MTA. Seems unreasonable, right? Not so much.

http://www.garrysmod.com/2014/04/19/exp ... -released/

This more or less just happened to Garry's Mod. Yes, it was a virus developed to work via a videogame. Security will always be the first priority.

Link to comment
Why a whitelist? just ask the server and client if they want to recive a file, then it can be managed by the scripters who make these work itself.

The server controls the whitelist via script. Global blacklist for specific sites. We may also manage a global whitelist so sites like say reddit.com are whitelisted permanently.

Link to comment
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...