Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Silkroad Online > SRO Private Server > SRO PServer Guides & Releases
You last visited: Today at 02:28

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

Advertisement



[Release] Custom Unique Notifies with IFSystemMessage Colors

Discussion on [Release] Custom Unique Notifies with IFSystemMessage Colors within the SRO PServer Guides & Releases forum part of the SRO Private Server category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Mar 2010
Posts: 568
Received Thanks: 228
[Release] Custom Unique Notifies with IFSystemMessage Colors

Hello Everyone,

Custom Unique Notifies with IFSystemMessage Colors

Use @ for this

Credits for helper CustomUniqueNotifiers: @ from With some things changing.





Add this in DllMain.cpp


Code:
#include "CustomUniqueNotifiers.h"
//Custom Unique Notifies with IFSystemMessage Colors
CustomUniqueNotifiers::InitializeCustomUniqueNotifies();

DevKit_DLL->Source Files Create CustomUniqueNotifiers.cpp after Add this

Code:
#include "CustomUniqueNotifiers.h"
#include <memory/hook.h>
#include "CTextStringManager.h"

std::vector<std::pair<std::wstring, std::wstring>> CustomUniqueNotifiers::CustomUniqueNotifies;

std::wstring* CustomUniqueNotifiers::HasCustomUniqueNotify(std::wstring* NameStrID)
{
	typedef std::vector<std::pair<std::wstring, std::wstring>>::iterator iterator_t;
	for (iterator_t i = CustomUniqueNotifies.begin(); i != CustomUniqueNotifies.end(); i++)
	{
		if (wcscmp(i->first.c_str(), NameStrID->c_str()) == 0)
		{
			return &i->second;
		}
	}
	return NULL;
}

bool CustomUniqueNotifiers::AddCustomUniqueNotify(std::wstring NameStrID, std::wstring MsgCode)
{
	if (!HasCustomUniqueNotify(&NameStrID))
	{
		CustomUniqueNotifies.push_back(std::pair<std::wstring, std::wstring>(NameStrID, MsgCode));
		return true;
	}
	return false;
}

bool CustomUniqueNotifiers::RemoveCustomUniqueNotify(std::wstring NameStrID)
{
	for (int i = 0; i < CustomUniqueNotifies.size(); i++)
	{
		std::pair<std::wstring, std::wstring> notify = CustomUniqueNotifies[i];
		if (wcscmp(notify.first.c_str(), NameStrID.c_str()) == 0)
		{
			CustomUniqueNotifies.erase(CustomUniqueNotifies.begin() + i);
			return true;
		}
	}
	return false;
}

void CustomUniqueNotifiers::InitializeCustomUniqueNotifies(void)
{
	replaceOffset(0x00875444, addr_from_this(&CTextStringManager::OnUniqueNameRetrieve));

	//UIIT_MSG_APPEAR_KERBEROS & UIIT_MSG_APPEAR_IVY -> textuisystem.txt
	//SN_MOB_EU_KERBEROS & SN_MOB_AM_IVY -> textdata_object.txt
	AddCustomUniqueNotify(std::wstring(L"SN_MOB_EU_KERBEROS"), std::wstring(L"UIIT_MSG_APPEAR_KERBEROS"));
	AddCustomUniqueNotify(std::wstring(L"SN_MOB_AM_IVY"), std::wstring(L"UIIT_MSG_APPEAR_IVY"));
	AddCustomUniqueNotify(std::wstring(L"SN_MOB_RM_ROC"), std::wstring(L"UIIT_MSG_APPEAR_ROC"));

}
DevKit_DLL->Header Files Create CustomUniqueNotifiers.h after Add this

Code:
#pragma once
#include <Windows.h>
#include <iostream>
#include <vector>



class CustomUniqueNotifiers
{
public:
	static std::vector<std::pair<std::wstring, std::wstring>> CustomUniqueNotifies;

	static std::wstring* HasCustomUniqueNotify(std::wstring* NameStrID);
	static bool AddCustomUniqueNotify(std::wstring NameStrID, std::wstring MsgCode);
	static bool RemoveCustomUniqueNotify(std::wstring NameStrID);

	static void InitializeCustomUniqueNotifies();
};

DevKit_DLL->Source Files Create CTextStringManager.cpp after Add this

Code:
#include "CTextStringManager.h"
#include <GInterface.h>
#include "CustomUniqueNotifiers.h"
#include "IFSystemMessage.h"
#include <BSLib/multibyte.h>

const DWORD OnJE = 0x00875ABE;
const DWORD OnJNE = 0x00875449;

