Register for your free account! | Forgot your password?

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

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

Advertisement



Help about console log in c#

Discussion on Help about console log in c# within the SRO Coding Corner forum part of the Silkroad Online category.

Reply
 
Old   #1
 
HatersDAD's Avatar
 
elite*gold: 0
Join Date: Jan 2018
Posts: 11
Received Thanks: 1
Help about console log in c#

hello best community!,
i wanna make log to table in db.
example: if gm drop item, my filter log it in db (Charname,Code,Date).
any help pls!
thanks.
HatersDAD is offline  
Old 01/03/2018, 05:54   #2

 
KingDollar's Avatar
 
elite*gold: 1117
Join Date: Dec 2013
Posts: 858
Received Thanks: 806
then you should create sql table first
Code:
create table _GM_Log (Charname varchar(64),Command varchar(50),Date Datetime)
after you will have to parse 7010 packet which is gm command packet

this enum would help you
it doesn't have the all commands but that what i have parsed, you can parse more if you need just use any packet analyzer, send command , check what byte you received
Code:
public enum GameCommands : byte
{
    FindUser = 1,
    GoTown = 2,
    ToTown = 3,
    WorldStatus = 4,
    LoadMonster = 6,
    MakeItem = 7,
    MoveToUser = 8,
    WP = 10,
    Zoe = 12,
    Ban = 13,
    Invisible = 14,
    Invincible = 15,
    Recalluser = 17,
    Recallguild = 18,
    Liename = 19,
    Mobkill = 20,
    resetq = 28,
    Movetonpc = 31,
    Makerentitem = 38,
    Spawnunique_loc = 42
}
now let's parse the packet it self
Code:
byte action = pck.ReadUInt8();
GameCommands commandsEnum = (GameCommands)action;
string commandName = commandsEnum.ToString();

//exceute your sqlfunction with parsed paramters and charname
KingDollar is offline  
Thanks
1 User
Old 01/03/2018, 18:10   #3
 
HatersDAD's Avatar
 
elite*gold: 0
Join Date: Jan 2018
Posts: 11
Received Thanks: 1
Quote:
Originally Posted by KingDollar View Post
then you should create sql table first
Code:
create table _GM_Log (Charname varchar(64),Command varchar(50),Date Datetime)
after you will have to parse 7010 packet which is gm command packet

this enum would help you
it doesn't have the all commands but that what i have parsed, you can parse more if you need just use any packet analyzer, send command , check what byte you received
Code:
public enum GameCommands : byte
{
    FindUser = 1,
    GoTown = 2,
    ToTown = 3,
    WorldStatus = 4,
    LoadMonster = 6,
    MakeItem = 7,
    MoveToUser = 8,
    WP = 10,
    Zoe = 12,
    Ban = 13,
    Invisible = 14,
    Invincible = 15,
    Recalluser = 17,
    Recallguild = 18,
    Liename = 19,
    Mobkill = 20,
    resetq = 28,
    Movetonpc = 31,
    Makerentitem = 38,
    Spawnunique_loc = 42
}
now let's parse the packet it self
Code:
byte action = pck.ReadUInt8();
GameCommands commandsEnum = (GameCommands)action;
string commandName = commandsEnum.ToString();

//exceute your sqlfunction with parsed paramters and charname
Thanks my hero

Quote:
Originally Posted by KingDollar View Post
then you should create sql table first
Code:
create table _GM_Log (Charname varchar(64),Command varchar(50),Date Datetime)
after you will have to parse 7010 packet which is gm command packet

this enum would help you
it doesn't have the all commands but that what i have parsed, you can parse more if you need just use any packet analyzer, send command , check what byte you received
Code:
public enum GameCommands : byte
{
    FindUser = 1,
    GoTown = 2,
    ToTown = 3,
    WorldStatus = 4,
    LoadMonster = 6,
    MakeItem = 7,
    MoveToUser = 8,
    WP = 10,
    Zoe = 12,
    Ban = 13,
    Invisible = 14,
    Invincible = 15,
    Recalluser = 17,
    Recallguild = 18,
    Liename = 19,
    Mobkill = 20,
    resetq = 28,
    Movetonpc = 31,
    Makerentitem = 38,
    Spawnunique_loc = 42
}
now let's parse the packet it self
Code:
byte action = pck.ReadUInt8();
GameCommands commandsEnum = (GameCommands)action;
string commandName = commandsEnum.ToString();

//exceute your sqlfunction with parsed paramters and charname
hello best, thats save only command name i want to save command who is typed like if he type (/makeitem item_scroll_01) thats save in table (charname,item_scroll_01,date). thanks in advance.
HatersDAD is offline  
Old 01/04/2018, 14:18   #4

 
KingDollar's Avatar
 
elite*gold: 1117
Join Date: Dec 2013
Posts: 858
Received Thanks: 806
it depends then on action
as example if make item
Code:
if(commandsEnum == GameCommands.MakeItem)
{
 uint itemid = pck.ReadUint32();
 byte itemplus = pck.ReadUint8();
}
KingDollar is offline  
Old 01/04/2018, 17:51   #5
 
HatersDAD's Avatar
 
elite*gold: 0
Join Date: Jan 2018
Posts: 11
Received Thanks: 1
Quote:
Originally Posted by KingDollar View Post
it depends then on action
as example if make item
Code:
if(commandsEnum == GameCommands.MakeItem)
{
 uint itemid = pck.ReadUint32();
 byte itemplus = pck.ReadUint8();
}
thank you my hero.
HatersDAD is offline  
Reply


Similar Threads Similar Threads
WTS New PS4 Console 500GB..$400..Xbox One Console...$400
10/21/2021 - Consoles Trading - 1 Replies
Shipping We ship using USPS or UPS We ship within 3 business day from receipt of payment. We do not change your shipping address by email. Please make sure your address is correct before checking out and making payment.on our website We do ship to APO, FPO, Post Office box addresses. We do ship to worldwide its free Support With any question regarding our items please do not hesitate to message us and we will be happy to answer and assist you.
Wie stellt man die Console ein oder für was ist die console genau?
02/10/2013 - Rappelz Private Server - 3 Replies
Hallo und zwar wollte ich fragen was die Console Genau ist, und wie man diese dann Richtig einstellen tut. Wäre sehr nett wen ihr mir dabei Helfen könnt. Google und suche hier bei epvp haben bis jetzt nicht´s gefunden. Falls es euch hilft ich habe 7.3 Files Auth, Ubload, und Gameserver Funktionieren Einwandfrei.
[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; ...



All times are GMT +1. The time now is 16:25.


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.