[SURSĂ]Informaţii utilizator în pm(partea de server)

Avatar utilizator
 
Mesaje: 150
Membru din: Joi Noi 03, 2016 6:27 pm
Like-uri oferite: 2 times
Like-uri primite: 1 time

[SURSĂ]Informaţii utilizator în pm(partea de server)

de Zeith » Dum Dec 25, 2016 6:32 pm

Imagine

1.Sursă client.
Deschide pythonnetworkstreamcommand.cpp
Caută:
Code: Select All Code
  else if (!strcmpi(szCmd, "bilgiver"))
   {
     if (5 != TokenVector.size())
     {
       TraceError("CPythonNetworkStream::ServerCommand(c_szCommand=%s) - Strange Parameter Count : %d", c_szCommand, TokenVector.size());
       return;
     }

     const std::string & c_rstrName = TokenVector[1].c_str();
     int iEmpire = atoi(TokenVector[2].c_str());
     int iLevel = atoi(TokenVector[3].c_str());
     int iChannel = atoi(TokenVector[4].c_str());

     PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_BilgiIsle", Py_BuildValue("(siii)", c_rstrName.c_str(), iEmpire, iLevel, iChannel));
   }


2.Sursă server.
Deschide char.h
Caută:
Code: Select All Code
void       SetGMLevel();

Adaugă mai jos:
Code: Select All Code
 int         GetChannel() const;

Deschide char.cpp
Caută:
Code: Select All Code
 quest::CQuestManager::instance().LevelUp(GetPlayerID());

Adaugă mai jos:
Code: Select All Code
// UpdateP2P
         TPacketGGLogin p;
         p.bHeader = HEADER_GG_LOGIN;
         strlcpy(p.szName, GetName(), sizeof(p.szName));
         p.dwPID = GetPlayerID();
         p.bEmpire = GetEmpire();
         p.lMapIndex = SECTREE_MANAGER::instance().GetMapIndex(GetX(), GetY());
         p.bChannel = g_bChannel;
         p.iLevel = GetLevel();
         P2P_MANAGER::instance().Send(&p, sizeof(TPacketGGLogin));

Caută:
Code: Select All Code
BYTE CHARACTER::GetGMLevel() const
{
   if (test_server)
     return GM_IMPLEMENTOR;
   return m_pointsInstant.gm_level;
}

Adaugă mai jos:
Code: Select All Code
int CHARACTER::GetChannel() const
{
   return g_bChannel;
}

Caută:
Code: Select All Code
int CHARACTER::GetChannel() const
{
   return g_bChannel;
}

Inlocuieşte cu:
Code: Select All Code
TPacketGGLogin p;

     p.bHeader = HEADER_GG_LOGIN;
     strlcpy(p.szName, GetName(), sizeof(p.szName));
     p.dwPID = GetPlayerID();
     p.bEmpire = GetEmpire();
     p.lMapIndex = SECTREE_MANAGER::instance().GetMapIndex(GetX(), GetY());
     p.bChannel = g_bChannel;
     p.iLevel = GetLevel();

     P2P_MANAGER::instance().Send(&p, sizeof(TPacketGGLogin));

deschide input_db.cpp
Caută:
Code: Select All Code
 TPacketGGLogin p;

     p.bHeader = HEADER_GG_LOGIN;
     strlcpy(p.szName, ch->GetName(), sizeof(p.szName));
     p.dwPID = ch->GetPlayerID();
     p.bEmpire = ch->GetEmpire();
     p.lMapIndex = SECTREE_MANAGER::instance().GetMapIndex(ch->GetX(), ch->GetY());
     p.bChannel = g_bChannel;

     P2P_MANAGER::instance().Send(&p, sizeof(TPacketGGLogin));

Schimbă cu:
Code: Select All Code
TPacketGGLogin p;

     p.bHeader = HEADER_GG_LOGIN;
     strlcpy(p.szName, ch->GetName(), sizeof(p.szName));
     p.dwPID = ch->GetPlayerID();
     p.bEmpire = ch->GetEmpire();
     p.lMapIndex = SECTREE_MANAGER::instance().GetMapIndex(ch->GetX(), ch->GetY());
     p.bChannel = g_bChannel;
     p.iLevel = ch->GetLevel();

     P2P_MANAGER::instance().Send(&p, sizeof(TPacketGGLogin));

Deschide packet.h
Caută:
Code: Select All Code
typedef struct SPacketGGLogin
{
   BYTE   bHeader;
   char   szName[CHARACTER_NAME_MAX_LEN + 1];
   DWORD   dwPID;
   BYTE   bEmpire;
   long   lMapIndex;
   BYTE   bChannel;
} TPacketGGLogin;

Schimbă cu:
Code: Select All Code
typedef struct SPacketGGLogin
{
   BYTE   bHeader;
   char   szName[CHARACTER_NAME_MAX_LEN + 1];
   DWORD   dwPID;
   BYTE   bEmpire;
   long   lMapIndex;
   BYTE   bChannel;
   int     iLevel;
} TPacketGGLogin;

