Example #1
0
        public override void ReadImplement()
        {
            int roomId = ReadInt();

            roomName  = ReadString(23);
            mapId     = ReadShort();
            stage4vs4 = ReadByte();
            byte type = ReadByte();

            stageType     = (RoomTypeEnum)type;
            state         = (RoomStateEnum)ReadByte();
            players       = ReadByte();
            slots         = ReadByte();
            ping          = ReadByte();
            weaponsFlag   = ReadByte();                  //RoomWeaponsFlag È um Enum
            randomMap     = ReadByte();                  //0=DESATIVADO 2=ATIVADO
            modeSpecial   = (RoomModeSpecial)ReadByte(); //2=DINO 3=SHOTGUN 4=SNIPER 6=CHALLENGE NORMAL 7=HEADHUNTER 8=CHALLENGE KNIFE 9=ZOMBIE 10=CHAOS (MODO PORRADA NAO É MODO SPECIAL=0)
            leaderName    = ReadString(33);
            killTime      = ReadInt();
            limit         = ReadByte(); //BLOQUEAR A ENTRADA QUANDO A PARTIDA ESTIVER EM ANDAMENTO(JOGANDO)
            seeConf       = ReadByte(); //[MIN 0 MAX 30] 0=DESATIVADO 1=TERCEIRA PESSOA 2=CAMERA LIVRE 4=VISUALIZAR TIME ADVERSÁRIO 8=VER HP DO INIMIGO 16=DESATIVAR O USO DA VISÃO DE TERCEIRA PESSOA
            balancing     = ReadShort();
            password      = ReadString(4);
            IsSpecialMode = modeSpecial == RoomModeSpecial.CHALLENGE_NORMAL || modeSpecial == RoomModeSpecial.CHALLENGE_KNIFE || modeSpecial == RoomModeSpecial.ZOMBIE;
            if (IsSpecialMode)
            {
                aiCount = ReadByte();
                aiLevel = ReadByte();
            }
            Logger.DebugPacket(GetType().Name, $"RoomId: {roomId} RoomName: {roomName} MapId: {mapId} Stage4vs4: {stage4vs4} StageType: {stageType} Type: {type} State: {state} Players: {players} Slots: {slots} Ping: {ping} WeaponsFlag: {weaponsFlag} RandomMap: {randomMap} ModeSpecial: {modeSpecial} KillTime: {killTime} Limit: {limit} SeeConf: {seeConf} Balancing: {balancing} AiCount: {aiCount} AiLevel: {aiLevel}");
        }
Example #2
0
 public Room(int roomNumber, bool isOcupedid, RoomTypeEnum type, string description)
 {
     RoomNumber      = roomNumber;
     this.isOcupedid = isOcupedid;
     Type            = type;
     Description     = description;
 }
 public ReservationCreateRoomViewModel(int id, RoomTypeEnum roomType, double pricePerAdult, double pricePerChild, bool isFree)
 {
     this.Id            = id;
     this.RoomType      = roomType;
     this.PricePerAdult = pricePerAdult;
     this.PricePerChild = pricePerChild;
     this.IsFree        = isFree;
 }
Example #4
0
 public Room(int capacity, RoomTypeEnum roomType, bool isFree, double pricePerAdult, double pricePerChild, int number)
 {
     Capacity      = capacity;
     RoomType      = roomType;
     IsFree        = isFree;
     PricePerAdult = pricePerAdult;
     PricePerChild = pricePerChild;
     Number        = number;
 }
Example #5
0
 public RoomsEditViewModel(int id, int capacity, RoomTypeEnum roomType
                           , bool isFree, double pricePerAdult, double pricePerChild, int number)
 {
     Id            = id;
     Capacity      = capacity;
     RoomType      = roomType;
     IsFree        = isFree;
     PricePerAdult = pricePerAdult;
     PricePerChild = pricePerChild;
     Number        = number;
 }
Example #6
0
 public override void ReadImplement()
 {
     roomId      = ReadInt();
     roomName    = ReadString(23);
     mapId       = ReadShort();
     stage4vs4   = ReadByte();
     stageType   = (RoomTypeEnum)ReadByte();
     state       = (RoomStateEnum)ReadByte();
     players     = ReadByte();
     slots       = ReadByte();
     ping        = ReadByte();
     weaponsFlag = ReadByte();
     randomMap   = ReadByte();
     modeSpecial = (RoomModeSpecial)ReadByte();
     aiCount     = ReadByte();
     aiLevel     = ReadByte();
 }
Example #7
0
 public override void ReadImplement()
 {
     try
     {
         matchId = ReadShort();
         int channel1 = ReadInt();
         int channel2 = ReadInt();
         ReadShort();
         roomName  = ReadString(23);
         mapId     = ReadShort();
         stage4vs4 = ReadByte();
         mode      = (RoomTypeEnum)ReadByte();
         ReadShort();
         slots = ReadByte();
         ReadByte();
         weaponsFlag = ReadByte();
         randomMap   = ReadByte();
         modeSpecial = (RoomModeSpecial)ReadByte();
     }
     catch (Exception ex)
     {
         PacketLog(ex);
     }
 }
