Giter VIP home page Giter VIP logo

gdpys's Introduction

RealistikDash

Hi, I am RealistikDash! I am a 19 year old fascinated with programming, and a strong urge to work on major projects.

Skills

  • ๐Ÿ Python connoisseur
  • ๐Ÿฆ€ Rust enthusiast
  • ๐Ÿšข Docker devotee
  • ๐Ÿ’พ MySQL enjoyer
  • ๐Ÿค– Cython appreciator
  • ๐Ÿ” Meilisearch follower

Currently working on

  • Delta Dash Backend Infrastructure Project
  • RealistikGDPS

Exams are over! (20/6/23)

gdpys's People

Contributors

apinanyogaratnam avatar cmyui avatar efwxx avatar lenforiee avatar realistikdash avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

gdpys's Issues

Can't update level

Updating your own level causes a level with the same name to be uploaded rather than updating the current version.

Use Numba JIT

Use Numba to speed up repetitive functions (such as get level). This will provide noticeable performance benefits of repetitive functions.

This will make the function slower the first time it's run but will speed up the later execution of same functions by an order of magnitude.

Switch to snake case

The functions all need to be switched to snake case to be easier on the eyes and be more consistent.

How to set it up

ok cvolton gdps is easy to install - just sets webservre and mysql. but how to install and setup gdpys v3? is there any guides?

if possible, add a texture pack manager

you read the title. try to add a texture pack manager. it would make a separate file (for example, packs) where you can store texture packs in. using an external program, you can switch between normal gd texture pack (resources folder) and other texture packs installed. lmk if needs more clarification.

Gauntlet levels not working

Get levels handler does not respond with a response gd requires for gauntlets. This may be a small issue such as a missing arg as the supposed requirements for it a re fulfilled.

Python 3.6 support

The current plugin system uses asyncio.run which was added in python 3.7. This will make GDPyS not work correctly in Python implementations such as PyPy.

Update readme.md

Add more guides, features, cheatless, just like master branch.

New Caching System

GDPyS is severely in need of a new caching system. Currently, there are ~4 individual caching systems in the classes that use them. This means that there are essentially identical implementations of caching repeated multiple times throughout the codebase. This means that if I were to want to make a change to the caching system, I would be required to implement that change 4 times. The caching system is just mixed with the rest of the code without any care or separation. The current way makes it hard to add more caches to speed up more actions.

However, there are more reasons than just code maintainability. Firstly, there is no cache limit. This means that stuff can keep on being added onto the cache, potentially causing the host to run out of memory. While this has not happened during testing, it can become a major issue of servers with large player bases and large databases.

Secondly, the current cache has no expiry date. This means that outdated cached data can stay on the server potentially forever (or until a server restart) if it were to be updated without consideration for cached data. This can be a major problem during surges of activity or really anytime.

Requirements for a new system.

  • It is its own system, not integrated into any particular function.
  • It preferably uses a class based design, meaning a new cache can just be created by doing something along the lines of Cache()
  • There is a customisable limit to how many objects can be cached.
  • It allows to retrieve objects by ID (such as getting user object from cache by using the account id).
  • Cache can expire after a customisable amount of time. Checking for expired cache can be done during caching of an object or fetching of an object.

WWW Form url encoded

While playing with the requests module and GDPyS, I noticed that post args are urlencoded. Currently, the HTTP server does not attempt to urldecode the urlform. TODO: Investigate if this causes any issues with GD.

Plugin SDK

Create functions for plugins to use. This will allow for plugins to do server actions such as banning users.

Fix daily level not showing

Daily level does not show. This is to do with the getlevels handler not returning the special daily level response gd requires. Get daily level handler is working correctly.

Check user input more

Check user input further than is already done. This will include things such as: enforcing character limits server side, only allowing alphanumeric characters in usernames

Cythonise frequently used functions

Proposition

