Skip to content
Success

Changes

Summary

  1. Commands: Completely rewrite command logic (commit: b6a4c56) (details)
  2. Server: Remove isXXXXXX flags and reset client info (commit: dcbdabe) (details)
  3. Structs: Bump version (commit: 44c3d82) (details)
Commit b6a4c56dc0132a5435e3f88a6ab47ae8df4eff87 by 16738302+Haxk20
Commands: Completely rewrite command logic

Previously commands were done on if else if
case. Which at the time seemed like OK idea.

Well few months and it WASNT.
In C we can have an pointer to a function which
we can execute.

So lets have an hash map (Thanks UThash) and
linked list (Thanks UTlist.).
Linked list for managment (WIP)
Hash map for being able to find each command in constant
time.

Now we can have all structs containing the commands
in the hash map with ID as the command name with / prefix

Permissions were also refactored. Now we have an uint32
with each bit as flag. This does put a limitation
of 32 roles. But lets be honest.
If you need 33+ different roles you are doing something
wrong.
Trusted is the right most bit.
Guard is second bit from right.
Mod third and etc.
Each role has an perm offset to be able
to set the specific bit.
This allows 2+ roles to have the same permissions.

This new way of handling also allows extensions
(When they will be done. Dont ask always!)
to add their own commands and also
allows runtime loading and uloading of commands.

This may have some issues but generally the system
is miles superior to what we had before.
(commit: b6a4c56)
The file was addedSource/Util/Utlist.h
The file was modified Source/Protocol.h (diff)
The file was modified Source/Server.c (diff)
The file was modified Source/Commands.h (diff)
The file was modified Source/Protocol.c (diff)
The file was modified Source/Commands.c (diff)
The file was modified Source/Structs.h (diff)
Commit dcbdabed6aa110565ba062bf72dccf93c3ec2af2 by 16738302+Haxk20
Server: Remove isXXXXXX flags and reset client info
(commit: dcbdabe)
The file was modified Source/Protocol.c (diff)
The file was modified Source/Structs.h (diff)
The file was modified Source/Structs.h (diff)