std::wstring* CTextStringManager::GetStringByNameStrID(std::wstring* NameStrID)
{
	return reinterpret_cast <std::wstring*(__thiscall*)(CTextStringManager*, std::wstring*)>(0x008C9BB0)(this, NameStrID);
}

void CTextStringManager::OnUniqueNameRetrieve(std::wstring* NameStrID)
{	
	std::wstring* MsgCheck = CustomUniqueNotifiers::HasCustomUniqueNotify(NameStrID);
	if (MsgCheck)
	{
		CGInterface* myface = CGInterface::GetInterface();
		std::wstring* mymsg = this->GetStringByNameStrID(MsgCheck);
		
		CALL(mymsg);

		__asm {
			add esp, 0x1C;
			jmp OnJE;
		}
	}

	this->GetStringByNameStrID(NameStrID);
	__asm {
		add esp, 0x1C;
		jmp OnJNE;
	}
}

void CTextStringManager::CALL(std::wstring* Message)
{
	g_pCGInterface->ShowMessage_Notice(Message->c_str());
	g_pCGInterface->ShowMessage_Quest(Message->c_str());
	g_pCGInterface->ShowMessage_Warning(Message->c_str());

	//IFSystemMessage Normal
	//g_pCGInterface->WriteSystemMessage(SYSLOG_NONE, NameStrID->c_str());

	//IFSystemMessageColors
	IFSystemMessage *systemmessage = reinterpret_cast<IFSystemMessage *>(g_pCGInterface->m_IRM.GetResObj(68, 1));
	systemmessage->write(0xFF, 0xff004b, Message->c_str(), 0, 1);
}
DevKit_DLL->Header Files Create CTextStringManager.h after Add this

Code:
#pragma once
#include <iostream>

class CTextStringManager
{
public:
	std::wstring* GetStringByNameStrID(std::wstring* NameStrID);
	void OnUniqueNameRetrieve(std::wstring* NameStrID);
	void CALL(std::wstring * NameStrID);
};

ClientLib->Source Files Edit in IFSystemMessage.cpp

Code:
// CIFSystemMessage::write(int a1, int color, wchar_t* msg, int a2, int a3) .text:007B89E0 sro_client_dev.exe:$3B89E0 #3B89E0 <sub_7B89E0>
void IFSystemMessage::write(int a1, int color, const wchar_t* msg, int a2, int a3)
{
    // Redirection to original client code
    reinterpret_cast<void(__thiscall*)(IFSystemMessage*, int, int, wchar_t, int, int)>(0x007B89E0)(this, a1, color, reinterpret_cast<wchar_t>(msg), a2, a3);
}

ClientLib->Header Files Edit in IFSystemMessage.h

Code:
void write(int a1, int color,const wchar_t* msg, int a2, int a3);
media\server_dep\silkroad\textdata->textuisystem.txt

Code:
1	UIIT_MSG_APPEAR_KERBEROS	타림분지에 우르치가 등장하였습니다.	0	0	0	0	0	0	Cerberus has appeared on Desperado Hill.	0	0	0	0	0	0	0	0	
1	UIIT_MSG_APPEAR_IVY	타클라마칸에 로드야르칸이 등장하였습니다.	0	0	0	0	0	0	Ivy has appeared on Ararat Mountain.	0	0	0	0	0	0	0	0

ClientLib->Header Files Add in GInterface.h

Code:
//GetInterface
static CGInterface* GetInterface();

ClientLib->Source Files Add in GInterface.cpp


Code:
CGInterface* CGInterface::GetInterface(void)
{
	return *reinterpret_cast<CGInterface**>(0x0110F80C);
}

this system have one problem try to figure out and fix it


Good Luck to Everyone
Laag#82 is offline  
Thanks
16 Users
Old 09/03/2020, 02:39   #2
 
elite*gold: 0
Join Date: Dec 2009
Posts: 386
Received Thanks: 88
This is what I mean very helpful to learn for me and to know how it’s works, no any fight for credits with the community, no any likes to need for release. Just a release and done, thank you!
mudik is offline  
Thanks
2 Users
Old 09/03/2020, 02:48   #3

 
Dev.L0RdReVaN's Avatar
 
elite*gold: 355
Join Date: Mar 2009
Posts: 264
Received Thanks: 52
Nice Job bro
Dev.L0RdReVaN is offline  
Thanks
1 User
Old 09/03/2020, 04:08   #4

 
XxGhostSpiriTxX's Avatar
 
