mirror of
https://github.com/Ragora/T2-CPP.git
synced 2026-02-24 00:53:36 +00:00
Restructured project structure to use a singular SLN; made the T2API common to all projects; adjusted watchdog timer to 8 seconds
This commit is contained in:
parent
e1c5d1dead
commit
527474ff24
79 changed files with 469 additions and 626 deletions
55
CommonAPI/Common/source/DXAPI/NetConnection.cpp
Normal file
55
CommonAPI/Common/source/DXAPI/NetConnection.cpp
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
#include <DXAPI/NetConnection.h>
|
||||
#include <DXAPI/NetObject.h>
|
||||
#include <LinkerAPI.h>
|
||||
namespace DX
|
||||
{
|
||||
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;
|
||||
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;
|
||||
}
|
||||
NetObject NetConnection::resolveGhostParent(S32 id) {
|
||||
if (this->getGhostFrom()) {
|
||||
if (this->mGhostRefs[id].obj)
|
||||
{
|
||||
return NetObject((unsigned int)(this->mGhostRefs[id].obj));
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
NetObject NetConnection::resolveGhost(S32 id) {
|
||||
if (this->getGhostTo()) {
|
||||
return NetObject((unsigned int)this->mLocalGhosts[id]);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
NetConnection::NetConnection(unsigned int obj) : SimObject(obj)
|
||||
|
||||
{
|
||||
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)));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue