• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Dzień & Noc

Status
Not open for further replies.

Burczyk91

New Member
Joined
Jul 21, 2012
Messages
268
Reaction score
3
Witam mam do was pytanko, otóż czy wiecie może jak wyłączyć na swoim serwie to że zmienia się pora dnia?
 
w source chyba albo to jest zrobione w cliencie gry niewiem
 
Podmień w pliku game.cpp:
PHP:
void Game::checkLight()
{
        checkLightEvent = Scheduler::getInstance().addEvent(createSchedulerTask(EVENT_LIGHTINTERVAL,
                boost::bind(&Game::checkLight, this)));

        lightHour = lightHour + lightHourDelta;
        if(lightHour > 1440)
                lightHour -= 1440;

        if(std::abs(lightHour - SUNRISE) < 2 * lightHourDelta)
                lightState = LIGHT_STATE_SUNRISE;
        else if(std::abs(lightHour - SUNSET) < 2 * lightHourDelta)
                lightState = LIGHT_STATE_SUNSET;

        int32_t newLightLevel = lightLevel;
        bool lightChange = false;
        switch(lightState)
        {
                case LIGHT_STATE_SUNRISE:
                {
                        newLightLevel += (LIGHT_LEVEL_DAY - LIGHT_LEVEL_NIGHT) / 30;
                        lightChange = true;
                        break;
                }
                case LIGHT_STATE_SUNSET:
                {
                        newLightLevel -= (LIGHT_LEVEL_DAY - LIGHT_LEVEL_NIGHT) / 30;
                        lightChange = true;
                        break;
                }
                default:
                        break;
        }

        if(newLightLevel <= LIGHT_LEVEL_NIGHT)
        {
                lightLevel = LIGHT_LEVEL_NIGHT;
                lightState = LIGHT_STATE_NIGHT;
        }
        else if(newLightLevel >= LIGHT_LEVEL_DAY)
        {
                lightLevel = LIGHT_LEVEL_DAY;
                lightState = LIGHT_STATE_DAY;
        }
        else
                lightLevel = newLightLevel;

        if(lightChange)
        {
                LightInfo lightInfo;
                getWorldLightInfo(lightInfo);
                for(AutoList<Player>::iterator it = Player::autoList.begin(); it != Player::autoList.end(); ++it)
                {
                        if(!it->second->hasCustomFlag(PlayerCustomFlag_HasFullLight))
                                it->second->sendWorldLight(lightInfo);
                }
        }
}
Na
PHP:
void Game::checkLight()
{
}
 
Status
Not open for further replies.
Back
Top