Skip to content
This repository has been archived by the owner on Jul 28, 2022. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Sleitnick/AeroGameFramework
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.4.1
Choose a base ref
...
head repository: Sleitnick/AeroGameFramework
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Apr 20, 2019

  1. Commit Data module

    Sleitnick committed Apr 20, 2019
    Copy the full SHA
    e7d667b View commit details

Commits on May 1, 2019

  1. Weird rejoin bug hotfix

    This change fixes a strange bug with players leaving and rejoining the same server
    ThoughtSpinnr authored May 1, 2019
    Copy the full SHA
    0998b9b View commit details
  2. Fix Increment()

    increment fix
    ThoughtSpinnr authored May 1, 2019
    Copy the full SHA
    1153ffc View commit details
  3. Merge pull request #76 from Rocky28447/data

    Weird rejoin bug tempfix
    Sleitnick authored May 1, 2019
    Copy the full SHA
    0125e1c View commit details

Commits on May 2, 2019

  1. defaultVal being table fix

    If the ``defaultVal`` passed to ``Data:Get()`` is a table, we now return and save a copy of the table rather than the original.
    ThoughtSpinnr authored May 2, 2019
    Copy the full SHA
    8477ed0 View commit details

Commits on May 6, 2019

  1. Merge pull request #79 from Rocky28447/data

    defaultVal being table fix
    Sleitnick authored May 6, 2019
    Copy the full SHA
    d8a15c1 View commit details

Commits on May 9, 2019

  1. Add Promise implementation

    Sleitnick committed May 9, 2019
    Copy the full SHA
    b34cf0a View commit details
  2. Update filelist

    Sleitnick committed May 9, 2019
    Copy the full SHA
    db1d31a View commit details
  3. Data promises

    Sleitnick committed May 9, 2019
    Copy the full SHA
    1aaa261 View commit details
  4. Data Get fix

    Sleitnick committed May 9, 2019
    Copy the full SHA
    20d4d91 View commit details

Commits on May 18, 2019

  1. Update Data.lua

    Acecateer authored May 18, 2019
    Copy the full SHA
    a1c7f93 View commit details
  2. Copy the full SHA
    f7dd9e7 View commit details

Commits on May 19, 2019

  1. Merge pull request #82 from Acecateer/data

    Add function for invoking OnClose functions
    Sleitnick authored May 19, 2019
    Copy the full SHA
    3f3303f View commit details
  2. Style changes

    Sleitnick committed May 19, 2019
    Copy the full SHA
    1d5960a View commit details

Commits on May 20, 2019

  1. Merge pull request #1 from Sleitnick/data

    Style changes
    Acecateer authored May 20, 2019
    Copy the full SHA
    c204279 View commit details
  2. Update Data.lua

    Acecateer authored May 20, 2019
    Copy the full SHA
    5693d6a View commit details
  3. Copy the full SHA
    0d7db1a View commit details
  4. Merge pull request #84 from Acecateer/data

    Add events "Success" and "Failed" for data methods
    Sleitnick authored May 20, 2019
    Copy the full SHA
    8f9bc49 View commit details

Commits on May 21, 2019

  1. Caching improvements

    Sleitnick committed May 21, 2019
    Copy the full SHA
    54fca9f View commit details
  2. Copy the full SHA
    c7424c1 View commit details
  3. Add comments

    Sleitnick committed May 21, 2019
    Copy the full SHA
    a50809f View commit details
  4. OrderedDataStore example

    Sleitnick committed May 21, 2019
    Copy the full SHA
    76091ba View commit details

Commits on Dec 15, 2019

  1. Update doc links

    Sleitnick committed Dec 15, 2019
    Copy the full SHA
    7b8a6ca View commit details

