EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Server Code Submissions (https://www.eqemulator.org/forums/forumdisplay.php?f=669)
-   -   VoA Stuff (https://www.eqemulator.org/forums/showthread.php?t=34893)

Noport 02-10-2012 04:40 AM

I'm working on Hot & VoA code for server. I have made changes on my server code
for VoA Client. I don't want to summit any code for the server unless i know it works and
runs right.

For Svn

I made changes client.cpp file source under world.
I fixed the opcode order to read the correct way just like live server.
this is how my server reads the opcode now
[Thu Feb 09 10:01:49 2012]00043:WorldAuthenticate: Initiating Login.
[Thu Feb 09 10:01:49 2012]00044:WorldAuthenticate. I got a message of type 0x5b0b (23307).OP_GuildsList=
[Thu Feb 09 10:01:49 2012]00045:WorldAuthenticate. I got a message of type 0x1497 (5271).OP_LogServer=
[Thu Feb 09 10:01:49 2012]00046:WorldRPServer message: server name xxxxxxxxxxxx

[Thu Feb 09 10:01:49 2012]00047:WorldAuthenticate. I got a message of type 0x655c (25948).OP_ApproveWorld=
[Thu Feb 09 10:01:50 2012]00048:WorldAuthenticate. I got a message of type 0x710e (28942).OP_EnterWorld=
[Thu Feb 09 10:01:50 2012]00049:WorldAuthenticate. I got a message of type 0x631a (25370).OP_ExpansionInfo=
[Thu Feb 09 10:01:50 2012]00050:WorldAuthenticate. I got a message of type 0x49b6 (18870).OP_SendCharInfo=
[Thu Feb 09 10:01:50 2012]00051:Check 1x. 0x3f4c3235

[Thu Feb 09 10:01:50 2012]00052:Check 1sa. 0x4de1b0f1

[Thu Feb 09 10:01:50 2012]00053:Check 1sa. 0x1fc34415

[Thu Feb 09 10:01:50 2012]00054:WorldAuthenticate. I got a message of type 0x7930 (31024).OP_PostEnterWorld=
[Thu Feb 09 10:01:50 2012]00055:WorldAuthenticate. Access granted.

missing SendlogInfo <---- SendlogInfo
OP_GuildsList=
OP_LogServer=

missing SendWorldComplete= <----- SendWorldComplete= has to do with the housing project.

OP_ApproveWorld=
OP_EnterWorld=
OP_ExpansionInfo=
OP_SendCharInfo=

OP_PostEnterWorld=


this is what i'm using right now

}

if (!pZoning)
SendGuildList();
SendLogServer();
if (!pZoning)
SendApproveWorld();
SendEnterWorld(cle->name());
SendExpansionInfo();
SendCharInfo();
if (!pZoning) {

SendPostEnterWorld();
database.LoginIP(cle->AccountID(), long2ip(GetIP()).c_str());
}

}


Client.h Headers under world the correct order.

class Client {
public:
Client(EQStreamInterface* ieqs);
~Client();

bool Process();
void ReceiveData(uchar* buf, int len);
void SendLoginInfo();
void SendGuildList();
void SendLogServer();
void SendWorldComplete();
void SendApproveWorld();
void SendEnterWorld(std::string name);
void SendExpansionInfo();
void SendCharInfo();
void SendPostEnterWorld();
void EnterWorld(bool TryBootup = true);
void ZoneUnavail();
void QueuePacket(const EQApplicationPacket* app, bool ack_req = true);
void Clearance(sint8 response);
bool GenPassKey(char* key);


client.cpp Source under world

}

if (!pZoning)
SendLoginInfo();
SendGuildList();
SendLogServer();
if (!pZoning)
SendWorldComplete();
if (!pZoning)
SendWorldcomplete();
SendApproveWorld();
SendEnterWorld(cle->name());
SendExpansionInfo();
SendCharInfo();
if (!pZoning) {

SendPostEnterWorld();
database.LoginIP(cle->AccountID(), long2ip(GetIP()).c_str());
}

SendLoginInfo , SendWorldComplete a must have for housing.
}

if (!pZoning)
SendLoginInfo();
SendGuildList();
SendLogServer();
if (!pZoning)
SendWorldComplete();
SendApproveWorld();
SendEnterWorld(cle->name());
SendExpansionInfo();
SendCharInfo();
if (!pZoning) {

SendPostEnterWorld();
database.LoginIP(cle->AccountID(), long2ip(GetIP()).c_str());
}

Noport 02-10-2012 07:06 AM

warning if it's not broken dont fix it.. Please don't try to add code if you don't known what your doing.
I may have skiped some other code that i have changed.

ServerFilesREV2100\trunk\EQEmuServer\common\patche s

patches.Cpp

#include "../debug.h"
#include "patches.h"

