procedure TBaseObject.SendRefMsg(wIdent, wParam: Word; nParam1, nParam2, nParam3: Integer; sMsg: string; dwDelay: LongWord); //消息
var
ii, nC: Integer;
nCX, nCY, nLX, nLY, nHX, nHY: Integer;
MapCellInfo: pTMapCellinfo;
OSObject: pTOSObject;
BaseObject: TBaseObject;
resourcestring
sExceptionMsg = ‘[Exception] TBaseObject::SendRefMsg Name = %s’;
begin
try
if (m_PEnvir = nil) or (m_VisibleHumanList = nil) then
Exit;
if (m_boObMode or m_boFixedHideMode) then
begin
SendMsg(Self, wIdent, wParam, nParam1, nParam2, nParam3, sMsg);
Exit;
end;
except
MainOutMessage(‘TBaseObject::SendRefMsg = ‘ + m_sCharName);
end;
EnterCriticalSection(ProcessMsgCriticalSection);
try
if ((GetTickCount – m_SendRefMsgTick) >= 500) or (m_VisibleHumanList.Count = 0) then
begin
m_SendRefMsgTick := GetTickCount();
try
m_VisibleHumanList.Clear;
except
end;
nLX := m_nCurrX – g_Config.nGroupMembersMax4 {12};
nHX := m_nCurrX + g_Config.nGroupMembersMax4 {12};
nLY := m_nCurrY – g_Config.nGroupMembersMax5 {12};
nHY := m_nCurrY + g_Config.nGroupMembersMax5 {12};
for nCX := nLX to nHX do
begin
for nCY := nLY to nHY do
begin
if m_PEnvir.GetMapCellInfo(nCX, nCY, MapCellInfo) then
begin
if MapCellInfo.ObjList <> nil then
begin
for ii := MapCellInfo.ObjList.Count – 1 downto 0 do
begin
try
OSObject := MapCellInfo.ObjList.Items[ii];
if OSObject = nil then
begin
MapCellInfo.ObjList.Delete(ii);
if MapCellInfo.ObjList.Count > 0 then
Continue;
MapCellInfo.ObjList.Free;
MapCellInfo.ObjList := nil;
Break;
end;
// if OSObject <> nil then
if Assigned(OSObject) then
begin
if OSObject.btType = OS_MOVINGOBJECT then
begin
if (GetTickCount – OSObject.dwAddTime) >= 60000 then
begin
try
Dispose(OSObject);
MapCellInfo.ObjList.Delete(ii);
if MapCellInfo.ObjList.Count <= 0 then
begin
FreeAndNil(MapCellInfo.ObjList);
// Break;
end;
except
MainOutMessage(Format(sExceptionMsg, [m_sCharName]));
end;
end
else
begin
try
BaseObject := TBaseObject(OSObject.CellObj);
// if (BaseObject <> nil) and not BaseObject.m_boGhost then
if Assigned(BaseObject) and (not BaseObject.m_boGhost) then
begin
if (BaseObject.m_btRaceServer = RC_PLAYOBJECT) and (not TPlayObject(BaseObject).m_boSafeOffLine) then
begin
if dwDelay > 0 then
BaseObject.SendDelayMsg(Self, wIdent, wParam, nParam1, nParam2, nParam3, sMsg, dwDelay)
else
BaseObject.SendMsg(Self, wIdent, wParam, nParam1, nParam2, nParam3, sMsg);
m_VisibleHumanList.Add(BaseObject);
end
else if BaseObject.m_boWantRefMsg then
begin
if (wIdent = RM_STRUCK) or (wIdent = RM_HEAR) or (wIdent = RM_DEATH) or (wIdent = RM_CHARSTATUSCHANGED) then
begin
if dwDelay > 0 then
BaseObject.SendDelayMsg(Self, wIdent, wParam, nParam1, nParam2, nParam3, sMsg, dwDelay)
else
BaseObject.SendMsg(Self, wIdent, wParam, nParam1, nParam2, nParam3, sMsg);
m_VisibleHumanList.Add(BaseObject);
end;
end;
end;
except
on E: Exception do
begin
MapCellInfo.ObjList.Delete(ii);
if MapCellInfo.ObjList.Count <= 0 then
begin
FreeAndNil(MapCellInfo.ObjList);
end;
MainOutMessage(Format(sExceptionMsg, [m_sCharName]));
MainOutMessage(E.Message);
// raise;
end;
end;
end;
end;
end;
except
on E: Exception do
begin
MainOutMessage(Format(‘TBaseObject.SendRefMsg :’, [m_sCharName]));
MainOutMessage(E.Message);
end;
end;
end;
end;
end;
end;
end;
end
else
begin
try
for nC := 0 to m_VisibleHumanList.Count – 1 do
// for nC := m_VisibleHumanList.Count – 1 downto 0 do
begin
BaseObject := TBaseObject(m_VisibleHumanList.Items[nC]);
if (BaseObject = nil) or (BaseObject.m_boGhost) or (BaseObject.m_PEnvir <> m_PEnvir) then
Continue;
if (Abs(BaseObject.m_nCurrX – m_nCurrX) <= g_Config.nGroupMembersMax4) and (Abs(BaseObject.m_nCurrY – m_nCurrY) <= g_Config.nGroupMembersMax5) then
begin
if (BaseObject.m_btRaceServer = RC_PLAYOBJECT) and (not TPlayObject(BaseObject).m_boSafeOffLine) then
begin
if dwDelay > 0 then
BaseObject.SendDelayMsg(Self, wIdent, wParam, nParam1, nParam2, nParam3, sMsg, dwDelay)
else
BaseObject.SendMsg(Self, wIdent, wParam, nParam1, nParam2, nParam3, sMsg);
end
else if BaseObject.m_boWantRefMsg then
begin
if (wIdent = RM_STRUCK) or (wIdent = RM_HEAR) or (wIdent = RM_DEATH) or (wIdent = RM_CHARSTATUSCHANGED) then
begin
if dwDelay > 0 then
BaseObject.SendDelayMsg(Self, wIdent, wParam, nParam1, nParam2, nParam3, sMsg, dwDelay)
else
BaseObject.SendMsg(Self, wIdent, wParam, nParam1, nParam2, nParam3, sMsg);
end;
end;
end;
end;
except
on E: Exception do
begin
MainOutMessage(Format(‘TBaseObject(m_VisibleHumanList.Items[nC]):’, [m_sCharName]));
MainOutMessage(E.Message);
end;
end;
end;
finally
LeaveCriticalSection(ProcessMsgCriticalSection);
end;
end;

1、本站admin账户所发布的源码均为测试过的源码
2、我们可以保证源码的完整性,不完整的源码可退款!
3、本站不在线下出售源码,请直接冲值购买!
4、由于商品特殊性,非源码本身问题概不退款!
5、会员发布的资源存在欺诈行为的可向QQ7951368 或者微信:Lingfengm2 举报,核实将获得奖励!
6、您的支持赞助就是本站长久运行!感谢广大爱好者会员用户的大力支持!

19191NET资源网 » 网关框架

发表评论

提供最优质的资源集合

立即查看 了解详情