mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-31 13:16:39 +00:00
double to int32 explicit conversion
This commit is contained in:
+1
-1
@@ -202,7 +202,7 @@ uint32 EQProtocolPacket::serialize(unsigned char *dest) const
|
|||||||
*(uint16 *)dest=opcode;
|
*(uint16 *)dest=opcode;
|
||||||
} else {
|
} else {
|
||||||
*(dest)=0;
|
*(dest)=0;
|
||||||
*(dest+1)=opcode;
|
*(dest+1)=(unsigned char)opcode;
|
||||||
}
|
}
|
||||||
memcpy(dest+2,pBuffer,size);
|
memcpy(dest+2,pBuffer,size);
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -72,7 +72,7 @@ void EQStream::init() {
|
|||||||
|
|
||||||
if(GetExecutablePlatform() == ExePlatformWorld || GetExecutablePlatform() == ExePlatformZone) {
|
if(GetExecutablePlatform() == ExePlatformWorld || GetExecutablePlatform() == ExePlatformZone) {
|
||||||
retransmittimer = Timer::GetCurrentTime();
|
retransmittimer = Timer::GetCurrentTime();
|
||||||
retransmittimeout = 500 * RETRANSMIT_TIMEOUT_MULT;
|
retransmittimeout = (uint32)500 * RETRANSMIT_TIMEOUT_MULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
OpMgr = nullptr;
|
OpMgr = nullptr;
|
||||||
@@ -478,10 +478,10 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
|
|||||||
if(RETRANSMIT_TIMEOUT_MULT && ntohl(Stats->average_delta)) {
|
if(RETRANSMIT_TIMEOUT_MULT && ntohl(Stats->average_delta)) {
|
||||||
//recalculate retransmittimeout using the larger of the last rtt or average rtt, which is multiplied by the rule value
|
//recalculate retransmittimeout using the larger of the last rtt or average rtt, which is multiplied by the rule value
|
||||||
if((ntohl(Stats->last_local_delta) + ntohl(Stats->last_remote_delta)) > (ntohl(Stats->average_delta) * 2)) {
|
if((ntohl(Stats->last_local_delta) + ntohl(Stats->last_remote_delta)) > (ntohl(Stats->average_delta) * 2)) {
|
||||||
retransmittimeout = (ntohl(Stats->last_local_delta) + ntohl(Stats->last_remote_delta))
|
retransmittimeout = (uint32)(ntohl(Stats->last_local_delta) + ntohl(Stats->last_remote_delta))
|
||||||
* RETRANSMIT_TIMEOUT_MULT;
|
* RETRANSMIT_TIMEOUT_MULT;
|
||||||
} else {
|
} else {
|
||||||
retransmittimeout = ntohl(Stats->average_delta) * 2 * RETRANSMIT_TIMEOUT_MULT;
|
retransmittimeout = (uint32)ntohl(Stats->average_delta) * 2 * RETRANSMIT_TIMEOUT_MULT;
|
||||||
}
|
}
|
||||||
if(retransmittimeout > RETRANSMIT_TIMEOUT_MAX)
|
if(retransmittimeout > RETRANSMIT_TIMEOUT_MAX)
|
||||||
retransmittimeout = RETRANSMIT_TIMEOUT_MAX;
|
retransmittimeout = RETRANSMIT_TIMEOUT_MAX;
|
||||||
|
|||||||
+1
-1
@@ -2010,7 +2010,7 @@ void NPC::ModifyNPCStat(const char *identifier, const char *newValue)
|
|||||||
}
|
}
|
||||||
if(id == "loottable_id")
|
if(id == "loottable_id")
|
||||||
{
|
{
|
||||||
loottable_id = atof(val.c_str());
|
loottable_id = (uint32)atof(val.c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(id == "healscale")
|
if(id == "healscale")
|
||||||
|
|||||||
Reference in New Issue
Block a user