• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

server_motd where update?

Mauzim

Member
Joined
Jan 3, 2011
Messages
568
Reaction score
9
i ahve problem in my gesior acc cuz when i change motd in config.lua it didn't update when i startup server but when i start up it first time it did where i ahve to find script for server_motd update every start up server or if it have didn't change it stay

any1 know?
 
Last edited by a moderator:
here you go, I'll give both just in case:
dauk.png
 
I did not mean to offend you. I just tried to help. You say it didn't change on startup after you edited it, so I thought maybe you edit in wrong place. Your text is a little bit hard to read, not sure what you need help with.
After I read it a few times, is the thing you need help with is the script that tells the server to only show MOTD once? If so, I might have found where it is, after some searching.. I am no pro with this, but maybe you kno if it's the right place.
In protocollogin.cpp this function:
Code:
if(OutputMessage_ptr output = OutputMessagePool::getInstance()->getOutputMessage(this, false))
    {
        TRACK_MESSAGE(output);
        output->AddByte(0x14);

        char motd[1300];
        sprintf(motd, "%d\n%s", g_game.getMotdId(), g_config.getString(ConfigManager::MOTD).c_str());
        output->AddString(motd);

        uint32_t serverIp = serverIps[0].first;
        for(IpList::iterator it = serverIps.begin(); it != serverIps.end(); ++it)
        {
            if((it->first & it->second) != (clientIp & it->second))
                continue;

            serverIp = it->first;
            break;
        }

        //Add char list
        output->AddByte(0x64);
        if(g_config.getBool(ConfigManager::ACCOUNT_MANAGER) && id != 1)
        {
            output->AddByte(account.charList.size() + 1);
            output->AddString("Account Manager");
            output->AddString(g_config.getString(ConfigManager::SERVER_NAME));
            output->AddU32(serverIp);
            output->AddU16(g_config.getNumber(ConfigManager::GAME_PORT));
        }
        else
            output->AddByte((uint8_t)account.charList.size());

        for(Characters::iterator it = account.charList.begin(); it != account.charList.end(); it++)
        {
            #ifndef __LOGIN_SERVER__
            output->AddString((*it));
            if(g_config.getBool(ConfigManager::ON_OR_OFF_CHARLIST))
            {
                if(g_game.getPlayerByName((*it)))
                    output->AddString("Online");
                else
                    output->AddString("Offline");
            }
            else
                //output->AddString(g_config.getString(ConfigManager::SERVER_NAME));
                output->AddString(IOLoginData::getInstance()->getCheckPlayerLevel((*it)));

            output->AddU32(serverIp);
            output->AddU16(g_config.getNumber(ConfigManager::GAME_PORT));
            #else
            if(version < it->second->getVersionMin() || version > it->second->getVersionMax())
                continue;

            output->AddString(it->first);
            output->AddString(it->second->getName());
            output->AddU32(it->second->getAddress());
            output->AddU16(it->second->getPort());
            #endif
        }

        //Add premium days
        if(g_config.getBool(ConfigManager::FREE_PREMIUM))
            output->AddU16(65535); //client displays free premium
        else
            output->AddU16(account.premiumDays);

        OutputMessagePool::getInstance()->send(output);
    }

I think this first code means it will break the loop if you login with same ip more than once:
Code:
if(OutputMessage_ptr output = OutputMessagePool::getInstance()->getOutputMessage(this, false))
    {
        TRACK_MESSAGE(output);
        output->AddByte(0x14);

        char motd[1300];
        sprintf(motd, "%d\n%s", g_game.getMotdId(), g_config.getString(ConfigManager::MOTD).c_str());
        output->AddString(motd);

        uint32_t serverIp = serverIps[0].first;
        for(IpList::iterator it = serverIps.begin(); it != serverIps.end(); ++it)
        {
            if((it->first & it->second) != (clientIp & it->second))
                continue;

            serverIp = it->first;
            break;
        }

But as I said, I'm not so smart so I don't know if this is the right place.
 
Dude I hope u wanna help me and thank you alot but you look to my problem form wrong side. Look in my webpage i have simple script
$query = $SQL->query('SELECT * FROM server_motd ORDER BY id DESC LIMIT 1')->fetch(); + '.$query['text'].'
to show server motd but server motd isn't update from config.php but from sql server_motd table. I need just know how to do update server_motd table every time i change my motd in config.php and start up server or just how to take text from config.php into webpage.
 
Back
Top