[Release] Anti Dupe Locked Warehouse

Mortred

Active Member
Joined
Jun 11, 2008
Messages
647
Reaction score
182
Code:
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[trg_CheckSameID]') and OBJECTPROPERTY(id, N'IsTrigger') = 1)
drop trigger [dbo].[trg_CheckSameID]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[AllItemsLog]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[AllItemsLog]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[CopyLog]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[CopyLog]
GO

CREATE TABLE [dbo].[AllItemsLog] (
[items_id] [int] IDENTITY (1, 1) NOT NULL ,
[items_type] [binary] (1) NOT NULL ,
[items_serial] [binary] (4) NOT NULL ,
[items_acid] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[CopyLog] (
[copy_id] [int] IDENTITY (1, 1) NOT NULL ,
[copy_acid] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[copy_whdata] [binary] (1200) NOT NULL ,
[copy_date] [datetime] NOT NULL
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[AllItemsLog] ADD
CONSTRAINT [DF_CT_ITEM_item] DEFAULT (0) FOR [items_type],
CONSTRAINT [DF_CT_ITEM_itemid] DEFAULT (0) FOR [items_serial],
CONSTRAINT [DF_CT_ITEM_itemrole] DEFAULT ('\') FOR [items_acid]
GO

CREATE INDEX [IX_CT_ITEM] ON [dbo].[AllItemsLog]([items_type], [items_serial]) ON [PRIMARY]
GO

ALTER TABLE [dbo].[CopyLog] ADD
CONSTRAINT [DF_CopyLog_copy_date] DEFAULT (getdate()) FOR [copy_date]
GO


SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO

CREATE TRIGGER [dbo].[trg_CheckSameID] ON [dbo].[character]
FOR UPDATE
AS
BEGIN
IF UPDATE(inventory)
BEGIN
SET NOCOUNT ON
DECLARE
@wh_acid varchar(10),
@wh_data binary(1200),
@wh_type binary(1),
@wh_serial binary(4),

@cr_user varchar(10),
@cr_acid varchar(10),
@cr_data binary(760),
@cr_type binary(1),
@cr_serial binary(4),

@al_acid varchar(10),
@j int,
@k int,
@find bit

SELECT @cr_acid=i.accountid,
@cr_data=i.inventory
FROM inserted i

SET @j=0
SET @find=0

WHILE @j<76 AND @cr_data IS NOT NULL
BEGIN
SET @cr_type=SUBSTRING(@cr_data,@j*10+1,1)
SET @cr_serial=SUBSTRING(@cr_data,@j*10+4,4)
IF @cr_type<>0xFF AND @cr_serial<>0x00000000
BEGIN
SELECT @al_acid=items_acid FROM allitemslog WHERE items_type=@cr_type AND items_serial=@cr_serial


IF @al_acid IS NULL
INSERT INTO allitemslog (items_type,items_serial,items_acid) VALUES (@cr_type,@cr_serial,@cr_acid)
ELSE
BEGIN
UPDATE allitemslog SET items_acid=@cr_acid WHERE items_type=@cr_type AND items_serial=@cr_serial


SELECT @wh_data=items FROM warehouse WHERE accountid=@al_acid

SET @k=0
WHILE @k<120 AND @wh_data IS NOT NULL
BEGIN
SET @wh_type=SUBSTRING(@wh_data,@k*10+1,1)
SET @wh_serial=SUBSTRING(@wh_data,@k*10+4,4)
IF @wh_type=@cr_type AND @wh_serial=@cr_serial
SET @find=1
SET @k=@k+1
END
END
END
SET @j=@j+1
END
IF @find=1
BEGIN
INSERT INTO copylog (copy_whdata,copy_acid,copy_date) VALUES (@wh_data,@al_acid,getdate())
-- this is wer u can add more punishment like ban or lock characters
UPDATE warehouse SET pw=5555,items=null WHERE accountid=@al_acid
END
SET NOCOUNT OFF
END
END


GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO

Code:
use muonline
select * from copylog

Това е да видиш кой дупи итеми

Code:
delete from warehouse where pw='5555'
delete from wharehouse where accountid='acc_tuk'

Unlock warehouse


Тествано е на 99b+ и 1.0n но не мисля че ще има проблем и при другите версий
ВЕСЕЛИ ПРАЗНИЦИ НА ВСИЧКИ !

.:: UPDATE ::.
Ето ви един simple модул който направих
table.jpg


1.Слагаме тоя файл data.php в главната директория на уеба
Code:
<?
//Edit this
$IP="127.0.0.1"; //IP
$user="sa"; //defaut sql user "sa"
$pwd ="pwd"; //sql password


//Don't tuch this
$connect=mssql_connect('$IP','$user','$pwd') ;
$db=mssql_select_db('MuOnline','$connect');

?>

2.Ето го и самия модул
Code:
<center>
<?php
require 'data.php';

$accounts=mssql_query("SELECT * From CopyLog");
	
echo "<TABLE border=1>
<tr>
<th border='1' bordercolor='black'  style='border-collapse: collapse; border: 1px solid black' align=center><font size=1 color=#999999><font size=1> # </td>
<th border='1' bordercolor='black'  style='border-collapse: collapse; border: 1px solid black' align=center><font size=1 color=#999999><font size=1> Account </td>
<th border='1' bordercolor='black'  style='border-collapse: collapse; border: 1px solid black' align=center><font size=1 color=#999999><font size=1> Date </td>
</tr>";
while($row = mssql_fetch_array($accounts))
  {
  echo "<tr>";
  echo "<td border='1' bordercolor='black'  style='border-collapse: collapse; border: 1px solid black' align=center><font size=1 color=#999999><font size=1>" . $row['copy_id'] . "</td>";
  echo "<td border='1' bordercolor='black'  style='border-collapse: collapse; border: 1px solid black' align=center><font size=1 color=#999999><font size=1>" . $row['copy_acid'] . "</td>";
  echo "<td border='1' bordercolor='black'  style='border-collapse: collapse; border: 1px solid black' align=center><font size=1 color=#999999><font size=1>" . $row['copy_date'] . "</td>";
  echo "</tr>";
  }
echo "</table>";

?>
</center>

.: UPDATE 2 :.
ЕТО ВИ СМС СКРИПТ ЗА МОБИО АВТОМАТИЧНО СЛЕД ИЗПРАЩАНЕТО НА СМС-А ДА ОТВАРЯ САНДЪКА
-Тестван е и работи!!
Code:
<?PHP

$item = $_REQUEST["item"];
$fromnum = $_REQUEST["fromnum"];
$extid = $_REQUEST["extid"];

$mobio_remote_addr = "194.12.244.114";
$servID = $_REQUEST["servID"];

$db_serv = '127.0.0.1';
$db_user = 'sa';
$db_pass = 'sql pass';
$db_name = 'MuOnline';

if($_SERVER['REMOTE_ADDR'] == $mobio_remote_addr) {

        $sms_reply = 'Greshka.Spazvaite tochno instrukciite.';
        $conn = mssql_connect($db_serv, $db_user, $db_pass);
        if($conn) {
                mssql_select_db($db_name);
                $res = mssql_query("SELECT  AccountID,pw FROM warehouse WHERE AccountID='$item'");
                if(mssql_num_rows($res)>0) {
                        mssql_query("UPDATE warehouse SET pw='0',lastpw='0' WHERE AccountID='$item'");

                        $sms_reply = "Your warehouse is unlocked";
                }

        }
        file("http://mobio.bg/paynotify/pnsendsms.php?servID=$servID&tonum=$fromnum&extid= $extid&message=".urlencode($sms_reply));
}


?>
 
Last edited:
някакви бъгове има ли тоя скрипт?
EDIT: и след като дупят веднага ли ги банва?
 
не ги банва а им локва сандъка
 
а веднага ли изтрива предметите? че нещо ползват хак в сървъра и това ме дразни...
 
немогат да си отворят сандъка веднага след като дупят
 
тия направо си аддват предмети и статс а уш има firewall и портовете са затворени...
 
от там може да се аддне статс и предмети?
 
статс да и могат да ти направят много мизерйй
 
при мене си работи перфекно не знам какво правите вие..
 
За смс-а ли?

PHP:
file("http://mobio.bg/paynotify/pnsendsms.php?servID=$servID&tonum=$fromnum&extid= $extid&message=".urlencode($sms_reply));

променете с

PHP:
file("http://mobio.bg/paynotify/pnsendsms.php?servID=$servID&tonum=$fromnum&extid=$extid&message=".urlencode($sms_reply));