13 #include "../../clib/rawtypes.h" 14 #include "../globals/network.h" 15 #include "../globals/settings.h" 16 #include "../globals/state.h" 17 #include "../globals/uvars.h" 18 #include "../mobile/attribute.h" 19 #include "../mobile/charactr.h" 20 #include "../network/packethelper.h" 22 #include "../statmsg.h" 24 #include "../uoclient.h" 25 #include "../uoskills.h" 40 : my_vital_changed( nullptr ), others_vital_changed( nullptr )
50 clients.push_back( client );
54 for (
unsigned i = 0; i < clients.size(); ++i )
56 if ( clients[i] == client )
58 clients[i] = clients.back();
69 if ( client && client->
ready )
83 if ( client && client->
ready )
96 msg->WriteFlipped<
u16>( 1000u );
108 msg->WriteFlipped<
u16>(
static_cast<u16>( v ) );
113 msg->WriteFlipped<
u16>(
static_cast<u16>( v ) );
124 msg->WriteFlipped<
u16>(
static_cast<u16>( v ) );
129 msg->WriteFlipped<
u16>(
static_cast<u16>( v ) );
132 if ( me->has_party() )
133 me->party()->on_mana_changed( me );
143 msg->WriteFlipped<
u16>(
static_cast<u16>( v ) );
148 msg->WriteFlipped<
u16>(
static_cast<u16>( v ) );
151 if ( me->has_party() )
152 me->party()->on_stam_changed( me );
179 msg->WriteFlipped<
u16>(
static_cast<u16>( av.effective_tenths() ) );
180 msg->WriteFlipped<
u16>(
181 static_cast<u16>( av.base() ) );
182 msg->Write<
u8>( av.lock() );
184 msg->WriteFlipped<
u16>( av.cap() );
185 u16 len = msg->offset;
187 msg->WriteFlipped<
u16>( len );
188 msg.
Send( client, len );
239 attribute_updaters[uoskill.
pAttr->
attrid].pUOSkill = &uoskill;
250 for (
auto& client : clients )
void send_uo_intelligence(Client *client, Mobile::Character *me, const Mobile::Attribute *)
const Mobile::Attribute * pAttr
void initialize_client_interfaces()
int current_thousands() const
void send_fake_hits(Client *client, Mobile::Character *me, const Core::Vital *vital)
Just like send_uo_hits, but sends hits on a 1000-basis instead.
void(* others_vital_changed)(Client *client, Mobile::Character *him, const Core::Vital *vital)
bool inrange(const UObject *c1, unsigned short x, unsigned short y)
void send_uo_strength(Client *client, Mobile::Character *me, const Mobile::Attribute *)
std::unique_ptr< Network::UOClientInterface > uo_client_interface
void send_uo_dexterity(Client *client, Mobile::Character *me, const Mobile::Attribute *)
void(* my_attr_changed)(Client *client, Mobile::Character *me, const Mobile::Attribute *attr)
void send_uo_mana(Client *client, Mobile::Character *me, const Core::Vital *vital)
void send_uo_hits(Client *client, Mobile::Character *me, const Core::Vital *vital)
const UOSkill & GetUOSkill(unsigned skillid)
std::vector< ClientVitalUpdaters > vital_updaters
NetworkManager networkManager
void Send(Client *client, int len=-1) const
const AttributeValue & attribute(unsigned attrid) const
virtual void Initialize() POL_OVERRIDE
ClientInterface & Interface
static void tell_attribute_changed(Mobile::Character *who, const Mobile::Attribute *attr)
void send_uo_stamina(Client *client, Mobile::Character *me, const Core::Vital *vital)
virtual void Initialize()
void send_full_statmsg(Network::Client *client, Mobile::Character *chr)
virtual void bcast_vital_changed(Mobile::Character *who, const Core::Vital *vital) const POL_OVERRIDE
SettingsManager settingsManager
void send_uo_skill(Client *client, Mobile::Character *me, const Mobile::Attribute *attr)
std::vector< ClientAttributeUpdaters > attribute_updaters
void(* my_vital_changed)(Client *client, Mobile::Character *me, const Core::Vital *vital)
const VitalValue & vital(unsigned vitalid) const
const Core::UOSkill * pUOSkill
ClientAttributeUpdaters()
static void tell_vital_changed(Mobile::Character *who, const Core::Vital *vital)
void deregister_client(Client *client)
void register_client(Client *client)
UoClientGeneral uoclient_general