Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port gamemode to Lua #108

Merged
merged 2 commits into from
Jan 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions gamemode/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# http://editorconfig.org
root = true

[*]
indent_size = 2
indent_style = space
quote_style = double
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[*.lua]
space_before_function_open_parenthesis = true
space_before_closure_open_parenthesis = true
align_call_args = true
align_continuous_assign_statement = false
align_continuous_rect_table_field = false
remove_call_expression_list_finish_comma = true
end_statement_with_semicolon = never
55 changes: 55 additions & 0 deletions gamemode/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<div align="center">
<a href="https://github.com/MafiaHub/MafiaMP"><img src="https://github.com/MafiaHub/Framework/assets/9026786/43e839f2-f207-47bf-aa59-72371e8403ba" alt="MafiaMP" /></a>
</div>

<div align="center">
<a href="https://discord.gg/eBQ4QHX"><img src="https://img.shields.io/discord/402098213114347520.svg" alt="Discord server" /></a>
<a href="LICENSE.md"><img src="https://img.shields.io/badge/License-MafiaHub%20OSS-blue" alt="license" /></a>
</div>

<br />
<div align="center">
Mafia: Multiplayer - Demo gamemode
</div>

<div align="center">
<sub>
Brought to you by <a href="https://github.com/Segfaultd">@Segfault</a>,
<a href="https://github.com/zaklaus">@zaklaus</a>,
<a href="https://github.com/DavoSK">@DavoSK</a>,
and other contributors!
</sub>
</div>
<hr/>

## Introduction

Demo gamemode for [Mafia: Multiplayer](https://github.com/MafiaHub/MafiaMP).

| Directory | Description |
| ------------------ | --------------------- |
| [/client](/client) | Client scripts |
| [/server](/server) | Server scripts |
| [/shared](/shared) | Shared scripts & data |

## Getting started

### VSCode typings

If you use VSCode, we recommend you to install [Lua Language Server extension](https://marketplace.visualstudio.com/items?itemName=sumneko.lua) which will allow you to benefit of autocompletion and many other advantages.

As the Lua Language Server extension [no longer supports single workspace](https://github.com/LuaLS/lua-lingual-server/discussions/3030), you need to open the workspace multiroot to take advantage of typing. Open `gamemode.code-workspace` in VSCode and click on **Open Workspace**.

- Annotations documentation is available here: https://luals.github.io/wiki/annotations/

## Contributing

We're always looking for new contributors, so if you have any ideas or suggestions, please let us know and we'll see what we can do to make it better. You can either reach us at our Discord server [MafiaHub](https://discord.gg/c6gW9yRXZH), or by raising an issue on our repository.

If you're interested in development, please read our [Contribution Guidelines](https://github.com/MafiaHub/Framework/blob/develop/.github/CONTRIBUTING.md).

## License

The code is licensed under the [MafiaHub OSS](LICENSE.txt) license.

The 5th clause exists to ensure that the work can focus primarily on this repository, as we provide an access to the multiplayer mod. This is important to ensure that the mod is not used for other purposes, such as the creation of other derivative projects, that would diverge from the original work. This approach guarantees that the changes are directly made to the original work itself, having a healthy ecosystem in mind.
19 changes: 19 additions & 0 deletions gamemode/client/.luarc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"$schema": "https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json",
"runtime.version": "Lua 5.4",
"workspace.library": [
"../shared/sdk.shared.d.lua"
],
"format": {
"defaultConfig": {
"quote_style": "double",
"space_before_function_open_parenthesis": "true",
"space_before_closure_open_parenthesis": "true",
"align_call_args": "true",
"align_continuous_assign_statement": "false",
"align_continuous_rect_table_field": "false",
"remove_call_expression_list_finish_comma": "true",
"end_statement_with_semicolon": "never"
}
}
}
1 change: 1 addition & 0 deletions gamemode/client/main.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Console.log("Hello from client!")
1 change: 1 addition & 0 deletions gamemode/client/sdk.client.d.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
---@meta _
29 changes: 29 additions & 0 deletions gamemode/gamemode.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"folders": [
{
"path": "."
},
{
"path": "client"
},
{
"path": "server"
},
{
"path": "shared"
}
],
"settings": {
"files.exclude": {
"server/": true,
"client/": true,
"shared/": true
}
},
"extensions": {
"recommendations": [
"editorconfig.editorconfig",
"sumneko.lua"
]
}
}
Loading