コード例 #1
0
void Player::SendInitialLogonPackets()
{
    // Initial Packets... they seem to be re-sent on port.
    //m_session->OutPacket(SMSG_SET_REST_START_OBSOLETE, 4, &m_timeLogoff); // Seem to be unused by client

    StackWorldPacket<32> data(SMSG_BINDPOINTUPDATE);

    data << float(m_bind_pos_x);
    data << float(m_bind_pos_y);
    data << float(m_bind_pos_z);
    data << uint32(m_bind_mapid);
    data << uint32(m_bind_zoneid);

    m_session->SendPacket(&data);

    //Proficiencies
    SendSetProficiency(4, armor_proficiency);
    SendSetProficiency(2, weapon_proficiency);

    //Tutorial Flags
    data.Initialize(SMSG_TUTORIAL_FLAGS);

    for (uint8 i = 0; i < 8; i++)
        data << uint32(m_Tutorials[i]);

    m_session->SendPacket(&data);

    smsg_TalentsInfo(false);
    smsg_InitialSpells();

    data.Initialize(SMSG_SEND_UNLEARN_SPELLS);
    data << uint32(0); // count, for (count) uint32;
    GetSession()->SendPacket(&data);

    SendInitialActions();
    smsg_InitialFactions();

    data.Initialize(SMSG_LOGIN_SETTIMESPEED);

    data << uint32(Arcemu::Util::MAKE_GAME_TIME());
    data << float(0.0166666669777748f);    // Normal Game Speed
    data << uint32(0);   // 3.1.2

    m_session->SendPacket(&data);

    // cebernic for speedhack bug
    m_lastRunSpeed = 0;
    UpdateSpeed();

    WorldPacket ArenaSettings(SMSG_UPDATE_WORLD_STATE, 16);

    ArenaSettings << uint32(0xC77);
    ArenaSettings << uint32(sWorld.Arena_Progress);
    ArenaSettings << uint32(0xF3D);
    ArenaSettings << uint32(sWorld.Arena_Season);

    m_session->SendPacket(&ArenaSettings);

    LOG_DETAIL("WORLD: Sent initial logon packets for %s.", GetName());
}
コード例 #2
0
ファイル: PlayerPacketWrapper.cpp プロジェクト: vata/wowice
void Player::SendInitialLogonPackets()
{
	// Initial Packets... they seem to be re-sent on port.
	//m_session->OutPacket(SMSG_SET_REST_START_OBSOLETE, 4, &m_timeLogoff); // Seem to be unused by client

    StackWorldPacket<32> data( SMSG_BINDPOINTUPDATE );

    data << float( m_bind_pos_x );
    data << float( m_bind_pos_y );
    data << float( m_bind_pos_z );
    data << uint32( m_bind_mapid );
    data << uint32( m_bind_zoneid );

    m_session->SendPacket( &data );

	//Proficiencies
    SendSetProficiency( 4, armor_proficiency);
    SendSetProficiency( 2, weapon_proficiency);
	
	//Tutorial Flags
	data.Initialize( SMSG_TUTORIAL_FLAGS );
	
    for (int i = 0; i < 8; i++)
		data << uint32( m_Tutorials[i] );

	m_session->SendPacket(&data);

	smsg_TalentsInfo( false );
	smsg_InitialSpells();

	data.Initialize(SMSG_SEND_UNLEARN_SPELLS);
	data << uint32(0); // count, for(count) uint32;
	GetSession()->SendPacket( &data );

	SendInitialActions();
	smsg_InitialFactions();

    /* Some minor documentation about the time field
    // MOVE THIS DOCUMENTATION TO THE WIKI

    minute's = 0x0000003F                  00000000000000000000000000111111
    hour's   = 0x000007C0                  00000000000000000000011111000000
    weekdays = 0x00003800                  00000000000000000011100000000000
    days     = 0x000FC000                  00000000000011111100000000000000
    months   = 0x00F00000                  00000000111100000000000000000000
    years    = 0x1F000000                  00011111000000000000000000000000
    unk	     = 0xE0000000                  11100000000000000000000000000000
    */

	data.Initialize(SMSG_LOGIN_SETTIMESPEED);

	time_t minutes = sWorld.GetGameTime( ) / 60;
	time_t hours = minutes / 60; minutes %= 60;
    time_t gameTime = 0;

    // TODO: Add stuff to handle these variables

	time_t basetime = UNIXTIME;
	uint32 DayOfTheWeek;
	if(localtime(&basetime)->tm_wday == 0)
		DayOfTheWeek = 6;
	else
		   DayOfTheWeek = localtime(&basetime)->tm_wday - 1;
	uint32 DayOfTheMonth = localtime(&basetime)->tm_mday - 1;
	uint32 CurrentMonth = localtime(&basetime)->tm_mon;
	uint32 CurrentYear = localtime(&basetime)->tm_year - 100;

	#define MINUTE_BITMASK      0x0000003F
    #define HOUR_BITMASK        0x000007C0
    #define WEEKDAY_BITMASK     0x00003800
    #define DAY_BITMASK         0x000FC000
    #define MONTH_BITMASK       0x00F00000
    #define YEAR_BITMASK        0x1F000000
    #define UNK_BITMASK         0xE0000000

    #define MINUTE_SHIFTMASK    0
    #define HOUR_SHIFTMASK      6
    #define WEEKDAY_SHIFTMASK   11
    #define DAY_SHIFTMASK       14
    #define MONTH_SHIFTMASK     20
    #define YEAR_SHIFTMASK      24
    #define UNK_SHIFTMASK       29

    gameTime = ((minutes << MINUTE_SHIFTMASK) & MINUTE_BITMASK);
    gameTime|= ((hours << HOUR_SHIFTMASK) & HOUR_BITMASK);
    gameTime|= ((DayOfTheWeek << WEEKDAY_SHIFTMASK) & WEEKDAY_BITMASK);
    gameTime|= ((DayOfTheMonth << DAY_SHIFTMASK) & DAY_BITMASK);
    gameTime|= ((CurrentMonth << MONTH_SHIFTMASK) & MONTH_BITMASK);
    gameTime|= ((CurrentYear << YEAR_SHIFTMASK) & YEAR_BITMASK);

    data << uint32( gameTime );
	data << float( 0.0166666669777748f );  // Normal Game Speed
	data << uint32( 0 ); // 3.1.2
	
    m_session->SendPacket( &data );

	// cebernic for speedhack bug
	m_lastRunSpeed = 0;
	UpdateSpeed();

    WorldPacket ArenaSettings(SMSG_UPDATE_WORLD_STATE, 16);

    ArenaSettings << uint32( 0xC77 );
    ArenaSettings << uint32( sWorld.Arena_Progress );
    ArenaSettings << uint32( 0xF3D );
    ArenaSettings << uint32( sWorld.Arena_Season );

    m_session->SendPacket( &ArenaSettings );

	sLog.outDetail("WORLD: Sent initial logon packets for %s.", GetName());
}