MCPcopy Create free account
hub / github.com/assaultcube/AC / serverbrowseralternativeviews

Function serverbrowseralternativeviews

source/src/serverbrowser.cpp:876–899  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

874}
875
876void serverbrowseralternativeviews(int shiftdirection)
877{
878 if(searchlan == 2) return;
879 const char *ckeys = getalias("serverbrowseraltviews");
880 if(!ckeys) return;
881 const char *sep = " \t\n\r";
882 char *keys = newstring(ckeys), *b, *k = strtok_r(keys, sep, &b);
883 vector<int> cats;
884 cats.add(0);
885 while(k)
886 {
887 loopv(favcats) if(!strcmp(favcats[i], k)) cats.add(i + 1);
888 k = strtok_r(NULL, sep, &b);
889 }
890 delete[] keys;
891 if(cats.length())
892 {
893 loopv(cats)
894 {
895 if(cats[i] == showonlyfavourites) { showonlyfavourites = cats[(i + shiftdirection + cats.length()) % cats.length()]; return; }
896 }
897 }
898 showonlyfavourites = 0;
899}
900
901vector<const char *> favcattags;
902

Callers 1

serverskeyFunction · 0.85

Calls 6

getaliasFunction · 0.85
newstringFunction · 0.85
strtok_rFunction · 0.85
loopvFunction · 0.70
addMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected