decomp DBCServer_Release and inspect/document database

This commit is contained in:
Benjamin Palko 2026-10-14 23:22:03 -04:00
parent 4b267cbe05
commit 7834b98bf0
28222 changed files with 843300 additions and 144 deletions

View file

@ -0,0 +1,42 @@
CREATE PROCEDURE [dbo].[SetCurrency]
@UserId varchar(50),
@ServerId int,
@NewBalance int
AS
BEGIN
SET NOCOUNT ON
DECLARE @Result varchar(20)
DECLARE @Zen int;
BEGIN TRY
BEGIN TRANSACTION
-- Check if entry with given UserId and ServerId exists
SELECT @Zen = Zen FROM CashTable
WHERE WindyCode = @UserId AND WorldId = @ServerId;
IF @@ROWCOUNT > 0 -- entry exists
BEGIN
UPDATE CashTable SET Zen = @NewBalance
WHERE WindyCode = @UserId AND WorldId = @ServerId;
SET @Zen = @NewBalance;
SET @Result = 'Success';
END
ELSE -- entry does not exist
BEGIN
SET @Result = 'Failed';
END;
COMMIT TRANSACTION;
END TRY
BEGIN CATCH
ROLLBACK TRANSACTION;
SET @Result = 'TransactionFailed';
END CATCH
SELECT @Result as Result, @Zen as Zen;
END