• CoD4xAdmin
  • Recent
  • Popular
  • Groups
  • Users
  • Register
  • Login
Cirkus Serveri Forum
  • CoD4xAdmin
  • Recent
  • Popular
  • Groups
  • Users
  • Register
  • Login

Display Rounds

Scheduled Pinned Locked Moved
Support
2
7
389
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S
    SMiLeY
    last edited by SMiLeY 22 Oct 2022, 10:01

    Hi,

    Not reallly support and more of a question.

    I was wondering how you are getting the rounds displayed on your WebAdmin SD server? Something in MoD? If I have round based SD or SR i don't see but its nice to see. 🙂

    rounds.png

    N 1 Reply Last reply 5 Nov 2022, 19:46 Reply Quote 0
    • N
      NeHo Administrators @SMiLeY
      last edited by 5 Nov 2022, 19:46

      @SMiLeY I have a hostname.gsx file

      init(){
              level.hostnameSeperator = "-"; //Change this to whatever character you like. This can not be more then 1 character.
       
              if( level.hostnameSeperator.size > 1 )
                      return;
      
              if( level.gametype  == "sd" )
                      addRoundsToHostname( game["roundsplayed"], 19 );
              else
                      setHostName( getOriginalHostname() );
      }
       
      addRoundsToHostname( currentRound, maxRounds ){
              setHostName( getOriginalHostname() + " " + level.hostnameSeperator + " Round: " + currentRound + "/" + maxRounds );
      }
       
      setHostName( newHostName ){
              SetDvar("sv_hostname", newHostName);
      }
       
      getOriginalHostname(){
              hostname = GetDvar("sv_hostname");
              if(IsSubStr(hostname, level.hostnameSeperator + " Round:" ))
                      return trimRight( trimAllRightThroughSeperator( hostname, level.hostnameSeperator ));
              return hostname;
      }
       
      trimAllRightThroughSeperator( string, seperator ){
              i = string.size;
              for(; i && string[i-1] != seperator; i--){}
              return getSubStr( string, 0, i-1 );
      }
       
      trimRight( string )
      {
              i = string.size;
              for(; i && string[i-1] == " "; i-- ){}
              return getSubStr( string, 0, i );
      }
      

      And in my init gsx I call it here

      startGameType()
      {
             thread neho\hostname::init();
      }
      

      I keep hitting the 'Escape' key - but I'm still here. ...

      S 1 Reply Last reply 5 Nov 2022, 21:15 Reply Quote 1
      • S
        SMiLeY @NeHo
        last edited by 5 Nov 2022, 21:15

        @NeHo Thank you.

        I just came on to say that I have it running ok.

        JEENNN also posted the same answer on CoD4X forum.

        In globallogic.gsx under callback_startgametype() I added thread maps\mp\gametypes_hostname::init(); and put hostname.gsc in that path.

        Thanks for the reply. 🙂

        S 1 Reply Last reply 5 Nov 2022, 23:01 Reply Quote 0
        • S
          SMiLeY @SMiLeY
          last edited by 5 Nov 2022, 23:01

          @NeHo

          As I said previously in another topic. When the server name updates its name say from Round 6/11 to Round 7/11 All the player stats are lost and screenshots are gone.

          I have no idea why it does that.

          It is as if you have changed the MoD for example. If you are waiting and then go back to webadmin 2022-11-06 00_51_03-404 Error.png

          So it is like the server is not there anymore because the name has changed. I really would like to know why and sort this problem out. I cannot have more than one server if i want to have scores for the same player. Really need some help because I just have no idea 😞

          N 1 Reply Last reply 6 Nov 2022, 00:37 Reply Quote 0
          • N
            NeHo Administrators @SMiLeY
            last edited by NeHo 11 Jun 2022, 02:13 6 Nov 2022, 00:37

            @SMiLeY it happens because your URL changes, every time when the round changes your URL also changes

            There is a line to solve this issue, the rounds part must start with " - Round"
            https://github.com/byNeHo/CoD4x-WebAdmin/blob/master/app/controllers/cod4x_plugins/index.js#L615

            Right now only " - Round" part will work, since I already uploaded, changed and I still didn't finish everything for the next version you will have to use for now separator "-", later on in the new update I can also add a new rule with " | Round" if you want it that way

            Look at my application, the name is "Cirkus S&D HC High XP - Round: 5/19"

            • so I have my normal server name, plus the rounds part ( - Round )
              https://www.cirkus-serveri.com/cirkus-s-and-d-hc-high-xp
            • if you use anything else then "- Round" the link on the web will always change because your server name also changes, from my link example

            with (- Round)

            https://www.cirkus-serveri.com/cirkus-s-and-d-hc-high-xp
            

            with anything else, lets say (Round, without - in front)

            https://www.cirkus-serveri.com/cirkus-s-and-d-hc-high-xp-round-5-9
            

            On game server side in the above hostname.gsx

            separator

            level.hostnameSeperator = "-"; //Change this to whatever character you like. This can not be more then 1 character.
            

            after separator "Round"

            setHostName( getOriginalHostname() + " " + level.hostnameSeperator + " Round: " + currentRound + "/" + maxRounds );
            

            Also remember that every server needs unique name

            If your server is named

            My Awesome Server
            

            your alias for that specific server would be

            my-awesome-server
            

            Every score and every screenshot is related to "my-awesome-server"

            So if your server name changes to

            My Awesome Server Round 5/19
            

            your alias is

            my-awesome-server-round-5-19
            

            so from now on you will only see screenshots and player scores for my-awesome-server-round-5-19

            For your specific situation, your separator is " | " instead of " - ", so if you go to your server details page your alias (link) is "fmjcod4-or-modernops-or-round-5-11", when it changes to next round it will be "fmjcod4-or-modernops-or-round-6-11", so its a different web address (alias) and a different game server with different name (different server has no screenshots and players are new players on new server)

            You get the 404 error because the server "fmjcod4-or-modernops-or-round-5-11" doesn't exist more once there is a new round

            I hope "perkele" you will understand it now 🙂

            I keep hitting the 'Escape' key - but I'm still here. ...

            S 1 Reply Last reply 6 Nov 2022, 10:47 Reply Quote 1
            • S
              SMiLeY @NeHo
              last edited by 6 Nov 2022, 10:47

              @NeHo said in Display Rounds:

              I hope "perkele" you will understand it now

              :beaming_face_with_smiling_eyes: :beaming_face_with_smiling_eyes: :beaming_face_with_smiling_eyes:

              That made my morning haha....Yes mate..that explains it PERFECTLY 🙂

              Thanks as always. I really love the app and don't want to use anything else. But i think you know that 🙂

              I am a pain at times I know mate. Sorry. 🙂 :love-you_gesture:

              S 1 Reply Last reply 6 Nov 2022, 15:16 Reply Quote 1
              • S
                SMiLeY @SMiLeY
                last edited by SMiLeY 11 Jun 2022, 16:17 6 Nov 2022, 15:16

                @SMiLeY Perkele I'm back.

                I still do not understand why a player..me in this case is not tracked score wise when I add another server. I cleared all and tested again. If I look in the database under the collection for playerstats I see me on the first server. I created another server went in and killed myself and waited for the rotation. But no score tracked!

                Should another entry not be made in the db under playerstats for another server? This is the same on my friends webadmin.

                Screenshot from 2022-11-06 17-10-14.png

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post

                0

                Online

                191

                Users

                268

                Topics

                1.2k

                Posts
                Powered & Designed by NeHo