Coder Social home page Coder Social logo

rap-sor / samp-cef Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pycckue-bnepeg/samp-cef

0.0 0.0 0.0 1.37 MB

Client and server plugins for SA:MP to embed CEF.

License: GNU General Public License v3.0

JavaScript 0.04% C++ 0.29% C 0.01% Rust 99.43% Pawn 0.23%

samp-cef's Introduction

SAMP CEF

This project embeds CEF into SA:MP expanding abilities to express yourself with beauty in-game interfaces using HTML / CSS / JavaScript.

It is a FRAMEWORK (or SDK), not something that you download and use. To be able to create you should have some webdev basics (JS / HTML / CSS).

What you can do

  • Create browser views from a gamemode or from client-side plugins (C ABI).
  • Place browsers on objects (with kind-of spatial sound)
  • Send and receive custom defined events from / to clients.

Crates

  • cef - Rust wrappers around CEF C API.
  • cef-api - Rust wrappers to build client plugins using CEF.
  • cef-interface - example of a Rust plugin.
  • cef-sys - bindings for CEF C API.
  • client - client CEF plugin.
  • d3dx9 - bindings to DirectX SDK.
  • loader - small loader that makes it work (should be named cef.asi).
  • messages - protobuf messages to communicate with server on net.
  • network - quinn glue (laminar like).
  • proto - raw proto files.
  • renderer - glue between CEF renderer process and main logic.
  • server - server side plugin.

Download

Latest builds from the master branch are placed in the Actions.

Currently there is those OS:

  • CentOS 7 (cef-centos-7.so)
  • Debian 9, 10, 11 (cef-debian-*.so)
  • Ubuntu 18.04, 20.04 (cef-ubuntu-*.so)
  • Windows (cef-windows.dll)

And also all client-side parts (cef.asi, client.dll, renderer.exe).

Building

Dependencies

  • Rust compiler (nightly) with i686-windows-pc-msvc toolchain
  • Prebuilt CEF with proprietary codes (if you wanna use streams). I had one for you in releases. (Client only)
  • Environment variable CEF_PATH that points to libcef.lib (client only).
    • In powershell it's like $env:CEF_PATH="C:/some/path"
    • Then build

Notes ...

If you get a linker error, you should change hard-coded links in the source code

  • client/build.rs - path to DirectX SDK (default one)

Running Rust

and now

cargo +nightly build --target i686-windows-pc-msvc --release

rustup toolchain install nightly-i686
cargo +nightly-i686 build --release

also the client plugin can be built using OpenAL for sound (rodio by default). to do that compile the client without default features. for example:

cargo +nightly-i686 build --release --package client --no-default-features

to make it work you should place openal.dll as sound.dll in the cef folder. I do not remember what version is used exactly ... but I have it on the release page.

to build specific part you can add --package <NAME>

for example if you will try to build ALL crates on linux, you will get an error. so, pass --package server to build only server on linux.

CEF version

Current versions of CEF and Chromium: 89.0.5+gc1f90d8+chromium-89.0.4389.40 release branch 4389

Date:             February 26, 2021

CEF Version:      89.0.5+gc1f90d8+chromium-89.0.4389.40
CEF URL:          https://bitbucket.org/chromiumembedded/cef.git
                  @c1f90d8c933dce163b74971707dbd79f00f18219

Chromium Version: 89.0.4389.40
Chromium URL:     https://chromium.googlesource.com/chromium/src.git
                  @2c3400a2b467aa3cf67b4942740db29e60feecb8

Docs

Video examples

BIG TODO: EXAMPLES

But it's similar to fivem or ragemp implementations.

samp-cef's People

Contributors

pycckue-bnepeg avatar kalixis avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.