2014-09-02 06:13:03 +00:00
|
|
|
#include <DXAPI/NetConnection.h>
|
2014-11-16 22:53:23 +00:00
|
|
|
#include <DXAPI/NetObject.h>
|
|
|
|
|
#include <LinkerAPI.h>
|
2014-09-02 06:13:03 +00:00
|
|
|
namespace DX
|
|
|
|
|
{
|
2015-01-16 22:54:32 +00:00
|
|
|
unsigned char NetConnection::getGhostFrom() {
|
|
|
|
|
return *(unsigned char *)((this->actualbaseptr)+0x8204);
|
|
|
|
|
}
|
|
|
|
|
unsigned char NetConnection::getGhostTo() {
|
|
|
|
|
return *(unsigned char *)((this->actualbaseptr)+0x8205);
|
|
|
|
|
}
|
|
|
|
|
S32 NetConnection::getGhostIndex(NetObject obj) {
|
|
|
|
|
unsigned int object_ptr = (unsigned int)obj.base_pointer_value;
|
2014-11-16 22:53:23 +00:00
|
|
|
unsigned int my_ptr = this->base_pointer_value-0xA0;
|
|
|
|
|
unsigned int ghostid=0;
|
|
|
|
|
unsigned int function=0x584FB0;
|
|
|
|
|
__asm
|
|
|
|
|
{
|
|
|
|
|
mov ecx,my_ptr
|
|
|
|
|
mov edx,object_ptr
|
|
|
|
|
push edx
|
|
|
|
|
call function
|
|
|
|
|
mov ghostid, eax
|
|
|
|
|
}
|
|
|
|
|
return ghostid;
|
|
|
|
|
}
|
2016-02-23 07:07:23 +00:00
|
|
|
unsigned int NetConnection::resolveGhostParent(S32 id) {
|
2015-01-16 22:54:32 +00:00
|
|
|
if (this->getGhostFrom()) {
|
|
|
|
|
if (this->mGhostRefs[id].obj)
|
|
|
|
|
{
|
2016-02-23 07:07:23 +00:00
|
|
|
return (unsigned int)(this->mGhostRefs[id].obj);
|
2015-01-16 22:54:32 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2016-02-23 07:07:23 +00:00
|
|
|
unsigned int NetConnection::resolveGhost(S32 id) {
|
|
|
|
|
if (id == NULL) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2015-01-16 22:54:32 +00:00
|
|
|
if (this->getGhostTo()) {
|
2016-02-23 07:07:23 +00:00
|
|
|
if ((unsigned int)this->mLocalGhosts[id] == NULL) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
return (unsigned int)this->mLocalGhosts[id];
|
2015-01-16 22:54:32 +00:00
|
|
|
}
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2014-11-16 22:53:23 +00:00
|
|
|
NetConnection::NetConnection(unsigned int obj) : SimObject(obj)
|
|
|
|
|
|
2014-09-02 06:13:03 +00:00
|
|
|
{
|
2015-01-16 22:54:32 +00:00
|
|
|
unsigned int ptr=((this->base_pointer_value)-(0xA0));
|
|
|
|
|
this->actualbaseptr=ptr;
|
|
|
|
|
unsigned int * ginfoptrptr=0;
|
|
|
|
|
ginfoptrptr=(unsigned int *) (this->actualbaseptr+(0x8210));
|
|
|
|
|
this->mGhostRefs = (GhostInfo *) *ginfoptrptr;
|
|
|
|
|
this->mLocalGhosts = (NetObject **) *(unsigned int *) ((this->actualbaseptr+(0x820C)));
|
|
|
|
|
|
2014-09-02 06:13:03 +00:00
|
|
|
}
|
2014-11-16 22:53:23 +00:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|