For$
<!-- begin site header -->
<div id=

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - thegk01

Pages: [1]
1
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

2
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: [Select]
[ 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 :)
thegk01

3
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.  :)

Create src/blocks/tnt.h
Code: [Select]
#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: [Select]
#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: [Select]
[...]
(block == BLOCK_SNOW || block == BLOCK_REED || block == BLOCK_TORCH || block == BLOCK_TNT

[...]

to

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

Add this line to src/plugin.cpp on line 66:
Code: [Select]
#include "blocks/tnt.h"
Add these lines to src/plugin.cpp on line 123:
Code: [Select]
BlockTNT* tntblock = new BlockTNT();
BlockCB.push_back(tntblock);

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

Code: [Select]
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! :)
Please send any bugs or suggestions to me! This would be very helpful.

thegk01

4
Support / Tested 2-Mar-11 Release: One BIG Problem!
« on: May 05, 2011, 10:58:41 am »
Hey guys!

I have built the new release; I noticed the fact that, as I logged in, the console said "tek1 logged in!" instead of "thegk01 logged in!". It seems that Notch changed the chat engine.
As I wanted to give me a bit TNT (because I'm working on TNT currently...), the console only received:
ietek1ttlP
give thegk01 tnt

I don't know how to fix it because I don't know the code of Minecraft... And nothing big changed on the chat.cpp file, or?

I hope this gonna be fixed... Until then, I try to program TNT ;)

-- thegk01


EDIT: And I needed to change the config.cfg that users are not looked up in the Minecraft user database - Sure, there is no "tek1"...

5
Development / System Requirements? CPU: ARM?
« on: March 30, 2011, 08:19:43 pm »
Hello at all  ;)
I have two questions: Which system requirements does mineserver need to run "good"?
And: Can I run it with a ARM-CPU? (633 MHz)

Just a few questions... ;)

thegk01

6
Development / Mineserver fails at saving/generating chunks?!
« on: March 18, 2011, 04:31:41 pm »
Hello at all,
I have a problem with my Mineserver.
If I launch the server within a map ( = the server should generate one), it generates a map and I can log onto the server. After moving a bit around I see always two lines of errors, showing hundreds of times...
The Error:
Error loading file
Failed to open file Worldname/region/r.X.Y.mcr
(Where X and Y are -1, 0 or 1)

It seems that this error is caused by saving the generated chunks into the files.
I did'nt change anything on the generate/save code.

When configuring the server to open a map generated by the original Minecraft server software or Minecraft, it does'nt create this error until I move out of the region Minecraft generated ( = I move into a point where Mineserver notices that it must generate new parts of the map)

I hope I did'nt make much mistakes in my text.
Please help me! I am confused... :'(

thegk01

Pages: [1]