title color through the devkit

01/16/2021 04:49 sigel123456789#1
first of all i have 0 knowledge about c++
i was trying to change the title color but it does change it for me only
Code:
    CICharactor *entity = 0;

    CLASSLINK_LOOP_BEGIN(CICharactor)
        if (obj->GetName() == g_pCICPlayer->GetName()) {
            entity = obj;
            if (entity)
                entity->UpdateTitleColor(0xff004b);
        }
    CLASSLINK_LOOP_END(CICharactor)
01/16/2021 19:48 LegendarySouL#2
Click in button change language turkish you can seen color change in own your character !! if using athena source dev_kit!!
01/17/2021 22:31 Devsome#3
#moved
01/18/2021 08:03 JellyBitz#4
Quote:
Originally Posted by sigel123456789 View Post
i was trying to change the title color but it does change it for me only
Haha that's how it's works!
You'll be changing your "graphics" but only for your client.
You need the server communication otherwise it will looks like you're hacking your client.

You'll have to know a little bit about C++ & C# (C##?) to make it work as it should be by building some kind protocol using a filter.

But.. What's a protocol? The way a program interacts with another one.

1. Client ask to the server (Sending a custom MsgStreamBuffer/packet for it)
2. Server (Filter) reads the packet info (don't let it pass to gameserver)
3. Server check all is correct and will reply sending a custom packet to people involved; you and all players with the same region ID to be short.
4. Client will receive that custom packet/MsgStreamBuffer and will proceed to change the title attributes from entity id specified

If you plan to make the protocol you'll be ending creating this methods for making things easier:

Client.SendTitleColorRequest(byte ColorIndex) : Send a packet with the color position that you wants to use
Server.ReadTitleColorRequest(Packet p) : Check client request about titles and reply to the user if there is an error or success while you send an update to all players around
Server.CreateUpdateTitleColorPacket(uint PlayerID, Color TitleColor) : Create and returns a packet to be sent to the client to update the player title color
Server.SendUpdateToPeopleAtRegion(int Regions[], Packet p): Sends a packet to the people on the specified regions
Client.ReadTitleColorUpdate(MsgStreamBuffer p) : Reads the packet and updates the title color from Player ID specified

Note: I'm trying to be short, limiting to Color only.
You should build a title protocol instead colors only, but I'm just giving you the main idea.
01/20/2021 06:24 sigel123456789#5
Quote:
Originally Posted by JellyBitz View Post
Haha that's how it's works!
You'll be changing your "graphics" but only for your client.
You need the server communication otherwise it will looks like you're hacking your client.

You'll have to know a little bit about C++ & C# (C##?) to make it work as it should be by building some kind protocol using a filter.

But.. What's a protocol? The way a program interacts with another one.

1. Client ask to the server (Sending a custom MsgStreamBuffer/packet for it)
2. Server (Filter) reads the packet info (don't let it pass to gameserver)
3. Server check all is correct and will reply sending a custom packet to people involved; you and all players with the same region ID to be short.
4. Client will receive that custom packet/MsgStreamBuffer and will proceed to change the title attributes from entity id specified

If you plan to make the protocol you'll be ending creating this methods for making things easier:

Client.SendTitleColorRequest(byte ColorIndex) : Send a packet with the color position that you wants to use
Server.ReadTitleColorRequest(Packet p) : Check client request about titles and reply to the user if there is an error or success while you send an update to all players around
Server.CreateUpdateTitleColorPacket(uint PlayerID, Color TitleColor) : Create and returns a packet to be sent to the client to update the player title color
Server.SendUpdateToPeopleAtRegion(int Regions[], Packet p): Sends a packet to the people on the specified regions
Client.ReadTitleColorUpdate(MsgStreamBuffer p) : Reads the packet and updates the title color from Player ID specified

Note: I'm trying to be short, limiting to Color only.
You should build a title protocol instead colors only, but I'm just giving you the main idea.
thanks for making it clear
edit
all is done and i send the packet to whole server but it still changes for the user only
edit 2 it worked now thanks to you ^^
could u please explain as above how to keep the title color for the user , cause when the user go off or teleport the title back to yellow
01/20/2021 23:46 NorseGodTyr#6
Quote:
Originally Posted by sigel123456789 View Post
thanks for making it clear
edit
all is done and i send the packet to whole server but it still changes for the user only
edit 2 it worked now thanks to you ^^
could u please explain as above how to keep the title color for the user , cause when the user go off or teleport the title back to yellow
Save the title color in a Table
01/21/2021 03:53 sigel123456789#7
Quote:
Originally Posted by NorseGodTyr View Post
Save the title color in a Table
so whenever a player appear next to the title owner it has to re execute all functions isnt that looks wierd ?
01/21/2021 15:32 sonzenbi#8
Quote:
Originally Posted by sigel123456789 View Post
so whenever a player appear next to the title owner it has to re execute all functions isnt that looks wierd ?
like you, I know nothing about c ++
But here's how I did it
Hope someone has a better way
Code:
int CPSMission::OnPacketRecv(CMsgStreamBuffer* MsgBuffer)
{
    std::n_wstring str;
    wchar_t buffer[255];
    wchar_t buffer2[255];
    swprintf_s(buffer, TSM_GETTEXTPTR("UIO_SECOND_HWAN_CH_NAME_LEVEL_1"));
    swprintf_s(buffer2, TSM_GETTEXTPTR("UIO_SECOND_HWAN_CH_NAME_LEVEL_2"));
    CLASSLINK_LOOP_BEGIN(CICharactor)
        obj->fonttexture_title.GetText(&str);
        if (str.find(buffer) != std::n_string::npos) {
            obj->UpdateTitleColor(0xFF00FFFF);
        }
        else if (str.find(buffer2) != std::n_string::npos) {
            obj->UpdateTitleColor(0xFFFF0000);
        }//you should create std::map
    CLASSLINK_LOOP_END(CICharactor)
01/22/2021 14:08 Laag#82#9
Quote:
Originally Posted by sonzenbi View Post
like you, I know nothing about c ++
But here's how I did it
Hope someone has a better way
Code:
int CPSMission::OnPacketRecv(CMsgStreamBuffer* MsgBuffer)
{
    std::n_wstring str;
    wchar_t buffer[255];
    wchar_t buffer2[255];
    swprintf_s(buffer, TSM_GETTEXTPTR("UIO_SECOND_HWAN_CH_NAME_LEVEL_1"));
    swprintf_s(buffer2, TSM_GETTEXTPTR("UIO_SECOND_HWAN_CH_NAME_LEVEL_2"));
    CLASSLINK_LOOP_BEGIN(CICharactor)
        obj->fonttexture_title.GetText(&str);
        if (str.find(buffer) != std::n_string::npos) {
            obj->UpdateTitleColor(0xFF00FFFF);
        }
        else if (str.find(buffer2) != std::n_string::npos) {
            obj->UpdateTitleColor(0xFFFF0000);
        }//you should create std::map
    CLASSLINK_LOOP_END(CICharactor)

Hello to everyone,

bad idea :rolleyes:

you can upgrade to best

what happens if add this

Code:
std::map<std::wstring, int>CharTitleColors;
map<std::wstring, int>::iterator itTitle;
Code:
int CPSMission::OnPacketRecv(CMsgStreamBuffer* MsgBuffer)
{
	//This place is very bad
	CLASSLINK_LOOP_BEGIN(CICharactor)
	itTitle = CharTitleColors.find(obj->GetName().c_str());
	if (itTitle != CharTitleColors.end())
	{
		obj->UpdateTitleColor(itTitle->second);
	}
	CLASSLINK_LOOP_END(CICharactor)

}
Code:
CharTitleColors.insert(std::pair<std::wstring, int>(YouCharname, Youcolor));
with packet can use Live System

Good Luck

Special thanks to: florian0 :rolleyes:
01/23/2021 06:09 JellyBitz#10
Quote:
Originally Posted by sigel123456789 View Post
could u please explain as above how to keep the title color for the user , cause when the user go off or teleport the title back to yellow
Yes, that's the most important part here, keep the titles/info updated.
And not just for yourself (as above mentioned) but everyone, that's the point!

1. Save any update title successfully request to some database table as NorseGodTyr said.
2. Spawn tracking! This will give you more possibilities to update many other aspects in game if you didn't before.

Everytime a player spawns near to your character, you'll retrieve that extra information from that player (title at this case) from database.
The right way is by using server side only (Filter) but client side is also possible.

From Filter (server side filter-database), you will:
- Send a title update if exists (you'll ask directly title info to database) to the character after every teleport.
- Detecting player spawns around the player and send the title update as above.

The only difference making it client side is removing the packet parsing from filter but is nothing to worry about. I already saw too much improvable code on many filters code, this would be like nothing. :p

How to detect spawns?
You can take a look [Only registered and activated users can see links. Click Here To Register...] for vSRO 1.188 packet structures and types.
02/08/2021 05:11 sigel123456789#11
Quote:
Originally Posted by JellyBitz View Post
Yes, that's the most important part here, keep the titles/info updated.
And not just for yourself (as above mentioned) but everyone, that's the point!

1. Save any update title successfully request to some database table as NorseGodTyr said.
2. Spawn tracking! This will give you more possibilities to update many other aspects in game if you didn't before.

Everytime a player spawns near to your character, you'll retrieve that extra information from that player (title at this case) from database.
The right way is by using server side only (Filter) but client side is also possible.

From Filter (server side filter-database), you will:
- Send a title update if exists (you'll ask directly title info to database) to the character after every teleport.
- Detecting player spawns around the player and send the title update as above.

The only difference making it client side is removing the packet parsing from filter but is nothing to worry about. I already saw too much improvable code on many filters code, this would be like nothing. :p

How to detect spawns?
You can take a look [Only registered and activated users can see links. Click Here To Register...] for vSRO 1.188 packet structures and types.
thanks to you all done now , i have only one last question
whenever these packets executed
0x7021 every move , 3013, 7158 , 750E , after every tp 3305
it selects every single charname in agentserver and checks if it's region = required charname to change colorname
then it sends packets for whole server with required charname , color to change it
my question is
will that fuck up the performance if i run +200 chars moving and teleporting etc..