Frequently used functions that work with potentially decent amount of data (such as the dict -> gd str builders or http parsers) should be converted to Cython. This will provide a significant performance benefit with not a lot of work. Essentially free speed.

How will it work.

Cython works by converting near Python code into C, that can be compiled and ran. This grants it some of the benefits of a compiled language such as static typing and the prior mentioned speed. This will not affect I/O heavy operations as those are already asynced and gain no benefits from Cython as those mostly include waiting.

Create new cursor for Cron job

Use a separate mysql cursor for the Cron job. Since it's ran in a thread, it would be possible for a request to be sent while the job is running, causing issues such as the request fetching from a Cron job query.

Replace route tuple with decorators.

The aim is to replace this ugly mess

GDPyS/gdpys.py

Lines 30 to 43 in 30df705

HANDLERS = (
("/accounts/registerGJAccount.php", register_account, HandlerTypes.PLAIN_TEXT, ("userName", "password", "email", "secret")),
("/accounts/loginGJAccount.php", login_account, HandlerTypes.PLAIN_TEXT, ("udid", "userName", "password", "secret", "sID")),
("/getGJUserInfo20.php", user_info, HandlerTypes.PLAIN_TEXT + HandlerTypes.AUTHED, ("gameVersion", "binaryVersion", "gdw", "accountID", "gjp", "targetAccountID", "secret")),
("/updateGJUserScore22.php", update_stats, HandlerTypes.PLAIN_TEXT + HandlerTypes.AUTHED, ("secret", "accGlow", "iconType", "accountID", "gjp", "userCoins", "seed2", "seed")),
("/getGJAccountComments20.php", account_comments, HandlerTypes.PLAIN_TEXT, ("accountID", "total", "page", "secret", "gdw")),
("/uploadGJAccComment20.php", upload_acc_comment, HandlerTypes.PLAIN_TEXT + HandlerTypes.AUTHED, ("accountID", "gjp", "comment", "secret", "chk", "cType")),
("/deleteGJAccComment20.php", delete_acc_comment, HandlerTypes.PLAIN_TEXT + HandlerTypes.AUTHED, ("accountID", "gjp", "secret", "commentID")),
("/updateGJAccSettings20.php", update_social, HandlerTypes.PLAIN_TEXT + HandlerTypes.AUTHED, ("accountID", "gjp", "secret")),
("/getGJSongInfo.php", get_song, HandlerTypes.PLAIN_TEXT, ("secret", "songID")),
("/getGJUsers20.php", profile_search, HandlerTypes.PLAIN_TEXT, ("str", "page", "total")),
("/requestUserAccess.php", req_mod, HandlerTypes.PLAIN_TEXT + HandlerTypes.AUTHED, ("accountID", "gjp", "secret", "gameVersion", "binaryVersion", "gdw")),
("/getGJScores20.php", get_leaderboard, HandlerTypes.PLAIN_TEXT + HandlerTypes.AUTHED, ("accountID", "secret", "gdw", "type")),
)

with nice decorators. Just a code quality and readability improvement. Not a performance one.

Add metadata to plugins

Add metadata such as plugin name, author name and plugin description to plugins to be used for etc loading the plugin.

Add mentions in comments

If someone mentions a user in a comment (eg @BruhMan) they will receive a message from GDPyS Bot that says the level name, level Id, comment content and the name of the person who mentioned the user. Make the amount of messages limited so people don't abuse this to spam people.

Extend the permission system

Here is the plan:

  • Add more permission enums
  • Add more permission checks when necessary
  • Create an easy way to create privilege groups

On rate CP calculation.

When a level is rated, the cp values for the cached obj should be locally updated or even updated in the db,

Native Newgrounds API

GDPyS Newgrounds API

Use the Newgrounds API for songs rather than sending requests to GD servers. This will also allow us to also bypass songs banned on the official Geometry Dash server.

Execution

  • Completely rewrite the addsongtodb function
  • Use the Newgrounds API to fetch data to be added to the database
  • Use the requests module to send the requests to the API.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.