Register for your free account! | Forgot your password?

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

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

Advertisement



[WIP] Get SRO Source Code - by re-writing it

Discussion on [WIP] Get SRO Source Code - by re-writing it within the SRO Coding Corner forum part of the Silkroad Online category.

Reply
 
Old 09/01/2019, 13:01   #91
 
elite*gold: 100
Join Date: Apr 2008
Posts: 860
Received Thanks: 1,486
Quote:
Originally Posted by cuoinuamieng View Post
How can i get the current character after login ?
The code didn't make it into the main branch, yet:


Code:
if (g_pCICPlayer ) {
  printf("Player Name is: %S\n", g_pCICPlayer ->m_charname.c_str()); // Edit: Added c_str here, oops
}
The "if" is somewhat important since the player object seems to be 0 while teleporting, sometimes.
florian0 is offline  
Thanks
2 Users
Old 09/02/2019, 12:45   #92

 
sarkoplata's Avatar
 
elite*gold: 166
Join Date: Apr 2009
Posts: 2,339
Received Thanks: 2,661
I don't know class names or anything, or why this works:
Code:
reinterpret_cast<wchar_t*>(0x00EEDAC0)
can it be g_pSelfCharname something?
sarkoplata is offline  
Old 09/03/2019, 08:52   #93
 
elite*gold: 0
Join Date: Apr 2008
Posts: 97
Received Thanks: 7
Playername is nulled , level and str int is true , may i missing something or wrong type ?
cuoinuamieng is offline  
Old 09/03/2019, 18:31   #94
 
elite*gold: 100
Join Date: Apr 2008
Posts: 860
Received Thanks: 1,486
Quote:
Originally Posted by sarkoplata View Post
I don't know class names or anything, or why this works:
Code:
reinterpret_cast<wchar_t*>(0x00EEDAC0)
can it be g_pSelfCharname something?
This is the selected character from CPSCharacterSelect selection animation. Looks safe to use to me.

Quote:
Originally Posted by cuoinuamieng View Post
Playername is nulled , level and str int is true , may i missing something or wrong type ?
If you were using the code from above, there was a mistake. It should have been
Code:
g_pCICPlayer ->m_charname.c_str()
florian0 is offline  
Thanks
2 Users
Old 09/13/2019, 03:12   #95
 
Raymond*'s Avatar
 
elite*gold: 388
Join Date: Aug 2017
Posts: 164
Received Thanks: 109
Amazing job bro, keep it up.
Raymond* is offline  
Thanks
1 User
Old 12/24/2019, 14:21   #96
 
elite*gold: 100
Join Date: Apr 2008
Posts: 860
Received Thanks: 1,486
Hello my beloved copy-paste squad,

one year has passed since the initial release. So it's time for something new"". I hope @ will give this one a proper rating as well.

I always wanted to have a proper example window to show how the library can be used. So I decided to reverse engineer the single most window nobody is interested in:

The chat window
(Dramatic: Dam dam dam ...)

I reverse engineered the chat. Not all of it, yet. But enough to keep me busy a for whole year.
We know have:
  • Networking support: You can now send packets to the server
  • Scroll-Bar behaviour: Attach a scrollbar to a textbox (probably also works with other lists)
  • Proper code to write anything to the chat
  • Did someone say "Item linking"?
  • A lot of example code on how to work with Silkroad's UI

Where's the code, bro?

It's not merged yet, therefore you can only find it here:


IFChatViewer.h:
IFChatViewer.cpp:

Merry christmas, copypasters
florian0
florian0 is offline  
Thanks
10 Users
Old 12/29/2019, 07:16   #97
 
elite*gold: 11
Join Date: May 2009
Posts: 617
Received Thanks: 589
Quote:
Originally Posted by Frukio92 View Post
Did you find the solution?
How do I change places automatically when every resolution changes?
you must hook the d3d reset event and calculate new positions based on client rect
qoaway is offline  
Old 12/29/2019, 08:26   #98
 
kanift's Avatar
 
elite*gold: 0
Join Date: May 2010
Posts: 62
Received Thanks: 78
Quote:
Originally Posted by Frukio92 View Post
Did you find the solution?
How do I change places automatically when every resolution changes?
u can do it as shine said or u can hook CGInterface__Resize(0x39F030) RVA and do it whenever client has to do it

Code:
void GetWindowSize(int* width, int* height)
{
	DWORD dwBase = reinterpret_cast<DWORD>(reinterpret_cast<void*(__cdecl*)()>(MAKE_RVA(0xF9CD0))());
	*width = *reinterpret_cast<int*>(dwBase + 0x24);
	*height = *reinterpret_cast<int*>(dwBase + 0x28);
}

