Exemplo n.º 1
0
        public int GetGSIdByLock(string CharName)
        {
            if (LockTable.Contains(CharName) == false)
            {
                return(-1);
            }
            TLockNode CurrLock = (TLockNode)LockTable[CharName];

            return(CurrLock.GSId);
        }
Exemplo n.º 2
0
 public bool SetCharLock(string CharName, int GSId)
 {
     if (LockTable.Contains(CharName) == true)
     {
         return false;
     }
     TLockNode NewLock = new TLockNode(CharName, GSId);
     LockTable.Add(CharName, NewLock);
     if (GSId != -1) GSLockTable[GSId].Add(CharName, NewLock);
     D2DBS.log.Write("info", "Locked char `" + CharName + "` for gs " + GSId.ToString());
     return true;
 }
Exemplo n.º 3
0
        public bool UnlockChar(string CharName)
        {
            if (LockTable.Contains(CharName) == false)
            {
                return(true);
            }
            TLockNode CurrLock = (TLockNode)LockTable[CharName];

            if (CurrLock.GSId != -1)
            {
                GSLockTable[CurrLock.GSId].Remove(CharName);
            }
            LockTable.Remove(CharName);
            D2DBS.log.Write("info", "Unlocked char `" + CharName + "`");
            return(true);
        }
Exemplo n.º 4
0
        public bool SetCharLock(string CharName, int GSId)
        {
            if (LockTable.Contains(CharName) == true)
            {
                return(false);
            }
            TLockNode NewLock = new TLockNode(CharName, GSId);

            LockTable.Add(CharName, NewLock);
            if (GSId != -1)
            {
                GSLockTable[GSId].Add(CharName, NewLock);
            }
            D2DBS.log.Write("info", "Locked char `" + CharName + "` for gs " + GSId.ToString());
            return(true);
        }