[V26 RP] My client crashes after loading!

Status
Not open for further replies.

IPMB1

Member
Jan 1, 2013
249
20
My client crashes after loading... Please help, I use UltraRP Emu and it works fine but the client crashes after the loading.

And it says:


Screenies:
You must be registered for see images attach
You must be registered for see images attach
You must be registered for see images attach

 

IPMB1

Member
Jan 1, 2013
249
20
Paste the error logged in "DC.err"
Code:
System.NullReferenceException: Object reference not set to an instance of an object.
   at Xoa.Managers.rankManager.fuseRights(Byte rankID, Int32 userID) in C:\Users\CALLUM\Desktop\emu1\Source\Managers\rankManager.cs:line 45
   at Xoa.Virtual.Users.virtualUser.processPacket(String currentPacket) in C:\Users\CALLUM\Desktop\emu1\Source\Virtual\Users\virtualUser.cs:line 787
   at Xoa.Virtual.Users.virtualUser.dataArrival(IAsyncResult iAr) in C:\Users\CALLUM\Desktop\emu1\Source\Virtual\Users\virtualUser.cs:line 395
 

Ethereal

Neurotic Male
May 18, 2013
494
330
Sorry, i'm not any good at C# :( I suggest you use a different Emulator. :up:

Sorry, i'm not any good at C# :( I suggest you use a diffrent Emulator.
 
Last edited by a moderator:

BetaSparkUK

Steamworks & Greenlight Developer
Mar 25, 2013
195
238
Emulator problem, please try using another emulator.
It might not be the emulator, or could be a corrupted emulator. Don't download edited emulators - use original ones.
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,195
3,906
Your logs say enough.

Code:
at Xoa.Managers.rankManager.fuseRights(Byte rankID, Int32 userID) in C:\Users\CALLUM\Desktop\emu1\Source\Managers\rankManager.cs:line 45

Go to line 45 in rankManager.cs, you probably have too high of a rank that isn't set to be cached in the rankManager.
 

IPMB1

Member
Jan 1, 2013
249
20
Your logs say enough.

Code:
at Xoa.Managers.rankManager.fuseRights(Byte rankID, Int32 userID) in C:\Users\CALLUM\Desktop\emu1\Source\Managers\rankManager.cs:line 45

Go to line 45 in rankManager.cs, you probably have too high of a rank that isn't set to be cached in the rankManager.

Code:
using System;
using System.Data;
using System.Text;
using System.Collections;
using System.Threading;
using Ion.Storage;
using Xoa;

namespace Xoa.Managers
{
    /// <summary>
    /// Provides information about the various user ranks/levels, aswell as ranks for games such as 'BattleBall' and 'SnowStorm'.
    /// </summary>
    public static class rankManager
    {
        private static Hashtable userRanks;

        /// <summary>
        /// Initializes the various user ranks, aswell as the ranks for games such as 'BattleBall' and 'SnowStorm'.
        /// </summary>
        public static void Init(bool Update)
        {
            userRanks = new Hashtable();
            Out.WriteLine("Staff System Loaded Successfully");

            for (byte b = 1; b <= 9; b++)
                userRanks.Add(b, new userRank(b));

            if (Update)
                Thread.CurrentThread.Abort();
        }
        /// <summary>
        /// Returns the fuserights string for a certain user rank.
        /// </summary>
        /// <param name="rankID">The ID of the user rank.</param>
        /// <param name="userID">The ID of the user.</param>
        public static string fuseRights(byte rankID, int userID)
        {
            string[] fuseRights = ((userRank)userRanks[rankID]).fuseRights;
            StringBuilder strBuilder = new StringBuilder();

            for (int i = 0; i < fuseRights.Length; i++)
                strBuilder.Append(fuseRights[i] + Convert.ToChar(2));

            foreach (string fuseright in userManager.getUser(userID)._fuserights)
                strBuilder.Append(fuseright);

            return strBuilder.ToString();
        }

        /// <summary>
        /// Returns a bool that indicates if a certain user has a certain fuseright.
        /// </summary>
        /// <param name="rankID">The ID of the user rank.</param>
        /// <param name="fuseRight">The fuseright to look for.</param>
        /// <param name="userID">The ID of the user.</param>
        public static bool containsRight(byte rankID, string fuseRight, int userID)
        {
            userRank objRank = ((userRank)userRanks[rankID]);
            for (int i = 0; i < objRank.fuseRights.Length; i++)
                if (objRank.fuseRights[i] == fuseRight)
                    return true;
            return userManager.getUser(userID)._fuserights.Contains(fuseRight);
        }

        /// <summary>
        /// Returns a bool that indicates if a certain user has a certain fuseright.
        /// </summary>
        /// <param name="rankID">The ID of the user rank.</param>
        /// <param name="fuseRight">The fuseright to look for.</param>
        /// <returns></returns>
        public static bool containsRankRight(byte rankID, string fuseRight)
        {
            userRank objRank = ((userRank)userRanks[rankID]);
            for (int i = 0; i < objRank.fuseRights.Length; i++)
                if (objRank.fuseRights[i] == fuseRight)
                    return true;
            return false;
        }
        /// <summary>
        /// Represents a user rank.
        /// </summary>
        private struct userRank
        {
            internal string[] fuseRights;
            /// <summary>
            /// Initializes a user rank.
            /// </summary>
            /// <param name="rankID">The ID of the rank to initialize.</param>
            internal userRank(byte rankID)
            {
                DataColumn dCol;
                using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
                {
                    dCol = dbClient.getColumn("SELECT fuseright FROM system_fuserights WHERE minrank <= " + rankID);
                }
                fuseRights = dataHandling.dColToArray(dCol);
            }
        }
    }
}

this is my whole rankmanager.cs
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,195
3,906
You may have an issue with your fuserights, try changing the rank of your player to 9 and ensure you have the fuserights table (I forgot the name of it for Holograph).
 

IPMB1

Member
Jan 1, 2013
249
20
You may have an issue with your fuserights, try changing the rank of your player to 9 and ensure you have the fuserights table (I forgot the name of it for Holograph).
i've already change my rank to 9 and still happening... anyway this is my first time to create an RP hotel
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,195
3,906
i've already change my rank to 9 and still happening... anyway this is my first time to create an RP hotel

Your issue is around here:

PHP:
foreach (string fuseright in userManager.getUser(userID)._fuserights) 
 strBuilder.Append(fuseright);

I suggest you check in virtualUser.cs around case "CL": to check how fuserights are handled, that's all I can suggest.
 

IPMB1

Member
Jan 1, 2013
249
20
Your issue is around here:

PHP:
foreach (string fuseright in userManager.getUser(userID)._fuserights)
strBuilder.Append(fuseright);

I suggest you check in virtualUser.cs around case "CL": to check how fuserights are handled, that's all I can suggest.
i guess this is the fuseright one:
Code:
                            using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
                            {
                                dCol = dbClient.getColumn("SELECT fuseright FROM users_fuserights WHERE userid = " + this.userID);
                            }
                            this._fuserights = new System.Collections.Generic.List<string>();
                            foreach (DataRow dbRow in dCol.Table.Rows)
                                _fuserights.Add(Convert.ToString(dbRow[0]));
                            sendData("@B" + rankManager.fuseRights(_Rank, this.userID));
                            sendData("DbIH");
                            sendData("@C");

                            using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
                            {
                                _Punch = 0;

and i checked the table "users_fuserights" in my db and its empty
 
Status
Not open for further replies.

Users who are viewing this thread

Top