Skip to content

Instantly share code, notes, and snippets.

View jalbright015's full-sized avatar

Jeremy Albright jalbright015

  • Plano, TX
  • 00:20 (UTC -05:00)
View GitHub Profile
@jalbright015
jalbright015 / mapper.c
Created February 10, 2023 05:10
Realm mapper
#include <events.h>
#include <daemons.h>
#define SAVE_DATA 0
#define BARRIERS_ENABLED 1
#define OVERLAP_DETECTION 1
#define OVERLAP_LIST_DISPLAY 1
#define HTML_OUTPUT_FILE "/open/jezu/mapper.html"
/*
(Date unknown) - Jezu@Astaria
Added error_handler() during porting to FluffOS
July 10, 2022 - Jezu@Astaria
- Refactored error_handler().
- Fixed bug in error_handler() that was incorrectly applying verbose_errors.
- Changed debug class for errors generated by wizards to be ':<wiz name>'. This is so wizzes can selectively enable which wizards they want to receive errors for.
#include <config.h>
#include <daemons.h>
#include <net/socket.h> // from the driver include dir
#include <net/socket_errors.h> // from the driver include dir
#include <net/config.h>
#include <net/daemons.h>
#include "/u/j/jezu/std/debug.c"
inherit DAEMON;
@jalbright015
jalbright015 / status_bar.c
Last active April 17, 2021 05:27
Status bar - Telnet control code proof of concept
/*
I apparently didn't write a header when I wrote this years ago, but here is the gist:
This is a proof of concept item that will place a static status bar at the bottom of the user's terminal window. The purpose for writing this was as a proof of concept for telnet control code utilzation in LPC. It uses telnet options and negotiation to perform the core of the functionality including automatically detecting window size and placement of the status bar.
Disclaimer: There are some things in this file I would definitely do differently today, but the methods I used as a means to an end are pretty crafty even to current Me.
Jezu@Astaria 17 April 2021
*/
@jalbright015
jalbright015 / tail.c
Last active April 16, 2021 04:14
Modified tail.c - Original by @gesslar
#include <driver/runtime_config.h>
// This function is expensive. It is also not compatible with
// old-style efun::tail() as 1) it acceptmp_size a second argument of
// the number of lines, and 2) it returns a string rather than
// printing out the resultmp_size.
//
// Did some significant changes to how it reads the file data
// and allocates lines for the return data. Based on my tests
// on a 120k file this reduced the execution time by over 99%.
/*
// events.c by Panic@Astaria 9/2008
// Basic observer pattern. Exposes a group of events and allows
// event subscribers to be notified of changes.
- Exposed a set and query for _subscriber.
- Uncommented the create and remove functions so that everything can call functions
here instead of inheriting. This way everything can query for any event from
any source.
// doors.c
// The standard door object. Any room (or other object if you like) that
// contains a door needs to inherit this file.
// Originally written by Rusty@TMI-2, 11-92.
// He lost his access in January 1993. Mobydick@TMI-2 went back and whipped
// the code into shape for the release.
// Originally part of room.c. Mobydick seperated in into two files, rooms
// and doors, on 2-17-93. This was done to save memory since most rooms do
// not contain doors and do not need this code.
//
@jalbright015
jalbright015 / harvester_scythe.c
Created April 10, 2021 00:41
A weapon that is used by a very high level, special mob
#include <mudlib.h>
#include <status.h>
#include <daemons.h>
#include <properties.h>
#include "../maze.h"
#include "/u/j/jezu/std/debug.c"
inherit WEAPON;
#define ANSI_OBJ "/obj/ansi_effects/bicolor.c"