Cuberite Forum
MCServer Development Discussion - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Cuberite (https://forum.cuberite.org/forum-4.html)
+--- Forum: Development (https://forum.cuberite.org/forum-13.html)
+--- Thread: MCServer Development Discussion (/thread-186.html)

Pages: 1 2 3 4 5 6 7 8 9


RE: MCServer Development Discussion - rs2k - 11-06-2011

(11-06-2011, 08:12 AM)Sebi Wrote: Notch's thoughts: *I'm running out of block ids!* *Idea! Let's use negative ids!* :V

Even worse, he's using NBT data to work around setting his meta ID limit too low for enchanting items. After working with NBT for as much as I have the past two weeks, I'm now 100% certain it originally stood for Notch's Binary Troll. After some negative feedback they decided to change the name to Named Binary Tag.


RE: MCServer Development Discussion - FakeTruth - 11-06-2011

(11-06-2011, 08:12 AM)Sebi Wrote: Notch's thoughts: *I'm running out of block ids!* *Idea! Let's use negative ids!* :V

Also, in cPlayer.cpp (and also somewhere in monster file) at line 265 you have
Code:
char block = GetWorld()->GetBlock( (int)m_Pos->x, (int)m_Pos->y, (int)m_Pos->z );
And there are some rounding issues with negative coords (you are set on fire one block off lava block)
Something like this shall do:
Code:
#define float2int(x) ((x)<0 ? ((int)(x))-1 : (int)(x))
char block = GetWorld()->GetBlock( float2int(m_Pos->x), float2int(m_Pos->y), float2int(m_Pos->z) );

Yeah, or just use floor() (slightly slower though), I got the same define you have in cNoise.cpp called FAST_FLOORTongue


RE: MCServer Development Discussion - Sebi - 11-06-2011

I've been messing with the server a bit and I implemented some stuff like lava physics, drops are deleted when in lava, water is now slower, lava gives actual damage etc.
Here's the diff file.


RE: MCServer Development Discussion - rs2k - 11-06-2011

I added the new files to the VC2010 file and the makefile. I patched the files with your diff and uploaded the changes here:

http://code.google.com/p/mc-server/source/detail?r=67


This release also has working pistons.


RE: MCServer Development Discussion - Sebi - 11-07-2011

I've rewritten pistons so that now they doesn't push blocks like redstone, they are breaking them and creating drops and also they have "strenth" (block limit) so you might want to merge it somehow. Also redstone ore and lapis drops are fixed. Also i'm not sure if you need to broadcast block action packet to whole world. DIFF


RE: MCServer Development Discussion - rs2k - 11-08-2011

I applied your code, but pistons are back to doing odd things. Their plungers are going the wrong direction. I'm looking into the cause now.

The broadcast of the packet only needs to happen to people within a certain range from the piston. I fon't have a way to check for players within range yet so I just am sending it to the whole server right now. lol
I found the problems. I'm fixing them now. The directions that Notch uses for the pistons are unlike his other direction metas. I changed your AddDir function to match his. I also fixed a line in the piston retraction code that didn't allow the piston extension to be deleted.
I've fixed the bugs (Also found a change that didn't allow creative mode to work in cClientHandle.cpp) and uploaded the changes.

I like that piston code. It's much more consolidated.


RE: MCServer Development Discussion - FakeTruth - 11-08-2011

(11-08-2011, 03:27 AM)rs2k Wrote: The broadcast of the packet only needs to happen to people within a certain range from the piston. I fon't have a way to check for players within range yet so I just am sending it to the whole server right now. lol

Use the Broadcast() function on the chunk the piston is in, it will send it to all players that have that chunk loaded


RE: MCServer Development Discussion - Sebi - 11-08-2011

I've been looking into mobs' code.
Code:
cMonster::SpawnOn( cClientHandle* a_Target )
Is this function supposed to run when a player sees a mob? (it does)
It has
Code:
Chunk->Broadcast( Spawn );
shouldn't it be
Code:
a_Target->Send( Spawn );

and also, when a mob is spawned (in cWorld.cpp) SpawnOn is called with NULL, why is it called there anyways?


RE: MCServer Development Discussion - FakeTruth - 11-08-2011

(11-08-2011, 04:51 AM)Sebi Wrote: I've been looking into mobs' code.
Code:
cMonster::SpawnOn( cClientHandle* a_Target )
Is this function supposed to run when a player sees a mob? (it does)
Yes

(11-08-2011, 04:51 AM)Sebi Wrote: It has
Code:
Chunk->Broadcast( Spawn );
shouldn't it be
Code:
a_Target->Send( Spawn );

and also, when a mob is spawned (in cWorld.cpp) SpawnOn is called with NULL, why is it called there anyways?

Giving NULL as the parameter will spawn the entity on all clients within range ( there's an if a_Target == 0 check )

You are right that it's strange that the entity spawn is broadcasted AND sent to all clients. If this is what happens the packets are sent multiple times to the same client. Sounds like an error


RE: MCServer Development Discussion - rs2k - 11-08-2011

I updated cPiston.cpp. I'm using your FastFloor define to find the piston's chunk. Smile