Fork me on GitHub
  August 17, 2018, 01:55:07 am
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  Home Help Search Login Register  
  Show Posts
Pages: [1] 2 3
1  Mineserver / Discussion / Re: Worth it? on: February 17, 2013, 01:45:24 pm
Well, I'll have a look at the code again... But I think there has been some development since I coded the TNT block, or am I wrong?  Wink
Since my Raspberry Pi came yesterday, Mineserver is getting interesting again... Smiley
But I don't know if I can invest much time... I'm close to finish school and am very busy learning stuff I'll never need again.
2  Mineserver / Discussion / Worth it? on: February 16, 2013, 12:52:33 am
Hello,
I wanted to ask if the mineserver project is still alive or worked on. Having a glance at GitHub, I see that the changes mostly lay half a year behind. The "Mineserver 2"-Repository is older than the fador-mineserver git.

Is it still worth the time to develop some things for mineserver? Or is mineserver (soon-to-be-)dead?

Greetings
3  General / Off Topic / Re: New Windows Build on: August 31, 2011, 06:43:15 pm
Is this a topic for the "Off Topic" thread?
Look on http://mineserver.be , there is this strange flag, drawn in 4 colors. If you click on it, you will get a list of the Windows Mineserver Builds.
4  Mineserver / Support / Re: Unable to Launch Mineserver on: August 31, 2011, 06:40:45 pm
It may be caused by the fact that Mineserver uses a slash for the path, but Windows uses a backslash...

C:\Users\Jordan Banasik\AppData\Roaming/.mineserver/config.cfg
5  Mineserver / Discussion / Re: Is Mineserver dead? on: August 20, 2011, 12:13:22 am
I think it is not dead. I would describe it as "a project, which would be nice if it would be more active". I think if someone would work on the code for a few days, it could be very nice, but actually it's nice for someone who needs a server with low cpu/RAM rquirements, not more.
After a long time waiting for a fix of a bug - without any answer - I changed to the normal Java Server. I *would* change back if the whole project would be up-to-date.