Commits on Dec 29, 2019

  1. Copy the full SHA
    699829d View commit details
  2. Merge master

    Sleitnick committed Dec 29, 2019
    Copy the full SHA
    d8f13a6 View commit details
  3. Filelist changes

    Sleitnick committed Dec 29, 2019
    Copy the full SHA
    2d5eaf1 View commit details
  4. Fix DataStore reference

    Sleitnick committed Dec 29, 2019
    Copy the full SHA
    492a698 View commit details
  5. Copy the full SHA
    40f4154 View commit details
  6. Copy the full SHA
    09816c1 View commit details
  7. StoreService refactoring

    Sleitnick committed Dec 29, 2019
    Copy the full SHA
    b355104 View commit details
  8. Copy the full SHA
    9f63684 View commit details

Commits on Dec 30, 2019

  1. Copy the full SHA
    0032a93 View commit details
  2. Merge pull request #118 from Sleitnick/data

    Use new Data module
    Sleitnick authored Dec 30, 2019
    2
    Copy the full SHA
    7516cd0 View commit details

Commits on Jan 6, 2020

  1. Update copyright year

    Sleitnick committed Jan 6, 2020
    Copy the full SHA
    e2c6794 View commit details
  2. New Thread module

    Sleitnick committed Jan 6, 2020
    Copy the full SHA
    e9c7254 View commit details
  3. Update filelist

    Sleitnick committed Jan 6, 2020
    Copy the full SHA
    1d8a2e0 View commit details
  4. Copy the full SHA
    5fbfb02 View commit details
  5. Clarify comment

    Sleitnick committed Jan 6, 2020
    Copy the full SHA
    84304dc View commit details
  6. Add DelayRepeat function

    Sleitnick committed Jan 6, 2020
    Copy the full SHA
    a1576c4 View commit details
  7. Merge pull request #122 from Sleitnick/use_thread

    Use thread
    Sleitnick authored Jan 6, 2020
    Copy the full SHA
    5ea342b View commit details
  8. Update filelist

    Sleitnick committed Jan 6, 2020
    Copy the full SHA
    5ea9344 View commit details
  9. Copy the full SHA
    5e80d1b View commit details
  10. Use table.pack

    Sleitnick committed Jan 6, 2020
    Copy the full SHA
    3465830 View commit details
  11. Use table.find for IndexOf

    Sleitnick committed Jan 6, 2020
    Copy the full SHA
    ba6b359 View commit details
  12. Doc fix

    Sleitnick committed Jan 6, 2020
    Copy the full SHA
    ec3a964 View commit details
  13. Document shared modules

    Sleitnick committed Jan 6, 2020
    Copy the full SHA
    c72c583 View commit details
  14. Promise doc

    Sleitnick committed Jan 6, 2020
    Copy the full SHA
    a18d947 View commit details
  15. Add doc shells

    Sleitnick committed Jan 6, 2020
    Copy the full SHA
    d52a459 View commit details
  16. Fade doc

    Sleitnick committed Jan 6, 2020
    Copy the full SHA
    1f15fe7 View commit details
  17. Doc updates

    Sleitnick committed Jan 6, 2020
    Copy the full SHA
    3431461 View commit details