Example #8
0
    public void CheckRoom(List <GameObject> currentSpawnedRooms, int curListIndex)
    {
        //RaycastHit2D upRay = Physics2D.Raycast(new Vector2(transform.position.x, transform.position.y) + Vector2.up * 2, Vector2.up, 22f, ~(1 << LayerMask.NameToLayer("Rooms")));
        //RaycastHit2D rightRay = Physics2D.Raycast(new Vector2(transform.position.x, transform.position.y) + Vector2.right * 2, Vector2.right, 15f, ~(1 << LayerMask.NameToLayer("Rooms")));
        //RaycastHit2D downRay = Physics2D.Raycast(new Vector2(transform.position.x, transform.position.y) + Vector2.down * 2, Vector2.down, 22f, ~(1 << LayerMask.NameToLayer("Rooms")));
        //RaycastHit2D leftRay = Physics2D.Raycast(new Vector2(transform.position.x, transform.position.y) + Vector2.left * 2, Vector2.left, 15f, ~(1 << LayerMask.NameToLayer("Rooms")));

        bool upRoom    = false;
        bool rightRoom = false;
        bool downRoom  = false;
        bool leftRoom  = false;

        for (int i = 0; i < currentSpawnedRooms.Count; i++)
        {
            //Check up
            if (currentSpawnedRooms[i].transform.position == transform.position + new Vector3(0, 20, 0))
            {
                upRoom = true;
            }

            //Check right
            if (currentSpawnedRooms[i].transform.position == transform.position + new Vector3(13, 0, 0))
            {
                rightRoom = true;
            }

            //Check down
            if (currentSpawnedRooms[i].transform.position == transform.position + new Vector3(0, -20, 0))
            {
                downRoom = true;
            }

            //Check left
            if (currentSpawnedRooms[i].transform.position == transform.position + new Vector3(-13, 0, 0))
            {
                leftRoom = true;
            }
        }

        if (upRoom == true && rightRoom == true && downRoom == true && leftRoom == true)
        {
            //14 -> LRBT
            afterCheckType = RoomTypeEnum.LRBT;
        }
        else if (upRoom == false && rightRoom == true && downRoom == true && leftRoom == true)
        {
            //13 -> LRB
            afterCheckType = RoomTypeEnum.LRB;
        }
        else if (upRoom == true && rightRoom == true && downRoom == false && leftRoom == true)
        {
            //12 -> LRT
            afterCheckType = RoomTypeEnum.LRT;
        }
        else if (upRoom == true && rightRoom == true && downRoom == true && leftRoom == false)
        {
            //11 -> TBR
            afterCheckType = RoomTypeEnum.TBR;
        }
        else if (upRoom == true && rightRoom == false && downRoom == true && leftRoom == true)
        {
            //10 -> TBL
            afterCheckType = RoomTypeEnum.TBL;
        }
        else if (upRoom == false && rightRoom == true && downRoom == true && leftRoom == false)
        {
            //9 -> RB
            afterCheckType = RoomTypeEnum.RB;
        }
        else if (upRoom == true && rightRoom == true && downRoom == false && leftRoom == false)
        {
            //8 -> RT
            afterCheckType = RoomTypeEnum.RT;
        }
        else if (upRoom == false && rightRoom == false && downRoom == true && leftRoom == true)
        {
            //7 -> LB
            afterCheckType = RoomTypeEnum.LB;
        }
        else if (upRoom == true && rightRoom == false && downRoom == false && leftRoom == true)
        {
            //6 -> LT
            afterCheckType = RoomTypeEnum.LT;
        }
        else if (upRoom == true && rightRoom == false && downRoom == true && leftRoom == false)
        {
            //5 -> TB
            afterCheckType = RoomTypeEnum.TB;
        }
        else if (upRoom == false && rightRoom == true && downRoom == false && leftRoom == true)
        {
            //4 -> LR
            afterCheckType = RoomTypeEnum.LR;
        }
        else if (upRoom == false && rightRoom == false && downRoom == true && leftRoom == false)
        {
            //3 -> B
            afterCheckType = RoomTypeEnum.B;
        }
        else if (upRoom == false && rightRoom == true && downRoom == false && leftRoom == false)
        {
            //2 -> R
            afterCheckType = RoomTypeEnum.R;
        }
        else if (upRoom == true && rightRoom == false && downRoom == false && leftRoom == false)
        {
            //1 -> T
            afterCheckType = RoomTypeEnum.T;
        }
        else if (upRoom == false && rightRoom == false && downRoom == false && leftRoom == true)
        {
            //0 -> L
            afterCheckType = RoomTypeEnum.L;
        }
        else
        {
            Debug.LogError("No Raycast Hit????");
        }

        //Debug.Log(curListIndex + ": upRoom = " + upRoom);
        //Debug.Log(curListIndex + ": rightRoom = " + rightRoom);
        //Debug.Log(curListIndex + ": downRoom = " + downRoom);
        //Debug.Log(curListIndex + ": leftRoom = " + leftRoom);
        //Debug.LogWarning(curListIndex + ": afterCheckType = " + afterCheckType);
    }
Example #9
0
 public static double getValue(RoomTypeEnum type)
 {
     return(type == RoomTypeEnum.Single ? SINGLE_PRICE :
            type == RoomTypeEnum.Double ? DOUBLE_PRICE :
            TRIPLE_PRICE);
 }
Example #10
0
 public Room(Guid id, string label, RoomTypeEnum type) : base(id, label)
 {
     Type = type;
 }
Example #11
0
 public override void ReadImplement()
 {
     mapId     = ReadShort();
     stage4vs4 = ReadByte();
     roomType  = (RoomTypeEnum)ReadByte();
 }
Example #12
0
 private RoomType(RoomTypeEnum @enum)
 {
     Id   = (int)@enum;
     Name = @enum.ToString();
 }