By the way: Nice name Wink (if it's based on the games)
6  Mineserver / Support / Re: Error building June 12 release :( on: July 11, 2011, 02:37:34 pm
Okay,
If I use a prebuilt map, then it works.
But if I start to chat, the mineserver executable stops with a "Floating Point Exception".

Sad
7  Mineserver / Support / Re: Error building June 12 release :( on: July 06, 2011, 10:31:46 pm
Okay, after I tried very much, added the headers borisko said ( Smiley ), changed some functions (because as a Mac user, there is nothing implemented Sad ), I am now at a point where Mineserver launches and loads the config files etc.
But, after "world" is created, the program crashes with this error:
Code:
[22:24:41] map.cpp:228::init(): World world
[22:24:41] mineserver.cpp:535::run(): Generating spawn area...
Floating point exception

Any suggestions? Sad
8  Mineserver / Support / Error building actual release :( on: June 28, 2011, 02:17:46 pm
Hey,
I got an error in the mcregion file while compiling on my MacBook (Intel Core 2 Duo).
The compiler said this:
Code:
[ 32%] Building CXX object CMakeFiles/mineserver.dir/src/mcregion.cpp.o
/Users/myname/Downloads/fador-mineserver-c643202-1/src/mcregion.cpp: In function ‘int getdir(std::string, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&)’:
/Users/myname/Downloads/fador-mineserver-c643202-1/src/mcregion.cpp:443: error: ‘DIR’ was not declared in this scope
/Users/myname/Downloads/fador-mineserver-c643202-1/src/mcregion.cpp:443: error: ‘dp’ was not declared in this scope
/Users/myname/Downloads/fador-mineserver-c643202-1/src/mcregion.cpp:445: error: ‘opendir’ was not declared in this scope
/Users/myname/Downloads/fador-mineserver-c643202-1/src/mcregion.cpp:451: error: ‘readdir’ was not declared in this scope
/Users/myname/Downloads/fador-mineserver-c643202-1/src/mcregion.cpp:453: error: invalid use of incomplete type ‘struct dirent’
/Users/myname/Downloads/fador-mineserver-c643202-1/src/mcregion.cpp:444: error: forward declaration of ‘struct dirent’
/Users/myname/Downloads/fador-mineserver-c643202-1/src/mcregion.cpp:453: error: invalid use of incomplete type ‘struct dirent’
/Users/myname/Downloads/fador-mineserver-c643202-1/src/mcregion.cpp:444: error: forward declaration of ‘struct dirent’
/Users/myname/Downloads/fador-mineserver-c643202-1/src/mcregion.cpp:455: error: invalid use of incomplete type ‘struct dirent’
/Users/myname/Downloads/fador-mineserver-c643202-1/src/mcregion.cpp:444: error: forward declaration of ‘struct dirent’
/Users/myname/Downloads/fador-mineserver-c643202-1/src/mcregion.cpp:458: error: ‘closedir’ was not declared in this scope
make[2]: *** [CMakeFiles/mineserver.dir/src/mcregion.cpp.o] Error 1
make[1]: *** [CMakeFiles/mineserver.dir/all] Error 2
make: *** [all] Error 2

Yep. This is bad.
Additionally, I want to ask how I compile for archv6? This would be the final step to let Mineserver run on my iPod touch.

Thanks for any help Smiley
thegk01
9  Mineserver / Development / Re: TNT! on: June 11, 2011, 06:30:16 pm
Oh, yes, sure!
I think there are much functions which must be added, but I am glad that I brought the project a little step further Wink

-- thegk01
10  Mineserver / Development / Re: TNT! on: June 02, 2011, 10:46:07 am
Yes, I got this warning too. It is caused by the if loops which are used to spawn other items than the block item, e.g. a destroyed redstone block will not drop a redstone block, but redstone dust.

If you know how to fix this error, help me Wink As far as I know, I need to convert the integers to uint8_t, but how can I fill a variable with uint8_t instead of int?

But, even if I think that this errors should be fixed, the code works like it should; every block which should not drop itself, but an item, does this.

thegk01
11  Mineserver / Discussion / Re: Mineserver Runs On... (post your specs) on: May 31, 2011, 08:24:47 pm
Mac OS 10.6.7
Intel Core 2 Duo 1,83 GHz
1 GB 667 MHz DDR2 RAM

(Even if this CPU is not fast/the RAM is not big, I have no problems to run Mineserver and Minecraft Smiley )
12  Mineserver / Support / Re: Login Error (Kicks player immediately) on: May 31, 2011, 12:31:31 pm
Had this problem a few times too.
Try to delete the player file in the directory of the map, that worked for me Wink

thegk01
13  Mineserver / Development / TNT! on: May 25, 2011, 02:40:42 pm
Hey,

Over the last week(s), I have programmed the TNT block. There are still much things that must be programmed/improved, but I think I have programmed it up to a point where you can use it.  Smiley

Create src/blocks/tnt.h
Code:
#pragma once

#include "basic.h"

class User;

class BlockTNT : public BlockBasic
{
public:
bool affectedBlock(int block);
void onStartedDigging(User* user, int8_t status, int32_t x, int8_t y, int map, int32_t z, int8_t direction);
bool onPlace(User* user, int16_t newblock, int32_t x, int8_t y, int32_t z, int map, int8_t direction);
bool onInteract(User* user, int32_t x, int8_t y, int32_t z, int map);
void rb(int32_t x,int8_t y,int8_t z,int map,User* user); // rb=Remove Block
void explode(User* user, int32_t x, int8_t y, int8_t z, int map);
};

Create src/blocks/tnt.cpp
Code:
#include "default.h"
#include "../mineserver.h"
#include "../map.h"
#include "../constants.h"
#include "../logger.h"

#include "tnt.h"

uint8_t pickint;

void BlockTNT::rb(int32_t x,int8_t y,int8_t z,int map, User* user)
{
uint8_t block, meta;
Mineserver::get()->map(map)->getBlock(x,y,z,&block,&meta);

// Blocks which have no pickups (or they are only accessable via /give )
if (block == 7 || block == 8 || block == 9 || block == 10 || block == 11 || block == 18 ||
block == 30 || block == 47 || block == 49 || block == 51 || block == 52 || block == 59 ||
block == 68 || block == 79 || block == 83 || block == 90 || block == 92 || block == 94) {
block = 0;
}

// Blocks which drop other things as the block item, (Coal, Diamond, ...)
if (block == 1) {
block=4;
} else if (block == 2) {
block=3;
}  else if (block == 16) {
block=263;
} else if (block == 21) {
block=351;
meta=4;
} else if (block == 26) {
block=355;
} else if (block == 53) {
block=5;
} else if (block == 55) {
block=331;
} else if (block == 56) {
block=264;
} else if (block == 59) {
block=295;
} else if (block == 60) {
block=3;
} else if (block == 62) {
block=61;
} else if (block == 68) {
block=63;
} else if (block == 73) {
block=331;
} else if (block == 74) {
block=331;
} else if (block == 76) {
block=75;
} else if (block == 78) {
block=332;
} else if (block == 82) {
block=337;
} else if (block == 83) {
block=338;
} else if (block == 89) {
block=348;
} else if (block == 92) {
block=354;
} else if (block == 95) /* Easter egg chest? */ {
block=54;
}


// Undestroyable blocks
if (block == 0 || block == 7 || block == 49) {
return;
} else {
Mineserver::get()->map(map)->setBlock(x,y,z,0,0);
Mineserver::get()->map(map)->sendBlockChange(x,y,z,0,0);
}

// Pickup Spawn Area
// The integer "pickint" is used to spawn 1/5 of the blocks, otherwise there would be too much pickups!
if(pickint == 5) {

if(block != 0) {
Mineserver::get()->map(map)->createPickupSpawn(x,y,z,block,meta,0,user);
}
pickint=0;
} else {
pickint++;
}

}

void BlockTNT::explode(User* user,int32_t x,int8_t y,int8_t z,int map)
{
pickint = 0;
if (rand() % 9 == 5) {
// There is a chance of 1/10 that the TNT block does'nt explode;
// this is more realistic ;)
Mineserver::get()->map(map)->setBlock(x,y,z,0,0);
Mineserver::get()->map(map)->sendBlockChange(x,y,z,0,0);
// But we want to be fair; let's create a pickup for the TNT block =)
Mineserver::get()->map(map)->createPickupSpawn(x,y,z,46,1,0,user);
} else {
int number; // Counter in the for(...){...} loops.
// Layer Y-4

//rb(x,y-4,z,map,user);

// Layer Y-3

rb(x-1,y-3,z+1,map,user);
rb(x,y-3,z+1,map,user);
rb(x+1,y-3,z+1,map,user);
rb(x-1,y-3,z,map,user);
rb(x,y-3,z,map,user);
rb(x+1,y-3,z,map,user);
rb(x-1,y-3,z-1,map,user);
rb(x,y-3,z-1,map,user);
rb(x+1,y-3,z-1,map,user);

// Layer Y-2

for (number=-2; number<=2; number++) {
rb(x+number,y-2,z+1,map,user);
rb(x+number,y-2,z,map,user);
rb(x+number,y-2,z-1,map,user);
}

rb(x-1,y-2,z+2,map,user);
rb(x,y-2,z+2,map,user);
rb(x+1,y-2,z+2,map,user);

rb(x-1,y-2,z-2,map,user);
rb(x,y-2,z-2,map,user);
rb(x+1,y-2,z-2,map,user);

// Layer Y-1

rb(x-3,y-1,z+2,map,user);
rb(x-3,y-1,z+1,map,user);
rb(x-3,y-1,z,map,user);
rb(x-3,y-1,z-1,map,user);
rb(x-3,y-1,z-2,map,user);

for (number=-2; number<=2; number++) {
rb(x-number,y-1,z+3,map,user);
rb(x-number,y-1,z+2,map,user);
rb(x-number,y-1,z+1,map,user);
rb(x-number,y-1,z,map,user);
rb(x-number,y-1,z-1,map,user);
rb(x-number,y-1,z-2,map,user);
rb(x-number,y-1,z-3,map,user);
}

rb(x+3,y-1,z+2,map,user);
rb(x+3,y-1,z+1,map,user);
rb(x+3,y-1,z,map,user);
rb(x+3,y-1,z-1,map,user);
rb(x+3,y-1,z-2,map,user);


// Layer Y {+,-} 0, same as TNT block

//rb(x-4,y,z,map,user);

rb(x-3,y,z+2,map,user);
rb(x-3,y,z+1,map,user);
rb(x-3,y,z,map,user);
rb(x-3,y,z-1,map,user);
rb(x-3,y,z-2,map,user);

for (number=-2; number<=2; number++) {
rb(x-number,y,z+3,map,user);
rb(x-number,y,z+2,map,user);
rb(x-number,y,z+1,map,user);
rb(x-number,y,z,map,user);
rb(x-number,y,z-1,map,user);
rb(x-number,y,z-2,map,user);
rb(x-number,y,z-3,map,user);
}

rb(x+3,y,z+2,map,user);
rb(x+3,y,z+1,map,user);
rb(x+3,y,z,map,user);
rb(x+3,y,z-1,map,user);
rb(x+3,y,z-2,map,user);

//rb(x+4,y,z,map,user);

//rb(x,y,z+4,map,user);
//rb(x,y,z-4,map,user);

// Layer Y+1

rb(x-3,y+1,z+2,map,user);
rb(x-3,y+1,z+1,map,user);
rb(x-3,y+1,z,map,user);
rb(x-3,y+1,z-1,map,user);
rb(x-3,y+1,z-2,map,user);

for (number=-2; number<=2; number++) {
rb(x-number,y+1,z+3,map,user);
rb(x-number,y+1,z+2,map,user);
rb(x-number,y+1,z+1,map,user);
rb(x-number,y+1,z,map,user);
rb(x-number,y+1,z-1,map,user);
rb(x-number,y+1,z-2,map,user);
rb(x-number,y+1,z-3,map,user);
}

rb(x+3,y+1,z+2,map,user);
rb(x+3,y+1,z+1,map,user);
rb(x+3,y+1,z,map,user);
rb(x+3,y+1,z-1,map,user);
rb(x+3,y+1,z-2,map,user);

// Layer Y+2

for (number=-2; number<=2; number++) {
rb(x+number,y+2,z+1,map,user);
rb(x+number,y+2,z,map,user);
rb(x+number,y+2,z-1,map,user);
}

rb(x-1,y+2,z+2,map,user);
rb(x,y+2,z+2,map,user);
rb(x+1,y+2,z+2,map,user);

rb(x-1,y+2,z-2,map,user);
rb(x,y+2,z-2,map,user);
rb(x+1,y+2,z-2,map,user);

// Layer Y+3

rb(x-1,y+3,z+1,map,user);
rb(x,y+3,z+1,map,user);
rb(x+1,y+3,z+1,map,user);
rb(x-1,y+3,z,map,user);
rb(x,y+3,z,map,user);
rb(x+1,y+3,z,map,user);
rb(x-1,y+3,z-1,map,user);
rb(x,y+3,z-1,map,user);
rb(x+1,y+3,z-1,map,user);

// Layer Y+4

//rb(x,y+4,z,map,user);

LOG2(INFO,"TNT Block exploded!");
}
}

bool BlockTNT::affectedBlock(int block)
{
switch (block)
{
case BLOCK_TNT:
return true;
}
return false;
}

bool BlockTNT::onPlace(User* user, int16_t newblock, int32_t x, int8_t y, int32_t z, int map, int8_t direction)
{
uint8_t oldblock;
uint8_t oldmeta;

if (!Mineserver::get()->map(map)->getBlock(x, y, z, &oldblock, &oldmeta))
{
revertBlock(user, x, y, z, map);
return true;
}
/* Check block below allows blocks placed on top */
if (!this->isBlockStackable(oldblock))
{
revertBlock(user, x, y, z, map);
return true;
}

/* move the x,y,z coords dependent upon placement direction */
if (!this->translateDirection(&x, &y, &z, map, direction))
{
revertBlock(user, x, y, z, map);
return true;
}

if (this->isUserOnBlock(x, y, z, map))
{
revertBlock(user, x, y, z, map);
return true;
}

if (!this->isBlockEmpty(x, y, z, map))
{
revertBlock(user, x, y, z, map);
return true;
}

return false;
}

void BlockTNT::onStartedDigging(User* user, int8_t status, int32_t x, int8_t y, int32_t z, int map, int8_t direction)
{
uint8_t block, metadata;
explode(user,x,y,z,map);

}

bool BlockTNT::onInteract(User* user, int32_t x, int8_t y, int32_t z, int map)
{
uint8_t block, metadata;
return true;
}

Change src/packets.cpp on line 617:
Code:
[...]
(block == BLOCK_SNOW || block == BLOCK_REED || block == BLOCK_TORCH || block == BLOCK_TNT

[...]

to

Code:
[...]
(block == BLOCK_SNOW || block == BLOCK_REED || block == BLOCK_TORCH
[...]

Add this line to src/plugin.cpp on line 66:
Code:
#include "blocks/tnt.h"

Add these lines to src/plugin.cpp on line 123:
Code:
BlockTNT* tntblock = new BlockTNT();
BlockCB.push_back(tntblock);

Change the CMakeLists.txt like this to include the new files (line 124):
Code:
src/blocks/wood.cpp

to

Code:
src/blocks/wood.cpp
src/blocks/tnt.cpp



This should be all you need to do if you wanna have TNT!
I added a few comments to tnt.cpp so you can understand how it works. If not, feel free to ask me! Smiley
Please send any bugs or suggestions to me! This would be very helpful.

thegk01
14  Mineserver / Plugins / Re: Plugin to allow usage of mods written in Java on: May 20, 2011, 11:05:11 am
And, additionally, Mineserver would become a server like the bukkit one. And Mineserver is not a rewriting, it's a different server! Independent. Wink
15  Mineserver / Support / Re: Tested 2-Mar-11 Release: One BIG Problem! on: May 17, 2011, 07:47:17 am
In the "original" Mineserver chat.cpp, the strings are wstring! (afaik)...
Dunno how to fix this. :/
Pages: [1] 2 3
Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!