#include "Client62.h"
#include "Titanium.h"
#include "Anniversary.h"
#include "Underfoot.h"
#include "SoF.h"
#include "SoD.h"
#include "HoT.h"
#include "VoA.h"

void RegisterAllPatches(EQStreamIdentifier &into) {
Client62::Register(into);
Titanium::Register(into);
SoF::Register(into);
SoD::Register(into);
Underfoot::Register(into);
HoT::Register(into);
VoA::Register(into);
}

void ReloadAllPatches() {
Client62::Reload();
Titanium::Reload();
SoF::Reload();
SoD::Reload();
Underfoot::Reload();
HoT::Reload();
VoA::Reload();
}


Added VoA.cpp
Added VoA.h
Added VoA_itemfields.h
Added VoA_ops.h
Added VoA_structs.h

ServerFilesREV2100\trunk\EQEmuServer\common

eq_constants.c

#define BIT_Client62 1
#define BIT_Titanium 2
#define BIT_SoF 4
#define BIT_SoD 8
#define BIT_Underfoot 16
#define BIT_HoT 16
#define BIT_VoA 16
#define BIT_TitaniumAndEarlier 3
#define BIT_SoFAndLater 0xFFFFFFFC
#define BIT_SoDAndLater 0xFFFFFFF8
#define BIT_UnderfootAndLater 0xFFFFFFF0
#define BIT_HoTAndLater 0xFFFFFFFC
#define BIT_VoAAndLater 0xFFFFFFFC
#define BIT_AllClients 0xFFFFFFFF


ServerFilesREV2100\trunk\EQEmuServer\zone

bot.h

typedef enum EqExpansions {
ExpansionNone,
ExpansionEQ,
ExpansionRoK,
ExpansionSoV,
ExpansionSoL,
ExpansionPoP,
ExpansionLoY,
ExpansionLDoN,
ExpansionGoD,
ExpansionOoW,
ExpansionDoN,
ExpansionDoDH,
ExpansionPoR,
ExpansionTSS,
ExpansionSoF,
ExpansionSoD,
ExpansionUF,
ExpansionHoT,
ExpansionVoA
};

client.h

typedef enum {
EQClientUnknown = 0,
EQClient62,
EQClientTitanium,
EQClientSoF,
EQClientSoD,
EQClientUnderfoot,
EQClientHoT,
EQClientVoA,
} EQClientVersion;


client_packet.cpp

}
else if(StreamDescription == "Patch VoA")
{
ClientVersion = EQClientVoA;
ClientVersionBit = BIT_VoA;
}

ServerFilesReV2100\trunk\EQEmuServer\world

Client.cpp

}
else if(StreamDescription == "Patch VoA")
{
ClientVersionBit = BIT_VoA;
}
}


case OP_ZoneChange:
// HoT sends this to world while zoning and wants it echoed back.
if(!eqs->Describe().compare("Patch HoT"))
{
QueuePacket(app);
}
else if(!eqs->Describe().compare("Patch VoA"))
{
QueuePacket(app);
}
break;

\ServerFilesRev2100\trunk\EQEmuServer\world

Client.h