Showing with 16,425 additions and 1,582 deletions.
  1. +18 −0 .github/workflows/deploy_docs.yaml
  2. +24 −0 .github/workflows/lint.yaml
  3. +4 −2 .gitignore
  4. +59 −1 CHANGELOG.md
  5. +1 −1 LICENSE
  6. +17 −5 README.md
  7. +2 −1 build_filelist.py
  8. +20 −19 docs/controllers.md
  9. +38 −11 docs/execution_model.md
  10. +10 −0 docs/index.md
  11. +6 −6 docs/install.md
  12. +133 −0 docs/module_docs/client_controllers/fade.md
  13. +1 −0 docs/module_docs/client_controllers/task_scheduler.md
  14. +76 −0 docs/module_docs/client_controllers/user_input.md
  15. +176 −0 docs/module_docs/client_controllers/user_inputs/gamepad.md
  16. +73 −0 docs/module_docs/client_controllers/user_inputs/keyboard.md
  17. +195 −0 docs/module_docs/client_controllers/user_inputs/mobile.md
  18. +162 −0 docs/module_docs/client_controllers/user_inputs/mouse.md
  19. +127 −0 docs/module_docs/client_modules/camera_shaker.md
  20. +144 −0 docs/module_docs/client_modules/pid.md
  21. +94 −0 docs/module_docs/client_modules/smooth.md
  22. +80 −0 docs/module_docs/client_modules/tween.md
  23. +15 −0 docs/module_docs/server_modules/profile_service.md
  24. +31 −0 docs/module_docs/shared/base64.md
  25. +162 −0 docs/module_docs/shared/date.md
  26. +73 −0 docs/module_docs/shared/listener_list.md
  27. +54 −0 docs/module_docs/shared/maid.md
  28. +89 −0 docs/module_docs/shared/number_util.md
  29. +180 −0 docs/module_docs/shared/promise.md
  30. +67 −0 docs/module_docs/shared/signal.md
  31. +176 −0 docs/module_docs/shared/string_util.md
  32. +236 −0 docs/module_docs/shared/table_util.md
  33. +62 −0 docs/module_docs/shared/thread.md
  34. +34 −0 docs/module_docs/shared/vector_util.md
  35. +95 −11 docs/modules.md
  36. +61 −25 docs/services.md
  37. +57 −0 docs/settings.md
  38. +131 −127 filelist.json
  39. +1 −1 filelist.min.json
  40. +2 −0 foreman.toml
  41. BIN imgs/logo_512_discord.png
  42. +34 −3 mkdocs.yml
  43. +2 −0 requirements.txt
  44. +8,200 −0 roblox.toml
  45. +0 −26 rojo.json
  46. +9 −0 selene.toml
  47. +0 −49 src/ReplicatedStorage/Aero/Internal/FastSpawn.lua
  48. +82 −0 src/ReplicatedStorage/Aero/Internal/Settings.lua
  49. +40 −19 src/ReplicatedStorage/Aero/Shared/Base64.lua
  50. +1 −1 src/ReplicatedStorage/Aero/Shared/Date.lua
  51. +0 −99 src/ReplicatedStorage/Aero/Shared/Event.lua
  52. +9 −3 src/ReplicatedStorage/Aero/Shared/ListenerList.lua
  53. +160 −0 src/ReplicatedStorage/Aero/Shared/Maid.lua
  54. +120 −0 src/ReplicatedStorage/Aero/Shared/NumberUtil.lua
  55. +1,428 −0 src/ReplicatedStorage/Aero/Shared/Promise.lua
  56. +182 −0 src/ReplicatedStorage/Aero/Shared/Signal.lua
  57. +13 −17 src/ReplicatedStorage/Aero/Shared/TableUtil.lua
  58. +164 −0 src/ReplicatedStorage/Aero/Shared/Thread.lua
  59. +62 −0 src/ReplicatedStorage/Aero/Shared/VectorUtil.lua
  60. +102 −27 src/ServerScriptService/Aero/Internal/AeroServer.server.lua
  61. +21 −21 src/ServerStorage/Aero/Modules/{DataStoreCache/SafeDataStore → Data}/MockDataStoreService.lua
  62. +789 −0 src/ServerStorage/Aero/Modules/Data/init.lua
  63. +0 −109 src/ServerStorage/Aero/Modules/DataStoreCache/SafeDataStore/init.lua
  64. +0 −163 src/ServerStorage/Aero/Modules/DataStoreCache/init.lua
  65. +1,729 −0 src/ServerStorage/Aero/Modules/ProfileService.lua
  66. 0 src/ServerStorage/Aero/Services/.gitkeep
  67. +0 −372 src/ServerStorage/Aero/Services/DataService.lua
  68. +0 −148 src/ServerStorage/Aero/Services/StoreService.lua
  69. +8 −8 src/StarterPlayer/StarterPlayerScripts/Aero/Controllers/TaskScheduler.lua
  70. +14 −14 src/StarterPlayer/StarterPlayerScripts/Aero/Controllers/UserInput/Gamepad.lua
  71. +3 −2 src/StarterPlayer/StarterPlayerScripts/Aero/Controllers/UserInput/Keyboard.lua
  72. +67 −12 src/StarterPlayer/StarterPlayerScripts/Aero/Controllers/UserInput/Mobile.lua
  73. +32 −30 src/StarterPlayer/StarterPlayerScripts/Aero/Controllers/UserInput/Mouse.lua
  74. +13 −5 src/StarterPlayer/StarterPlayerScripts/Aero/Controllers/UserInput/init.lua
  75. +81 −24 src/StarterPlayer/StarterPlayerScripts/Aero/Internal/AeroClient.client.lua
  76. +1 −1 src/StarterPlayer/StarterPlayerScripts/Aero/Modules/CameraShaker/CameraShakePresets.lua
  77. +5 −2 src/StarterPlayer/StarterPlayerScripts/Aero/Modules/CameraShaker/init.lua
  78. +45 −191 src/StarterPlayer/StarterPlayerScripts/Aero/Modules/PID.lua
  79. +20 −21 src/StarterPlayer/StarterPlayerScripts/Aero/Modules/Smooth/SmoothDamp.lua
  80. +2 −4 src/StarterPlayer/StarterPlayerScripts/Aero/Modules/Tween/init.lua
  81. +1 −1 version.txt
