(10-27-2011, 05:53 AM)FakeTruth Wrote: These are just some pointers, don't take it too hard I thought you said you're new to C++ so I'm sure there's so much stuff going on you don't even know what's happening.
I suspect that I created cPacket_EntityEquipment before the documentation was complete, and nobody had any idea what it did, so I just named it m_Short ^^
Yes, I'm new to C++ and greatly appreciate any help or pointers you can give. I'm open to all advice. Learning this is a handful right now, but it's a ton of fun.
I think I added m_Gamemode to cWorld correctly, now I'm working on sending the packets with the correct information. I'll probably have some more questions soon.
I fixed most of the problems and made the changes you suggested for the gamemode. I've got it working for the respawn:
Code:
void cPlayer::Respawn()
{
m_Health = 20;
cWorld* World = cRoot::Get()->GetWorld();
// Create Respawn player packet
cPacket_Respawn Packet;
//Set Gamemode for packet by looking at world's gamemode (Need to check players gamemode.)
Packet.m_CreativeMode = cRoot::Get()->GetWorld()->GetGameMode();
//Send Packet
m_ClientHandle->Send( Packet );
TeleportTo( World->GetSpawnX(), World->GetSpawnY(), World->GetSpawnZ() );
SetVisible( true );
}
but I'm not sure where or how the login packet is sent from the server yet.
Edit:
figured it out. It's just done differently in cClientHandle than it is in cPlayer.
Going to upload my changes now.
It does appear
if( m_ItemID <= 0 ) m_ItemID = -1; // Fix, to make sure no invalid values are sent
is correct for this packet.
Edit:
Changes at: http://code.google.com/p/mc-server/source/detail?r=18