~swag/armagetronad/0.2.9-sty+ct+ap-fork

« back to all changes in this revision

Viewing changes to src/network/nServerInfo.cpp

Append (and parse) a list of authenticated names to the big server info messages (the ones that make up the details you see on the server browser)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1226
1226
    ping = .999;
1227
1227
    users = 0;
1228
1228
    userNames_ = userNamesOneLine_ = "Sever polled over master server, no reliable user data available.";
 
1229
    userGlobalIDs_ = "";
1229
1230
    advancedInfoSet = true;
1230
1231
 
1231
1232
    CalcScore();
2640
2641
    if ( nServerInfoAdmin::GetAdmin() )
2641
2642
    {
2642
2643
        userNames_  = nServerInfoAdmin::GetAdmin()->GetUsers();
 
2644
        userGlobalIDs_  = nServerInfoAdmin::GetAdmin()->GetGlobalIDs();
2643
2645
        options_    = nServerInfoAdmin::GetAdmin()->GetOptions();
2644
2646
        url_        = nServerInfoAdmin::GetAdmin()->GetUrl();
2645
2647
    }
2650
2652
        userNames_  = str;
2651
2653
        options_    = str;
2652
2654
        url_        = str;
 
2655
        userGlobalIDs_ = "";
2653
2656
    }
2654
2657
}
2655
2658
 
2676
2679
    m << userNames_;
2677
2680
    m << options_;
2678
2681
    m << url_;
 
2682
 
 
2683
    m << userGlobalIDs_;
2679
2684
}
2680
2685
 
2681
2686
// *******************************************************************************************
2729
2734
        options_ = "No Info\n";
2730
2735
        url_ = "No Info\n";
2731
2736
    }
 
2737
    if ( !m.End() )
 
2738
    {
 
2739
        m >> userGlobalIDs_;
 
2740
    }
 
2741
    else
 
2742
    {
 
2743
        userGlobalIDs_ = "";
 
2744
    }
2732
2745
 
2733
2746
    userNamesOneLine_.Clear();
2734
 
    for ( int i = 0; i < userNames_.Len()-2 ; ++i )
 
2747
    for ( int i = 0, j = 0; i < userNames_.Len()-1 ; ++i )
2735
2748
    {
2736
2749
        char c = userNames_[i];
2737
2750
        if ( c == '\n' )
2738
 
            userNamesOneLine_ << "0xffffff, ";
 
2751
        {
 
2752
            userNamesOneLine_ << "0xffffff";
 
2753
            if( j < userGlobalIDs_.Len()-2 && userGlobalIDs_[j] != '\n' ) {
 
2754
                userNamesOneLine_ << " (";
 
2755
                do
 
2756
                {
 
2757
                    userNamesOneLine_ << userGlobalIDs_[j];
 
2758
                }
 
2759
                while ( ++j < userGlobalIDs_.Len()-1 && userGlobalIDs_[j] != '\n' );
 
2760
                userNamesOneLine_ << ")";
 
2761
            }
 
2762
            else
 
2763
                ++j;
 
2764
            if ( i < userNames_.Len()-2 )
 
2765
                userNamesOneLine_ << ", ";
 
2766
        }
2739
2767
        else
2740
2768
            userNamesOneLine_ << c;
2741
2769
    }