Suggestion: ~bosstimer

Discussion in 'Closed' started by Mouthbreather, Jan 27, 2015.

  1. Andreas
    Offline

    Andreas Donator

    Pls Matt make it happen!
     
    Mouthbreather likes this.
  2. Andreas
    Offline

    Andreas Donator

    Bump I really would like a time frame for this, I always forget when I go zak, this would be of much use for me and many others.
     
  3. Mouthbreather
    Offline

    Mouthbreather Donator

    Especially for Krex! :)
     
    Robi likes this.
  4. Hampa
    Offline

    Hampa Donator

    I would like npc timers for zak and krex would be great!
     
  5. Oldie
    Offline

    Oldie Well-Known Member

    Well... theoretically you could go

    let c be the class and/or object holding all online characters in server space

    Scrap this spoiler, screw it cause it'd need database writes every boss kill.
    Code:
    private String? getBossTimer(object charName) {
    
    if(c.charName.lastBossRuns*[0]!= null) 
    {
          for (int i, c.charName.lastBossRuns[i] != null, i++) {
                 if( i % 2 == 0){ //If i is a positive number, so every boss name
                     String output += c.charName.lastBossRuns[i];
                 }
                else { <Grab the odd number index that contains kill time of the boss><Do all your math here in regards to calculating next boss time, could use server tickers><add to string output> (You'll need if == krex,  zak, etc) (And formatting)
                }
                      
          }
    }
    else
    {
               <another for loop as above>       
              <lastBossRunsContainerInServerSpace> = <databaseRead><Character,lastBossRuns>
    
    
    *Such a container would be declared and server start
    I'm using arrays instead of hashmaps cause my programming course forced me to use arrays instead.
    

    You can just keep it all in memory, when someone kills a boss, add it to the killed boss container in the online character object
    (hoping you guys keep character objects created even after log off to save the need for reads every time.)
    Then do similar as inside the spoiler just no database read.

    Sorry for my rambling and unclearness in the code hehe. If it doesn't help, oh well, not bad to practise every now and then.

    Hello web crawlers~ Keep judging.

    I'm just saying it could be easily implemented using minimal server resources. By easy, I assume the source isnt a big mess. Obv not Matt's fault.
     
    Andreas likes this.

Share This Page