Deschide p2p.cpp
Caută:
Code: Select All Code
(void P2P_MANAGER::Boot(LPDESC d)):
     p.bHeader = HEADER_GG_LOGIN;
     strlcpy(p.szName, ch->GetName(), sizeof(p.szName));
     p.dwPID = ch->GetPlayerID();
     p.bEmpire = ch->GetEmpire();
     p.lMapIndex = SECTREE_MANAGER::instance().GetMapIndex(ch->GetX(), ch->GetY());
     p.bChannel = g_bChannel;
     d->Packet(&p, sizeof(p));

schimbă cu:
Code: Select All Code
p.bHeader = HEADER_GG_LOGIN;
     strlcpy(p.szName, ch->GetName(), sizeof(p.szName));
     p.dwPID = ch->GetPlayerID();
     p.bEmpire = ch->GetEmpire();
     p.lMapIndex = SECTREE_MANAGER::instance().GetMapIndex(ch->GetX(), ch->GetY());
     p.bChannel = g_bChannel;
     p.iLevel = ch->GetLevel();
     d->Packet(&p, sizeof(p));

caută:
Code: Select All Code
(void P2P_MANAGER::Login(LPDESC d, const TPacketGGLogin * p)):
   pkCCI->lMapIndex = p->lMapIndex;
   pkCCI->pkDesc = d;
   pkCCI->bChannel = p->bChannel;
   sys_log(0, "P2P: Login %s", pkCCI->szName);

   CGuildManager::instance().P2PLoginMember(pkCCI->dwPID);
   CPartyManager::instance().P2PLogin(pkCCI->dwPID, pkCCI->szName);

Schimbă cu:
Code: Select All Code
pkCCI->lMapIndex = p->lMapIndex;
   pkCCI->pkDesc = d;
   pkCCI->bChannel = p->bChannel;
   pkCCI->iLevel = p->iLevel;
   sys_log(0, "P2P: Login %s", pkCCI->szName);

   CGuildManager::instance().P2PLoginMember(pkCCI->dwPID);
   CPartyManager::instance().P2PLogin(pkCCI->dwPID, pkCCI->szName);

Deschide p2p.h
Caută:
Code: Select All Code
typedef struct _CCI
{
   char   szName[CHARACTER_NAME_MAX_LEN + 1];
   DWORD   dwPID;
   BYTE   bEmpire;
   long   lMapIndex;
   BYTE   bChannel;

   LPDESC   pkDesc;
} CCI;

Inlocuieste cu:
Code: Select All Code
typedef struct _CCI
{
   char   szName[CHARACTER_NAME_MAX_LEN + 1];
   DWORD   dwPID;
   BYTE   bEmpire;
   long   lMapIndex;
   BYTE   bChannel;

   LPDESC   pkDesc;
   int     iLevel;
} CCI;

Deschide cmd_general.cpp
Adaugă:
Code: Select All Code
ACMD(do_bilgial)
{
   char arg1[256];
   one_argument(argument, arg1, sizeof(arg1));

   if (!*arg1)
     return;

   int iTargetEmpire = 0;
   int iTargetLevel = 0;
   int iTargetChannel = 0;

   LPCHARACTER tch = CHARACTER_MANAGER::instance().FindPC(arg1);
   if (tch)
   {
     iTargetEmpire = (int)tch->GetEmpire();
     iTargetLevel = tch->GetLevel();
     iTargetChannel = tch->GetChannel();
   }
   else {
     CCI * pkCCI = P2P_MANAGER::instance().Find(arg1);
     if (pkCCI)
     {
       iTargetEmpire = (int)pkCCI->bEmpire;
       iTargetLevel = pkCCI->iLevel;
       iTargetChannel = (int)pkCCI->bChannel;
     }
     else {
       ch->ChatPacket(CHAT_TYPE_INFO, "Hedef oyuncu: %s suan offline", arg1);
       return;
     }
   }

   ch->ChatPacket(CHAT_TYPE_COMMAND, "bilgiver %s %d %d %d", arg1, iTargetEmpire, iTargetLevel, iTargetChannel);
}
Imagine
{
if ($viață->state==100% șmecher)
$me->Zeith();
$life->state = Pwp la fraţii mei;
else $prost->În căutare.;
}

Avatar utilizator
 
Mesaje: 232
Membru din: Vin Noi 17, 2017 12:01 am
Like-uri oferite: 0 time
Like-uri primite: 0 time

Re: [SURSĂ]Informaţii utilizator în pm(partea de server)

de .NicuGaming. » Vin Dec 22, 2017 9:53 am

Mutat in sectiunea C++!


Înapoi la C++

Cine este conectat

Utilizatorii ce navighează pe acest forum: Niciun utilizator înregistrat şi 1 vizitator