This repository has been archived by the owner on Apr 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
242 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = tab | ||
indent_size = 4 | ||
end_of_line = crlf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = false | ||
|
||
[*.yml] | ||
indent_style = space | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: check | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Check | ||
run: cargo check --verbose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Release | ||
|
||
permissions: | ||
contents: write | ||
|
||
on: | ||
push: | ||
tags: | ||
- v[0-9]+.* | ||
|
||
jobs: | ||
create-release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: taiki-e/create-gh-release-action@v1 | ||
with: | ||
changelog: CHANGELOG.md | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
upload-assets: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: taiki-e/upload-rust-binary-action@v1 | ||
with: | ||
bin: multiblox | ||
token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"editor.formatOnSave": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# 0.1.0 | ||
|
||
Initial version. | ||
|
||
Creates a mutex with CreateMutexA with name `ROBLOX_singletonMutex`, stays in system tray. | ||
|
||
Windows only. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[package] | ||
name = "multiblox" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[profile.release] | ||
panic = "abort" | ||
strip = true | ||
opt-level = "z" | ||
lto = true | ||
codegen-units = 1 | ||
|
||
[dependencies] | ||
trayicon = "0.1.3" | ||
winapi = { version = "0.3.9", features = ["winuser"] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Multiblox | ||
|
||
Simple program to allow running multiple Roblox client instances at once. | ||
|
||
## Downloading | ||
|
||
Download a build from the [Releases](https://github.com/DvvCz/Multiblox/releases/latest) | ||
|
||
## Usage | ||
|
||
Open Multiblox **before** opening Roblox, and it should move to your system tray / "hidden icons". | ||
|
||
You should be able to open multiple clients while it is there. | ||
|
||
## ⚠️ Note | ||
|
||
This is not associated with the Roblox corporation in any way. | ||
|
||
I doubt you would get banned for using this, but keep in mind there could always be a chance. |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
hard_tabs = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
mod singleton; | ||
|
||
#[derive(PartialEq, Clone)] | ||
enum Events { | ||
Close, | ||
} | ||
|
||
fn main() { | ||
// If you're overwhelmed by the amount of code here, don't worry | ||
// This single variable declaration is all that matters with regards to patching Roblox. | ||
// The rest of it just makes this use a system tray icon. | ||
let singleton = singleton::Singleton::new().expect("Failed to acquire mutex"); | ||
|
||
let (stop_send, stop_recv) = std::sync::mpsc::channel::<bool>(); | ||
let (event_send, event_recv) = std::sync::mpsc::channel::<Events>(); | ||
|
||
let icon = trayicon::TrayIconBuilder::new() | ||
.sender(event_send) | ||
.icon_from_buffer(include_bytes!("../assets/icon.ico")) | ||
.tooltip("Multiblox") | ||
.menu(trayicon::MenuBuilder::new().item("Close", Events::Close)) | ||
.build() | ||
.expect("Failed to create trayicon"); | ||
|
||
let join = std::thread::spawn(move || { | ||
event_recv.iter().next(); | ||
let _ = stop_send.send(true); // Couldn't have hung up | ||
}); | ||
|
||
loop { | ||
use winapi::um::winuser; | ||
|
||
let _ = icon; | ||
let _ = singleton; | ||
|
||
if let Ok(true) = stop_recv.try_recv() { | ||
let _ = join.join(); // Can't possibly panic | ||
break; | ||
} | ||
|
||
let mut msg = core::mem::MaybeUninit::uninit(); | ||
let bret = unsafe { winuser::GetMessageA(msg.as_mut_ptr(), 0 as _, 0, 0) }; | ||
if bret > 0 { | ||
unsafe { | ||
winuser::TranslateMessage(msg.as_ptr()); | ||
winuser::DispatchMessageA(msg.as_ptr()); | ||
} | ||
} else { | ||
break; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
extern "system" { | ||
fn CreateMutexA( | ||
opts: *const core::ffi::c_void, | ||
takeover: u32, | ||
name: *const i8, | ||
) -> *const core::ffi::c_void; | ||
fn ReleaseMutex(m: *const core::ffi::c_void); | ||
fn CloseHandle(m: *const core::ffi::c_void); | ||
} | ||
|
||
pub struct Singleton { | ||
mutex: *const core::ffi::c_void, | ||
} | ||
|
||
impl Singleton { | ||
#[inline] | ||
pub fn new() -> core::option::Option<Self> { | ||
let mutex = unsafe { | ||
CreateMutexA( | ||
core::ptr::null(), | ||
1, | ||
"ROBLOX_singletonMutex\0".as_ptr() as _, | ||
) | ||
}; | ||
if mutex.is_null() { | ||
None | ||
} else { | ||
Some(Self { mutex }) | ||
} | ||
} | ||
} | ||
|
||
impl Drop for Singleton { | ||
#[inline] | ||
fn drop(&mut self) { | ||
unsafe { | ||
ReleaseMutex(self.mutex); | ||
CloseHandle(self.mutex); | ||
} | ||
} | ||
} |