vexyl / mchawk Goto Github PK
View Code? Open in Web Editor NEWA Minecraft classic server
License: MIT License
A Minecraft classic server
License: MIT License
The server currently doesn't know anything about block types and doesn't check if blocks placed by players are valid. Clients could send bogus blocks to the server which will happily broadcast the changes to other clients, potentially causing clients to crash.
If a plugin writer decides to change the permission name, players with the previous permission name will still retain that permission, and /revoke won't work because the plugin won't be able to find it. There should be a PermissionsPlugin.Prune() function that searches for unused player permissions and deletes them. It should be called automatically when the Permissions plugin's init() gets called.
Commands should have to register subcommands that have their own parameters. /help should show the appropriate subcommand help listing.
(Thanks Empy for suggestion)
A player should be able to send a private message using the @ symbol. E.g., @playername message should work as a private message to playername.
(Thanks Empy for suggestion)
Players should be notified when someone rejoins the game, kicking the inactive "ghost" client, which, without a notification, looks strange. It should say something like "Player rejoined the game" or "Player kicked (Logged in from somewhere else)."
(Thanks Empy for suggestion)
When someone tries to change too many blocks with /cuboid it doesn't remove the cuboid operation.
All of the C++ commands need to be converted to equivalent Lua plugin commands.
The server should send a "Player warped to world" message in all cases where the player leaves the world and goes to another world. For instance, the message should be broadcasted when a player uses /teleport from a world that the target player is not in.
(Thanks Empy for pointing this out)
There should be a WorldJoin event for plugins to hook onto. This will be useful for a plugin like cuboid that needs to delete cuboid operations when a player leaves the world. Also, this could solve issue #33 since you could write a function that display " warped to " that hooks onto WorldJoinEvent.
Sometimes empty lines are sent during line wrapping as "> "
Protocols should be more generic. Keep it all in C++ (could be done in Lua, but no reason to do so). Protocol base class/interface? It should at least register itself with the server and worlds can check if a given protocol is available and do whatever it wants based on that. E.g., worlds could choose whether to use CPE or not and players could create entirely classic worlds (no CPE).
Example idea:
class IProtocol {
virtual bool IsValidBlock(int type) = 0;
virtual GetName() = 0;
};
...
class CPE : public IProtocol
{
// implement the above virtual functions
/// ...
}
CPE::CPE()
{
Server::GetInstance()->RegisterProtocol("CPE", this);
}
/* ...
* Server/World use the above for whatever
*/
The log system should be less verbose with date/time. It should say the date only when the server first starts and on new days. After that, it should only state the time for each entry. Also, optional colors would be nice for the log type (info/warning/error).
Clients should be notified when a player joins another world.
E.g., /goto freebuild should show something like "Vexyl warped to freebuild" to all other players connected.
(Thanks Empy for suggestion)
Partial name matches should show potential matches if multiple exist.
(Thanks ksft for idea)
Bedrock shouldn't be placable or breakable. Make sure commands respect this as well (e.g., /cuboid)
(Thanks turtleclub for pointing this out)
There should be categories for commands in the /help and /commands listings.
(Thanks Empy for suggestion)
Use cmake to generate makefile for Linux and VS2017 project files for Windows.
Plugins should be able to specify which Lua library it requires. If a dependency is missing, it should either output an error or automatically download it with a Lua package manager such as LuaRocks.
(Thanks Xerolyph for suggestion)
Hide player position calculations (x * 32 + 51) from client code.
Commands taking world names should have name autocompletion just like player names. This should be implemented in a Server::GetWorldByName() function.
(Thanks Empy for suggestion)
Saving newly created worlds using /world new
only saves the raw map data (to the wrong directory). It needs to write a .ini file with the correct settings to the worlds directory and the map data to worlds/maps directory.
Packet types (in Network/Protocol.hpp) should be an enum, not a chain of #defines.
There should be a timer to limit how often plugins can update. If the plugin has a tick function it should only be called every n milliseconds.
The Lua library (.lua) is outdated. The current Visual Studio 2017 version won't compile the project with this lua library because it has been built with an older version of the C++ compiler. For someone with the same problem:
You have to download the latest lua binary from the official site, copy it to the corresponding paths of the C++ project directory and then adjust the Visual Studio project file to point to the right files and directories.
For the future, we have to find a way to make it better. It's not feasible to update the dependency by hand all time nor is self compiling it a good idea.
Before this issue, we also had issues with C includes. These includes has been replaced by their C++ equivalents. (see commit 92e00df)
Also the project specified Windows SDK version didn't fit.
Have the info command show permissions of player. This can wait until the info command is ported to Lua.
Currently, the server uses the BufferStream class from a book called Multiplayer Game Programming: Architecting Networked Games by Josh Glazer and Sanjay Madhav (https://github.com/MultiplayerBook/MultiplayerBook).
I want to replace it with a custom one for practice and to not completely rely on the book's code.
There should be some kind of permission group in the Permissions plugin. It should basically be a list of permissions with a name. This will make it easy to add a ranks plugin later.
There should be a cooldown option for commands. For example, the /billnye command can be used to spam the chat, so a SetCooldown(30) for a 30second delay inbetween calls would help a lot.
(Thanks turtleclub for suggestion)
There should be an automute plugin for chat. It should automatically mute a player some default n seconds. It could work by hooking onto ClassicProtocol.MessageEvent how many messages are being sent per second. If it's enough to be regarded as spam, automute the player.
(Thanks Cecil for suggestion)
The ops.txt
and plugin
directory should be added to the repository and the server should create them if they don't exist - rather than error about them in the console/log.
The permission plugin should be able to accept a space or comma separated string of permissions in any case where a single permission would be accepted.
Every so often a world create and saved with /world is corrupted, turning into a 0-byte map file. The config file is not affected. This does not happen to default/freebuild.
Server operators should be able to type commands into the console shell window. The server should have some kind of concept of a console user. Use a cross-platform library such as Readline if necessary. Since it would be nice to have command history and cursor movement, do not use raw std::cin or std::getline.
(Thanks Xerolyph for suggestion)
Lua plugins should be able to access the logger and have logger show source file name and line (even in Lua plugins).
The logger should also be able to use colors easily. There should be some convenient way to specify log colors that the logger translates to the platform's correct console color.
Commands should be able to register subcommands. The command handler or the command itself should go through each argument and check if it's a subcommand of that command. It should recursively do this for subcommands as they themselves may have subcommands.
Chat messages need to break on words and handle color codes on newlines.
There should be a command to set which channel you're currently chatting in. For example, /voice <global/local/playername> would set it to the global, local, or player private message channel respectively.
(Thanks Empy for suggestion)
The who command currently only displays the player list. If a player provides the who command with an argument, have it do a reverse lookup on aliases to find player.
The server should be multi-threaded, preferably using C++11 threads. Make sure it's portable. If necessary, use SFML threads since we link to it anyway (even though that library's functionality the server uses should eventually be replaced by custom implementations, see issue #6 )
There should be a /main command that sends the player to default world.
(Thanks ChrisKerman999 for suggestion)
SFML is currently being used mostly for it's network capabilities (sfml-network). The server also uses it for timers with sf::Clock and for sending the heartbeat request. SFML does the job very well and has a clean API but it's an additional dependency that's not really needed, so I'd like to replace it with custom implementations.
More specifically, I want TCPSocket/TCPServer classes that take care of buffering data, listening for connections, sending/receiving data, and setting socket options. Also, we'll need a Timer class that has at least the following member functions: Start(), Pause(), Reset(), and GetTimeAsMilliseconds().
If a map is 0-bytes and the server attempts to send it to a client, the level data chunk packet will not be sent. The client will receive the level init packet and level end packet, crashing clients such as ClassicalSharp.
(Thanks UnknownShadow200 for pointing this out)
Need to compile libraries used by server for Windows and make a VS2017 project, fixing any platform errors that arise. Better yet, use cmake to generate the project files.
cURL would be a good choice to send a heartbeat request over https.
See https://curl.haxx.se/libcurl/c/https.html for an example.
Ever since I added a 4th permission there's this weird ampersand at the end with /permissions: "permission, admin, cuboid, server&"
The permission system should be a core part of the server and should be rewritten in C++.
Currently /cmds is an alias for /help. It would be more convenient to instead have to show a comma-separated list of all commands.
(Thanks Empy for suggestion)
Refactor code to use smart pointers and to be const-correct. I've already ran into a lot of issues using raw pointers. Const-correct code is less error prone and looks cleaner.
Add command aliases to Lua plugin commands. It shouldn't be too difficult since the command handler already supports aliases.
Using /goto or any other world lookup command should autocomplete world names (like how player names work in commands; see Server::GetClientByName())
(Thanks Empy for suggestion)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.