18 changes: 18 additions & 0 deletions .github/workflows/deploy_docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Deploy Docs

on:
push:
branches:
- master

jobs:
build:
name: Build & deploy docs
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Deploy docs
uses: mhausenblas/mkdocs-deploy-gh-pages@master
env:
GITHUB_TOKEN: ${{ SECRETS.GITHUB_TOKEN }}
24 changes: 24 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Lint

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: Roblox/setup-foreman@v1
name: Install Foreman
with:
version: "^1.0.0"
token: ${{ SECRETS.GITHUB_TOKEN }}
- name: Lint
run: |
selene ./
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
imgs/*.psd
.luacheckrc
node_modules/
site/
site/
aws/**/*.zip
aws/**/*_deploy/
aws/**/*out.yaml
60 changes: 59 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

The following are updates that have been implemented into the framework, so you can understand the impact of upgrading the plugin or framework as changes are made.

Understand that the framework may change frequently, so upcoming changes may break compatiblility with previous versions. Before upgrading, it is recommended that you read this `CHANGELOG.md` to see if there are BC Breaks, otherwise known as backwards-compatibility breaks, which may have an impact on your implementation against the framework working.
Understand that the framework may change frequently, so upcoming changes may break compatibility with previous versions. Before upgrading, it is recommended that you read this `CHANGELOG.md` to see if there are BC Breaks, otherwise known as backwards-compatibility breaks, which may have an impact on your implementation against the framework working.

Anything noted with a ==[BC Break]== you should be cautious about upgrading until you understand what refactoring you may have to do in order to support the framework version.

@@ -14,6 +14,13 @@ As always, you can also check the commit history for a given version as well, an

