EOSERV Forum > EOSERV > Status Bar warning (FIXED) (RELESE)
Topic is locked.
Page: << 1 >>
Status Bar warning (FIXED) (RELESE)
Author Message
Post #20266 Status Bar warning (FIXED) (RELESE)

I've decided to release my Status bar warning code.


Put in world.cpp:

void World::WarningMsg(std::string message)
{
    PacketBuilder builder;

    builder.SetID(PACKET_PING, PACKET_OPEN);
    builder.AddString(message);

    UTIL_VECTOR_FOREACH_ALL(this->characters, Character *, character)
    {
        character->player->client->SendBuilder(builder);
    }
}


Put in world.hpp:

        void WarningMsg(std::string message);


In talk.cpp with other admin commands:

                else if (command.length() >= 4 && command.compare(0,4,"warn") == 0 && this->player->character->admin >= static_cast<int>(this->server->world->admin_config["warning"]))
                {
                    std::string message = "";
                    for (int i = 0; i < arguments.size(); ++i)
                    {
                        message += arguments[i];
                        message += " ";
                    }
                    this->server->world->WarningMsg(message);
                }


In main.cpp with other admin commands default levels:

        eoserv_config_default(aconfig, "warning"       , 2);


And in your admin.ini:

# Displays warning in client's statusbar
# $warning message
warning = 2



now you can use the command.

Say $warning (message) to display message. For example "$warning It works" will display "[warning] It works".


Edit : fixed error

14 years, 28 weeks ago
Post #20307 Re: Status Bar warning (FIXED) (RELESE)

Does this by any chance make a noise? If not, I don't see the player will notice it.

14 years, 28 weeks ago
Post #20309 Re: Status Bar warning (FIXED) (RELESE)

Nice, one thing O_O
When i use it, a short message works, but when i do a long message like:
$warning Server Shutting Down in 3 Seconds

It warps me to map 0, x 0, y 0

:(

And Sound would be nice, so its noticable

14 years, 28 weeks ago
Post #20318 Re: Status Bar warning (FIXED) (RELESE)

I don't think the purpose of the [warning] message is properly understood. This shouldn't be used for announcements, but it could be used as more of an [info] message as it is intended for. For example, upon entering a map and stepping on to certain tiles you could display a message "[info] a hidden chest is nearby" or maybe "[warning] hidden spikes may harm your player, use caution". The [info] message could in a more advanced method be used for config changes, noting map mutations, or basically any other function that is not really important but worth noting. If you are not content without a sound representation of this method, try using the "jukebox" packet and adding a builder to this script and send a tone of your choosing to all players (personally, i like the one used with "dark bite" or commonly called "effect 31").

14 years, 28 weeks ago
Post #20319 Re: Status Bar warning (FIXED) (RELESE)
Apollo posted: (26th Sep 2009 11:25 pm)

I don't think the purpose of the [warning] message is properly understood. This shouldn't be used for announcements, but it could be used as more of an [info] message as it is intended for. For example, upon entering a map and stepping on to certain tiles you could display a message "[info] ahidden chest is nearby" or maybe "[warning] hidden spikes may harm your player, use caution". The [info] message could in a more advanced method be used for config changes, noting map mutations, or basically any other function that is not really important but worth noting. If you are not contentwithout a sound representation of this method, try using the "jukebox" packet and adding a builder to this script and send a tone of your choosing to all players (personally, i like the one used with "dark bite" or commonly called "effect 31").


Errr, I don't think you understand.

He created this to warn users.

Not for information notices.
14 years, 28 weeks ago
Post #20359 Re: Status Bar warning (FIXED) (RELESE)

I understand perfectly. He created a script that allows for typing in messages to be displayed in the info bar at the botton of the client screen. This is the same bar that displays item information by hovering over it in the inventory menu, the npc name by clicking it, or exp gained from a single npc. It does however display warnings if your character should block the arena line. For the purpose of "announcing" Sausage has already built-in ServerMsg and Admin Announce.

The point I was making is that this script could be used to note in-game useful information as it was originally programmed to do, rather than hack in a couple of packets to associate sound with message to create a psuedo-warning message. (btw, if the player is afk at the time this "warning" is sent, there is no way for the player to retrieve the dialog that was sent as it is only displayed for a few seconds).

14 years, 28 weeks ago
Post #20369 Re: Status Bar warning (FIXED) (RELESE)
Apollo posted: (27th Sep 2009 11:57 am)

I understand perfectly. He created a script that allows for typing in messages to be displayed in the info bar at the botton of the client screen. This is the same bar that displays item information by hovering over it in the inventory menu, the npc name by clicking it, or exp gained from asingle npc. It does however display warnings if your character should block the arena line. For the purpose of "announcing" Sausage has already built-in ServerMsg and Admin Announce.

The point I was making is that this script could be used to note in-game useful information as it was originally programmed to do, rather than hack in a couple of packets to associate sound with message to create a psuedo-warning message. (btw, if the player is afk at the time this "warning" issent, there is no way for the player to retrieve the dialog that was sent as it is only displayed for a few seconds).


On topic: Is that like $warn Reboot and that reboot shows up on panel?

offtopic: Eoserv have server msgs?
---
Eoserv classes: Forum ghost, test player, ex-server owner, TOP 50, mapper & an
oldbie
14 years, 28 weeks ago
Post #20382 Re: Status Bar warning (FIXED) (RELESE)

Ok this is the information bar that appears below the chat window. This code, though labeled "warning message" release appears on the information bar line, no bells and whistles, just an easy way to hack in a message string on the information bar. ServerMsg was established a long time ago and should be used for creating warnings like these because it was created for that purpose in the original program. This dialog box is primarily used for information in the client code. As I said before, this script can be useful when tied to in game concepts, but there are better ways to announce warnings. Maybe I should release a ServerMsg message handler using "%" as the command notation. That would make a lot more sense to be used as a system warning rather than the information dialog.

14 years, 28 weeks ago
Page: << 1 >>
Topic is locked.
EOSERV Forum > EOSERV > Status Bar warning (FIXED) (RELESE)