Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
2151300
Improvements to event flags, including moving event flags to the even…
Volte6 Feb 24, 2025
f58a010
Adding command register functions
Volte6 Feb 24, 2025
79c2cde
Moving a lot of code to event listeners
Volte6 Feb 25, 2025
913249d
Additional listeners, moved more code around.
Volte6 Feb 25, 2025
7904e14
Adding events for gain/loss of items
Volte6 Feb 25, 2025
99f129a
Small typo fixes
Volte6 Feb 25, 2025
2fb8067
Adding script triggered event
Volte6 Feb 25, 2025
a1dbb1e
Moved music out of GMCP listener
Volte6 Feb 25, 2025
b3f6225
streamlined some code. Offloaded more event code to listeners.
Volte6 Feb 25, 2025
fc0f9d2
Small changes
Volte6 Feb 25, 2025
ee2726e
Renaming files, adding support for a wildcard listener for debugging
Volte6 Feb 25, 2025
aa2551a
Removed lock race condition. Also got rid of referencing non basic ty…
Volte6 Feb 25, 2025
203711b
Reverting type changes
Volte6 Feb 26, 2025
11e0b2e
misc adjustments and cleanup
Volte6 Feb 26, 2025
7f10288
minor change
Volte6 Feb 26, 2025
03fb348
Refactored queue.go to use generics, avoids a type assertion in each …
Volte6 Feb 26, 2025
0e392d9
Fixing queue generic
Volte6 Feb 26, 2025
734450e
Adding `logwatch` admin command and associated events.
Volte6 Feb 26, 2025
68310e5
Adding some test benchmarks for planning purposes
Volte6 Feb 26, 2025
1e29065
Adding Buff listener that was forgotten
Volte6 Feb 26, 2025
b4233da
adjusting gearup to try and avoid removing worn gear.
Volte6 Feb 26, 2025
ea03ad0
renamed `logwatch` to `syslogs`, enabled finer control of log levels …
Volte6 Feb 26, 2025
1f1e326
Storing/Loading roundcount from its own file. Removed roundcount data…
Volte6 Feb 27, 2025
50419c6
improving `online` command for admins. Changing importance of many lo…
Volte6 Feb 27, 2025
ce53801
removing useless admincommand inptuhandler, moving useful functionali…
Volte6 Feb 27, 2025
a0b74c7
Removing build/release no "workflow_dispatch" from git workflow
Volte6 Feb 27, 2025
f81b763
adding unit tests and pqueue
Volte6 Feb 27, 2025
ecb9bb7
Initial movement of logging code to `mudlog` package
Volte6 Feb 27, 2025
aa86d1e
Renaming `slog.{func}(` usage to `mudlog.{func}(`
Volte6 Feb 27, 2025
3af8ff6
Removing some references to `slog` that search didn't pick up before.
Volte6 Feb 27, 2025
d2cc909
Removing version checking until properly implemented.
Volte6 Feb 27, 2025
80a9152
Additional cleanup of `mudlog`
Volte6 Feb 27, 2025
7734386
Adding dedupe queue
Volte6 Feb 28, 2025
787b1a5
`about` update
Volte6 Feb 28, 2025
9f682df
Modified homepage, moved stats to "/viewstats" page.
Volte6 Feb 28, 2025
8313316
minor clear up
Volte6 Feb 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ name: Build and release
on:
push:
branches: [master]
workflow_dispatch:

permissions:
contents: write
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.vscode
private-notes.txt
**/users/*
**/config-overrides.yaml
**/config-overrides.yaml
**/.roundcount
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ When running several environment variables can be set to alter behaviors of the
- **CONFIG_PATH**_=/path/to/alternative/config.yaml_ - This can provide a path to a copy of the config.yaml containing only values you wish to override. This way you don't have to modify the original config.yaml
- **LOG_PATH**_=/path/to/log.txt_ - This will write all logs to a specified file. If unspecified, will write to _stderr_.
- **LOG_LEVEL**_={LOW/MEDIUM/HIGH}_ - This sets how verbose you want the logs to be. _(Note: Log files rotate every 100MB)_
- **LOG_NOCOLOR**_=1_ - If set, logs will be written without colorization.

# Why Go?

