|
You last visited: Today at 05:14
Advertisement
How to send items to all accounts.Rohan
Discussion on How to send items to all accounts.Rohan within the Rohan forum part of the MMORPGs category.
01/09/2014, 10:35
|
#1
|
elite*gold: 0
Join Date: Mar 2010
Posts: 42
Received Thanks: 1
|
How to send items to all accounts.Rohan
Hi how can i send items directly to there event or item mall inventory? please need some help .
|
|
|
01/09/2014, 10:53
|
#2
|
elite*gold: 0
Join Date: Nov 2008
Posts: 196
Received Thanks: 20
|
You have to create SQL statement which loops adding value to Rohangame .dbo. TEventItem for every user
|
|
|
01/09/2014, 13:13
|
#3
|
elite*gold: 33
Join Date: Jan 2011
Posts: 2,693
Received Thanks: 456
|
Quote:
Originally Posted by exstrike1234
Hi how can i send items directly to there event or item mall inventory? please need some help .
|
GO
DECLARE @a Integer = 100
DECLARE @i Integer
SELECT @i = COUNT(id) FROM dbo.TCharacter
SET @i = @i + 100
WHILE (@a < @i)
BEGIN
INSERT INTO dbo.TEventItem (type, attr, stack, rank, equip_level, equip_dexterity, equip_intelligence, equip_strength, char_id) VALUES (0, 0, 0, 0, 0, 0, 0, 0, @a)
SET @a = @a + 1
END
Just change the 100 to your the first Char ID on your DB from dbo.TCharacter. It will count every Char on the Server and send it to Event Inventar.
|
|
|
01/09/2014, 14:35
|
#4
|
elite*gold: 0
Join Date: May 2009
Posts: 697
Received Thanks: 249
|
That's what Dr.Dr.SheldonLeeCooper Said is right. I did a little differently. Why? Simple no one will have access to the server. Only I.
I made a simple program in Java that logs on the server and gives you the options for those who send or even send to all.
An easy way is also using php, makes an Administrator page with the script does a FOREACH only for the ID_CHAR and within that FOR Insert SQL.
Each has a way I prefer more security
|
|
|
01/09/2014, 15:29
|
#5
|
elite*gold: 0
Join Date: Feb 2011
Posts: 333
Received Thanks: 111
|
It's a bit more elegant this way
Code:
INSERT INTO [RohanGame].[dbo].[TEventItem] SELECT
1 -- [type]
,0x00 -- attr
,1 -- stack
,1 -- rank
,1 -- equip level
,1 -- str
,1 -- dex
,1 -- int
,id -- char id
, GETDATE() -- date
FROM RohanGame.dbo.TCharacter
|
|
|
01/09/2014, 16:35
|
#6
|
elite*gold: 0
Join Date: May 2009
Posts: 697
Received Thanks: 249
|
Quote:
Originally Posted by zzerachiel
It's a bit more elegant this way
|
The only difference is that zzerachiel your code does not loop. Inserts one record at a time.
And as the question was to send items to all the accounts. Better place with Loop.
Code:
GO
DECLARE @a Integer = 100
DECLARE @i Integer
SELECT @i = COUNT(id) FROM dbo.TCharacter
SET @i = @i + 100
WHILE (@a < @i)
BEGIN
INSERT INTO dbo.TEventItem (type, attr, stack, rank, equip_level, equip_dexterity, equip_intelligence, equip_strength, char_id)
VALUES (0, 0, 0, 0, 0, 0, 0, 0, @a)
SET @a = @a + 1
END
|
|
|
01/09/2014, 17:04
|
#7
|
elite*gold: 0
Join Date: Feb 2011
Posts: 333
Received Thanks: 111
|
Since when looping a few thousand times is better than adding all of them at once?
Not to mention that with my code you don't need to know the starting character id, nor the end.
What would your code do if there are gaps in the character_id?
I mean, it's nice that you managed to get a one line statement and turn it into 10 lines, while loosing performance.
|
|
|
01/09/2014, 17:24
|
#8
|
elite*gold: 0
Join Date: May 2009
Posts: 697
Received Thanks: 249
|
Quote:
Originally Posted by zzerachiel
Since when looping a few thousand times is better than adding all of them at once?
Not to mention that with my code you don't need to know the starting character id, nor the end.
What would your code do if there are gaps in the character_id?
I mean, it's nice that you managed to get a one line statement and turn it into 10 lines, while loosing performance.
|
You're right with the Loop loses a bit of performance.
But I replied the post with the Loop because unfortunately I couldn't run your code. may be I missed something. But it's not working for me
|
|
|
01/09/2014, 17:40
|
#9
|
elite*gold: 0
Join Date: Feb 2011
Posts: 333
Received Thanks: 111
|
Works.
All i said is that my code is a bit more elegant.
|
|
|
01/09/2014, 17:55
|
#10
|
elite*gold: 0
Join Date: May 2009
Posts: 697
Received Thanks: 249
|
Perfect!
But it's not working for me! -_-
|
|
|
01/09/2014, 19:29
|
#11
|
elite*gold: 0
Join Date: Feb 2011
Posts: 333
Received Thanks: 111
|
If you edited TEventItem structure, it won't work
|
|
|
01/09/2014, 21:24
|
#12
|
elite*gold: 0
Join Date: May 2009
Posts: 697
Received Thanks: 249
|
Something in my SQL Server was blocking I have a paid version ... installed some additional patch's dai stopped working the sql scripts. but now it's working is bug.
|
|
|
01/10/2014, 05:50
|
#13
|
elite*gold: 0
Join Date: Jul 2013
Posts: 79
Received Thanks: 51
|
Quote:
Originally Posted by zzerachiel
Works.
All i said is that my code is a bit more elegant.
|
omg!! what hell is that of pict .. seem i need re-school to understand it
|
|
|
01/10/2014, 06:07
|
#14
|
elite*gold: 0
Join Date: May 2009
Posts: 697
Received Thanks: 249
|
Quote:
Originally Posted by moviper
omg!! what hell is that of pict .. seem i need re-school to understand it 
|
is a SQL script to insert items in EventInventory.
|
|
|
06/06/2014, 19:19
|
#15
|
elite*gold: 0
Join Date: Mar 2013
Posts: 34
Received Thanks: 5
|
Quote:
Originally Posted by zzerachiel
It's a bit more elegant this way
Code:
INSERT INTO [RohanGame].[dbo].[TEventItem] SELECT
1 -- [type]
,0x00 -- attr
,1 -- stack
,1 -- rank
,1 -- equip level
,1 -- str
,1 -- dex
,1 -- int
,id -- char id
, GETDATE() -- date
FROM RohanGame.dbo.TCharacter
|
How to send it if certain players?
|
|
|
All times are GMT +1. The time now is 05:15.
|
|