CGInterface__Resize_Hook(void* pCGInterface)
{
	int width, height;
	GetWindowSize(&width, &height);

	CIFWnd* pCIFMinimap = GetIFWnd(pCGInterface, 10, 1);
	pCIFMinimap->SetPosition(width / 2, height / 2);
}
im pretty sure that this project has GetIFWnd and SetPosition equivalent and with my example above, u will be set the minimap to center of the window when the resolution changed
kanift is offline  
Old 12/29/2019, 18:13   #99
 
#HB's Avatar
 
elite*gold: 100
Join Date: Sep 2017
Posts: 1,108
Received Thanks: 903
Code:
#define CLIENT_SCREEN_WIDTH (*(int*)0x00ED7CB8)
#define CLIENT_SCREEN_HEIGHT (*(int*)0x00ED7CBC)

void CIFFacebookGuide::ResetPosition()
{
	USHORT PosX = 0, PosY = 222;
	PosX = CLIENT_SCREEN_WIDTH - 85;
	this->MoveGWnd(PosX, PosY);
}
#HB is offline  
Thanks
1 User
Old 12/29/2019, 21:04   #100
 
#HB's Avatar
 
elite*gold: 100
Join Date: Sep 2017
Posts: 1,108
Received Thanks: 903
You shall trigger the function after changing resolution.
#HB is offline  
Thanks
1 User
Old 01/03/2020, 07:00   #101
 
concucu's Avatar
 
elite*gold: 0
Join Date: Sep 2012
Posts: 215
Received Thanks: 124
...
concucu is online now  
Old 01/15/2020, 09:59   #102
 
concucu's Avatar
 
elite*gold: 0
Join Date: Sep 2012
Posts: 215
Received Thanks: 124
...
concucu is online now  
Old 01/15/2020, 13:12   #103
 
elite*gold: 100
Join Date: Apr 2008
Posts: 860
Received Thanks: 1,486
GetResObj returns an CIFWnd-pointer by default. This is the base type. For all UI types.
CIFStatic is a CIFWnd, but CIFWnd is not a CIFStatic. Assigning an CIFWnd-pointer to a CIFStatic-pointer would be an upcast (since CIFWnd is the parent and CIFStatic the derived class). So this wont work.
Since we KNOW (or at least hope) which type will be returned from GetResObject, we can use the reinterpret_cast-pry bar and make it a CIFStatic:
Code:
CIFStatic* label = reinterpret_cast<CIFStatic*>(wnd->m_IRM.GetResObj(13, 1));
Since this code is ugly, I made another version which casts it to the given type internally. Functionality is the same, but code is shorter and more readable.

Code:
CIFStatic* label = wnd->m_IRM.GetResObj<CIFStatic>(13, 1);
There are plenty of occurrences to use as examples:


florian0 is offline  
Thanks
1 User
Old 01/18/2020, 19:58   #104
 
elite*gold: 0
Join Date: Oct 2019
Posts: 12
Received Thanks: 3
how can i color any post
do you know? @
Frukio92 is offline  
Old 01/29/2020, 07:53   #105
 
concucu's Avatar
 
elite*gold: 0
Join Date: Sep 2012
Posts: 215
Received Thanks: 124
Quote:
Originally Posted by Frukio92 View Post
how can i color any post
do you know? @
edit on resinfo -> your file

@
Can you make an example of a list in the UI?
We can
- Display a list
- Select an object from the list

thank you
concucu is online now  
Reply

Tags
ussless


Similar Threads Similar Threads
[Source] Fix the old exp bar - by writing code!
05/17/2020 - SRO PServer Guides & Releases - 18 Replies
Hello beloved, dead community, its time for another release. Its more of a proof of concept and I hope it might inspire people to continue working on it. You don't need the source to accomplish cool things. Just write your own source. http://i.epvpimg.com/d7hJbab.png Ye, its super ugly looking. I choose to be a coder, not a designer. I'd be happy, if someone supplies me a proper version of the 2dt and ddj files so I can update this embarrassing screenshot. Anyway. It allows you to...
[Release/WIP]EP6 Source code
04/15/2018 - Shaiya PServer Guides & Releases - 33 Replies
Hi guys, First of all, I want to say that this release is not recommended for public servers yet. Shortly ago I changed my server to ep6 using shen1l's pet.dll, the server crashed every day, after checking the dump files I discovered that the problem was in pet.dll, but without the source code it would be harder to find the cause of the problem. So I decided to start a project and release the source code for everyone, so that everyone can solve their problems more easily, and also so that...
[C++ Source] My Free Farm Bot [WIP]
06/28/2011 - Browsergames - 0 Replies
I decided to release this on here as i have no more use for it and no intention to continue the project. I am releasing 2 projects: One basic library for mff called libmff(although it is not really a library) there is an example on how to use it in the package. And a helper with a fancy gui. Note that there is almost no error checking on the helper and that it crashes if you for example forget to select a product. You need libcurl and boost for both and GWEN(the gui toolkit by garry) for...



All times are GMT +1. The time now is 14:33.


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.