Expand Down
6 changes: 3 additions & 3 deletions _datafiles/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@ OnDeathXPPenalty: none
OnDeathProtectionLevels: 5
# - EnterRoomMessageWrapper -
# Decorate entrance text with this. Put a %s where the message should be.
EnterRoomMessageWrapper: "\n <ansi fg=\"enters-message\"> >>> </ansi>%s\n"
EnterRoomMessageWrapper: " <ansi fg=\"enters-message\"> >>> </ansi>%s\n"
# - ExitRoomMessageWrapper -
# Decorate exit text with this. Put a %s where the message should be.
ExitRoomMessageWrapper: "\n <ansi fg=\"leaves-message\"> >>> </ansi>%s\n"
ExitRoomMessageWrapper: " <ansi fg=\"leaves-message\"> >>> </ansi>%s\n"
# - MaxIdleSeconds -
# How long players can go without any input, before being kicked.
# A value of 0 (zero) means never kick inactive players.
Expand Down Expand Up @@ -400,7 +400,7 @@ BannedNames:
NextRoomId: 1002
# - LogIntervalRoundCount -
# How often to log the round count. Can help judge logs a little better.
LogIntervalRoundCount: 1
LogIntervalRoundCount: 15
# - Locked -
# All config names defined here are immutable to the `server set` admin
# command. They can only be changed by editing the config file directly.
Expand Down
27 changes: 9 additions & 18 deletions _datafiles/html/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,19 @@
<body>
<h1>GoMud</h1>

{{ if ne .Stats.WebSocketPort 0 }}
{{ if ne .WebSocketPort 0 }}
<p><b>Access Web Terminal:</b> <a href="/webclient">Link</a></p>
{{ end }}

<p>&nbsp;</p>

<p><b>View Server Config:</b> <a href="/viewconfig">Link</a></p>

<p>&nbsp;</p>

<h3>Players Online: </h1>

{{if gt (len .Stats.OnlineUsers) 0 }}
{{if gt (len .OnlineUsers) 0 }}
<table border="1" cellspacing="0" cellpadding="3">
<tr>
<th>#</th>
Expand All @@ -44,7 +48,7 @@ <h3>Players Online: </h1>
<th>Time Online</th>
<th>Permission</th>
</tr>
{{range $index, $uInfo := .Stats.OnlineUsers}}
{{range $index, $uInfo := .OnlineUsers}}
<tr>
<td align="right">{{ add $index 1 }}.</td>
<td align="center"><b>{{ $uInfo.CharacterName }}</b></td>
Expand All @@ -61,21 +65,8 @@ <h3>Players Online: </h1>
{{end}}

<p>&nbsp;</p>

<h3>Server Config: </h3>

<table border="1" cellspacing="0" cellpadding="3">
<tr>
<th>Name</th>
<th>Value</th>
</tr>
{{range $name, $value := .ConfigData}}
<tr>
<td>{{ $name }}</td>
<td>{{ $value }}</td>
</tr>
{{end}}
</table>
<p>&nbsp;</p>
<p>&nbsp;</p>

<p class="footer">
Powered by <b>GoMud</b> - Available free at <a target="_blank" href="http://github.com/Volte6/GoMud">github.com/Volte6/GoMud</a>
Expand Down
48 changes: 48 additions & 0 deletions _datafiles/html/public/viewconfig.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<html>
<head>
<title>GoMud Configuration</title>
<style>
body {
font-family: Verdana, sans-serif;
}
th {
background-color:#ccc;
}
tr {
border-bottom: 1px solid #ddd;
}
tr:nth-child(even) {
background-color: #D6EEEE;
}
td {
font-family: monospace;
}
.footer{
text-align:center;
}
</style>
</head>
<body>
<h3>Server Config: </h3>

<table border="1" cellspacing="0" cellpadding="3">
<tr>
<th>Name</th>
<th>Value</th>
</tr>
{{range $name, $value := .}}
<tr>
<td>{{ $name }}</td>
<td>{{ $value }}</td>
</tr>
{{end}}
</table>

<p>&nbsp;</p>

<p class="footer">
Powered by <b>GoMud</b> - Available free at <a target="_blank" href="http://github.com/Volte6/GoMud">github.com/Volte6/GoMud</a>
</p>

</body>
</html>
2 changes: 2 additions & 0 deletions _datafiles/world/default/keywords.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ help:
- server
- skillset
- spawn
- syslogs
- zap
- zone
# Aliases for keywords when typing: help <keyword>
Expand Down Expand Up @@ -224,6 +225,7 @@ command-aliases:
history: ['log']
time: ['date']
noop: ['wake']
syslogs: ['syslog']
'party chat': ['pchat', 'psay']
'bank deposit': ['deposit']
'bank withdraw': ['withdraw']
Expand Down
26 changes: 19 additions & 7 deletions _datafiles/world/default/rooms/frostfang/35.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,32 @@
const magic_phrase = "zyphrial lumara vorthos";

