![]() |
[SHARE] knowledge about good times (C1++ 32-bit stuff)
eng: IF someone interested, let me know, i'll continue, otherwise i'll stop =)
this thread if just for people who wanna some info about internals of any EXTenders, how it works, why it works, etc showing my sources of one of my oldy C1->C4 dll as an example or maybe someone still working on one of C1++ projects, so maybe it will be helpful rus: ЕСЛИ это кому-нить интересно, дайте знать, иначе ну его нах =) эта ветка для людей, кому интересно, что же там внутри у всяких там экстендеров, как и почему это работает и т.д. на примере исходников одной из стареньких моих C1->C4 дллок или кто-нить до сих пор работает над одним из C1++ прожектом, и это может оказаться полезным trouble: when party leader leave world (disconnects), party destructs and dies under mobs =), but in C4 leader rights should be transfered to another member проблема: когда пати лидер дисконнектится, пати распадается и обычно умирает под мобами =), а в C4 права лидера должны передаваться другому члену. Code:
#include "Globals.h" |
Yes i would like to show me your stuff :p and explane me all about C1 servers. I start as Dev first time in L2c4 Retail files, so i want realy learn about C1 files.
|
Continue, of course.
I'm learning c++ and interested in it. |
<rus>
Это всегда интересно - я вообще для С1 на дельфи длл писал, с переходом на С4 пришлось почти с нуля учить С++. [набравшись наглости] - заголовочные файлы к этому примеру входят в список документов, с которых сняли гриф секретности? :-) зы. надо бы и по английски какую-нибудь стандартную фигню написать - не принимай близко к сердцу :-) </rus> Excellent !!!! Good stuff!!! keep going ahead!!! :-) |
Maybe guys u have fix for HELP.html for c1 servers?
|
SO_VALID_USER - simple thing that checks given pointer and checks if its really poits to valid User class
0x00602C04 - offset of User virtual functions, same for all users its good when u not sure and wanna reinsure %) SafeObjects.h Code:
#pragma once |
Nice thanks.
|
globals - common stuff of extender
CLog_AddW() - unicode version of CLog:Add CLog_AddA() - ansi version of CLog::Add Assemble() - packet assembler Disassemble() - packet disassembler all these 4 functions points into original c1 l2server.exe g_Cfg - global class that contain settings readed from .ini g_Console - global class for console output g_GM_Allowed - can any GM login/use commands SC_LoadBlockedItems() - load list of IDs that can not be placed on shortcut panel SC_ItemInBlockList() - checks if item can me placed on shortcut panel ....... as i remember this list was used to remove enchant scrolls from shortcuts... %) GM_LoadAllowedChars() - load list of char names that able to be GM GM_CharAllowed() - checks if given char name can use GM commands globals.h Code:
#pragma onceCode:
#include "Globals.h" |
omg...i can't even understand, what is virtual user functions (is it point, where dll may call server functions, or is it one function, which operate with users? -_-).
...going to google. :) |
Quote:
but i'll try to explain: Code:
class CSomeClassoffset of n2 == 4 BUT Code:
class CSomeClassoffset of n2 == 8 and at zero offset there is pointer to array of virtual functions so, almost every c++ class inside l2server has virtual functions and they are all different.. CCreature - one address, CNPC - another, User - 0x00602C04 so we can check by dword (qword in x64) value at offset 0 what this class is. |
troubles:
1. when ur weight too high, u can not move, but can when u on strider 2. when u trading, u can go away too far and then confirm проблемы: 1. при большом весе нельзя двигаться, но на страйдере почему-то можно 2. при передаче вещей можно убежать далеко, а затем только подтвердить packet 0x01 handler fix this bugs CP_01_MoveBackwardToLocation.cpp Code:
#include "Globals.h" |
humordwarf:
mm... you want to tell, that 0 offset of class has pointer, which point to array of all virtual functions at this class and so_valid_user checks, if this pointer assigned to NULL, then it's user not exist (*pUser points to disconnected user?), right? :) anyway thank you for explain and keep sources and comments going. :) |
Quote:
in given case - to correct User class, not to CNPC, not to CPet, not to any other |
humordwarf:
weheh.. i don't completely understand (i think it's just hard to explain it), but i'll try to find more info about this and thank you again, your posts are usefull even for me. :p maybe sometime i'll create my great dll for l2server. %) respect. |
Go HD :) Keep rocking.
|
Yeah, we need this project
<ru> da da, prodolzhaite pozhaluista </ru> |
I can't describe my respect for HD, thanks HD, again :P
|
ok.. next...
ServerPackets.h - some definitions for server->client packets Code:
#pragma once |
some /loc related stuff
little bit unoptimized, but works fine... as i remember... Settings.h Code:
#pragma onceCode:
#include "Settings.h"Code:
#include <windows.h> |
Well, may I just say thanks ? It's very usefull, and it seems that I can make something by myself now that's I understand better the system. I'm just lacking time, and it's a crucial things. So what you do here is really important, it spare me some time to study and see how things are working in L2server.
There is just one things I can't get in the last one, Code:
(( (nCurrentX+0x50000) >> 15 ) + 10) & 0x1F;EDIT : Figurd it out ! Thanks anyway. |
respect 4 HD
|
| All times are GMT. The time now is 15:17. |