elite*gold: 53
Join Date: Jul 2012
Posts: 541
Received Thanks: 190
ok but the system does not work? has a mistake right? thanks for shared
XxGhostSpiriTxX is offline  
Old 09/03/2020, 04:25   #5

 
elite*gold: 100
Join Date: Jun 2013
Posts: 442
Received Thanks: 778
I don't understand what you are releasing here? This is exactly the same as @ release for the custom unique notifier. The only thing I see that is somewhat different is the CALL function which shows the notification in three different kinds instead of just the blue function.

What's going on here? It's not like his thread has expired downloads or non-working links. Why are you re-uploading the same thing?
Anonymous-9238 is offline  
Thanks
1 User
Old 09/03/2020, 04:55   #6
 
elite*gold: 0
Join Date: Mar 2010
Posts: 568
Received Thanks: 228
Quote:
Originally Posted by esteve458 View Post
ok but the system does not work? has a mistake right? thanks for shared
You can add a screenshot of the error I can help you

Quote:
Originally Posted by Simulation1337 View Post
I don't understand what you are releasing here? This is exactly the same as @ release for the custom unique notifier. The only thing I see that is somewhat different is the CALL function which shows the notification in three different kinds instead of just the blue function.

What's going on here? It's not like his thread has expired downloads or non-working links. Why are you re-uploading the same thing?
no comment
Laag#82 is offline  
Old 09/03/2020, 05:03   #7

 
XxGhostSpiriTxX's Avatar
 
elite*gold: 53
Join Date: Jul 2012
Posts: 541
Received Thanks: 190
[QUOTE=khaleed2010;38346661]You can add a screenshot of the error I can help you

I think it is the error that you mention in the post

XxGhostSpiriTxX is offline  
Old 09/03/2020, 05:05   #8


 
Goosxc's Avatar
 
elite*gold: 150
Join Date: Jan 2020
Posts: 268
Received Thanks: 283
???
Goosxc is offline  
Old 09/03/2020, 06:08   #9
 
elite*gold: 0
Join Date: Mar 2010
Posts: 568
Received Thanks: 228
Quote:
Originally Posted by esteve458 View Post

I think it is the error that you mention in the post


Quote:
Originally Posted by Goosxc View Post
???
Done fix
Laag#82 is offline  
Thanks
1 User
Old 09/03/2020, 06:22   #10


 
ZαKuRα's Avatar
 
elite*gold: 23
Join Date: Feb 2011
Posts: 641
Received Thanks: 477
ZαKuRα is offline  
Old 09/03/2020, 06:24   #11
 
elite*gold: 0
Join Date: Apr 2012
Posts: 263
Received Thanks: 271
work perfect
thaidu0ngpr0 is offline  
Old 09/03/2020, 06:35   #12
 
elite*gold: 0
Join Date: Mar 2010
Posts: 568
Received Thanks: 228
Quote:
Originally Posted by thaidu0ngpr0 View Post
work perfect
Great
Laag#82 is offline  
Old 09/03/2020, 08:39   #13


 
Goosxc's Avatar
 
elite*gold: 150
Join Date: Jan 2020
Posts: 268
Received Thanks: 283
Work Perfect. but i have a question why it show 3 notice ??
Goosxc is offline  
Old 09/03/2020, 08:51   #14
 
elite*gold: 0
Join Date: Apr 2012
Posts: 263
Received Thanks: 271
Quote:
Originally Posted by Goosxc View Post
Work Perfect. but i have a question why it show 3 notice ??
delete this
g_pCGInterface->ShowMessage_Notice(Message->c_str());
g_pCGInterface->ShowMessage_Quest(Message->c_str());
g_pCGInterface->ShowMessage_Warning(Message->c_str());
thaidu0ngpr0 is offline  
Thanks
1 User
Old 09/03/2020, 13:24   #15

 
XxGhostSpiriTxX's Avatar
 
elite*gold: 53
Join Date: Jul 2012
Posts: 541
Received Thanks: 190
work perfect

XxGhostSpiriTxX is offline  
Reply


Similar Threads Similar Threads
[Mini-Release] Custom Unique Notifies
05/09/2021 - SRO PServer Guides & Releases - 40 Replies
https://www.elitepvpers.com/forum/sro-pserver-guid es-releases/4806749-non-mini-release-rewriting-cli ent-notification-handler.html



All times are GMT +1. The time now is 02:28.


Powered by vBulletin®
Copyright ©2000 - 2025, 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 ©2025 elitepvpers All Rights Reserved.