|
You last visited: Today at 14:32
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.
09/01/2019, 13:01
|
#91
|
elite*gold: 100
Join Date: Apr 2008
Posts: 860
Received Thanks: 1,486
|
Quote:
Originally Posted by cuoinuamieng
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.
|
|
|
09/02/2019, 12:45
|
#92
|
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?
|
|
|
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 ?
|
|
|
09/03/2019, 18:31
|
#94
|
elite*gold: 100
Join Date: Apr 2008
Posts: 860
Received Thanks: 1,486
|
Quote:
Originally Posted by sarkoplata
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
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()
|
|
|
09/13/2019, 03:12
|
#95
|
elite*gold: 388
Join Date: Aug 2017
Posts: 164
Received Thanks: 109
|
Amazing job bro, keep it up.
|
|
|
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
|
|
|
12/29/2019, 07:16
|
#97
|
elite*gold: 11
Join Date: May 2009
Posts: 617
Received Thanks: 589
|
Quote:
Originally Posted by Frukio92
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
|
|
|
12/29/2019, 08:26
|
#98
|
elite*gold: 0
Join Date: May 2010
Posts: 62
Received Thanks: 78
|
Quote:
Originally Posted by Frukio92
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
|
|
|
12/29/2019, 18:13
|
#99
|
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);
}
|
|
|
12/29/2019, 21:04
|
#100
|
elite*gold: 100
Join Date: Sep 2017
Posts: 1,108
Received Thanks: 903
|
You shall trigger the function after changing resolution.
|
|
|
01/03/2020, 07:00
|
#101
|
elite*gold: 0
Join Date: Sep 2012
Posts: 215
Received Thanks: 124
|
...
|
|
|
01/15/2020, 09:59
|
#102
|
elite*gold: 0
Join Date: Sep 2012
Posts: 215
Received Thanks: 124
|
...
|
|
|
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:

|
|
|
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? @
|
|
|
01/29/2020, 07:53
|
#105
|
elite*gold: 0
Join Date: Sep 2012
Posts: 215
Received Thanks: 124
|
Quote:
Originally Posted by Frukio92
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
|
|
|
 |
|
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.
|
|