Creative Mode
#7
(10-27-2011, 05:53 AM)FakeTruth Wrote: These are just some pointers, don't take it too hardTongue 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.Big Grin 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
Reply
Thanks given by:


Messages In This Thread
Creative Mode - by rs2k - 10-27-2011, 02:39 AM
RE: Creative Mode - by rs2k - 10-27-2011, 04:16 AM
RE: Creative Mode - by rs2k - 10-27-2011, 05:17 AM
RE: Creative Mode - by FakeTruth - 10-27-2011, 05:26 AM
RE: Creative Mode - by rs2k - 10-27-2011, 05:38 AM
RE: Creative Mode - by FakeTruth - 10-27-2011, 05:53 AM
RE: Creative Mode - by rs2k - 10-27-2011, 06:06 AM
RE: Creative Mode - by rs2k - 11-02-2011, 03:54 AM
RE: Creative Mode - by FakeTruth - 11-02-2011, 07:04 AM
RE: Creative Mode - by rs2k - 11-02-2011, 06:12 AM
RE: Creative Mode - by rs2k - 11-02-2011, 07:15 AM
RE: Creative Mode - by FakeTruth - 11-02-2011, 07:21 AM
RE: Creative Mode - by rs2k - 11-02-2011, 07:23 AM
RE: Creative Mode - by FakeTruth - 11-02-2011, 08:13 AM
RE: Creative Mode - by rs2k - 11-02-2011, 08:17 AM
RE: Creative Mode - by FakeTruth - 11-02-2011, 08:24 AM
RE: Creative Mode - by rs2k - 11-02-2011, 08:30 AM
RE: Creative Mode - by FakeTruth - 11-02-2011, 09:39 AM
RE: Creative Mode - by rs2k - 11-02-2011, 06:35 PM
RE: Creative Mode - by rs2k - 11-02-2011, 09:43 AM
RE: Creative Mode - by FakeTruth - 11-03-2011, 03:17 AM
RE: Creative Mode - by rs2k - 11-03-2011, 03:50 AM
RE: Creative Mode - by FraNkYWIllS - 12-20-2011, 08:24 PM



Users browsing this thread: 1 Guest(s)