Basic useful querys I did a few years ago to add gamepoint and items to the user via email or gamertag.
|
Add GamePoints by GamerTag
Spoiler:
PHP Code:
declare @in_CustomerID int;
declare @in_Gamertag nvarchar(64);
declare @in_GamePoints int;
SET @in_Gamertag = 'Yuri-BR'; -- Gamertag
SET @in_GamePoints = 1000; -- GamePoints
SELECT @in_CustomerID = CustomerID FROM UsersChars WHERE Gamertag = @in_Gamertag;
UPDATE UsersData SET GamePoints = (GamePoints + @in_GamePoints) WHERE CustomerID = @in_CustomerID;
|
Add GamePoints by Email
Spoiler:
PHP Code:
declare @in_CustomerID int;
declare @in_Email varchar(128);
declare @in_GamePoints int;
SET @in_Email = 'Yuri-BR@email.com'; -- Email
SET @in_GamePoints = 1000; -- GamePoints
SELECT @in_CustomerID = CustomerID FROM Accounts WHERE email = @in_Email;
UPDATE UsersData SET GamePoints = (GamePoints + @in_GamePoints) WHERE CustomerID = @in_CustomerID;
|
Add Item by GamerTag
Spoiler:
PHP Code:
declare @in_CustomerID int;
declare @in_Gamertag nvarchar(64);
declare @in_ItemID int;
declare @in_Quantity int;
SET @in_Gamertag = 'Yuri-BR'; -- Gamertag
SET @in_ItemID = 101088; -- ItemID
SET @in_Quantity = 5; -- Quantity
SELECT @in_CustomerID = CustomerID FROM UsersChars WHERE Gamertag = @in_Gamertag;
INSERT INTO UsersInventory (CustomerID, CharID, BackpackSlot, ItemID, LeasedUntil, Quantity, Var1, Var2, Var3)
VALUES (@in_CustomerID, 0, 0, @in_ItemID, GETDATE(), @in_Quantity, -1, -1, 10000);
|
Add Item by Email
Spoiler:
PHP Code:
declare @in_CustomerID int;
declare @in_Email varchar(128);
declare @in_ItemID int;
declare @in_Quantity int;
SET @in_Email = 'Yuri-BR@email.com'; -- Email
SET @in_ItemID = 101088; -- ItemID
SET @in_Quantity = 5; -- Quantity
SELECT @in_CustomerID = CustomerID FROM Accounts WHERE email = @in_Email;
INSERT INTO UsersInventory (CustomerID, CharID, BackpackSlot, ItemID, LeasedUntil, Quantity, Var1, Var2, Var3)
VALUES (@in_CustomerID, 0, 0, @in_ItemID, GETDATE(), @in_Quantity, -1, -1, 10000);
|