[Help] WZ_Char_SRV_SetStatus and @in_MapID - DC

Results 1 to 19 of 19
  1. #1
    Apprentice xAgentXx is offline
    MemberRank
    Jan 2014 Join Date
    24Posts

    [Help] WZ_Char_SRV_SetStatus and @in_MapID - DC

    When i or someone try to join my gameserver we get a disconnect.
    In the Server Log we get:

    Code:
    000193.354| time: 193, plrs:0/200, net_lastFreeId: 3378, objects: 3152, async:0 0 0 0 
    000206.551| peer00 PKT_C2S_StartGameReq, playerIdx:0 startGameAns: 1, lastNetID: 1026
    000206.575| WO_API: failed with error code 5 SQL Select Failed: Procedure or function 'WZ_Char_SRV_SetStatus' expects parameter '@in_MapID', which was not supplied.
    000206.575| !!!! UpdateCharThread failed, code: 5, ans: SQL Select Failed: Procedure or function 'WZ_Char_SRV_SetStatus' expects parameter '@in_MapID', which was not supplied.
    000206.576| !!!! CAsyncApiWorker 0 job CJobUpdateChar[1000001] 122A6048 failed
    000206.584| CAsyncApiWorker 0 job CJobUpdateChar[1000001] 122A6048 failed
    000206.584| AddForcedJob CID:1000001 CJobAddLogInfo
    in the r3dlog:

    Code:
    000176.288| Loading 'Levels\WZ_FrontEndLighting\collections\collections.xml'
    000176.288| r3dFile: can't open Levels\WZ_FrontEndLighting\collections\elements.bin
    000176.288| COLLECTIONS: Could not open 'Levels\WZ_FrontEndLighting\collections\elements.bin'
    000176.288| CollectionsManager::Init: populating 0 objects... 000176.288| done in 0.00 seconds
    000176.288| World loaded
    We use the latest Codex Release.
    Sorry for the bad english.


  2. #2
    Apprentice Dtridius is offline
    MemberRank
    Dec 2016 Join Date
    21Posts

    Re: WZ_Char_SRV_SetStatus and @in_MapID - DC

    check your paste levels, maybe you deleted this map. or check you code if you change your maps.
    i am brazilian developer if you want add skype Suporte.Diogo

  3. #3
    Apprentice xAgentXx is offline
    MemberRank
    Jan 2014 Join Date
    24Posts

    Re: WZ_Char_SRV_SetStatus and @in_MapID - DC

    Quote Originally Posted by Dtridius View Post
    check your paste levels, maybe you deleted this map. or check you code if you change your maps.
    i am brazilian developer if you want add skype Suporte.Diogo
    Done, i just found that i dont have
    Levels\WZ_FrontEndLighting\collections\elements.bin
    this file...
    How i can get it?

  4. #4
    Your average Dutch guy Laenoar is offline
    MemberRank
    Apr 2013 Join Date
    The NetherlandsLocation
    384Posts

    Re: WZ_Char_SRV_SetStatus and @in_MapID - DC

    Quote Originally Posted by xAgentXx View Post
    Done, i just found that i dont have
    Levels\WZ_FrontEndLighting\collections\elements.bin
    this file...
    How i can get it?
    That doesn't matter at all and is not the cause of your crash. The elements.bin file contains data for trees. Please post the code for your WZ_Char_SRV_SetStatus stored procedure.

  5. #5
    Apprentice xAgentXx is offline
    MemberRank
    Jan 2014 Join Date
    24Posts

    Re: WZ_Char_SRV_SetStatus and @in_MapID - DC

    WZ_Char_SRV_SetStatus Code:

    Spoiler:
    Code:
    ALTER PROCEDURE [dbo].[WZ_Char_SRV_SetStatus]
        @in_CustomerID int,
        @in_CharID int,
        @in_Alive int,
        @in_GamePos varchar(256),
        @in_GameFlags int,
        @in_Health float,
        @in_Hunger float,
        @in_Thirst float,
        @in_Toxic float,
        @in_TimePlayed int,
        @in_XP int,
        @in_Reputation int,
        @in_GameDollars int,
        @in_Stat00 int,
        @in_Stat01 int,
        @in_Stat02 int,
        @in_Stat03 int,
        @in_Stat04 int,
        @in_Stat05 int,
      @in_MapID int,
        @in_ResWood int = 0,
        @in_ResStone int = 0,
        @in_ResMetal int = 0,
        @in_CharData varchar(4000) = ''
    AS
    BEGIN
        SET NOCOUNT ON;
        
        --
        -- this function should be called only by server, so we skip all validations
        --
    
        -- record last game update and update GameDollars with DELTA value
        update UsersData set GameDollars=(GameDollars+@in_GameDollars), lastgamedate=GETDATE() where CustomerID=@in_CustomerID
        
        if(@in_GameDollars > 0) begin
            insert into DBG_GDLog (RecordTime, CustomerID, CharID, GameDollars) 
                values (GETDATE(), @in_CustomerID, @in_CharID, @in_GameDollars)
        end
    
        -- update basic character data
    if @in_MapID = 2
        update UsersChars set
            GamePos=@in_GamePos,
            GameFlags=@in_GameFlags,
            Alive=@in_Alive,
            Health=@in_Health,
            Food=@in_Hunger,
            Water=@in_Thirst,
            Toxic=@in_Toxic,
            TimePlayed=@in_TimePlayed,
            LastUpdateDate=GETDATE(),
            XP=@in_XP,
            Reputation=@in_Reputation,
            Stat00=@in_Stat00,
            Stat01=@in_Stat01,
            Stat02=@in_Stat02,
            Stat03=@in_Stat03,
            Stat04=@in_Stat04,
            Stat05=@in_Stat05
        where CharID=@in_CharID
    else if @in_MapID = 3
        update UsersChars set
            GamePos2=@in_GamePos,
            GameFlags=@in_GameFlags,
            Alive=@in_Alive,
            Health=@in_Health,
            Food=@in_Hunger,
            Water=@in_Thirst,
            Toxic=@in_Toxic,
            TimePlayed=@in_TimePlayed,
            LastUpdateDate=GETDATE(),
            XP=@in_XP,
            Reputation=@in_Reputation,
            Stat00=@in_Stat00,
            Stat01=@in_Stat01,
            Stat02=@in_Stat02,
            Stat03=@in_Stat03,
            Stat04=@in_Stat04,
            Stat05=@in_Stat05
        where CharID=@in_CharID
    else if @in_MapID = 4
        update UsersChars set
            GamePos3=@in_GamePos,
            GameFlags=@in_GameFlags,
            Alive=@in_Alive,
            Health=@in_Health,
            Food=@in_Hunger,
            Water=@in_Thirst,
            Toxic=@in_Toxic,
            TimePlayed=@in_TimePlayed,
            LastUpdateDate=GETDATE(),
            XP=@in_XP,
            Reputation=@in_Reputation,
            Stat00=@in_Stat00,
            Stat01=@in_Stat01,
            Stat02=@in_Stat02,
            Stat03=@in_Stat03,
            Stat04=@in_Stat04,
            Stat05=@in_Stat05
        where CharID=@in_CharID
    else if @in_MapID = 5
        update UsersChars set
            GamePos4=@in_GamePos,
            GameFlags=@in_GameFlags,
            Alive=@in_Alive,
            Health=@in_Health,
            Food=@in_Hunger,
            Water=@in_Thirst,
            Toxic=@in_Toxic,
            TimePlayed=@in_TimePlayed,
            LastUpdateDate=GETDATE(),
            XP=@in_XP,
            Reputation=@in_Reputation,
            Stat00=@in_Stat00,
            Stat01=@in_Stat01,
            Stat02=@in_Stat02,
            Stat03=@in_Stat03,
            Stat04=@in_Stat04,
            Stat05=@in_Stat05
        where CharID=@in_CharID
    else if @in_MapID = 6
        update UsersChars set
            GamePos5=@in_GamePos,
            GameFlags=@in_GameFlags,
            Alive=@in_Alive,
            Health=@in_Health,
            Food=@in_Hunger,
            Water=@in_Thirst,
            Toxic=@in_Toxic,
            TimePlayed=@in_TimePlayed,
            LastUpdateDate=GETDATE(),
            XP=@in_XP,
            Reputation=@in_Reputation,
            Stat00=@in_Stat00,
            Stat01=@in_Stat01,
            Stat02=@in_Stat02,
            Stat03=@in_Stat03,
            Stat04=@in_Stat04,
            Stat05=@in_Stat05
        where CharID=@in_CharID
    else if @in_MapID = 7
        update UsersChars set
            GamePos6=@in_GamePos,
            GameFlags=@in_GameFlags,
            Alive=@in_Alive,
            Health=@in_Health,
            Food=@in_Hunger,
            Water=@in_Thirst,
            Toxic=@in_Toxic,
            TimePlayed=@in_TimePlayed,
            LastUpdateDate=GETDATE(),
            XP=@in_XP,
            Reputation=@in_Reputation,
            Stat00=@in_Stat00,
            Stat01=@in_Stat01,
            Stat02=@in_Stat02,
            Stat03=@in_Stat03,
            Stat04=@in_Stat04,
            Stat05=@in_Stat05
        where CharID=@in_CharID
    else if @in_MapID = 8
        update UsersChars set
            GamePos7=@in_GamePos,
        GameFlags=@in_GameFlags,
            Alive=@in_Alive,
            Health=@in_Health,
            Food=@in_Hunger,
            Water=@in_Thirst,
            Toxic=@in_Toxic,
            TimePlayed=@in_TimePlayed,
            LastUpdateDate=GETDATE(),
            XP=@in_XP,
            Reputation=@in_Reputation,
            Stat00=@in_Stat00,
            Stat01=@in_Stat01,
            Stat02=@in_Stat02,
            Stat03=@in_Stat03,
            Stat04=@in_Stat04,
            Stat05=@in_Stat05
        where CharID=@in_CharID
    else if @in_MapID = 9
        update UsersChars set
            GamePos8=@in_GamePos,
          GameFlags=@in_GameFlags,
            Alive=@in_Alive,
            Health=@in_Health,
            Food=@in_Hunger,
            Water=@in_Thirst,
            Toxic=@in_Toxic,
            TimePlayed=@in_TimePlayed,
            LastUpdateDate=GETDATE(),
            XP=@in_XP,
            Reputation=@in_Reputation,
            Stat00=@in_Stat00,
            Stat01=@in_Stat01,
            Stat02=@in_Stat02,
            Stat03=@in_Stat03,
            Stat04=@in_Stat04,
            Stat05=@in_Stat05
        where CharID=@in_CharID
    
        -- update generic character data (if provided)
        if(@in_CharData <> '')
            update UsersChars set CharData=@in_CharData where CharID=@in_CharID
    
        -- update resources    
        update UsersData set ResWood=@in_ResWood, ResStone=@in_ResStone, ResMetal=@in_ResMetal where CustomerID=@in_CustomerID
        
        if(@in_Alive = 0) begin
            update UsersChars set DeathUtcTime=GETUTCDATE() where CharID=@in_CharID
            -- set default backpack on death
            update UsersChars set BackpackID=20176, BackpackSize=12 where CharID=@in_CharID
            -- delete stuff from backpack
            delete from UsersInventory where CustomerID=@in_CustomerID and CharID=@in_CharID
    
            exec DBG_StoreApiCall 'Death', 0, @in_CustomerID, @in_CharID
        end
    
      exec WZ_UPDATE_Leaderboards @in_CustomerID
    
        select 0 as ResultCode
    END

  6. #6
    Your average Dutch guy Laenoar is offline
    MemberRank
    Apr 2013 Join Date
    The NetherlandsLocation
    384Posts

    Re: WZ_Char_SRV_SetStatus and @in_MapID - DC

    Please post the content of api_SrvCharUpdate.aspx.cs​.

  7. #7
    Apprentice xAgentXx is offline
    MemberRank
    Jan 2014 Join Date
    24Posts

    Re: WZ_Char_SRV_SetStatus and @in_MapID - DC

    api_SrvCharUpdate.aspx.cs:

    Spoiler:
    Code:
    using System;
    using System.Collections.Generic;
    using System.Collections.Specialized;
    using System.Data;
    using System.Text;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Data.SqlClient;
    
    public partial class api_SrvCharUpdate : WOApiWebPage
    {
        string CustomerID = null;
        string CharID = null;
    
        void UpdateCharStatus()
        {
            // optional parameters until next gameservers update
            int ResWood = 0;
            int ResStone = 0;
            int ResMetal = 0;
            string CharData = "";
            try
            {
                ResWood = web.GetInt("r1");
                ResStone = web.GetInt("r2");
                ResMetal = web.GetInt("r3");
                CharData = web.Param("sC");
            }
            catch {}
    
            SqlCommand sqcmd = new SqlCommand();
            sqcmd.CommandType = CommandType.StoredProcedure;
            sqcmd.CommandText = "WZ_Char_SRV_SetStatus";
            sqcmd.Parameters.AddWithValue("@in_CustomerID", CustomerID);
            sqcmd.Parameters.AddWithValue("@in_CharID", CharID);
            sqcmd.Parameters.AddWithValue("@in_Alive", web.Param("s1"));
            sqcmd.Parameters.AddWithValue("@in_GamePos", web.Param("s2"));
            sqcmd.Parameters.AddWithValue("@in_Health", web.Param("s3"));
            sqcmd.Parameters.AddWithValue("@in_Hunger", web.Param("s4"));
            sqcmd.Parameters.AddWithValue("@in_Thirst", web.Param("s5"));
            sqcmd.Parameters.AddWithValue("@in_Toxic", web.Param("s6"));
            sqcmd.Parameters.AddWithValue("@in_TimePlayed", web.Param("s7"));
            sqcmd.Parameters.AddWithValue("@in_XP", web.Param("s8"));
            sqcmd.Parameters.AddWithValue("@in_Reputation", web.Param("s9"));
            sqcmd.Parameters.AddWithValue("@in_GameFlags", web.Param("sA"));
            sqcmd.Parameters.AddWithValue("@in_GameDollars", web.Param("sB"));
            sqcmd.Parameters.AddWithValue("@in_CharData", CharData);
            sqcmd.Parameters.AddWithValue("@in_MapID", web.Param("map"));
            sqcmd.Parameters.AddWithValue("@in_ResWood", ResWood);
            sqcmd.Parameters.AddWithValue("@in_ResStone", ResStone);
            sqcmd.Parameters.AddWithValue("@in_ResMetal", ResMetal);
            // generic trackable stats
            sqcmd.Parameters.AddWithValue("@in_Stat00", web.Param("ts00"));
            sqcmd.Parameters.AddWithValue("@in_Stat01", web.Param("ts01"));
            sqcmd.Parameters.AddWithValue("@in_Stat02", web.Param("ts02"));
            sqcmd.Parameters.AddWithValue("@in_Stat03", web.Param("ts03"));
            sqcmd.Parameters.AddWithValue("@in_Stat04", web.Param("ts04"));
            sqcmd.Parameters.AddWithValue("@in_Stat05", web.Param("ts05"));
            if (!CallWOApi(sqcmd))
                return;
        }
    
        void UpdateCharBackpack()
        {
            //@TODO: make it into single transaction!
            for (int i = 0; i < 999; i++)
            {
                string BpEntry;
                try
                {
                    BpEntry = web.Param("bp" + i.ToString());
                }
                catch
                {
                    break;
                }
    
                // c++ sprintf("%d %d %d %d %d %d %d", slot, isAdding, w1.itemID, w1.quantity, w1.Var1, w1.Var2, w1.Var3);
                string[] arr = BpEntry.Split(' ');
                if (arr.Length != 7)
                    throw new ApiExitException("bad BpEntry");
    
                int Slot = Convert.ToInt32(arr[0]);
                int Op = Convert.ToInt32(arr[1]);
                int ItemID = Convert.ToInt32(arr[2]);
                int Amount = Convert.ToInt32(arr[3]);
                int Var1 = Convert.ToInt32(arr[4]);
                int Var2 = Convert.ToInt32(arr[5]);
                int Var3 = Convert.ToInt32(arr[6]);
    
                string cmd = "";
                switch (Op)
                {
                    default: 
                        throw new ApiExitException("bad op");
                    case 0: // add
                        cmd = "WZ_Backpack_SRV_AddItem";
                        break;
                    case 1: // alter
                        cmd = "WZ_Backpack_SRV_AlterItem";
                        break;
                    case 2: // delete
                        cmd = "WZ_Backpack_SRV_DeleteItem";
                        break;
                }
    
                SqlCommand sqcmd = new SqlCommand();
                sqcmd.CommandType = CommandType.StoredProcedure;
                sqcmd.CommandText = cmd;
                sqcmd.Parameters.AddWithValue("@in_CustomerID", CustomerID);
                sqcmd.Parameters.AddWithValue("@in_CharID", CharID);
                sqcmd.Parameters.AddWithValue("@in_Slot", Slot);
                sqcmd.Parameters.AddWithValue("@in_ItemID", ItemID);
                sqcmd.Parameters.AddWithValue("@in_Amount", Amount);
                sqcmd.Parameters.AddWithValue("@in_Var1", Var1);
                sqcmd.Parameters.AddWithValue("@in_Var2", Var2);
                sqcmd.Parameters.AddWithValue("@in_Var3", Var3);
    
                if (!CallWOApi(sqcmd))
                    return;
            }
        }
    
        void UpdateCharAttachments()
        {
            string attm1 = web.Param("attm1");
            string attm2 = web.Param("attm2");
    
            SqlCommand sqcmd = new SqlCommand();
            sqcmd.CommandType = CommandType.StoredProcedure;
            sqcmd.CommandText = "WZ_Char_SRV_SetAttachments";
            sqcmd.Parameters.AddWithValue("@in_CustomerID", CustomerID);
            sqcmd.Parameters.AddWithValue("@in_CharID", CharID);
            sqcmd.Parameters.AddWithValue("@in_Attm1", attm1);
            sqcmd.Parameters.AddWithValue("@in_Attm2", attm2);
    
            if (!CallWOApi(sqcmd))
                return;
        }
    
        protected override void Execute()
        {
            // we still need to check login credentials in case of double login from other computer
            if (!WoCheckLoginSession())
                return;
    
            string skey1 = web.Param("skey1");
            if (skey1 != SERVER_API_KEY)
                throw new ApiExitException("bad key");
    
            CustomerID = web.CustomerID();
            CharID = web.Param("CharID");
    
            UpdateCharStatus();
            UpdateCharBackpack();
            UpdateCharAttachments();
    
            Response.Write("WO_0");
        }
    }

  8. #8
    Your average Dutch guy Laenoar is offline
    MemberRank
    Apr 2013 Join Date
    The NetherlandsLocation
    384Posts

    Re: WZ_Char_SRV_SetStatus and @in_MapID - DC

    Make your WZ_Char_SRV_SetStatus stored procedure look like this:
    Code:
    ALTER PROCEDURE [dbo].[WZ_Char_SRV_SetStatus]
        @in_CustomerID int,
        @in_CharID int,
        @in_Alive int,
        @in_GamePos varchar(256),
        @in_GameFlags int,
        @in_Health float,
        @in_Hunger float,
        @in_Thirst float,
        @in_Toxic float,
        @in_TimePlayed int,
        @in_XP int,
        @in_Reputation int,
        @in_GameDollars int,
        @in_Stat00 int,
        @in_Stat01 int,
        @in_Stat02 int,
        @in_Stat03 int,
        @in_Stat04 int,
        @in_Stat05 int,
        @in_ResWood int = 0,
        @in_ResStone int = 0,
        @in_ResMetal int = 0,
        @in_CharData varchar(4000) = ''
    AS
    BEGIN
        SET NOCOUNT ON;
        
        --
        -- this function should be called only by server, so we skip all validations
        --
    
        -- record last game update and update GameDollars with DELTA value
        update UsersData set GameDollars=(GameDollars+@in_GameDollars), lastgamedate=GETDATE() where CustomerID=@in_CustomerID
        
        if(@in_GameDollars > 0) begin
            insert into DBG_GDLog (RecordTime, CustomerID, CharID, GameDollars) 
                values (GETDATE(), @in_CustomerID, @in_CharID, @in_GameDollars)
        end
    
        declare @in_MapID int
        select @in_MapID=GameMapId from UsersChars where CharID=@in_CharID
    
        -- update basic character data
    if @in_MapID = 2
        update UsersChars set
            GamePos=@in_GamePos,
            GameFlags=@in_GameFlags,
            Alive=@in_Alive,
            Health=@in_Health,
            Food=@in_Hunger,
            Water=@in_Thirst,
            Toxic=@in_Toxic,
            TimePlayed=@in_TimePlayed,
            LastUpdateDate=GETDATE(),
            XP=@in_XP,
            Reputation=@in_Reputation,
            Stat00=@in_Stat00,
            Stat01=@in_Stat01,
            Stat02=@in_Stat02,
            Stat03=@in_Stat03,
            Stat04=@in_Stat04,
            Stat05=@in_Stat05
        where CharID=@in_CharID
    else if @in_MapID = 3
        update UsersChars set
            GamePos2=@in_GamePos,
            GameFlags=@in_GameFlags,
            Alive=@in_Alive,
            Health=@in_Health,
            Food=@in_Hunger,
            Water=@in_Thirst,
            Toxic=@in_Toxic,
            TimePlayed=@in_TimePlayed,
            LastUpdateDate=GETDATE(),
            XP=@in_XP,
            Reputation=@in_Reputation,
            Stat00=@in_Stat00,
            Stat01=@in_Stat01,
            Stat02=@in_Stat02,
            Stat03=@in_Stat03,
            Stat04=@in_Stat04,
            Stat05=@in_Stat05
        where CharID=@in_CharID
    else if @in_MapID = 4
        update UsersChars set
            GamePos3=@in_GamePos,
            GameFlags=@in_GameFlags,
            Alive=@in_Alive,
            Health=@in_Health,
            Food=@in_Hunger,
            Water=@in_Thirst,
            Toxic=@in_Toxic,
            TimePlayed=@in_TimePlayed,
            LastUpdateDate=GETDATE(),
            XP=@in_XP,
            Reputation=@in_Reputation,
            Stat00=@in_Stat00,
            Stat01=@in_Stat01,
            Stat02=@in_Stat02,
            Stat03=@in_Stat03,
            Stat04=@in_Stat04,
            Stat05=@in_Stat05
        where CharID=@in_CharID
    else if @in_MapID = 5
        update UsersChars set
            GamePos4=@in_GamePos,
            GameFlags=@in_GameFlags,
            Alive=@in_Alive,
            Health=@in_Health,
            Food=@in_Hunger,
            Water=@in_Thirst,
            Toxic=@in_Toxic,
            TimePlayed=@in_TimePlayed,
            LastUpdateDate=GETDATE(),
            XP=@in_XP,
            Reputation=@in_Reputation,
            Stat00=@in_Stat00,
            Stat01=@in_Stat01,
            Stat02=@in_Stat02,
            Stat03=@in_Stat03,
            Stat04=@in_Stat04,
            Stat05=@in_Stat05
        where CharID=@in_CharID
    else if @in_MapID = 6
        update UsersChars set
            GamePos5=@in_GamePos,
            GameFlags=@in_GameFlags,
            Alive=@in_Alive,
            Health=@in_Health,
            Food=@in_Hunger,
            Water=@in_Thirst,
            Toxic=@in_Toxic,
            TimePlayed=@in_TimePlayed,
            LastUpdateDate=GETDATE(),
            XP=@in_XP,
            Reputation=@in_Reputation,
            Stat00=@in_Stat00,
            Stat01=@in_Stat01,
            Stat02=@in_Stat02,
            Stat03=@in_Stat03,
            Stat04=@in_Stat04,
            Stat05=@in_Stat05
        where CharID=@in_CharID
    else if @in_MapID = 7
        update UsersChars set
            GamePos6=@in_GamePos,
            GameFlags=@in_GameFlags,
            Alive=@in_Alive,
            Health=@in_Health,
            Food=@in_Hunger,
            Water=@in_Thirst,
            Toxic=@in_Toxic,
            TimePlayed=@in_TimePlayed,
            LastUpdateDate=GETDATE(),
            XP=@in_XP,
            Reputation=@in_Reputation,
            Stat00=@in_Stat00,
            Stat01=@in_Stat01,
            Stat02=@in_Stat02,
            Stat03=@in_Stat03,
            Stat04=@in_Stat04,
            Stat05=@in_Stat05
        where CharID=@in_CharID
    else if @in_MapID = 8
        update UsersChars set
            GamePos7=@in_GamePos,
        GameFlags=@in_GameFlags,
            Alive=@in_Alive,
            Health=@in_Health,
            Food=@in_Hunger,
            Water=@in_Thirst,
            Toxic=@in_Toxic,
            TimePlayed=@in_TimePlayed,
            LastUpdateDate=GETDATE(),
            XP=@in_XP,
            Reputation=@in_Reputation,
            Stat00=@in_Stat00,
            Stat01=@in_Stat01,
            Stat02=@in_Stat02,
            Stat03=@in_Stat03,
            Stat04=@in_Stat04,
            Stat05=@in_Stat05
        where CharID=@in_CharID
    else if @in_MapID = 9
        update UsersChars set
            GamePos8=@in_GamePos,
          GameFlags=@in_GameFlags,
            Alive=@in_Alive,
            Health=@in_Health,
            Food=@in_Hunger,
            Water=@in_Thirst,
            Toxic=@in_Toxic,
            TimePlayed=@in_TimePlayed,
            LastUpdateDate=GETDATE(),
            XP=@in_XP,
            Reputation=@in_Reputation,
            Stat00=@in_Stat00,
            Stat01=@in_Stat01,
            Stat02=@in_Stat02,
            Stat03=@in_Stat03,
            Stat04=@in_Stat04,
            Stat05=@in_Stat05
        where CharID=@in_CharID
    
        -- update generic character data (if provided)
        if(@in_CharData <> '')
            update UsersChars set CharData=@in_CharData where CharID=@in_CharID
    
        -- update resources    
        update UsersData set ResWood=@in_ResWood, ResStone=@in_ResStone, ResMetal=@in_ResMetal where CustomerID=@in_CustomerID
        
        if(@in_Alive = 0) begin
            update UsersChars set DeathUtcTime=GETUTCDATE() where CharID=@in_CharID
            -- set default backpack on death
            update UsersChars set BackpackID=20176, BackpackSize=12 where CharID=@in_CharID
            -- delete stuff from backpack
            delete from UsersInventory where CustomerID=@in_CustomerID and CharID=@in_CharID
    
            exec DBG_StoreApiCall 'Death', 0, @in_CustomerID, @in_CharID
        end
    
      exec WZ_UPDATE_Leaderboards @in_CustomerID
    
        select 0 as ResultCode
    END

  9. #9
    Apprentice xAgentXx is offline
    MemberRank
    Jan 2014 Join Date
    24Posts

    Re: WZ_Char_SRV_SetStatus and @in_MapID - DC

    Nice it works, but now the old Accounts are locked and i have to register new accounts,
    and i cant use the Charakter "The Spy"

  10. #10
    Your average Dutch guy Laenoar is offline
    MemberRank
    Apr 2013 Join Date
    The NetherlandsLocation
    384Posts

    Re: WZ_Char_SRV_SetStatus and @in_MapID - DC

    Could you please post your logs again? Especially the log after trying to log in to a locked account and after trying to create a character with "The Spy" skin.

  11. #11
    Apprentice xAgentXx is offline
    MemberRank
    Jan 2014 Join Date
    24Posts

    Re: WZ_Char_SRV_SetStatus and @in_MapID - DC

    Quote Originally Posted by Laenoar View Post
    Could you please post your logs again? Especially the log after trying to log in to a locked account and after trying to create a character with "The Spy" skin.
    I fixxed the Problems, it was my fault ^^
    Thank you for your help.
    I have one problem again, when i go to my Servers i get the Error: Failed to get Prices for Server Rental.

    R3dlog:

    Code:
     003297.554| WO_API: failed with error code 5 bad int field Capacity_US
    003297.555| ApiGetServerRentPrices FAILED, code: 5
    Function WZ_ServerGetPrices:

    Spoiler:
    Code:
     
    
    ALTER PROCEDURE [dbo].[WZ_ServerGetPrices]
    AS
    BEGIN
        SET NOCOUNT ON;
    
        select 0 as ResultCode
        
        -- GAMESERVER prices
        select
            6000    as 'Base_US',        -- 8500 base price per server per month in US region. 0 if region is disabled
            6000    as 'Base_EU',        -- 8500 base price per server per month in europe region. 0 if region is disabled
            12000    as 'Base_RU',        -- 8500 base price per server per month in russian region. 0 if region is disabled
            6000    as 'Base_SA',        -- South america. Should be 3x price of US\EU server due to high cost of renting server equipment in Brazil
            -- percents of base price per each option
            0        as 'PVE',
            0        as 'PVP',
            1500    as 'Slot1',            -- not used right now. was 30 plr
            1550        as 'Slot2',            -- 50 plr
            1600        as 'Slot3',            -- 70 plr
            1650        as 'Slot4',            -- 100
          1700    as 'Slot5',            -- not used now - will be 250
            0        as 'Passworded',
            0        as 'MonthX2',        -- 
            0        as 'MonthX3',        -- 
            0        as 'MonthX6',
        0        as 'WeekX1',
            0        as 'OptNameplates',
            0        as 'OptCrosshair',
            0        as 'OptTracers'
            
        -- STRONGHOLD prices
        select
            3000        as 'Base_US',        -- base price per server per month in US region. 0 if region is disabled
            3000        as 'Base_EU',        -- base price per server per month in europe region. 0 if region is disabled
            6000        as 'Base_RU',        -- base price per server per month in russian region. 0 if region is disabled
            3000        as 'Base_SA',
            -- percents of base price per each option
            0        as 'PVE',
            0        as 'PVP',
            1500    as 'Slot1',            -- not used right now. was 30 plr
            1550        as 'Slot2',            -- 50 plr
            1600        as 'Slot3',            -- 70 plr
            1650        as 'Slot4',            -- 100
          1700    as 'Slot5',            -- not used now - will be 250
            0        as 'Passworded',
            -10        as 'MonthX2',        -- 
            -20        as 'MonthX3',        -- 
            -30        as 'MonthX6',
        10        as 'WeekX1',
            0        as 'OptNameplates',
            0        as 'OptCrosshair',
            0        as 'OptTracers'
            
        -- CAPACITY report
        declare @Games_US int = 80
        declare @Games_EU int = 80
        declare @Games_RU int = 50
        declare @Games_SA int = 800
        select @Games_US = count(*) from ServersList where ServerRegion=1  and WorkHours<RentHours
        select @Games_EU = count(*) from ServersList where ServerRegion=10 and WorkHours<RentHours
        select @Games_RU = count(*) from ServersList where ServerRegion=20 and WorkHours<RentHours
        select @Games_SA = count(*) from ServersList where ServerRegion=30 and WorkHours<RentHours
    
        select
            -- modify numbers here. 1st is global server capacity. 2nd is our HOSTED server number
            -- mul by 2 as with hibernate we can support more servers now
            (1500*2) - 80 as 'Capacity_US', @Games_US as 'Games_US',
            (1440*2) - 80 as 'Capacity_EU', @Games_EU as 'Games_EU',
            (280+50) -  50 as 'Capacity_RU', @Games_RU as 'Games_RU',
            (90*2) - 80 as 'Capacity_SA', @Games_SA as 'Games_SA'
            
    END

  12. #12
    Your average Dutch guy Laenoar is offline
    MemberRank
    Apr 2013 Join Date
    The NetherlandsLocation
    384Posts

    Re: WZ_Char_SRV_SetStatus and @in_MapID - DC

    I have never messed around with rented servers, sorry, I think you need to declare the capacity for all regions. For example:

    declare Capacity_US int = 80
    declare Capacity_EU int = 80

    And so on

  13. #13
    Apprentice xAgentXx is offline
    MemberRank
    Jan 2014 Join Date
    24Posts

    Re: WZ_Char_SRV_SetStatus and @in_MapID - DC

    Where i have to declare it ?

  14. #14
    Your average Dutch guy Laenoar is offline
    MemberRank
    Apr 2013 Join Date
    The NetherlandsLocation
    384Posts

    Re: WZ_Char_SRV_SetStatus and @in_MapID - DC

    Try making your code look like this:

    Code:
        declare @capacity_US int = 80
        declare @capacity_EU int = 80
        declare @capacity_RU int = 50
        declare @capacity_SA int = 80    
    
    select        
    
    -- modify numbers here. 1st is global server capacity. 2nd is our HOSTED server number        
    -- mul by 2 as with hibernate we can support more servers now        
    
    (1500*2) - @capacity_US, @Games_US as 'Games_US',        
    (1440*2) - @capacity_EU, @Games_EU as 'Games_EU',        
    (280+50) -  @capacity_RU, @Games_RU as 'Games_RU',        
    (90*2) - @capacity_SA, @Games_SA as 'Games_SA'        
    END

  15. #15
    Apprentice xAgentXx is offline
    MemberRank
    Jan 2014 Join Date
    24Posts

    Re: WZ_Char_SRV_SetStatus and @in_MapID - DC

    When i try to save i become this error:

    Code:
     Error: 137, Severity: 15, State: 2, Procedure: WZ_ServerGetPrices, Line: 68 [SQL Server]Must declare the scalar variable "@Game_US".

  16. #16
    Your average Dutch guy Laenoar is offline
    MemberRank
    Apr 2013 Join Date
    The NetherlandsLocation
    384Posts

  17. #17
    Apprentice xAgentXx is offline
    MemberRank
    Jan 2014 Join Date
    24Posts

    Re: WZ_Char_SRV_SetStatus and @in_MapID - DC

    Same Error:

    000020.579| WO_API: failed with error code 5 bad int field Capacity_US
    000020.579| ApiGetServerRentPrices FAILED, code: 5

  18. #18
    Your average Dutch guy Laenoar is offline
    MemberRank
    Apr 2013 Join Date
    The NetherlandsLocation
    384Posts

    Re: WZ_Char_SRV_SetStatus and @in_MapID - DC

    Sorry, I'm not sure what to do then. I can't look over all of your code so I can't find what's wrong.

  19. #19
    Apprentice xAgentXx is offline
    MemberRank
    Jan 2014 Join Date
    24Posts

    Re: [Help] WZ_Char_SRV_SetStatus and @in_MapID - DC

    Okay np and thanks to you!
    Can be closed.



Advertisement