1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. GTA Network forum is now in archive mode.

Closed CEF Problem

Discussion in 'Solved & Closed' started by HuMMeR, Jul 13, 2017.

  1. HuMMeR

    HuMMeR Member

    Messages:
    11
    Likes Received:
    1
    Joined:
    Jul 7, 2017
    Title:
    CEF Problem
    What's wrong?:
    CEF
    What should normally happen?:
    -
    How to reproduce the issue:
    -
    Write any additional information (Use spoilers for images):
    Help me, cef find file, don't show(( on other server is worked
    My result - 200 Code (OK) other server code(200) don't

    How fix?

    Code:
    DOWN /\_Other_Server_/\ DOWN
    [09:28:36] --> Initiatlize: Creating device
    [09:28:46] --> Browser: Start
    [09:28:46] -> Instantiated Renderer
    [09:28:46] --> Browser: Creating Browser
    [09:28:46] --> Browser: End
    [09:28:46] -> Browser created!
    [09:28:46] Trying to load page https://rpg/login.html...
    [09:28:46] -> [Local mode] Uri: https://rpg/login.html
    [09:28:46] -> Loading: D:\Games\GTANetwork\resources\rpg\login.html
    [09:28:46] Closed file stream!
    [09:28:46] -> Start: https://rpg/login.html
    [09:28:46] -> [Local mode] Uri: https://rpg/css/gta5.css
    [09:28:46] -> Loading: D:\Games\GTANetwork\resources\rpg\css\gta5.css
    [09:28:46] Closed file stream!
    [09:28:46] -> [Local mode] Uri: https://rpg/img/r.jpg
    [09:28:46] -> Loading: D:\Games\GTANetwork\resources\rpg\img\r.jpg
    [09:28:46] -> [Local mode] Uri: https://rpg/js/jquery-1.10.2.js
    [09:28:46] -> Loading: D:\Games\GTANetwork\resources\rpg\js\jquery-1.10.2.js
    [09:28:46] -> Error: File does not exist!
    [09:28:46] Closed file stream!
    [09:28:48] -> Setting main context!
    [09:28:48] -> Main context set!
    [09:28:48] -> End: https://rpg/login.html, -3
    [09:28:48] -> [Local mode] Uri: https://rpg/fonts/ChaletLondon.ttf
    [09:28:48] -> Loading: D:\Games\GTANetwork\resources\rpg\fonts\ChaletLondon.ttf
    [09:28:48] Closed file stream!
    UP /\_Other_Server_/\ UP
    
    DOWN__MY Server__DOWN
    
    [09:38:43] --> Initiatlize: Creating device
    [09:38:47] --> Browser: Start
    [09:38:47] -> Instantiated Renderer
    [09:38:47] --> Browser: Creating Browser
    [09:38:47] --> Browser: End
    [09:38:47] -> Browser created!
    [09:38:47] Trying to load page https://game/clientside/resources/boilerplate.html...
    [09:38:47] -> [Local mode] Uri: https://game/clientside/resources/boilerplate.html
    [09:38:47] -> Loading: D:\Games\GTANetwork\resources\game\clientside\resources\boilerplate.html
    [09:38:47] Closed file stream!
    [09:38:47] -> Start: https://game/clientside/resources/boilerplate.html
    [09:38:47] -> [Local mode] Uri: https://game/clientside/resources/main.css
    [09:38:47] -> Loading: D:\Games\GTANetwork\resources\game\clientside\resources\main.css
    [09:38:47] Closed file stream!
    [09:38:47] -> End: https://game/clientside/resources/boilerplate.html, 200
    
    META.FIle
    Code:
            <file src="clientside/resources/main.css" />  
            <file src="clientside/resources/boilerplate.html" />
    
           
        <!-- Main -->
            <script src="clientside/main.js" type="client" lang="javascript" />
    JS.FILE
    Code:
    class CefHelper {
      constructor (resourcePath) {
        this.path = resourcePath
        this.open = false
      }
    
      show () {
        if (this.open === false) {
          this.open = true
    
          var resolution = API.getScreenResolution()
    
          this.browser = API.createCefBrowser(resolution.Width, resolution.Height, true)
          API.waitUntilCefBrowserInit(this.browser)
          API.setCefBrowserPosition(this.browser, 0, 0)
          API.loadPageCefBrowser(this.browser, this.path)
          API.showCursor(true)
        }
      }
    
      destroy () {
        this.open = false;
        API.destroyCefBrowser(this.browser)
        API.showCursor(false)
      }
    
      eval (string) {
        this.browser.eval(string)
      }
    }
    
    var cef = null;
    
    API.onResourceStart.connect(function() {
      cef = new CefHelper('clientside/resources/boilerplate.html');
      cef.show();
    });
    
    API.onResourceStop.connect(function() {
      cef.destroy();
    });
     
    Last edited: Jul 13, 2017
  2. Vance

    Vance Well-Known Member

    Messages:
    244
    Likes Received:
    40
    Joined:
    Aug 31, 2016
  3. HuMMeR

    HuMMeR Member

    Messages:
    11
    Likes Received:
    1
    Joined:
    Jul 7, 2017

Share This Page