GM commands such as /ban

02/01/2011 04:11 (Saomi)#16
It is fixable from my understanding of it, its just disabled by default I guess.

I would find this sort of thing very useful on spando.. If i find fix I'll gladly share it.
02/01/2011 23:13 Bаne#17
Quote:
Originally Posted by (Saomi) View Post
It is fixable from my understanding of it, its just disabled by default I guess.

I would find this sort of thing very useful on spando.. If i find fix I'll gladly share it.
Intresting, mabey a dev team is needed XD
02/02/2011 14:03 Danco1990#18
This command is easy to emulate. Remember the EP7 admin trigger? Reverse engineer that ;). Im not releasing how i did it, but you can use a trigger, get your chatlogs working!
02/02/2011 22:47 Bаne#19
Quote:
Originally Posted by Danco1990 View Post
This command is easy to emulate. Remember the EP7 admin trigger? Reverse engineer that ;). Im not releasing how i did it, but you can use a trigger, get your chatlogs working!

TY can't belive i did not think of that!!!
02/02/2011 23:19 [GM]Father#20
Quote:
Originally Posted by Danco1990 View Post
This command is easy to emulate. Remember the EP7 admin trigger? Reverse engineer that ;). Im not releasing how i did it, but you can use a trigger, get your chatlogs working!
Are you verifying that the command came from a GM account?
Could be really dangerous if you are not.
02/03/2011 10:17 Danco1990#21
Ofcourse, compile it to do an inner join to check the Users_master, quite easy lol...
02/03/2011 13:30 zargon05#22
Here is a basic layout of how I achieved it. I didn't completely test it this but it should work.
Code:
USE [PS_Chatlog]
GO
/****** Object:  Trigger [dbo].[Commands]    Script Date: 02/03/2011 17:57:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[Commands]
ON [PS_Chatlog].[dbo].[ChatLog]
FOR INSERT
AS

DECLARE
@ChatData varchar(50),
@UserUID varchar(10),
@cmd varchar(10),
@char varchar(20),
@user varchar(20),
@auth smallint

SELECT @ChatData= ChatData from inserted
SELECT @UserUID=UserUID FROM inserted
SET @cmd = substring(@chatdata,1,3)
SET @char = substring(@chatdata,5,20)
SELECT @auth=Status FROM PS_UserData.dbo.Users_Master WHERE @UserUID=UserUID

IF (@auth = 16)
BEGIN
	IF (@cmd='ban')
	BEGIN
		SELECT @user=UserID FROM PS_GameData.dbo.Chars WHERE Charname=@char
		UPDATE ps_userdata.dbo.users_master
		SET status=-5
		WHERE userid=@user
	END	
END
02/03/2011 14:05 Alladrios#23
Working like a charm, thank you Zargon.

PS: I tried /ban Playername and got DCd (wich is normal) to get it to work just type in normal chat ban playername.
02/04/2011 01:02 Bаne#24
TY ZARAGON!!111
02/04/2011 12:34 Danco1990#25
I advice to use \ban instead of the normal /. This reduces the chance of incidental banning... rofl. Where is my credit for the tip Q.Q xD.
02/04/2011 13:55 zargon05#26
It works on anychat ^^
02/04/2011 13:59 Alladrios#27
aw that's nice indeed, so you can just type it in a notice like "Stat padding is not allowed, ban playername" lmao and then the player is done after a lil /kick :)

Do you think it would be possible to edit that trigger to make it find the from the charname then userid then the IP and make it ban all the accounts related to it right away?
02/04/2011 14:02 zargon05#28
Quote:
aw that's nice indeed, so you can just type it in a notice like "Stat padding is not allowed, ban playername" lmao and then the player is done.
Since it's only a basic layout what you suggest there won't work. It has to be "ban charname" as the only text in the chat.
Quote:
Do you think it would be possible to edit that trigger to make it find the from the charname then userid then the IP and make it ban all the accounts related to it right away?
Yes it is possible
02/08/2011 03:24 Bаne#29
Edit to the code:
USE [PS_Chatlog]
GO
/****** Object: Trigger [dbo].[Commands] Script Date: 02/03/2011 17:57:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[Commands]
ON [PS_Chatlog].[dbo].[ChatLog]
FOR INSERT
AS

DECLARE
@ChatData varchar(50),
@UserUID varchar(10),
@cmd varchar(10),
@char varchar(20),
@user varchar(20),
@auth smallint

SELECT @ChatData= ChatData from inserted
SELECT @UserUID=UserUID FROM inserted
SET @cmd = substring(@chatdata,1,3)
SET @char = substring(@chatdata,5,20)
SELECT @auth=Status FROM PS_UserData.dbo.Users_Master WHERE @UserUID=UserUID

IF (@auth = 16)
BEGIN
IF (@cmd='\ban')
BEGIN
SELECT @user=UserID FROM PS_GameData.dbo.Chars WHERE Charname=@char
UPDATE ps_userdata.dbo.users_master
SET status=-5
WHERE userid=@user
END
END

Made it \ban rather then just ban
02/08/2011 14:01 zargon05#30
I am working on a new version which is must more robust :). Release soon...