Skip to main content

Python for VC:MP Server Plugin

Project description

Python for VC:MP Server Plugin

GitHub Issues or Pull Requests GitHub Issues or Pull Requests GitHub License GitHub Release GitHub Tag GitHub Repo stars

赞助

许可证

MIT

贡献

如果你有能力,你可以向我们的仓库提交 Pull Request 或 Issue。

开发进度

目前 master 是主分支, rwir 分支上正在将进行 rust 重写的工作, 在修一些小问题,欢迎贡献

lets RWIR!

TODO

  • 实现 NPC 插件(habi)的 bindings
  • 实现 Exports 出来的 bindings

鸣谢

ysc3839 提供一些 Python 开发思路 shenjack 帮助解决一些很屎的代码,并且提供了一些参考代码

使用

如果你是 Linux 用户 (Docker)

docker run -d --name vcmp-python -v /path/to/your/server:/app -p 8192:8192 tianxiu2b2t/vcmp-python server

如果你是 Windows 用户

  1. pip 包安装
pip install vcmp-python-plugin
  1. 下载对应的 python 版本 dll 文件,或在 pip 包中寻找对应的 dll 文件
  2. 将 dll 文件放入你的 VCMP 服务器 plugins 文件夹中
  3. 修改 server.cfg 文件,添加以下内容
plugins python04rel64rspyo3py<python version>.dll
# 非必要不要开启……
# python_preloader false
python_script_path main.py
# 虚拟环境,比如 .venv/lib/python3.8/site-packages
# python_virtual_env 
# 日志等级,默认 INFO
# python_log_level INFO
# 检查更新,默认为 true
# python check_update true
# 是否记录日志,默认为 false
# python_file_log
# 重载脚本的时候,忽略已加载的模块,默认为 
# 例子: _bcrypt,_signal
# python_ignore_py_modules

or python_cfg.toml

[script]
script_path = "main.py"
virtual_env = ".venv/lib/python3.8/site-packages"
# 默认为 false
# preloader = false
[logger] # 可选
log_level = "INFO"
file_log = false

[advanced] # 可选
check_update = true
ignore_py_modules = [
    "_bcrypt",
    "_signal"
]
  1. 启动你的服务器
server.exe

示例脚本 (等有缘人提供)

main.py:


Build

  1. 安装 Python 和 rustc & cargo 依赖
  2. 进入目录
cargo build --release

如果你怕更新的时候复制插件到 plugins 里的话,可以访问此项目

vcmp-python-plugin-link 页面下载最新的插件

Project details


Release history Release notifications | RSS feed

This version

2.1.2

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vcmp_python_plugin-2.1.2.tar.gz (78.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vcmp_python_plugin-2.1.2-py3-none-any.whl (79.6 MB view details)

Uploaded Python 3

File details

Details for the file vcmp_python_plugin-2.1.2.tar.gz.

File metadata

  • Download URL: vcmp_python_plugin-2.1.2.tar.gz
  • Upload date:
  • Size: 78.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for vcmp_python_plugin-2.1.2.tar.gz
Algorithm Hash digest
SHA256 f7b62d88714e5f3b6c6ecc3bcdf4ea42351ad1d8ec27bbcc7980fb4c170f2223
MD5 48205a0e3a35edc04798084fb0cb1947
BLAKE2b-256 e9cc43d9d92169c93c2903bee478951b2129de3b64600a56d43faaafeedcde0d

See more details on using hashes here.

File details

Details for the file vcmp_python_plugin-2.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for vcmp_python_plugin-2.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 676855d70e01d18fc4bd306670677a8fd7d53a12f7652133eeaaefea29239350
MD5 38c910e64b55a719f8ca8adc7d08d28e
BLAKE2b-256 f13ae214053c0222f768150540f7fdca085a4bbafe12b098506bc0a9cb33723a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page