function onCommand_west(rest, user, room) {

if ( !user.HasQuest("3-end") ) {
SendUserMessage(user.UserId(), ' ');
SendUserMessage(user.UserId(), '<ansi fg="51">The icy wind howls through the gate, and you feel a chill run down your spine.</ansi>');
SendUserMessage(user.UserId(), '<ansi fg="51">You sense that you are not yet ready to face the dangers that lie beyond.</ansi>');
SendUserMessage(user.UserId(), ' ');
} else {

// Queue it with an input blocking flag and ignore further scripts flag
user.CommandFlagged('west', EventFlags.CmdSkipScripts|EventFlags.CmdBlockInputUntilComplete, 1)
// return true (handled) to prevent further execution
return true

SendUserMessage(user.UserId(), '');
SendUserMessage(user.UserId(), 'The eyes of the stone statues <ansi fg="51">glow</ansi> as you say the words, "<ansi fg="51">'+magic_phrase+'</ansi>"');
SendUserMessage(user.UserId(), 'You feel a sense of warmth wash over you, and the biting cold air no longer bothers you.');
SendUserMessage(user.UserId(), '');
}

user.GiveBuff(3);
}
SendUserMessage(user.UserId(), '');
SendUserMessage(user.UserId(), 'The eyes of the stone statues <ansi fg="51">glow</ansi> as you say the words, "<ansi fg="51">'+magic_phrase+'</ansi>"');
SendUserMessage(user.UserId(), 'You feel a sense of warmth wash over you, and the biting cold air no longer bothers you.');
SendUserMessage(user.UserId(), '');

user.GiveBuff(3);

// Queue it with an input blocking flag and ignore further scripts flag
user.CommandFlagged('west', EventFlags.CmdSkipScripts|EventFlags.CmdBlockInputUntilComplete, 1)
// return true (handled) to prevent further execution

return true
}


Expand Down
2 changes: 2 additions & 0 deletions _datafiles/world/default/rooms/frostfang/432.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ biome: city
exits:
leave:
roomid: 61
exitmessage: You gather your belongings and head back towards the main room of
the Inn.
23 changes: 0 additions & 23 deletions _datafiles/world/default/templates/admincommands/help.template

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
The <ansi fg="command">syslogs</ansi> command can be used to watch the server logs live.

<ansi fg="command">syslogs on</ansi> - Begin following all of the logs

There are 4 levels of log importance you can enable.
Each level includes all logs of higher importance levels.

<ansi fg="13">DEBUG</ansi> - Debugging logs. May not be enabled on this server.
<ansi fg="2">INFO</ansi> - General info that may or may not be useful.
<ansi fg="11">WARN</ansi> - Non urgent/critical warnings.
<ansi fg="1">ERROR</ansi> - Very serious problems that should be tracked.

Example:
<ansi fg="command">syslogs info</ansi> - Receive all <ansi fg="2">INFO</ansi>, <ansi fg="11">WARN</ansi>, and <ansi fg="1">ERROR</ansi> logs.
<ansi fg="command">syslogs error</ansi> - Receive only <ansi fg="1">ERROR</ansi> logs.

<ansi fg="command">syslogs off</ansi> - Stop following the logs

1 change: 1 addition & 0 deletions _datafiles/world/default/templates/help/about.template
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ during its first year of development. In alphabetical order:</ansi>
<ansi fg="14">Jake</ansi> aka <ansi fg="11">Jake</ansi>
<ansi fg="14">Jeff</ansi> aka <ansi fg="11">Armoredartist</ansi>
<ansi fg="14">Jeffrey Edwards</ansi> aka <ansi fg="11">Miphon</ansi>
<ansi fg="14">Jeremy Owens</ansi>
<ansi fg="14">Michael Myers</ansi> aka <ansi fg="11">avatus</ansi>
<ansi fg="14">Scott</ansi> aka <ansi fg="11">Neopong</ansi>
<ansi fg="14">William L</ansi> aka <ansi fg="11">1aw123</ansi>
22 changes: 0 additions & 22 deletions _datafiles/world/default/templates/systemcommands/help.template

This file was deleted.

This file was deleted.

2 changes: 2 additions & 0 deletions _datafiles/world/empty/keywords.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ help:
- server
- skillset
- spawn
- syslogs
- zap
- zone
# Aliases for keywords when typing: help <keyword>
Expand Down Expand Up @@ -224,6 +225,7 @@ command-aliases:
history: ['log']
time: ['date']
noop: ['wake']
syslogs: ['syslog']
'party chat': ['pchat', 'psay']
'bank deposit': ['deposit']
'bank withdraw': ['withdraw']
Expand Down
23 changes: 0 additions & 23 deletions _datafiles/world/empty/templates/admincommands/help.template

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
The <ansi fg="command">syslogs</ansi> command can be used to watch the server logs live.

<ansi fg="command">syslogs on</ansi> - Begin following all of the logs

