Esempio n. 1
0
        public static RoomVariable FromSFSArray(ISFSArray sfsa)
        {
            RoomVariable roomVariable = new SFSRoomVariable(sfsa.GetUtfString(0), sfsa.GetElementAt(2), sfsa.GetByte(1));

            roomVariable.IsPrivate    = sfsa.GetBool(3);
            roomVariable.IsPersistent = sfsa.GetBool(4);
            return(roomVariable);
        }
Esempio n. 2
0
        public static UserVariable FromSFSArray(ISFSArray sfsa)
        {
            UserVariable userVariable = new SFSUserVariable(sfsa.GetUtfString(0), sfsa.GetElementAt(2), sfsa.GetByte(1));

            if (sfsa.Count > 3)
            {
                userVariable.IsPrivate = sfsa.GetBool(3);
            }
            return(userVariable);
        }
Esempio n. 3
0
        public static Buddy FromSFSArray(ISFSArray arr)
        {
            Buddy     buddy    = new SFSBuddy(arr.GetInt(0), arr.GetUtfString(1), arr.GetBool(2), arr.Size() > 4 && arr.GetBool(4));
            ISFSArray sFSArray = arr.GetSFSArray(3);

            for (int i = 0; i < sFSArray.Size(); i++)
            {
                BuddyVariable variable = SFSBuddyVariable.FromSFSArray(sFSArray.GetSFSArray(i));
                buddy.SetVariable(variable);
            }
            return(buddy);
        }
Esempio n. 4
0
        public static Room FromSFSArray(ISFSArray sfsa)
        {
            bool flag = sfsa.Size() == 14;
            Room room = null;

            room                     = ((!flag) ? new SFSRoom(sfsa.GetInt(0), sfsa.GetUtfString(1), sfsa.GetUtfString(2)) : new MMORoom(sfsa.GetInt(0), sfsa.GetUtfString(1), sfsa.GetUtfString(2)));
            room.IsGame              = sfsa.GetBool(3);
            room.IsHidden            = sfsa.GetBool(4);
            room.IsPasswordProtected = sfsa.GetBool(5);
            room.UserCount           = sfsa.GetShort(6);
            room.MaxUsers            = sfsa.GetShort(7);
            ISFSArray sFSArray = sfsa.GetSFSArray(8);

            if (sFSArray.Size() > 0)
            {
                List <RoomVariable> list = new List <RoomVariable>();
                for (int i = 0; i < sFSArray.Size(); i++)
                {
                    list.Add(SFSRoomVariable.FromSFSArray(sFSArray.GetSFSArray(i)));
                }
                room.SetVariables(list);
            }
            if (room.IsGame)
            {
                room.SpectatorCount = sfsa.GetShort(9);
                room.MaxSpectators  = sfsa.GetShort(10);
            }
            if (flag)
            {
                MMORoom mMORoom = room as MMORoom;
                mMORoom.DefaultAOI = Vec3D.fromArray(sfsa.GetElementAt(11));
                if (!sfsa.IsNull(13))
                {
                    mMORoom.LowerMapLimit  = Vec3D.fromArray(sfsa.GetElementAt(12));
                    mMORoom.HigherMapLimit = Vec3D.fromArray(sfsa.GetElementAt(13));
                }
            }
            return(room);
        }
Esempio n. 5
0
        public override bool[] GetBoolArray(int index)
        {
            ISFSArray sFSArray = base.GetSFSArray(index);

            if (sFSArray == null)
            {
                return(null);
            }
            bool[] array = new bool[sFSArray.Size()];
            for (int i = 0; i < sFSArray.Size(); i++)
            {
                array.SetValue(sFSArray.GetBool(i), i);
            }
            return(array);
        }