mirror of
https://github.com/EQEmu/Server.git
synced 2026-01-06 05:13:52 +00:00
Added support for server-wide marquee messages.
This commit is contained in:
parent
64998a398d
commit
4816c1fc9a
@ -193,6 +193,7 @@
|
||||
#define ServerOP_QSSendQuery 0x5016
|
||||
#define ServerOP_CZSignalNPC 0x5017
|
||||
#define ServerOP_CZSetEntityVariableByNPCTypeID 0x5018
|
||||
#define ServerOP_WWMarquee 0x5019
|
||||
|
||||
/* Query Serv Generic Packet Flag/Type Enumeration */
|
||||
enum { QSG_LFGuild = 0 };
|
||||
@ -1254,6 +1255,15 @@ struct CZMessagePlayer_Struct {
|
||||
char Message[512];
|
||||
};
|
||||
|
||||
struct WWMarquee_Struct {
|
||||
uint32 Type;
|
||||
uint32 Priority;
|
||||
uint32 FadeIn;
|
||||
uint32 FadeOut;
|
||||
uint32 Duration;
|
||||
char Message[512];
|
||||
};
|
||||
|
||||
struct CZSetEntVarByNPCTypeID_Struct {
|
||||
uint32 npctype_id;
|
||||
char id[256];
|
||||
|
||||
@ -1312,6 +1312,7 @@ bool ZoneServer::Process() {
|
||||
case ServerOP_CZSignalNPC:
|
||||
case ServerOP_CZSetEntityVariableByNPCTypeID:
|
||||
case ServerOP_CZSignalClient:
|
||||
case ServerOP_WWMarquee:
|
||||
case ServerOP_DepopAllPlayersCorpses:
|
||||
case ServerOP_DepopPlayerCorpse:
|
||||
case ServerOP_ReloadTitles:
|
||||
|
||||
@ -3616,6 +3616,26 @@ XS(XS__crosszonesignalnpcbynpctypeid)
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
|
||||
XS(XS__worldwidemarquee);
|
||||
XS(XS__worldwidemarquee)
|
||||
{
|
||||
dXSARGS;
|
||||
if (items != 6)
|
||||
Perl_croak(aTHX_ "Usage: worldwidemarquee(type, priority, fadein, fadeout, duration, message)");
|
||||
|
||||
if (items == 6) {
|
||||
uint32 type = (uint32)SvIV(ST(0));
|
||||
uint32 priority = (uint32)SvIV(ST(1));
|
||||
uint32 fadein = (uint32)SvIV(ST(2));
|
||||
uint32 fadeout = (uint32)SvIV(ST(3));
|
||||
uint32 duration = (uint32)SvIV(ST(4));
|
||||
char* message = (char *)SvPV_nolen(ST(5));
|
||||
quest_manager.WorldWideMarquee(type, priority, fadein, fadeout, duration, message);
|
||||
}
|
||||
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
|
||||
XS(XS__debug);
|
||||
XS(XS__debug)
|
||||
{
|
||||
@ -3749,6 +3769,7 @@ EXTERN_C XS(boot_quest)
|
||||
newXS(strcpy(buf, "crosszonesignalclientbycharid"), XS__crosszonesignalclientbycharid, file);
|
||||
newXS(strcpy(buf, "crosszonesignalclientbyname"), XS__crosszonesignalclientbyname, file);
|
||||
newXS(strcpy(buf, "crosszonesignalnpcbynpctypeid"), XS__crosszonesignalnpcbynpctypeid, file);
|
||||
newXS(strcpy(buf, "worldwidemarquee"), XS__worldwidemarquee, file);
|
||||
newXS(strcpy(buf, "debug"), XS__debug, file);
|
||||
newXS(strcpy(buf, "delglobal"), XS__delglobal, file);
|
||||
newXS(strcpy(buf, "depop"), XS__depop, file);
|
||||
|
||||
@ -892,6 +892,10 @@ void lua_cross_zone_message_player_by_name(uint32 type, const char *player, cons
|
||||
quest_manager.CrossZoneMessagePlayerByName(type, player, message);
|
||||
}
|
||||
|
||||
void lua_world_wide_marquee(uint32 type, uint32 priority, uint32 fadein, uint32 fadeout, uint32 duration, const char *message) {
|
||||
quest_manager.WorldWideMarquee(type, priority, fadein, fadeout, duration, message);
|
||||
}
|
||||
|
||||
luabind::adl::object lua_get_qglobals(lua_State *L, Lua_NPC npc, Lua_Client client) {
|
||||
luabind::adl::object ret = luabind::newtable(L);
|
||||
|
||||
@ -1613,6 +1617,7 @@ luabind::scope lua_register_general() {
|
||||
luabind::def("cross_zone_signal_client_by_char_id", &lua_cross_zone_signal_client_by_char_id),
|
||||
luabind::def("cross_zone_signal_client_by_name", &lua_cross_zone_signal_client_by_name),
|
||||
luabind::def("cross_zone_message_player_by_name", &lua_cross_zone_message_player_by_name),
|
||||
luabind::def("world_wide_marquee", &lua_world_wide_marquee),
|
||||
luabind::def("get_qglobals", (luabind::adl::object(*)(lua_State*,Lua_NPC,Lua_Client))&lua_get_qglobals),
|
||||
luabind::def("get_qglobals", (luabind::adl::object(*)(lua_State*,Lua_Client))&lua_get_qglobals),
|
||||
luabind::def("get_qglobals", (luabind::adl::object(*)(lua_State*,Lua_NPC))&lua_get_qglobals),
|
||||
|
||||
@ -3017,6 +3017,20 @@ void QuestManager::CrossZoneSetEntityVariableByNPCTypeID(uint32 npctype_id, cons
|
||||
safe_delete(pack);
|
||||
}
|
||||
|
||||
void QuestManager::WorldWideMarquee(uint32 Type, uint32 Priority, uint32 FadeIn, uint32 FadeOut, uint32 Duration, const char *Message) {
|
||||
uint32 message_len = strlen(Message) + 1;
|
||||
auto pack = new ServerPacket(ServerOP_WWMarquee, sizeof(WWMarquee_Struct) + message_len);
|
||||
WWMarquee_Struct* WWMS = (WWMarquee_Struct*) pack->pBuffer;
|
||||
WWMS->Type = Type;
|
||||
WWMS->Priority = Priority;
|
||||
WWMS->FadeIn = FadeIn;
|
||||
WWMS->FadeOut = FadeOut;
|
||||
WWMS->Duration = Duration;
|
||||
strn0cpy(WWMS->Message, Message, 512);
|
||||
worldserver.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
}
|
||||
|
||||
bool QuestManager::EnableRecipe(uint32 recipe_id)
|
||||
{
|
||||
bool success = false;
|
||||
|
||||
@ -252,6 +252,7 @@ public:
|
||||
void CrossZoneSignalPlayerByName(const char *CharName, uint32 data);
|
||||
void CrossZoneSetEntityVariableByNPCTypeID(uint32 npctype_id, const char *id, const char *m_var);
|
||||
void CrossZoneMessagePlayerByName(uint32 Type, const char *CharName, const char *Message);
|
||||
void WorldWideMarquee(uint32 Type, uint32 Priority, uint32 FadeIn, uint32 FadeOut, uint32 Duration, const char *Message);
|
||||
bool EnableRecipe(uint32 recipe_id);
|
||||
bool DisableRecipe(uint32 recipe_id);
|
||||
void ClearNPCTypeCache(int npctype_id);
|
||||
|
||||
@ -1838,6 +1838,19 @@ void WorldServer::Process() {
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ServerOP_WWMarquee:
|
||||
{
|
||||
WWMarquee_Struct* WWMS = (WWMarquee_Struct*) pack->pBuffer;
|
||||
std::list<Client*> client_list;
|
||||
entity_list.GetClientList(client_list);
|
||||
auto iter = client_list.begin();
|
||||
std::string Message = WWMS->Message;
|
||||
while (iter != client_list.end()) {
|
||||
Client* client = (*iter);
|
||||
client->SendMarqueeMessage(WWMS->Type, WWMS->Priority, WWMS->FadeIn, WWMS->FadeOut, WWMS->Duration, Message);
|
||||
iter++;
|
||||
}
|
||||
}
|
||||
case ServerOP_ReloadWorld:
|
||||
{
|
||||
ReloadWorld_Struct* RW = (ReloadWorld_Struct*) pack->pBuffer;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user