Compare commits

..

10 Commits

Author SHA1 Message Date
ElementalAlchemist ee5a36f425 Default to filling the canvas with the key-out color 10 months ago
ElementalAlchemist 58f3b867f7 Better align bus stop signs with the front of the bus 10 months ago
ElementalAlchemist f678556ff5 Show icons for points we've driven past 10 months ago
ElementalAlchemist 95c0a86da0 Constantize the canvas width in case we want it widened in the future 10 months ago
ElementalAlchemist 4098619de9 Add key-out color on the ground 10 months ago
ElementalAlchemist c3bde04f3c Implement scaling 10 months ago
ElementalAlchemist b5a62e5a88 Implement canvas-based bus system 10 months ago
Mike Lang 2aadf79bfb thrimshim odo hack: assume unmatched time of day means dawn
until we can fix dawn detection.
10 months ago
Mike Lang bf9da27ca4 restreamer: refuse to load more than 2h of chat
this hard locks up the server due to merge taking a very long time
10 months ago
Mike Lang cb08f49003 pubbot: update total var before sending to zulip
so if zulip is down it still saves
10 months ago

@ -573,6 +573,9 @@ def get_chat_messages(channel):
if end <= start: if end <= start:
return "End must be after start", 400 return "End must be after start", 400
if end - start > datetime.timedelta(hours=2):
return "Cannot request more than 2h of chat", 400
hours_path = os.path.join(app.static_folder, channel, "chat") hours_path = os.path.join(app.static_folder, channel, "chat")
# This process below may fail if a batch is deleted out from underneath us. # This process below may fail if a batch is deleted out from underneath us.

@ -109,6 +109,10 @@ async function drawRoad() {
// Clear the previous canvas before starting // Clear the previous canvas before starting
context.clearRect(0, 0, CANVAS_PIXEL_WIDTH, 100); context.clearRect(0, 0, CANVAS_PIXEL_WIDTH, 100);
// Background the whole thing as the key-out color in case we need to bail
// out before drawing (e.g. we're in a non-DB game menu)
context.fillStyle = KEY_OUT_COLOR;
context.fillRect(0, 0, CANVAS_PIXEL_WIDTH, 100);
const currentTime = busData.clock_minutes; const currentTime = busData.clock_minutes;
const distance = busData.odometer; const distance = busData.odometer;

@ -835,7 +835,6 @@ def get_odometer(channel):
SELECT timestamp, clock, timeofday SELECT timestamp, clock, timeofday
FROM bus_data FROM bus_data
WHERE clock IS NOT NULL WHERE clock IS NOT NULL
AND timeofday IS NOT NULL
AND channel = %(channel)s AND channel = %(channel)s
AND timestamp > %(start)s AND timestamp > %(start)s
AND timestamp <= %(end)s AND timestamp <= %(end)s
@ -849,7 +848,8 @@ def get_odometer(channel):
clock_face = None clock_face = None
else: else:
clock12h = result.clock clock12h = result.clock
timeofday = result.timeofday # HACK: assume null means dawn, as we can reliably detect everything else.
timeofday = result.timeofday or "dawn"
clock24h = clock12h clock24h = clock12h
if time_is_pm(conn, result.timestamp, clock12h, timeofday): if time_is_pm(conn, result.timestamp, clock12h, timeofday):

@ -153,11 +153,11 @@ def main(conf_file, message_log_file, name=socket.gethostname()):
log["giveaway_entries"] = entries log["giveaway_entries"] = entries
entries_str = " ({} entries of ${:.2f})".format(entries, giveaway_amount) entries_str = " ({} entries of ${:.2f})".format(entries, giveaway_amount)
logging.info("New donation total: {}{}{}".format(msg["d"], increase_str, entries_str)) logging.info("New donation total: {}{}{}".format(msg["d"], increase_str, entries_str))
total = msg["d"]
if increase is not None and increase > 0: if increase is not None and increase > 0:
client.send_to_stream("bot-spam", "Donation Firehose", "Donation total is now ${:.2f}{}{}".format(msg["d"], increase_str, entries_str)) client.send_to_stream("bot-spam", "Donation Firehose", "Donation total is now ${:.2f}{}{}".format(msg["d"], increase_str, entries_str))
if increase is not None and increase >= 500: if increase is not None and increase >= 500:
client.send_to_stream("bot-spam", "Notable Donations", "Large donation of ${:.2f} (total ${:.2f}){}".format(increase, msg['d'], entries_str)) client.send_to_stream("bot-spam", "Notable Donations", "Large donation of ${:.2f} (total ${:.2f}){}".format(increase, msg['d'], entries_str))
total = msg["d"]
elif msg["c"].startswith("bid:"): elif msg["c"].startswith("bid:"):
log["type"] = "prize" log["type"] = "prize"

Loading…
Cancel
Save