mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-20 22:08:22 +00:00
LDON tweaks, working branch, average_level pass
This commit is contained in:
+10
-3
@@ -325,6 +325,7 @@ Client::Client(EQStreamInterface* ieqs)
|
||||
adv_requested_theme = 0;
|
||||
adv_requested_id = 0;
|
||||
adv_requested_member_count = 0;
|
||||
adv_requested_avg_lvl = 0;
|
||||
|
||||
for(int i = 0; i < XTARGET_HARDCAP; ++i)
|
||||
{
|
||||
@@ -5985,18 +5986,24 @@ void Client::SendAdventureCount(uint32 count, uint32 total)
|
||||
FastQueuePacket(&outapp);
|
||||
}
|
||||
|
||||
void Client::NewAdventure(int id, int theme, const char *text, int member_count, const char *members)
|
||||
void Client::NewAdventure(int id, int theme, const char *text, int member_count, const char *members, uint32 avg_level)
|
||||
{
|
||||
size_t text_size = strlen(text);
|
||||
auto outapp = new EQApplicationPacket(OP_AdventureDetails, text_size + 2);
|
||||
strn0cpy((char*)outapp->pBuffer, text, text_size);
|
||||
FastQueuePacket(&outapp);
|
||||
|
||||
adv_requested_id = id;
|
||||
adv_requested_id = id;
|
||||
adv_requested_theme = theme;
|
||||
|
||||
safe_delete_array(adv_requested_data);
|
||||
|
||||
adv_requested_member_count = member_count;
|
||||
adv_requested_data = new char[64 * member_count];
|
||||
adv_requested_avg_lvl = avg_level;
|
||||
adv_requested_data = new char[64 * member_count];
|
||||
|
||||
LogAdventure("[Client::NewAdventure] Adventure average level [{}]", adv_requested_avg_lvl);
|
||||
|
||||
memcpy(adv_requested_data, members, (64 * member_count));
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -1270,7 +1270,7 @@ public:
|
||||
void SendAdventureError(const char *error);
|
||||
void SendAdventureDetails();
|
||||
void SendAdventureCount(uint32 count, uint32 total);
|
||||
void NewAdventure(int id, int theme, const char *text, int member_count, const char *members);
|
||||
void NewAdventure(int id, int theme, const char *text, int member_count, const char *members, uint32 avg_level);
|
||||
bool IsOnAdventure();
|
||||
void LeaveAdventure();
|
||||
void AdventureFinish(bool win, int theme, int points);
|
||||
@@ -1613,6 +1613,7 @@ protected:
|
||||
int adv_requested_theme;
|
||||
int adv_requested_id;
|
||||
char *adv_requested_data;
|
||||
uint32 adv_requested_avg_lvl;
|
||||
int adv_requested_member_count;
|
||||
char *adv_data;
|
||||
|
||||
|
||||
+14
-7
@@ -9037,14 +9037,21 @@ void Client::Handle_OP_LDoNButton(const EQApplicationPacket *app)
|
||||
bool* p = (bool*)app->pBuffer;
|
||||
if (*p == true)
|
||||
{
|
||||
auto pack =
|
||||
new ServerPacket(ServerOP_AdventureRequestCreate,
|
||||
sizeof(ServerAdventureRequestCreate_Struct) + (64 * adv_requested_member_count));
|
||||
ServerAdventureRequestCreate_Struct *sac = (ServerAdventureRequestCreate_Struct*)pack->pBuffer;
|
||||
auto pack = new ServerPacket(
|
||||
ServerOP_AdventureRequestCreate,
|
||||
sizeof(ServerAdventureRequestCreate_Struct) +
|
||||
(64 * adv_requested_member_count));
|
||||
|
||||
ServerAdventureRequestCreate_Struct *sac = (ServerAdventureRequestCreate_Struct *) pack->pBuffer;
|
||||
|
||||
strcpy(sac->leader, GetName());
|
||||
sac->id = adv_requested_id;
|
||||
sac->theme = adv_requested_theme;
|
||||
sac->member_count = adv_requested_member_count;
|
||||
sac->id = adv_requested_id;
|
||||
sac->theme = adv_requested_theme;
|
||||
sac->member_count = adv_requested_member_count;
|
||||
sac->average_level = adv_requested_avg_lvl;
|
||||
|
||||
LogAdventure("[Client::Handle_OP_LDoNButton] Adventure average level [{}]", sac->average_level);
|
||||
|
||||
memcpy((pack->pBuffer + sizeof(ServerAdventureRequestCreate_Struct)), adv_requested_data, (64 * adv_requested_member_count));
|
||||
worldserver.SendPacket(pack);
|
||||
delete pack;
|
||||
|
||||
+12
-1
@@ -1688,7 +1688,16 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
Client *c = entity_list.GetClientByName(ars->leader);
|
||||
if (c)
|
||||
{
|
||||
c->NewAdventure(ars->id, ars->theme, ars->text, ars->member_count, (const char*)(pack->pBuffer + sizeof(ServerAdventureRequestAccept_Struct)));
|
||||
LogInfo("[ServerOP_AdventureRequestAccept] Adventure average level [{}]", ars->average_level);
|
||||
|
||||
c->NewAdventure(
|
||||
ars->id,
|
||||
ars->theme,
|
||||
ars->text,
|
||||
ars->member_count,
|
||||
(const char *) (pack->pBuffer + sizeof(ServerAdventureRequestAccept_Struct)),
|
||||
ars->average_level
|
||||
);
|
||||
c->ClearPendingAdventureRequest();
|
||||
}
|
||||
break;
|
||||
@@ -1811,6 +1820,8 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
zone->adv_data = new char[pack->size];
|
||||
memcpy(zone->adv_data, pack->pBuffer, pack->size);
|
||||
ServerZoneAdventureDataReply_Struct* ds = (ServerZoneAdventureDataReply_Struct*)zone->adv_data;
|
||||
|
||||
LogAdventure("[ServerOP_AdventureZoneData] Adventure average level [{}]", ds->average_level);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user