Jump to content

Expand Maximum Level


Recommended Posts

Are you kidding me?

Please read and do the whole tutorial...

This time you forget to do this:

guild.h
Replace this:

typedef struct SGuildMemberPacketData
{   
	DWORD pid;
	BYTE grade;
	BYTE is_general;
	BYTE job;
	BYTE level;
	DWORD offer;
	BYTE name_flag;
	char name[CHARACTER_NAME_MAX_LEN+1];
} TGuildMemberPacketData;

To this:

typedef struct SGuildMemberPacketData
{   
	DWORD pid;
	BYTE byGrade;
	BYTE byIsGeneral;
	BYTE byJob;
	int	 byLevel;
	DWORD dwOffer;
	BYTE byNameFlag;
} TGuildMemberPacketData;

If someone do this way, there is no more guild name in packet, so it doesn't appear at guild window.

I think you forgot about this?

Link to comment
Share on other sites

  • Premium

Are you kidding me?

Please read and do the whole tutorial...

This time you forget to do this:

guild.h
Replace this:

typedef struct SGuildMemberPacketData
{   
	DWORD pid;
	BYTE grade;
	BYTE is_general;
	BYTE job;
	BYTE level;
	DWORD offer;
	BYTE name_flag;
	char name[CHARACTER_NAME_MAX_LEN+1];
} TGuildMemberPacketData;

To this:

typedef struct SGuildMemberPacketData
{   
	DWORD pid;
	BYTE byGrade;
	BYTE byIsGeneral;
	BYTE byJob;
	int	 byLevel;
	DWORD dwOffer;
	BYTE byNameFlag;
} TGuildMemberPacketData;

If someone do this way, there is no more guild name in packet, so it doesn't appear at guild window.

I think you forgot about this?

Not at all. The name is sent by a different way, and this name data isn't necessary in the packet.

I've got a bug report that if your level is higher than 255, and you want to create a guild, it will fail, and your character will stuck. I will look after this ASAP, but now I don't have so much time. Sorry for this issue.

  • Love 1

The one and only UI programming guideline

Link to comment
Share on other sites

 

I've got a bug report that if your level is higher than 255, and you want to create a guild, it will fail, and your character will stuck. I will look after this ASAP, but now I don't have so much time. Sorry for this issue.

It's nice to see that you support this topic and don't forget about this :)

Yes, and also when you try to login with someone at guild... it disconnect

 

 

Link to comment
Share on other sites

  • Premium

So... Today I finally had some time to fix the issue. The problem was that I forgot to add the name length to the packet in the SendListPacket function.

If you already set up the maximum level, you only have to insert this:

pack.size += (CHARACTER_NAME_MAX_LEN + 1) * m_member.size();

after this:

pack.size += sizeof(TGuildMemberPacketData) * m_member.size();

in the SendListPacket function in the guild.cpp

Sorry all for the inconvenience, it was totally my mistake, and sorry for the ignored reports about packet problems, I thought it wasn't my mistake, because it worked for me, but it was mine, since I didn't tested the guild with more than one member. Now it should work.

  • Love 2

The one and only UI programming guideline

Link to comment
Share on other sites

Hi, masodikbela,i'm sorry if i bother you with this question ,but i tried to understand why did you used a subheader.pack function,but unsuccesful.Can you explain me for what did you used that function? I'm new in this type of programming and i want to start from the bottom with the logic and then the  implemmentation of code.Thanks!

 

PS: Good work i searched this tutorial for months.

Link to comment
Share on other sites

  • Premium

Hi, masodikbela,i'm sorry if i bother you with this question ,but i tried to understand why did you used a subheader.pack function,but unsuccesful.Can you explain me for what did you used that function? I'm new in this type of programming and i want to start from the bottom with the logic and then the  implemmentation of code.Thanks!

 

PS: Good work i searched this tutorial for months.

Hi there,

So I'm a C++ newbie too, but fortunately I know the answer to this question.

There is a lot of function inside the guild. For example, if you want to invite a new member, your client have to sends it first to the server, then the server should sends it to you target. Or if you want to set the grade of a member of your guild, your client sends it first to the server, and the server sends the new grade to all of your guild's member. Or an another example, if you login into the game, the server will sends the guild member list, and the member's informations (for e.g. they level, and online state) to your client.
By default, all of this things need a new packet number. Since the packet numbers are limited to 256 (from 0 to 255, but 0 is never used, to avoid empty packets(maybe?)), we can't waste packet numbers for all of this tiny functions, and because these functions all in connection with the guild, we can use only one packet.

So the main packet contains its header (in our case its 75(guild packet)), the subheader (its like the header, we could name it its "child"), and the size of the subheader. The size is not always necessary, usually we send only one packet at once. But there are some case, when we like to send a structure more than once. Lets see CGuild::SendListPacket function in the guild.cpp. As you can see, here we are sending all of the guild member's data in the same time. So we have to set the size variable of our "header packet", to let the client know how many times it has to get the information from the data (you can see the processing of this in the client/PythonNetworkStreamPhaseGame.cpp/CPythonNetworkStream::RecvGuild function/case GUILD_SUBHEADER_GC_LIST)

I hope its understandable ;)

  • Love 1

The one and only UI programming guideline

Link to comment
Share on other sites

  • Premium

Yes it's more than understandable.Thank you very much masodikbela , you just make my day better. Can i contact you in private to ask you more things about packs and the understanding of how this codes actually works because i see you are very good at explaining . 

 

Regards! 

My pleasure ;) Of course you can, usually I answer to all of the private messages, but sometimes its take more time (1-2 days) because of the lack of time.

The one and only UI programming guideline

Link to comment
Share on other sites

  • 3 weeks later...
  • Premium

Today I've found another little bug. In normal case, it won't take effect. It appears when you make partys on a channel, then you shut down the channel (or all channel, except the db) and restart that channel(s). Then the core will crash (on windows) or you can't login into the affected characters.

So if you have already set up the max level edits, you have to do this:

Open db/ClientManager.cpp, then search for: void CClientManager::SendPartyOnSetup(CPeer* pkPeer)

Then replace this:

pkPeer->Encode(&it_member->second.bLevel, sizeof(BYTE));

To this:

pkPeer->Encode(&it_member->second.bLevel, sizeof(int));

Sorry for the inconvenience.

  • Love 3

The one and only UI programming guideline

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...
  • 1 month later...
  • Premium
10 hours ago, Ragirov43 said:

:masodikbela  system problem

 

lvl accepted ;)

guild table accepted ;)

group party accepted ;)

no guild war Sending :(

I checked this, and I found this in the guild_war.cpp:

    if (gw.type == GUILD_WAR_TYPE_FIELD)
        return;

So if you tired to do a field war (type 0) then this could be the problem. Other wars are working perfectly for me.

  • Love 1

The one and only UI programming guideline

Link to comment
Share on other sites

  • 3 months later...

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.