Loading...   


void handle_method_multiple_args(per_session_data_eqemu *session, rapidjson::Document &document, std::string &method) {
	CheckParams(2, "[zone_id, instance_id]");
	VerifyID();
	CalculateSize();

	ServerPacket *pack = new ServerPacket(ServerOP_WIRemoteCall, sz);
	pack->WriteUInt32((uint32)id.size());
	pack->WriteString(id.c_str());
	pack->WriteUInt32((uint32)session->uuid.size());
	pack->WriteString(session->uuid.c_str());
	pack->WriteUInt32((uint32)method.size());
	pack->WriteString(method.c_str());
	pack->WriteUInt32(3);

	auto &params = document["params"];
	auto &param = params[(rapidjson::SizeType)0];
	pack->WriteUInt32((uint32)strlen(param.GetString()));
	pack->WriteString(param.GetString());

	int i = 0;
	while (params[i].Size() > 0){
		param = params[i];
		pack->WriteUInt32((uint32)strlen(param.GetString()));
		pack->WriteString(param.GetString());
	}

	worldserver->SendPacket(pack);
	safe_delete(pack);
}

Raw Paste Data