mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-20 13:21:28 +00:00
More work on Client Marquee messages.
This commit is contained in:
parent
a96f10b6aa
commit
2ac1f37b02
@ -5084,10 +5084,8 @@ struct ClientMarqueeMessage_Struct {
|
|||||||
//opacity = (priority / 255) - floor(priority / 255)
|
//opacity = (priority / 255) - floor(priority / 255)
|
||||||
//# of fade in/out blinks = (int)((priority - 1) / 255)
|
//# of fade in/out blinks = (int)((priority - 1) / 255)
|
||||||
//so 510 would have 100% opacity and 1 extra blink at end
|
//so 510 would have 100% opacity and 1 extra blink at end
|
||||||
uint32 unk12; //no idea, seen 0, 500, 1000. I'm assuming this has to do with the fade in/out.
|
uint32 fade_in_time; //The fade in time, in ms
|
||||||
uint32 unk16; //no idea, seen 500, 1000. I'm assuming this has to do with the fade in/out.
|
uint32 fade_out_time; //The fade out time, in ms
|
||||||
//Visually I couldn't tell a difference from these previous two,
|
|
||||||
//but there's probably a reason for them that's more subtle than what i was looking for
|
|
||||||
uint32 duration; //in ms
|
uint32 duration; //in ms
|
||||||
char msg[1]; //message plus null terminator
|
char msg[1]; //message plus null terminator
|
||||||
|
|
||||||
|
|||||||
@ -8042,3 +8042,23 @@ void Client::Consume(const Item_Struct *item, uint8 type, int16 slot, bool auto_
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Client::SendMarqueeMessage(uint32 type, uint32 priority, uint32 fade_in, uint32 fade_out, uint32 duration, std::string msg)
|
||||||
|
{
|
||||||
|
if(duration == 0 || msg.length() == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
EQApplicationPacket outapp(OP_Marquee, sizeof(ClientMarqueeMessage_Struct) + msg.length());
|
||||||
|
ClientMarqueeMessage_Struct *cms = (ClientMarqueeMessage_Struct*)outapp.pBuffer;
|
||||||
|
|
||||||
|
cms->type = type;
|
||||||
|
cms->unk04 = 10;
|
||||||
|
cms->priority = priority;
|
||||||
|
cms->fade_in_time = fade_in;
|
||||||
|
cms->fade_out_time = fade_out;
|
||||||
|
cms->duration = duration;
|
||||||
|
strcpy(cms->msg, msg.c_str());
|
||||||
|
|
||||||
|
QueuePacket(&outapp);
|
||||||
|
}
|
||||||
@ -1136,6 +1136,7 @@ public:
|
|||||||
const char* GetRacePlural(Client* client);
|
const char* GetRacePlural(Client* client);
|
||||||
const char* GetClassPlural(Client* client);
|
const char* GetClassPlural(Client* client);
|
||||||
void SendWebLink(const char* website);
|
void SendWebLink(const char* website);
|
||||||
|
void SendMarqueeMessage(uint32 type, uint32 priority, uint32 fade_in, uint32 fade_out, uint32 duration, std::string msg);
|
||||||
|
|
||||||
void DuplicateLoreMessage(uint32 ItemID);
|
void DuplicateLoreMessage(uint32 ItemID);
|
||||||
void GarbleMessage(char *, uint8);
|
void GarbleMessage(char *, uint8);
|
||||||
|
|||||||
@ -761,18 +761,7 @@ void command_optest(Client *c, const Seperator *sep)
|
|||||||
}
|
}
|
||||||
case 3:
|
case 3:
|
||||||
{
|
{
|
||||||
char *msg = "This is a test message";
|
c->SendMarqueeMessage(15, 250, 0, 500, 5000, "Some msg");
|
||||||
EQApplicationPacket outapp(OP_Marquee, sizeof(ClientMarqueeMessage_Struct) + strlen(msg));
|
|
||||||
ClientMarqueeMessage_Struct *cms = (ClientMarqueeMessage_Struct*)outapp.pBuffer;
|
|
||||||
cms->priority = 510;
|
|
||||||
cms->type = 15;
|
|
||||||
cms->unk04 = 10;
|
|
||||||
cms->unk12 = 1000;
|
|
||||||
cms->unk16 = 1000;
|
|
||||||
cms->duration = 5000;
|
|
||||||
strcpy(cms->msg, msg);
|
|
||||||
|
|
||||||
c->QueuePacket(&outapp);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
|||||||
@ -1229,6 +1229,11 @@ void Lua_Client::SetConsumption(int in_hunger, int in_thirst) {
|
|||||||
self->SetConsumption(in_hunger, in_thirst);
|
self->SetConsumption(in_hunger, in_thirst);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Lua_Client::SendMarqueeMessage(uint32 type, uint32 priority, uint32 fade_in, uint32 fade_out, uint32 duration, std::string msg) {
|
||||||
|
Lua_Safe_Call_Void();
|
||||||
|
self->SendMarqueeMessage(type, priority, fade_in, fade_out, duration, msg);
|
||||||
|
}
|
||||||
|
|
||||||
luabind::scope lua_register_client() {
|
luabind::scope lua_register_client() {
|
||||||
return luabind::class_<Lua_Client, Lua_Mob>("Client")
|
return luabind::class_<Lua_Client, Lua_Mob>("Client")
|
||||||
.def(luabind::constructor<>())
|
.def(luabind::constructor<>())
|
||||||
@ -1473,7 +1478,8 @@ luabind::scope lua_register_client() {
|
|||||||
.def("GetThirst", (int(Lua_Client::*)(void))&Lua_Client::GetThirst)
|
.def("GetThirst", (int(Lua_Client::*)(void))&Lua_Client::GetThirst)
|
||||||
.def("SetHunger", (void(Lua_Client::*)(int))&Lua_Client::SetHunger)
|
.def("SetHunger", (void(Lua_Client::*)(int))&Lua_Client::SetHunger)
|
||||||
.def("SetThirst", (void(Lua_Client::*)(int))&Lua_Client::SetThirst)
|
.def("SetThirst", (void(Lua_Client::*)(int))&Lua_Client::SetThirst)
|
||||||
.def("SetConsumption", (void(Lua_Client::*)(int, int))&Lua_Client::SetConsumption);
|
.def("SetConsumption", (void(Lua_Client::*)(int, int))&Lua_Client::SetConsumption)
|
||||||
|
.def("SendMarqueeMessage", (void(Lua_Client::*)(uint32, uint32, uint32, uint32, uint32, std::string))&Lua_Client::SendMarqueeMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
luabind::scope lua_register_inventory_where() {
|
luabind::scope lua_register_inventory_where() {
|
||||||
|
|||||||
@ -273,6 +273,7 @@ public:
|
|||||||
void SetHunger(int in_hunger);
|
void SetHunger(int in_hunger);
|
||||||
void SetThirst(int in_thirst);
|
void SetThirst(int in_thirst);
|
||||||
void SetConsumption(int in_hunger, int in_thirst);
|
void SetConsumption(int in_hunger, int in_thirst);
|
||||||
|
void SendMarqueeMessage(uint32 type, uint32 priority, uint32 fade_in, uint32 fade_out, uint32 duration, std::string msg);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user