class Client {
public:
Client(EQStreamInterface* ieqs);
~Client();

bool Process();
void ReceiveData(uchar* buf, int len);
void SendLoginInfo();
void SendGuildList();
void SendLogServer();
void SendWorldComplete();
void SendApproveWorld();
void SendEnterWorld(std::string name);
void SendExpansionInfo();
void SendCharInfo();
void SendPostEnterWorld();
void EnterWorld(bool TryBootup = true);
void ZoneUnavail();
void QueuePacket(const EQApplicationPacket* app, bool ack_req = true);
void Clearance(sint8 response);
bool GenPassKey(char* key);

clientlist.cpp

void ClientList::SendClientVersionSummary(const char *Name)
{
uint32 Client62Count = 0;
uint32 ClientTitaniumCount = 0;
uint32 ClientAnniversaryCount = 0;
uint32 ClientSoFCount = 0;
uint32 ClientSoDCount = 0;
uint32 ClientUnderfootCount = 0;
uint32 ClientHoTCount = 0;
uint32 ClientVoACount = 0;


LinkedListIterator<ClientListEntry*> Iterator(clientlist);

Iterator.Reset();

while(Iterator.MoreElements())
{
ClientListEntry* CLE = Iterator.GetData();

if(CLE && CLE->zone())
{
switch(CLE->GetClientVersion())
{
case 1:
{
++Client62Count;
break;
}
case 2:
{
++ClientTitaniumCount;
break;
}
case 3:
{
++ClientAnniversaryCount;
break;
}
case 4:
{
++ClientSoFCount;
break;
}
case 5:
{
++ClientSoDCount;
break;
}
case 6:
{
++ClientUnderfootCount;
break;
}
case 7:
{
++ClientHoTCount;
break;
}
case 8:
{
++ClientVoACount;
break;
}
default:
break;
}
}

Iterator.Advance();

}

zoneserver_list.SendEmoteMessage(Name, 0, 0, 13, "There are %i 6.2, %i Titanium, %i SoF, %i SoD, %i UF,%i HoT and %i VoA clients currently connected.",
Client62Count, ClientTitaniumCount, ClientAnniversaryCount, ClientSoFCount, ClientSoDCount, ClientUnderfootCount, ClientHoTCount, ClientVoACount);
}

Congdar 02-10-2012 09:51 AM

When posting code in the forums, it's easier to read if you surround the code with blocks (code) (/code) except don't use parentheses, use brackets--> []. I used parentheses here because if i use brackets it doesn't show, it converts to:
Code:

if(true) {
    do_something();
}


trevius 02-10-2012 06:54 PM

I moved your posts to their own thread. The thread titled "Sticky: Post Your New Code Here!" doesn't literally mean to post submissions in that thread. I locked that thread so it doesn't happen again.

Unfortunately, unless you can provide a diff of what you did, your code in this thread will probably just be ignored. We can't tell what you changed without spending a ton of time to figure out where everything should go. If you post a diff, it will make more sense.

If you use TortoiseSVN for getting your source code, then posting a diff is VERY easy. Just right click on your EQEmuServer folder and select TortoiseSVN->Create Patch...

Then, select the files you want to show in your patch diff and click OK. You then have the option to save your diff, but the easiest thing to do is click Save to clipboard.

Then start a post on this forum and click the # button above your post window where the B I U buttons and such are. Then just press CTRL+V to paste your code diff.

The code boxes are done like this

\[CODE\]Here is where you put code\[/CODE\]
Without the \ slashes.

Here is an example of what it should look like:

Code:

Index: changelog.txt
===================================================================
--- changelog.txt        (revision 2099)
+++ changelog.txt        (working copy)
@@ -1,5 +1,8 @@
 EQEMu Changelog (Started on Sept 24, 2003 15:50)
 -------------------------------------------------------
+==02/10/2012==
+Trevius: Look, I made a change!
+
 ==02/03/2012==
 Trevius: Added accout_status field to the discovered_items table to make it easier to remove accidental GM item discovery from the table.
 
Index: zone/entity.cpp
===================================================================
--- zone/entity.cpp        (revision 2097)
+++ zone/entity.cpp        (working copy)
@@ -4453,12 +4453,12 @@
 
 void EntityList::SignalAllClients(int32 data)
 {
-        LinkedListIterator<Client*> iterator(client_list);
+        LinkedListIterator<Client*> iterator(client_list);
        iterator.Reset();
-        while(iterator.MoreElements())
+        while(iterator.MoreElements())
        {
                Client *ent = iterator.GetData();
-                if(ent)
+                if (ent->CastToClient() && ent->CastToClient()->Connected())
                {
                        ent->Signal(data);
                }
@@ -4469,12 +4469,15 @@
 void EntityList::GetMobList(list<Mob*> &m_list)
 {
        m_list.clear();
-        LinkedListIterator<Mob*> iterator(mob_list);
+        LinkedListIterator<Mob*> iterator(mob_list);
        iterator.Reset();
-        while(iterator.MoreElements())
+        while(iterator.MoreElements())
        {
                Mob *ent = iterator.GetData();
-                m_list.push_back(ent);
+                if (!ent->IsClient() || (ent->IsClient() && ent->CastToClient() && ent->CastToClient()->Connected()))
+                {
+                        m_list.push_back(ent);
+                }
                iterator.Advance();
        }
 }
@@ -4482,12 +4485,15 @@
 void EntityList::GetNPCList(list<NPC*> &n_list)
 {
        n_list.clear();
-        LinkedListIterator<NPC*> iterator(npc_list);
+        LinkedListIterator<NPC*> iterator(npc_list);
        iterator.Reset();
-        while(iterator.MoreElements())
+        while(iterator.MoreElements())
        {
                NPC *ent = iterator.GetData();
-                n_list.push_back(ent);
+                if (ent->GetHP() > 0)
+                {
+                        n_list.push_back(ent);
+                }
                iterator.Advance();
        }
 }
@@ -4495,12 +4501,15 @@
 void EntityList::GetClientList(list<Client*> &c_list)
 {
        c_list.clear();
-        LinkedListIterator<Client*> iterator(client_list);
+        LinkedListIterator<Client*> iterator(client_list);
        iterator.Reset();
-        while(iterator.MoreElements())
+        while(iterator.MoreElements())
        {
                Client *ent = iterator.GetData();
-                c_list.push_back(ent);
+                if (ent->CastToClient() && ent->CastToClient()->Connected())
+                {
+                        c_list.push_back(ent);
+                }
                iterator.Advance();
        }
 }


Noport 02-10-2012 09:11 PM

Thank you for the hits & tips.


All times are GMT -4. The time now is 07:08 AM.

Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.