Things were a little boring lately, exams, life... This brings us back to developing hard days.
If you're still interested into developing SRO, yo dude, this thread is for you.
Introduction Video
The goal of the thread won't be that useful for servers as a gameplay, I mean, it will be useful as for staff members only, since they should be the only people who use the console.
What Can I Use This For: Basically, you can do more stuff controlling the server if you have got your own filter or emulator, and you know how to do the communication between the client and the server. But remember to check user's primary & content group before doing the command job, or normal players will play around with media, open console and cheat.
Background Work: Well, searching this could be one of the easiest things you may try to find, the first & correct idea should be in your mind is looking for an existing command name in sro_client strings, and yeah, that's it.
Basically, the client has a list of existing commands, it's loaded on sro_client loading. So, we can hook the function that loads commands and load our custom commands with it, pretty simple. Here's a final output of my code,
Note: I used florian's hooking lib to hook, if you wanna use it, you'll find it in the attachments.
Note: Any addresses given above were found on VSRO 1.88 sro_client, so they are most likely different on any other version. Note: Structures above are for VC80 libs, back when string/wstring was 28 bytes. Note: Always compile on Release!
------ Build started: Project: ClientLib, Configuration: Release Win32 ------
IFConsole.cpp
..\..\..\..\source\libs\ClientLib\src\IFConsole.cpp(83): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
..\..\..\..\source\libs\ClientLib\src\IFConsole.cpp(83): error C2440: 'initializing' : cannot convert from 'std::_Vector_iterator<_Ty,_Alloc>' to 'int'
with
[
_Ty=std::pair<const wchar_t *,ConsoleCommandFunc (__stdcall *)>,
_Alloc=std::allocator<std::pair<const wchar_t *,ConsoleCommandFunc (__stdcall *)>>
]
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
..\..\..\..\source\libs\ClientLib\src\IFConsole.cpp(83): error C2678: binary '!=' : no operator found which takes a left-hand operand of type 'int' (or there is no acceptable conversion)
C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\guiddef.h(197): could be 'int operator !=(const GUID &,const GUID &)'
while trying to match the argument list '(int, std::_Vector_iterator<_Ty,_Alloc>)'
with
[
_Ty=std::pair<const wchar_t *,ConsoleCommandFunc (__stdcall *)>,
_Alloc=std::allocator<std::pair<const wchar_t *,ConsoleCommandFunc (__stdcall *)>>
]
..\..\..\..\source\libs\ClientLib\src\IFConsole.cpp(85): error C2227: left of '->first' must point to class/struct/union/generic type
type is 'int'
..\..\..\..\source\libs\ClientLib\src\IFConsole.cpp(85): error C2227: left of '->second' must point to class/struct/union/generic type
type is 'int'
========== Build: 0 succeeded, 1 failed, 10 up-to-date, 0 skipped ==========
Code:
void CIFConsole::OnCommandsLoading(void)
{
/*for (auto i = CustomConsoleCommands.begin(); i != CustomConsoleCommands.end(); i++)
{
this->AddCommand(i->first, i->second, 0);
}*/ -> this got errors
reinterpret_cast<void(__thiscall*)(CIFConsole*)>(0x00558910)(this);
}
------ Build started: Project: ClientLib, Configuration: Release Win32 ------
IFConsole.cpp
..\..\..\..\source\libs\ClientLib\src\IFConsole.cpp(83): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
..\..\..\..\source\libs\ClientLib\src\IFConsole.cpp(83): error C2440: 'initializing' : cannot convert from 'std::_Vector_iterator<_Ty,_Alloc>' to 'int'
with
[
_Ty=std::pair<const wchar_t *,ConsoleCommandFunc (__stdcall *)>,
_Alloc=std::allocator<std::pair<const wchar_t *,ConsoleCommandFunc (__stdcall *)>>
]
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
..\..\..\..\source\libs\ClientLib\src\IFConsole.cpp(83): error C2678: binary '!=' : no operator found which takes a left-hand operand of type 'int' (or there is no acceptable conversion)
C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\guiddef.h(197): could be 'int operator !=(const GUID &,const GUID &)'
while trying to match the argument list '(int, std::_Vector_iterator<_Ty,_Alloc>)'
with
[
_Ty=std::pair<const wchar_t *,ConsoleCommandFunc (__stdcall *)>,
_Alloc=std::allocator<std::pair<const wchar_t *,ConsoleCommandFunc (__stdcall *)>>
]
..\..\..\..\source\libs\ClientLib\src\IFConsole.cpp(85): error C2227: left of '->first' must point to class/struct/union/generic type
type is 'int'
..\..\..\..\source\libs\ClientLib\src\IFConsole.cpp(85): error C2227: left of '->second' must point to class/struct/union/generic type
type is 'int'
========== Build: 0 succeeded, 1 failed, 10 up-to-date, 0 skipped ==========
Code:
void CIFConsole::OnCommandsLoading(void)
{
/*for (auto i = CustomConsoleCommands.begin(); i != CustomConsoleCommands.end(); i++)
{
this->AddCommand(i->first, i->second, 0);
}*/ -> this got errors
reinterpret_cast<void(__thiscall*)(CIFConsole*)>(0x00558910)(this);
}
for (std::vector<std:air<const wchar_t*, ConsoleCommandFunc*>>::iterator i = CustomConsoleCommands.begin(); i != CustomConsoleCommands.end(); i++)
{
this->AddCommand(i->first, i->second, 0);
}
reinterpret_cast<void(__thiscall*)(CIFConsole*)>(0 x00558910)(this);
[Release] Customizing Battle Arena Required Number Of Participants 01/18/2021 - SRO PServer Guides & Releases - 17 Replies Hey there,
I saw a lot of people talking about this, I was interested thinking it's a hard thing to find, like a challenge, you know...
I spent a whole day looking into GS, found relations..etc, but I realized atn that it just receives the order from shard manager's schedule, and it doesn't do that participants count check.
So I started to look into shard manager, a few hours then, I found it, it wasn't that hard if I worked straight on shard manager. Anyways, there's the addresses...
[RELEASE] Console Commands for Lame Console Look 12/07/2011 - CO2 PServer Guides & Releases - 12 Replies Well, to avoid any further useless posts on this subject... here are a ton of console based commands that will control the game from the server console. I will not explain what each does, it should be pretty easy to figure out, and I don't intend to answer stupid questions. If its a good question, I will answer it.
public static void DoStuff()
{
bool flag = true;
Console.Clear();
Console.ForegroundColor = ConsoleColor.Red;
...
Customizing GM Commands 02/16/2010 - Dekaron Private Server - 9 Replies Hey i was wondering if anyone knows how to mod
The GM Commands in the database, i know how to in the .exe,
but it can be easily bypass using another .exe so yea.
My question,
How to delete certain GM commands ?