{"id":19952559,"url":"https://github.com/dosmike/motdmenu","last_synced_at":"2025-10-04T10:41:24.776Z","repository":{"id":133520177,"uuid":"382359205","full_name":"DosMike/MotdMenu","owner":"DosMike","description":"[TF2] Move menus into the motd browser because it's cool","archived":false,"fork":false,"pushed_at":"2023-03-19T14:45:43.000Z","size":176,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-15T06:10:18.461Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"SourcePawn","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DosMike.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-02T13:44:43.000Z","updated_at":"2024-03-19T13:45:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"a05b5451-4297-410b-bc2b-395690848ff0","html_url":"https://github.com/DosMike/MotdMenu","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/DosMike/MotdMenu","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DosMike%2FMotdMenu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DosMike%2FMotdMenu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DosMike%2FMotdMenu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DosMike%2FMotdMenu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DosMike","download_url":"https://codeload.github.com/DosMike/MotdMenu/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DosMike%2FMotdMenu/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278302556,"owners_count":25964519,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T01:13:37.769Z","updated_at":"2025-10-04T10:41:24.747Z","avatar_url":"https://github.com/DosMike.png","language":"SourcePawn","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Motd Menu\n\nThis library allows plugins to display VGUI Menus as nice web interface in the\nMotd window. Motd Menus are set up almost identical to regular menus.\nAdditionally plugin developers can decide to display icons on the Motd version\nof menus.\n\nMenus need to be written with MotdMenu in order to work properly. While a\nplugin could theoretically render out any menu, i didn't see an easy way to\nget the MenuHandler.\n\nWhen displaying a menu in the motd, all menu data is first piped into a \ndatabase. From there a php script builds the Motd page and it is displayed.\nMenu actions done in the Motd browser are piped back into the server through\nrcon and then sent to the original MenuHandler.\n\nThis system probably works on other games as well, but I have only tested it on\nTF2. Vote menus are currently also not supported. Although it would probably be\nreally nice to see vote results visually, I don't like the idea of having a\nfull-screen vote menu pop up.\n\n## Features\n\nMotd menus can be turned off in !settings and they also detect if clients\ndisabled html motds. In that case the players will just receive a regular VGUI\nmenu.\n\nKeep in mind that `cl_disablehtmlmotd` is only checked with 1 player/second,\nso refreshing that value could take some time. I could query that value more\noften but I don't think it's worth it.\n\nUsers can also choose to have the menu displayed in a bigger motd screen\ninstead of the small blackboard screen TF2 normally uses, but that currently\ndoes not affect rendering at all.\n\n## Commands\n\nThere's one server command `sm_motdmenu_callback` for rcon - don't use it.\n\n## Installation\n\n1) Download the plugin and put it in your addons folder as usual.\n2) Loading the plugin now will fail, but generate it's config if missing.\n3) Edit the plugin config (see below).\n4) Put the web content on your php server.  \n   Don't use too many subdirectories as the url with additional data added must\n   not exceed something like 150 chars.\n5) Edit the web config (see below).\n6) Reload the plugin in your server.\n\nOne web setup can handle mutliple servers.\n\nIf you install a plugin that uses MotdMenu and provides icons, you probably\nneed to put those image resources into the `img` web directory.\n\n### Plugin Config\n\nThe Config is located in addons/sourcemod/configs/motdmenu.cfg\n\n- `serverid` is the name php will know what server to notify. Allowed\n  characters are `a`-`z` `A`-`Z` `0`-`9` and `_`\n- `baseurl` is the public address of where the web page resides.\n  For example `https://myserver.net/motdmenu/`.  \n  Don't use too many subdirectories as the url with additional data added must\n  not exceed something like 150 chars.\n- `database` the database entry from `databases.cfg` to use to talk to the motd.\n\nThere are also three sounds in this config, those are basically copies of the\nmenu sound values in the core config of sourcemod, but maybe you want different\nmenu sounds for Motd Menu\n\n### Web Config\n\nThis config is `settings.php`. Yes I could have used a key value file you're\nused to, but storing data in a php script is less likely to leak in case of\nmisconfiguration.\n\n- `database` is the database to connect to for data exchange. This needs to be\n  the same across all game servers using this web instance. The values are\n  pretty much the same as used in `databases.cfg`.\n- `servers` is the list of servers to talk to. Every entry in this list needs\n  to be named exactly the same as the server `serverid` value.  \n  - `name` is currently pretty unused, but displayed at the top of motd menus.\n  - `host` is your game servers ip address.\n  - `port` is the game servers port. Usually thats 27015.\n  - `rconpass` is the rcon password. Please choose a strong one so nobody can\n    guess it and break your server from outside. \n\n## Developing\n\nBasic usage of motd menus does not differ a lot from regular VGUI menus. There\nare only a hand full of command that you need:\n\n| VGUI Menu | MOTD Menu | Comment |\n|-----|-----|-----|\n| `CreateMenu`\u003cbr\u003e`new Menu` | `CreateMotdMenu`\u003cbr\u003e`new MotdMenu` |  |\n| `DisplayMenu`\u003cbr\u003e`Menu.Display` | `DisplayMotdMenu`\u003cbr\u003e`MotdMenu.DisplayMotd` | Only the method map will automatically fall back to `Menu.Display` if Motd Menus are disabled |\n| `CancelMenu`\u003cbr\u003e`Menu.Cancel` | `CancelMotdMenu`\u003cbr\u003e`MotdMenu.Cancel` | Will hide the menu, again should fall back to `CancelMenu` if not Motd Menu is open |\n| `delete menu` | `CloseMotdMenu`\u003cbr\u003e`MotdMenu.Close` | This call is necessary to remove some additional resources the plugin needs to store to make callbacks from the motd browser work |\n\nThe methodmap tries to hide away the logic for optional includes. So if you\ninclude `motdmenu.inc` optional, the `MotdMenu` methodmap automatically\nproxies to `Menu` if motd menus is not loaded. To not have the include as\ncompile time requirement you'll need to some preprocessor magic.\n\nAs a nice little bonus you can provide an image for ever menu option displaying\nin the MOTD. All you need to do for that is to pass a `MotdIconPathProvider` to\nthe `DisplayMotdMenu`/`MotdMenu.DisplayMotd` call. In this function you receive\nthe info data you pass into the menu item back and can map it to a image path.\n\n```c#\n// MotdIconPathProvider for a fruit menu\nbool GetMenuFruitIcon(const char[] menuInfo, char[] iconPath, int iconPathSize) {\n\tFormat(iconPath, iconPathSize, \"img/fruitmenu/fruit_%s.png\", menuInfo);\n}\nvoid ShowFruitMenu(int client) {\n\tchar translated[64];\n\tMotdMenu menu = new MotdMenu(FruitMenuHandler, MENU_ACTIONS_DEFAULT);\n\tmenu.SetTitle(\"%T\", client, \"pick fruit\");\n\tFormat(translated, sizeof(translated), \"%T\", client, \"fruit banana\");\n\tmenu.AddItem(\"banana\", translated);\n\tFormat(translated, sizeof(translated), \"%T\", client, \"fruit orange\");\n\tmenu.AddItem(\"banana\", translated);\n\tmenu.DisplayMotd(client, GetMenuFruitIcon, MENU_TIME_FOREVER);\n}\nif(action == MenuAction_Select) {\n\t// ...\n} else if(action == MenuAction_Cancel \u0026\u0026 param2 == MenuCancel_ExitBack) {\n\t// ...\n} else if(action == MenuAction_End) {\n\tCloseMotdMenu(menu);\n}\n```\n\nI recommend requiring image resources for your menus to be in the web directory\nin `img/plugin/image.png` so they don't clash with other plugins but allowing\nthe server admins to exchange images if they so desire.\n\nWhen your plugin unload it's recommended that you call `CloseAllMenus`. This\nwill invalidate and close all motd menus currently opened by your plugin to\nprevent the console spamming useless errors when your plugin reloads.\n\n## Dependencies\n\nYou'll need smlib to compile the plugin.\nThe web part was written on PHP 7.2.\n\n## Plans\n\nThe plugin shall grow as my requirements grow, and I'll be using it in my main\nproject from now on.\n\nSuggestions and feedback are welcome, but I don't know if or how fast I'll add\nstuff to this plugin.\n\n### Thank you\n\nThank you to psychonic for writing Dynamic MOTD, it was a very helpful\nresource. Also thank you to the sourcemod community and discord guild for\nanswering my questions. Lastly I want to thank Fuffeh for supporting the\nidea.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdosmike%2Fmotdmenu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdosmike%2Fmotdmenu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdosmike%2Fmotdmenu/lists"}