| Version | Date | Description |
| ---|---|--- |
| [1.7.2]($1.7.2) | 2020-11-23 | <ul><li>Fix ProfileService so that it will work properly within the AGF environment</li><li>Replace `tick()` with appropriate replacements (e.g. `time()` and `os.time()`)</li><li>Fix linter</li></ul>
| [1.7.1](#1.7.1) | 2020-08-25 | <ul><li>Remove StoreService</li><li>Remove old Event module</li><li>Add new Signal module (replaces Event module)</li><li>Add new raycasting methods</li><li>Add ProfileService module</li><li>Upgrade Promise to 3.0.1</li><li>Implement new `.settings` file for configuring module behavior within the framework</li><li>Updated VS Code extension to allow for creating settings files (v0.0.23)</li><li>New PID implementation</li></ul> |
| [1.6.1](#1.6.1) | 2020-05-21 | <ul><li>Switch to Selene for linting</li><li>Include GitHub Action to run Selene for new pull requests</li><li>Less verbose method names for firing events</li><li>Various bug fixes and performance improvements</li></ul> |
| [1.6.0](#1.6.0) | 2020-04-23 | <ul><li>Add NumberUtil and VectorUtil libraries under Shared</li></ul> |
| [1.5.2](#1.5.2) | 2020-04-14 | <ul><li>Fix a breaking issue with back-to-back calls to a RemoteFunction incorrectly caching</li></ul> |
| [1.5.1](#1.5.1) | 2020-04-06 | <ul><li>Added Maid class</li></ul> |
| [1.5.0](#1.5.0) | 2020-01-05 | <ul><li>Added Data module</li><li><b>==[BC Break]==</b> Removed DataStoreService and its dependencies</li><li>Added Thread module</li></ul> |
| [1.4.1](#1.4.1) | 2019-12-15 | <ul><li>Fixed execution order for modules to respect init/start lifecycle</li><li>Add ability to force `Init` execution order using `__aeroOrder` field</li></ul> |
| [1.4.0](#1.4.0) | 2019-10-17 | <ul><li>Added `service:FireAllClientsEventExcept(eventName, player, ...)`</li><li>Dropped Roblox Studio plugin support in favor of VS Code extension</li><li>New documentation site</li></ul> |
| [1.3.0](#1.3.0) | 2018-12-19 | <ul><li>Restructured source directory and installer to be compatible with Rojo</li></ul> |
@@ -25,6 +32,57 @@ As always, you can also check the commit history for a given version as well, an

### Version History Notes

#### <a name="1.7.2"></a> Version 1.7.2
Fixes ProfileService so that it properly works within the AGF environment.

Use proper time functions within the code. `tick()` is no longer considered acceptable, and most cases can be swapped with `time()`. See [DevForum thread](https://devforum.roblox.com/t/luau-recap-june-2020/632346) on this topic.

[AGF Development] Fixed automated Selene linter by switching to Foreman for tool installations.

#### <a name="1.7.1"></a> Version 1.7.1
<b>==[BC Break]==</b> Removed StoreService, as it was not very good and pigeonholed developers into a specific pattern for product purchases.

<b>==[BC Break]==</b> Added new Signal module to replace the older Event module. The API is the same, but the implementation is more robust.

<b>==[BC Break]==</b> New PID implementation.

Replaced older raycasting methods with the newer ones within the Mouse and Mobile input modules.

Added MadStudio's ProfileService module for datastore use. This module is much more robust than the existing Data module.

Added a new `.settings` module feature to configure the behavior of modules within the framework. For instance, a controller named `MyController` can now have a `MyController.settings` module that contains specific configuration details for the module. See [Settings](https://sleitnick.github.io/AeroGameFramework/settings/) documentation. The VS Code extension for AGF has also been updated to support this feature (v0.0.22).

#### <a name="1.6.1"></a> Version 1.6.1
Added support for Selene. All pull requests are now required to pass through the Selene check before being merged into master.

Implemented less verbose method names for firing events and deprecated the old versions.

Modules are no longer wrapped with the Aero metatable if they already have a metatable and a `__call` metamethod. This adds easier support of third-party modules such as DataStore2.

The mouse is no longer enabled/disabled by default based on user input. If developers wish to hide the mouse automatically when a gamepad is used, `UserInput.HideMouse` must be set to `true`.

There were also various bug fixes and performance enhancements thanks to the implementation of Selene.

#### <a name="1.6.0"></a> Version 1.6.0
Added NumberUtil and VectorUtil libraries. These libraries contain functions that are commonly used in game development but are not available out-of-the-box in Roblox's API.

#### <a name="1.5.2"></a> Version 1.5.2
Fix a breaking issue regarding back-to-back invocations of RemoteFunctions within the internal client script. This issue was caused by an incorrect design decision that subsequent calls to a pending RemoteFunction should return the result of the first pending invocation. In other words, if a RemoteFunction was invoked 5 times at the exact same time, each invocation would return the result of the _first_ invocation.

This faulty design has been reverted to the old behavior from before v1.5.1, which guarantees that each invocation of a RemoteFunction is unique.

#### <a name="1.5.1"></a> Version 1.5.1
Added [Quenty's](https://github.com/Quenty) Maid class. This class allows for easy cleanup of tasks.

Also fixed many small bugs and made minor improvements throughout the framework.

#### <a name="1.5.0"></a> Version 1.5.0
Added a new Data module, which replaces the older DataStoreService. The new Data module gives developers more robust control over data, including improved error handling due to the module using promises.

<b>==[BC Break]==</b> The DataStoreService and its dependencies have been removed. The Data module is the official replacement. The DataStoreService had many flaws and could introduce developers into tricky situations that caused data losses due to unknown data failures.

Added a Thread module under Shared. This module should be used instead of the built-in global functions `spawn` and `delay`. Both the `spawn` and `delay` functions are known to throttle unexpectedly. Such behavior is unacceptable, and thus the Thread module aims at giving alternatives to both functions. The use of the Thread's `Thread.Spawn` and `Thread.Delay` functions can easily be dropped in to replace any existing `spawn` and `delay` code. The module also contains a `Thread.SpawnNow` function, which will spawn a new thread immediately, as opposed to the next frame. In addition, the `Thread.Delay` returns the heartbeat connection, which means that the delay can be cancelled by disconnecting the connection.

#### <a name="1.4.1"></a> Version 1.4.1
Fixed an issue with lazy-loaded modules. Before, lazy-loaded modules could break the execution lifecycle rule if loaded within the `Init` method of a service or controller. When this happened, the `Init` _and_ `Start` method would execute within the loaded module. This is a problem, since `Start` should not be executed yet. This is now fixed. The `Start` method will be held off from execution until the proper time within the framework lifecycle.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018 Stephen Leitnick
Copyright (c) 2018-2020 Stephen Leitnick

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
22 changes: 17 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
## :warning: Project is archived :warning:

AeroGameFramework is no longer maintained and should not be used in future projects. [Knit](https://github.com/Sleitnick/Knit) is the successor to AGF. Over time, it has become clear that AGF forces bad design decisions on developers and leads to a messy and fragmented code-base.

------------------

![Logo](/imgs/logo_github_readme.png)

![Lint](https://github.com/Sleitnick/AeroGameFramework/workflows/Lint/badge.svg?branch=master)

# AeroGameFramework
A powerful game framework for the Roblox platform.

AeroGameFramework is a Roblox game framework that makes development easy and fun. The framework is designed to simplify the communication between modules and seamlessly bridge the gap between the server and client. Never again will you have to touch RemoteFunctions or RemoteEvents.

Join the [Discord server](https://discord.gg/GUdNjJs) for further discussion about the framework.

# Documentation
Visit the [documentation site](https://sleitnick.github.io/AeroGameFramework).

# Video Tutorial
Learn how to use the framework in the video tutorial series:
https://www.youtube.com/watch?v=8ta0cHX1ceE&index=1&list=PLk3R4TM3pnqv7doCTUHtn-wkydaA08npc

**Note:** This tutorial series does not use the newer VS Code extension workflow. An updated series is in the works.
Visit the [AGF Tutorial](https://www.youtube.com/watch?v=0T-slvWfYkc&list=PLk3R4TM3pnqvde1cqOIH_bGnCWwMKDqKL) playlist.

# Example

@@ -53,4 +60,9 @@ end
return MyService
```

These are complete code examples. They could be put into the framework and work as-is.
These are complete code examples. They could be put into the framework and work as-is.

# Support

Support AGF by [buying me a coffee](https://www.buymeacoffee.com/sleitnick) and keeping me energized to keep up the work on this project! Any support is very much appreciated.
<link href="https://fonts.googleapis.com/css?family=Lato&subset=latin,latin-ext" rel="stylesheet"><a class="bmc-button" target="_blank" href="https://www.buymeacoffee.com/sleitnick"><img src="https://cdn.buymeacoffee.com/buttons/bmc-new-btn-logo.svg" alt="Buy me a coffee"><span style="margin-left:15px;font-size:19px !important;">Buy me a coffee</span></a>
3 changes: 2 additions & 1 deletion build_filelist.py
Original file line number Diff line number Diff line change
@@ -29,7 +29,8 @@ def find(ar, name):
print("Building file list...")

paths_data = []
all_files = check_output(["git", "ls-tree", "--name-only", "-r", "master", "src"])
cur_branch = check_output(["git", "rev-parse", "--abbrev-ref", "HEAD"]).decode("utf-8").strip()
all_files = check_output(["git", "ls-tree", "--name-only", "-r", cur_branch, "src"]).decode("utf-8")
paths = all_files.split("\n")
for path in paths:
path_array = path.split("/")
39 changes: 20 additions & 19 deletions docs/controllers.md
Original file line number Diff line number Diff line change
@@ -43,10 +43,10 @@ return MyController

| Returns | Method |
| -------- | ----------- |
| `void` | `controller:WrapModule(Table tbl)` |
| `void` | `controller:RegisterEvent(String eventName)` |
| `void` | `controller:FireEvent(String eventName, ...)` |
| `void` | `controller:ConnectEvent(String eventName, Function handler)` |
| `Table` | `controller:WrapModule(Table tbl)` |

--------------------------

@@ -129,7 +129,7 @@ end

function MyController:Init()
-- Create 'Hello' event:
self.Hello = self.Shared.Event.new()
self.Hello = self.Shared.Signal.new()
end
```

@@ -143,9 +143,11 @@ The `WrapModule` method can be used to transform a table into a framework-like m
function MyController:Start()

local thisThing = {}

function thisThing:Start()
print("thisThing started")
end

function thisThing:Init()
print("thisThing initialized")
end
@@ -157,6 +159,9 @@ function MyController:Start()
local anotherThing = require(someModule)
self:WrapModule(anotherThing)

-- Wrapping and requiring an external module in one line:
local otherModuleWrapped = self:WrapModule(require(otherModule))

end
```

@@ -167,27 +172,23 @@ end

## Forcing `Init` Order

By setting the `__aeroOrder` field, the `Init` execution order can be defined. By default, the order of execution is unknown.
By using the `Order` setting, the `Init` execution order can be defined. By default, the order of execution is undetermined. For instance, you have services called `MyController` and `AnotherController`, you could have `MyController.settings` and `AnotherController.settings` modules with the following configuration:

```lua
local MyController = {}
MyController.__aeroOrder = 1

function MyController:Init()
print("MyController will be initialized before AnotherController")
end

...

local AnotherController = {}
AnotherController.__aeroOrder = 2
-- MyController.settings
return {
Order = 1;
}
```

function AnotherController:Init()
print("AnotherController will be initialized after MyController")
end
```lua
-- AnotherController.settings
return {
Order = 2;
}
```

By practice, it is discouraged to utilize another controller before entering into the `Start` phase of the controller (i.e. after all controllers have been initialized). However, using `__aeroOrder` can be used to guarantee initialization order. In the above example, `AnotherController` would be able to safely utilize `MyController`, knowing that `MyController` is guaranteed to have been initialized due to the execution order.
With this configuration, it is guaranteed that `MyController` will have `Init` invoked before `AnotherController`.

--------------------------

@@ -259,7 +260,7 @@ end

-- Server service:
function CustomService:Start()
self.Services:ConnectClientEvent("Hello", function(player, msg)
self:ConnectClientEvent("Hello", function(player, msg)
print(player.Name .. " says: " .. msg)
end)
end
49 changes: 38 additions & 11 deletions docs/execution_model.md
Original file line number Diff line number Diff line change
@@ -23,26 +23,53 @@ Services and Controllers act as singletons. In other words, only one instance ex

## Forcing `Init` Order

The order of which `Init` is invoked for services and controllers can be explicitly set. This is done through the `__aeroOrder` field.
The order of which `Init` is invoked for services and controllers can be explicitly set. This is done through the `Order` setting. For more info, see the [Settings](settings.md) section.

Simply set the service or controller `__aeroOrder` field to a number. The `Init` process will execute based on ascending order. Services and controllers without an `__aeroOrder` field set will be executed last (technically, the default order is set to `math.huge`).
--------------------------

## Preventing `Init` or `Start`

!!! note
The `__aeroOrder` field can be any valid number, including negatives and non-whole numbers. See the examples under the [Services](services.md) and [Controllers](controllers.md) page.
There might be times where it is not desired for the framework to invoke either the `Start` or the `Init` method on a module, service, or controller. In such an instance, a flag can be added to indicate that the method should not be invoked by the framework. Use the `PreventInit` and `PreventStart` settings to skip over `Start` or `Init`. For more info, see the [Settings](settings.md) section.

--------------------------

## Preventing `Init` or `Start`
## External Use

It is possible (but not recommended) to use AGF outside of the framework environment. In other words, a script within the workspace can access modules within the framework. This is useful if an existing script or system cannot be included into the framework, but needs to access items within the framework. In order to do this the `_G.Aero` global is exposed on both the server and the client.

Accessing `_G.Aero` from the server will allow access to server-side services and modules, as well as shared modules.

Accessing `_G.Aero` from the client will allow access to client-side controllers and modules, as well as shared modules.

### Wait for External Aero
Because `_G.Aero` is not assigned until the framework has fully initialized, external scripts must first check and wait for the global to be assigned before attempting to use it:
```lua
while (not _G.Aero) do wait() end
local aero = _G.Aero
```

### Use External Aero from Server
Once `aero` is referenced, it can be used the same way you would use `self` within a controller or service. For example, using `_G.Aero` from the server:
```lua
while (not _G.Aero) do wait() end
local aero = _G.Aero

There might be times where it is not desired for the framework to invoke either the `Start` or the `Init` method on a module, service, or controller. In such an instance, a flag can be added to indicate that the method should not be invoked by the framework.
aero.Services.MyService:Hello()
local maid = aero.Shared.Maid.new()
```

The two flags are:
### Use External Aero from Client
Using `aero` from the client is the same as the server, except access will be granted to client-side modules:
```lua
while (not _G.Aero) do wait() end
local aero = _G.Aero

- `__aeroPreventInit`
- `__aeroPreventStart`
aero.Controllers.Fade:Out()
local date = aero.Shared.Date.new()
```

!!! note
Set the flag to a truthy value (preferrably just `true`). See the example under the [Modules](modules.md#prevent-init-or-start) page.
!!! warning
Using AGF externally using `_G.Aero` is considered bad practice. The global is only provided so that edge-cases can be filled where it is not possible to include a script or system into the framework.

--------------------------

10 changes: 10 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -4,11 +4,21 @@

AeroGameFramework is a Roblox game framework that makes development easy and fun. The framework is designed to simplify the communication between modules and seamlessly bridge the gap between the server and client. Never again will you have to touch RemoteFunctions or RemoteEvents.

## Learning

This is the main documentation page for AGF and is the single point of information for using the framework. There is also a [YouTube tutorial](https://www.youtube.com/watch?v=0T-slvWfYkc&list=PLk3R4TM3pnqvde1cqOIH_bGnCWwMKDqKL) series available.

## Collaborate
AeroGameFramework is an open-source project, and your support is much appreciated. Feel free to report bugs, suggest features, and make pull requests. Please visit the [GitHub repository](https://github.com/Sleitnick/AeroGameFramework) for more information.

Join the public [AeroGameFramework Discord server](https://discord.gg/GUdNjJs) to participate in discussions about the framework.

The framework was built and is supported primary by [Stephen Leitnick](https://github.com/Sleitnick).

## Support

Support AGF by [buying me a coffee](https://www.buymeacoffee.com/sleitnick) and keeping me energized to keep up the work on this project! Any support is very much appreciated.


--------------------------

Loading