Git Product home page Git Product logo

ponyliving-loading-screen's Introduction

Background

Garry's Mod is a sandbox video game by Facepunch, published by Valve in 2006. When connecting to a game server, players view a loading screen while the game client downloads all of the server's custom files. This process can take a long time, and even if players have already downloaded those files, they will still be on the loading screen for some time as their client syncs to the server's game state.

PonyLiving was a very popular My Little Pony-themed DarkRP server that became the 3rd most populous Gmod server at its peak. I was an administrator and developer there, and one thing I did for the server was develop its loading screen.

Technical Details

Garry's Mod renders HTML in Awesomium, a now-abandoned SDK for implementing the WebKit engine. Awesomium mostly supports HTML5 and CSS3, at least for the specifications that existed when it was still in active development, but does not support Javascript ES6 or newer. When Gmod players connect to a server, their client displays a web page defined by the server's sv_loadingurl convar, which functions as the server's loading screen.

If the URL contains "%s" or "%m", Gmod will replace them with the player's Steam ID and the server's current map respectively, which can be then processed by the web page as PHP GET parameters or with some other method. Gmod will also call the GameDetails function in Javascript if it exists, passing in the server name, map name, gamemode, player's Steam ID, and other details. It will also call other functions related to file downloading progress.

Repository

I originally made this project in 2013, but I've cleaned up the code a bit for presentation here. I've fixed several bugs, reorganized the files into folders, deprecated jPlayer which I used for cross-platform autoplaying audio but browsers don't allow that anymore, deprecated gfycat.js since their API endpoint is no longer available, and updated the code for compatibility with PHP 8.1. I've also removed my Steam API key, so anyone running or using this code will need to provide their own. The original files (except the music) can be seen in the commit history.

Features

  • Themes for each season and some holidays, uses geoPlugin's API to find the viewer's hemisphere to determine the appropriate season
  • Events for special dates such as PonyLiving's anniversary
  • April Fool's theme is a creepy static-covered theme with jitters, text corruption, and other effects, dynamically applied through Javascript
  • Random songs and loading images based on theme, with some images being rare
  • Uses Steam Web API for retrieving player's avatar and username
  • PHP parameters for debugging and variable overrides
  • Saves logs of player joins to text files (development ended before I could move to a proper SQL database), and associates Steam IDs with IPs to discover alt accounts and ban evasion
  • Logs are viewable from a password-protected page, access is saved with a cookie

Demonstration

Youtube video Picture 1 Picture 2 Picture 3 Picture 4 Picture 5

ponyliving-loading-screen's People

Contributors

valeriedesumo avatar

Watchers

 avatar

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.