Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Silkroad Online > SRO Coding Corner
You last visited: Today at 10:26

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



title color through the devkit

Discussion on title color through the devkit within the SRO Coding Corner forum part of the Silkroad Online category.

Reply
 
Old   #1
 
sigel123456789's Avatar
 
elite*gold: 0
Join Date: Sep 2015
Posts: 327
Received Thanks: 55
title color through the devkit

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)
sigel123456789 is offline  
Old 01/16/2021, 19:48   #2
 
LegendarySouL's Avatar
 
elite*gold: 0
Join Date: Nov 2020
Posts: 170
Received Thanks: 61
Click in button change language turkish you can seen color change in own your character !! if using athena source dev_kit!!
LegendarySouL is offline  
Old 01/17/2021, 22:31   #3
dotCom
 
Devsome's Avatar
 
elite*gold: 9842
The Black Market: 107/0/0
Join Date: Mar 2009
Posts: 16,866
Received Thanks: 4,685
Arrow SRO Private Server -> SRO Coding Corner

#moved
Devsome is offline  
Old 01/18/2021, 08:03   #4
 
JellyBitz's Avatar
 
elite*gold: 0
Join Date: Sep 2018
Posts: 423
Received Thanks: 953
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.
JellyBitz is offline  
Thanks
2 Users
Old 01/20/2021, 06:24   #5
 
sigel123456789's Avatar
 
elite*gold: 0
Join Date: Sep 2015
Posts: 327
Received Thanks: 55
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
sigel123456789 is offline  
Old 01/20/2021, 23:46   #6
 
NorseGodTyr's Avatar
 
elite*gold: 0
Join Date: May 2013
Posts: 2,223
Received Thanks: 1,483
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
NorseGodTyr is offline  
Old 01/21/2021, 03:53   #7
 
sigel123456789's Avatar
 
elite*gold: 0
Join Date: Sep 2015
Posts: 327
Received Thanks: 55
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 ?
sigel123456789 is offline  
Old 01/21/2021, 15:32   #8
 
sonzenbi's Avatar
 
elite*gold: 0
Join Date: Feb 2017
Posts: 197
Received Thanks: 120
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)
sonzenbi is offline  
Thanks
2 Users
Old 01/22/2021, 14:08   #9
 
elite*gold: 0
Join Date: Mar 2010
Posts: 568
Received Thanks: 228
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

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
Laag#82 is offline  
Thanks
3 Users
Old 01/23/2021, 06:09   #10
 
JellyBitz's Avatar
 
elite*gold: 0
Join Date: Sep 2018
Posts: 423
Received Thanks: 953
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.

How to detect spawns?
You can take a look for vSRO 1.188 packet structures and types.
JellyBitz is offline  
Thanks
3 Users
Old 02/08/2021, 05:11   #11
 
sigel123456789's Avatar
 
elite*gold: 0
Join Date: Sep 2015
Posts: 327
Received Thanks: 55
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.

How to detect spawns?
You can take a look 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..
sigel123456789 is offline  
Reply


Similar Threads Similar Threads
RGH-Jtag-Devkit Kaufen.
08/02/2013 - Consoles - 2 Replies
Hallo, Ich wollte wissen wo ich Billig eine RGH bzw eine Jtag Kaufen kann ich hatte in Letzter zeit eine von einem freund doch dieser Braucht sie jetzt wieder selber da wollte ich mir jetzt auch eine kaufen :p
Rexiles DevKit
09/14/2012 - WarRock Guides, Tutorials & Modifications - 2 Replies
Hey homies... Im the Rexiles Head Developer (Server, Website). I wanted to release the Official DevKit (1.0), which is only useable for Plugins (Rexiles Game Server). If you download Here (or as Attachment), you see the Source Files (for Plugins) and the DLLs you have to Include (its all .NET, lol). So if you wanted to make a Plugin for the Server, write one, i'll check the compatibility and maybe i'll include it into the server. So, that's it... ToDo-List ~ Interface for Room.Room ~...



All times are GMT +1. The time now is 10:27.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.