Post Pacific

Post Pacific (https://postpacific.loc-online.com/index.php)
-   Темы без сохранившегося раздела (https://postpacific.loc-online.com/forumdisplay.php?f=10001)
-   -   [Help]Disable shout and trade from macro (https://postpacific.loc-online.com/showthread.php?t=5840)

deathor 24.09.2006 15:33

[Help]Disable shout and trade from macro
 
People spam macros in towns a lot, so I just want to disable the usage of ! or + in front of the macro commands. Any suggestions? :)

poltomb 24.09.2006 16:21

would need research into the client...and hex, hex, hex

FidoW 24.09.2006 16:50

-- Deleted --

poltomb 24.09.2006 19:55

i didnt even think about trying it db side...that looks like what needs to be done.. nice fidow

deathor 25.09.2006 02:19

very nice info! I was messing around with stored procedures but couldn't find a way to add a check. If I do it I'll post it. But if someone knows, let us know:)

top-gear 25.09.2006 03:53

procedure for macroinfo is

Code:

ALTER PROCEDURE [dbo].[lin_CreateMacroInfo]
(
@macro_id                int,
@macro_order                int,
@macro_int1                int,
@macro_int2                int,
@macro_int3                int,
@macro_str                nvarchar(255)
)
AS
SET NOCOUNT ON

if ( exists ( select * from user_macro where macro_id = @macro_id ) )
begin
        if ( exists ( select * from user_macroinfo where macro_id = @macro_id and macro_order = @macro_order ) )
        begin
                update user_macroinfo set macro_int1 = @macro_int1, macro_int2 = @macro_int2, macro_int3 = @macro_int3 where macro_id = @macro_id and macro_order = @macro_order

        end else begin
                insert into user_macroinfo ( macro_id, macro_order, macro_int1, macro_int2, macro_int3, macro_str )
                values ( @macro_id, @macro_order, @macro_int1, @macro_int2, @macro_int3, @macro_str )
        end

end

couldnt make it check for ! or + on creation either

FidoW 25.09.2006 03:58

Im not an expert in SQL.. but.. maybe something like this..
please, someone correct me if i am wrong, i dont know if this is possible... and if this works...

IF @macro_str LIKE '!%'
BEGIN
RAISERROR ('Not allowed macro : name = [%s]', 16, 1, @macro_str)
RETURN -1
END

IF @macro_str LIKE '+%'
BEGIN
RAISERROR ('Not allowed macro : name = [%s]', 16, 1, @macro_str)
RETURN -1
END

top-gear 25.09.2006 14:04

nice fidow, this is something good! ill test and tell u

wton 30.09.2006 12:18

hi,
work o no work...?

fidow, te agradeceria si me dices si funciono o no tu explicacion, gracias :D

FidoW 30.09.2006 12:26

I dont know, i dont test that, but i was thinking, when a macro is inserted in db first is inserted in user_macro table.. later in user_macroinfo ... with my mod maybe we can have some problems in user_macroinfo table... macros created but without data... or something like that... and.. i dont know if game reject creation of macro ... i think... if this works... macro is created at least temporaly (is cached)... when you restart server macro disaper.

wton 30.09.2006 12:41

ok gracias por la info ^^

thanks for info...


All times are GMT. The time now is 15:27.