There are 4 levels of log importance you can enable.
Each level includes all logs of higher importance levels.

<ansi fg="13">DEBUG</ansi> - Debugging logs. May not be enabled on this server.
<ansi fg="2">INFO</ansi> - General info that may or may not be useful.
<ansi fg="11">WARN</ansi> - Non urgent/critical warnings.
<ansi fg="1">ERROR</ansi> - Very serious problems that should be tracked.

Example:
<ansi fg="command">syslogs info</ansi> - Receive all <ansi fg="2">INFO</ansi>, <ansi fg="11">WARN</ansi>, and <ansi fg="1">ERROR</ansi> logs.
<ansi fg="command">syslogs error</ansi> - Receive only <ansi fg="1">ERROR</ansi> logs.

<ansi fg="command">syslogs off</ansi> - Stop following the logs

23 changes: 21 additions & 2 deletions _datafiles/world/empty/templates/help/about.template
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ or modified to build your own world using built-in tools.
<ansi fg="187">:::::.</ansi>\<ansi fg="187">::::::::.</ansi>\<ansi fg="187">::::::::.</ansi>\<ansi fg="187">::::::::.</ansi>\<ansi fg="187">::::::::.</ansi>\<ansi fg="187">::::::::.</ansi>\<ansi fg="187">::::::::.</ansi>\<ansi fg="187">::::::::.</ansi>\<ansi fg="187"></ansi>
' `--' `.-' `--' `--' `--' `-.' `--' `</ansi>

<ansi fg="black-bold">.:</ansi> <ansi fg="magenta"></ansi><ansi fg="command">GoMud</ansi> History
<ansi fg="black-bold">.:</ansi> <ansi fg="magenta"><ansi fg="command">GoMud</ansi> History</ansi>

<ansi fg="command">GoMud</ansi> development began in <ansi fg="red">late 2023</ansi> with several key goals in mind:
<ansi fg="command">GoMud</ansi> development began in <ansi fg="red">late 2023</ansi> by <ansi fg="14">Dylan Squires</ansi> (aka <ansi fg="11">Volte6</ansi>) with
several key goals in mind:

<ansi fg="red-bold">1.</ansi> <ansi fg="11">Offer a new, free code base in a modern language.</ansi>
<ansi fg="command">Go</ansi> was selected as it has a fast build process and excellent OS/CPU
Expand All @@ -40,3 +41,21 @@ or modified to build your own world using built-in tools.
<ansi fg="6"> .--. .-'. .--. .--. .--. .--. .`-. .--.
<ansi fg="187">:::::.</ansi>\<ansi fg="187">::::::::.</ansi>\<ansi fg="187">::::::::.</ansi>\<ansi fg="187">::::::::.</ansi>\<ansi fg="187">::::::::.</ansi>\<ansi fg="187">::::::::.</ansi>\<ansi fg="187">::::::::.</ansi>\<ansi fg="187">::::::::.</ansi>\<ansi fg="187"></ansi>
' `--' `.-' `--' `--' `--' `-.' `--' `</ansi>

<ansi fg="black-bold">.:</ansi> <ansi fg="magenta">Special Thanks</ansi>

<ansi fg="8">Those who contributed to <ansi fg="command">GoMud</ansi> via <ansi fg="15">testing</ansi>, <ansi fg="15">content</ansi>, <ansi fg="15">code</ansi>, and <ansi fg="15">discussion</ansi>
during its first year of development. In alphabetical order:</ansi>

<ansi fg="14">Andrew Burns</ansi> aka <ansi fg="11">mister_burns</ansi>
<ansi fg="14">Arin Bennett</ansi> aka <ansi fg="11">Sloan</ansi>
<ansi fg="14">Colin Senner</ansi> aka <ansi fg="11">colinsenner</ansi>
<ansi fg="14">Durf Durfleton</ansi> aka <ansi fg="11">Durf</ansi>
<ansi fg="14">Ethan Samuels</ansi> aka <ansi fg="11">ethaburd</ansi>
<ansi fg="14">Jake</ansi> aka <ansi fg="11">Jake</ansi>
<ansi fg="14">Jeff</ansi> aka <ansi fg="11">Armoredartist</ansi>
<ansi fg="14">Jeffrey Edwards</ansi> aka <ansi fg="11">Miphon</ansi>
<ansi fg="14">Jeremy Owens</ansi>
<ansi fg="14">Michael Myers</ansi> aka <ansi fg="11">avatus</ansi>
<ansi fg="14">Scott</ansi> aka <ansi fg="11">Neopong</ansi>
<ansi fg="14">William L</ansi> aka <ansi fg="11">1aw123</ansi>
Loading
Loading