DFCS is a custom server for minecraft (protocol version 7). It's written in Pascal. Features:
- Support for heartbeat-protocol
- Supports small and large maps (+ save), currently, it needs too much time to save and compress the map when it's larger than 256*256*256
- Low memory usage.
- HOT Supports c5script Scripting Language (Modules!). They can directly modify the map and interact with the user (chat, kick etc.)
- High-Portable: Runs on every platform the Free Pascal Compiler supports (pre-compiled binarys planned for Windows, Linux and Mac)
It's currently Alpha, there are still some small problems with player spawning (everything else works nice, except from physics, see below).
Modules
The server's primary goal is to provide a user-friendly module-system, using scripts. Here is an example for a script which allows the half-blocks to work correctly (it is already supported by server):
cdecl HalfBlocks_BlockChange(m,client,x,y,z,blocktype,d)
{
if(blocktype 44){return(0);};
if (BlockAt(x,y-1,z) = 44)
{
SetBlockAt(x,y-1,z,43);
SetBlockAt(x,y,z,0);
return(2); // Prevent the engine from setting a halfblock to x,y,z
};
}
There is a GUI-Tool for managing modules. There are already some interesting ones like WaterBuild, but even spreading water is implemented as a module.
The more custom servers the better! Question, will all parts of the server be scriptable, or will certain parts be hidden from modification? If so, how far down will it go?
It offers some functions for:
- Modyfing the map (SetBlock, GetBlock)
- Interacting with the clients (Teleport them, use Chat, get position etc.)
That's what should be possible to do. It is organized in modules, and modules can have some local variables, timers and define WatchBlocks (add attributes to blocks).
When something happens, the scriptengine will call defined scriptfunctions for each module (OnChangeBlock, OnPlayerMove, OnChatCommand etc.). The server will come along with a documentation of the possibilities.
I will extend it when people request new functions.
Rollback Post to RevisionRollBack
DF Custom Server - Minecraft Modular Custom Server written in Object Pascal
It reads the modules from an online database and give the user the ability to save and activate them for his local server. It is also possibles to define some configuration variables for each module.
The displayed definitionfile for GuestArea is:
name=GuestArea
desc=Restricts players with accesslevel 0 to a given area.
author=Tumm
version=1
require_engine=3
prior=0
active=1
Config1=X|16
Config2=Y|16
Config3=Z|16
Config4=Radius|8
[edit]GuestArea-Script now works :smile.gif:![/edit]
Rollback Post to RevisionRollBack
DF Custom Server - Minecraft Modular Custom Server written in Object Pascal
This may be perfect for my custom server needs. Would you mind releasing some sort of alpha? (pleeeease)
As for commands, what I would want:
Send a message to all users or to one in particular
Detect and client messages and the necessary string functions so that they can be parsed
Get/Set blocks
Set server name/pessage/if it's private without having to restart server
Get/set player coords
Handle incoming block placement packets manually (to implement usergroups and stuff with maximum control)
- Send a message to all users or to one in particular
Already implemented:
- Say(s,n,params) : Say s from n. if n < 0, it is said as a server message. See Log().
- PrivateSay(s,client,p): Says something to one client only. See Say.
Detect and client messages and the necessary string functions so that they can be parsed
- MODULENAME_Command(m,client,cmd,a,b,c,d,e) : Called when a player sends a command, a,b,c,d,e are the parameters seperated by space
Get/Set blocks
- BlockAt(x,y,z) : Returns the block at x,y,z
- SetBlockAt(x,y,z,:cool.gif: : Commits a blockchange. It is sent to all clients automatically.
Handle incoming block placement packets manually (to implement usergroups and stuff with maximum control)
- MODULENAME_BlockChange(m,client,x,y,z,blocktype,d): Called on blockchange (client is player-id, -1 when Block is modified by server or other modules)
Get/set player coords
- Teleport(c,x,y,z,r) : Teleports a player to the specified position (r is x-rotation)
- PlayerAtX(c,blocks) : Returns the position of the player (X). if blocks = 1, it is divided with 32 to get the position in blocks
- PlayerAtY(c,blocks) : See above
- PlayerAtZ(c,blocks) : See above
@Alpha: It might release today or tomorrow.
Rollback Post to RevisionRollBack
DF Custom Server - Minecraft Modular Custom Server written in Object Pascal
I don't want to sound like an ass but your API could use some improvement.
The PlayerAt* ones are very confusing (really sounds like it gets the player at the position, not the position of the player). I'm not very familiar with Pascal but isn't there an object oriented way to do it, like player.GetPosition() that returns a structure with (x, y, z)? If not at least change the name..
Yes, the renaming should be done.
The scriptengine itself is quite - minimal. It does not support any object-orientated structures, but i could implement a "GetPosition(player)" which returns such an object. Then it would be possible to fetch the coordinates with GetX, GetY and GetZ.
Do you think that would be better?
Rollback Post to RevisionRollBack
DF Custom Server - Minecraft Modular Custom Server written in Object Pascal
If you don't have objects, you must have either RAM access or local file access for storage of data and interpretation of it as objects. As long as you have local file access, some way to have objects or at least arrays, loops, variables, and conditional statements, I'm good.
Constants:
- protocol_version : Version of the Minecraft-Protocol the engine supports (1,2,3)
- engine_version : The Engine's version (1,2,3)
- mapsize : Returns the mapsize (Use GetX() etc.)
- port : The server's port
- maxplayer : Maxplayer
- motd : Server's message of the day
- name : Server's name
Functions:
- BlockAt(x,y,z) : Returns the block at x,y,z
- SetBlockAt(x,y,z,:cool.gif: : Commits a blockchange. It is sent to all clients automatically.
- PlayerName(p) : Returns Ps Name
- ClientCount : Returns how many clients are connected ( They do NOT have to be ready to receive )
- Kick(c,reason) : Kick c for reason reason
- GetX(p) : Returns the x-coordinate of a position
- GetY(p) : See above
- GetZ(p) : See above
- PlayerPos(c,blocks) : Returns the position of the player. if blocks = 1, it is divided with 32 to get the position in blocks. Use GetX() etc.
- ClientLevel(c) : Returns the level of a client (100 = Operator)
- GetClientByN(n) : Returns the Client with number N. It can be used for iterating clients (0 to count - 1)
- GetClientByID(n) : Returns the Client with the given ID
- GetClientID(c) : Get Client's ID
- StringMatch(a,:cool.gif: : Returns 1 if strings are equal (ignores case, ignores trailing space)
- Say(s,n,params) : Say s from n. if n < 0, it is said as a server message. See Log().
- PrivateSay(s,client,p): Says something to one client only. See Say.
- StartTimer(m,interval): Sets the module's timer to an interval of X seconds. If another timer is still running, it will be stopped. interval is in ms.
- GetRuntime : Returns the server's runtime in ms
- StopTimer(m) : Stops the module's timer
- log(s,params) : Writes something to the server log. You can use format-parameters: log("Result: %d",4+3);
- Local(m) : Returns an array to module's local variables (very useful). Example: Local(m).(4); // <-- Fourth local variable
- SpawnPos : Returns position of the Spawnpoint
- GetBlockTypeName(n) : Returns the name of a block (parameter is the opcode)
- Teleport(c,x,y,z,r) : Teleports a player to the specified position (r is x-rotation)
- GetConfigVar(m,n) : Returns the value of the Nst config entry in metafile of Module m. Must be Integer.
Callbacks:
- MODULENAME_Init(m) : Called when the server is initialized (Parameter is the module-object)
- MODULENAME_BlockChange(m,client,x,y,z,blocktype,d): Called on blockchange (client is player-id, -1 when Block is modified by server or other modules)
- MODULENAME_Command(m,client,cmd,a,b,c,d,e) : Called when a player sends a command, a,b,c,d,e are the parameters seperated by space
- MODULENAME_Move(m,client,x,y,z) : Called when a player moves to X,Y,Z (teleport or regular move)
- MODULENAME_Timer(m) : Called as a timer event
There are some problems with enginecalls which are using string-parameters (Currently with Kick(), which works correctly if i call it within the engine).
Btw: Operators can script ingame using /script
Rollback Post to RevisionRollBack
DF Custom Server - Minecraft Modular Custom Server written in Object Pascal
DFCS is a custom server for minecraft (protocol version 7). It's written in Pascal. Features:
- Support for heartbeat-protocol
- Supports small and large maps (+ save), currently, it needs too much time to save and compress the map when it's larger than 256*256*256
- Low memory usage.
- HOT Supports c5script Scripting Language (Modules!). They can directly modify the map and interact with the user (chat, kick etc.)
- High-Portable: Runs on every platform the Free Pascal Compiler supports (pre-compiled binarys planned for Windows, Linux and Mac)
It's currently Alpha, there are still some small problems with player spawning (everything else works nice, except from physics, see below).
Modules
The server's primary goal is to provide a user-friendly module-system, using scripts. Here is an example for a script which allows the half-blocks to work correctly (it is already supported by server):
There is a GUI-Tool for managing modules. There are already some interesting ones like WaterBuild, but even spreading water is implemented as a module.
Release
For the last release and other information, check out it's homepage: http://goldenwipf.de/dfc/wordpress !
Fortunately not :>! It's just a language like C (in my view with nicer properties).
I'm not proud of some parts of my code - but yes, I think it will come open-source. Maybe not with the first stable release.
Thx :smile.gif:
- Modyfing the map (SetBlock, GetBlock)
- Interacting with the clients (Teleport them, use Chat, get position etc.)
That's what should be possible to do. It is organized in modules, and modules can have some local variables, timers and define WatchBlocks (add attributes to blocks).
When something happens, the scriptengine will call defined scriptfunctions for each module (OnChangeBlock, OnPlayerMove, OnChatCommand etc.). The server will come along with a documentation of the possibilities.
I will extend it when people request new functions.
It reads the modules from an online database and give the user the ability to save and activate them for his local server. It is also possibles to define some configuration variables for each module.
The displayed definitionfile for GuestArea is:
[edit]GuestArea-Script now works :smile.gif:![/edit]
This may be perfect for my custom server needs. Would you mind releasing some sort of alpha? (pleeeease)
As for commands, what I would want:
Send a message to all users or to one in particular
Detect and client messages and the necessary string functions so that they can be parsed
Get/Set blocks
Set server name/pessage/if it's private without having to restart server
Get/set player coords
Handle incoming block placement packets manually (to implement usergroups and stuff with maximum control)
Already implemented:
Detect and client messages and the necessary string functions so that they can be parsed
Get/Set blocks
Handle incoming block placement packets manually (to implement usergroups and stuff with maximum control)
Get/set player coords
@Alpha: It might release today or tomorrow.
You are wonderous.
Also, what is the full list of commands?
The PlayerAt* ones are very confusing (really sounds like it gets the player at the position, not the position of the player). I'm not very familiar with Pascal but isn't there an object oriented way to do it, like player.GetPosition() that returns a structure with (x, y, z)? If not at least change the name..
Script to edit Minecraft maps with Paint3D
Eddy, don't listen to that child. You're doing excellent, and the sooner you release an alpha, the fewer fingers I'll have to remove from your hand.
The scriptengine itself is quite - minimal. It does not support any object-orientated structures, but i could implement a "GetPosition(player)" which returns such an object. Then it would be possible to fetch the coordinates with GetX, GetY and GetZ.
Do you think that would be better?
If you don't have objects, you must have either RAM access or local file access for storage of data and interpretation of it as objects. As long as you have local file access, some way to have objects or at least arrays, loops, variables, and conditional statements, I'm good.
Also, what is the full list of commands so far?
There are some problems with enginecalls which are using string-parameters (Currently with Kick(), which works correctly if i call it within the engine).
Btw: Operators can script ingame using /script
How 'bout now.
Now?
Now?
.... NOW!?
errrmm
How about now.
Nope?
Now?
No, thank you. I will not shut up. I can ask as many times as I want and there's not a thing you can do about it.
Wait..
Wait, why do you have duct tape in the glove compaRTMENMMFFfmfmmf!!!
mfmfmm
mmfmfm!!
MFMFMMFMM!!
MMFMFMRG!!
*smack*
mmmmmmmmf --
Dur, read it ^, now go sit in the corner!