Skip to content

Commit

Permalink
Merge pull request #4 from privt00/1.5.2
Browse files Browse the repository at this point in the history
1.5.2
  • Loading branch information
privt00 authored Jan 17, 2024
2 parents b50bce3 + f7cce46 commit 586a039
Show file tree
Hide file tree
Showing 234 changed files with 63,628 additions and 0 deletions.
30 changes: 30 additions & 0 deletions misc/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# TFC-Plex License
Version 2.1, December 26, 2023

Copyright (c) 2023, TFC-Hosting

## Definitions
a. "Software" refers to the TFC-Plex program.
b. "Host" refers to the server or system on which the Software is executed.
c. "Modification" refers to any alteration, adaptation, or derivative work of the Software.

## License Grant
a. This Software is subject to the terms of the Apache 2.0 License (https://www.apache.org/licenses/LICENSE-2.0), with the following modifications:

## Permitted Actions
a. The Software may only be used for personal purposes and for internal use within companies. Sale, publication, merging, or sublicensing remains prohibited.

## Limitations
a. Changes to the TFC-Plex Software's footer are prohibited. Violation of this prohibition may result in the suspension of the Host.
b. The TFC-Plex API may not be altered without explicit permission. Permission requests can be made through the Discord server (https://discord.gg/MCfBtSWPE8).

## Host Verification
a. A Host may be considered "verified" if it adheres to these license terms and is deemed 100% legitimate.

## Relationship to Pterodactyl Panel
a. The TFC-Plex Software is a Pterodactyl Panel Shop and is not directly affiliated with the Pterodactyl Panel. Any references to the Pterodactyl Panel are for contextualization purposes only and should not be construed as an official connection.

## Disclaimer
a. The TFC-Plex Software is provided "as is," without any warranty or guarantee. The author is not liable for any damages arising from the use of the TFC-Plex Software.

This license has been created to address the author's concerns regarding changes to the TFC-Plex Software's footer, API, and Host verification. It is recommended to carefully read and understand this license before using, modifying, or distributing the TFC-Plex Software.
60 changes: 60 additions & 0 deletions misc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# tfc-plex

![image](https://cdn.tfc-plex.de/img/gitlogo.png)
<p align="center" dir="auto">Trusted by 19 host and 2843 users.</p>
<p align="center">
<a><img src="https://img.shields.io/github/downloads/privt00/tfc-plex/total?color=blue&label=v1.5.0 Downloads"/></a>
<a href="https://discord.gg/BXmzHS9DRA"><img src="https://img.shields.io/discord/1175441775972860076?color=blue&label=Discord&logo=tfc-plex&logoColor=blue" alt="discord" /></a>
<a href="https://docs.tfc-plex.de/"><img alt="Docs" src="https://img.shields.io/website?down_color=lightred&down_message=Offline&label=Docs&up_color=blue&up_message=Online&url=https://docs.tfc-plex.de/"></a>
<a href="https://tfc-plex.de"><img alt="Website" src="https://img.shields.io/website?down_color=lightred&down_message=Offline&label=Website&up_color=blue&up_message=Online&url=https://tfc-plex.de"></a>
<a href="https://dash.tfc-hosting.de"><img alt="Demo" src="https://img.shields.io/website?down_color=lightred&down_message=Offline&label=Demo&up_color=blue&up_message=Online&url=https://demo.tfc-plex.de"></a>
<a href="https://github.com/privt00/tfc-plex/stargazers"><img src="https://img.shields.io/github/stars/privt00/tfc-plex?label=Stars %E2%AD%90" height="20"/></a>
</p>




## Features



---

## 👀 Preview
TFC-plex Demo: https://dash.tfc-hosting.de/

## 👀 Our Docs
https://docs.tfc-plex.de/



Dashboard (v1.5.0):
![dashboard](https://cdn.discordapp.com/attachments/1188790627006160917/1191455862213054564/image.png?ex=65a580bd&is=65930bbd&hm=0896f3d81b0efbb603952e2bb71b9715ac59a1549aacc5e5cefb58cac07ecf03&)

Server (v1.5.0):
![Your Servers](https://cdn.discordapp.com/attachments/1188790627006160917/1191456026625581106/image.png?ex=65a580e4&is=65930be4&hm=252033749f8b8210e157bde90f607084ef93d01e54d3812031deda3cb3097d60&)

User Settings (v1.0):
![Account Setting](https://cdn.discordapp.com/attachments/1188790627006160917/1191456220507291748/image.png?ex=65a58113&is=65930c13&hm=10ac67a97193372589bae86c069e35c9db2273e141df13d2302afc00060f9b8c&)

Theme Switcher (v1.5.0):
![Shop](https://cdn.discordapp.com/attachments/1188790627006160917/1191456387583201352/image.png?ex=65a5813a&is=65930c3a&hm=c95064fe0e40c8960dbdc3fda4a28b36c09856e90c7afe5de1e336055935b20d&)


---

## 📝 Authors
- [**Privt**](https://github.com/privt00)




---

# Cangelog

|Date|Version|Short Description|Long Description|
|---|---|---|---|
|2023/12/24|v1.0|First Release||

© 2023-2024 TFC-Plex by privt00
38 changes: 38 additions & 0 deletions misc/addons/claim.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
const indexjs = require("../index.js");
const fs = require("fs");
const moment = require("moment");

module.exports.load = async function (app, db) {
app.get("/claim", async (req, res) => {
if (!req.session.pterodactyl) return res.redirect("/login");

let theme = indexjs.get(req);

// Check if claiming is enabled in settings
let settings = JSON.parse(fs.readFileSync("./settings.json").toString());
if (!settings.claiming.enabled) {
return res.send(`Claiming is currently disabled. <a href='/dashboard?alert=claimtoosoon'>go back to dashboard</a>`);
}

// Check if the user has already claimed coins on the current day
let lastClaimDate = await db.get("lastClaimDate-" + req.session.userinfo.id) || null;
let currentDate = moment().format("YYYY-MM-DD");

if (lastClaimDate === currentDate) {
return res.send(`You have already claimed your coins today. <a href='/dashboard?alert=claimtoosoon'>go back to dashboard</a>`);
}

// Update last claim date for the user
await db.set("lastClaimDate-" + req.session.userinfo.id, currentDate);

// ... Rest of your existing code

// Award coins for the claim
let coinsPerClaim = settings.claiming.coinsPerClaim || 20;
let coins = await db.get("coins-" + req.session.userinfo.id) || 0;
coins = coins + coinsPerClaim;
await db.set("coins-" + req.session.userinfo.id, coins);

res.send(`You have successfully claimed ${coinsPerClaim} coins. <a href='/dashboard?alert=claim'>go back to dashboard</a>`);
});
};
Loading

0 comments on commit 586a039

Please sign in to comment.