Vampi Needs Ideas

Started by Sweet, September 14, 2011, 03:52:12 PM

Previous topic - Next topic

Apollo

And you mean what by that?

If I could rearrange the alphabet, I'd put your sister and I side by side.

Heav’n hath no rage like love to hatred turn’d, Nor Hell a fury, like a woman scorn’d.

Pupskuchen

You are the only person that doesn't know how frogmod works

Sweet


Apollo

Considering I used to run several frogmod servers, I find that slightly insulting.

If I could rearrange the alphabet, I'd put your sister and I side by side.

Heav’n hath no rage like love to hatred turn’d, Nor Hell a fury, like a woman scorn’d.

Zoocata

To tell if someone saved the map or not. :D

unixfreak

#40
Something i just thought of, seeing as frogmod already uses GeoIP maybe place a flag next to the countryname on the http console?

These seem to have a non restrictive license and look nice: http://www.famfamfam.com/lab/icons/flags/

Would add a nice touch.


PS; Tried spendign the last hour adding it myself although, i'm a bit of a noob when it comes to c++ , heres a few changes i tried to make;
Put the flags folder from the above link into web/flags (the .gif ones)

roughly line 259: web/frogmod.js
html.push('<td><img src="flags/"'+players[p].country_code+'.gif" />' +players[p].country+'</td>');

roughly line 795: engine/server.cpp
//added this
const char *country_code = GeoIP_country_code_by_ipnum(geoip, endianswap32(c.peer->address.host));

And resused some of the code for getclientcountry() to work as getclientcountry_code()
Then this will work: printf("client's country code: %s\n", country_code);

I'm just guessing here, but i tried adding this for the http console:
roughly line 643: fpsgame/server.cpp
evbuffer_add_json_prop(buf, "country_code", getclientcountry_code(ci->clientnum)

however fails to compile, like this :-/
/tmp/frogmod-justice/fpsgame/server.cpp: In function ‘void server::evbuffer_add_json_player(evbuffer*, server::clientinfo*, bool, bool)’:
/tmp/frogmod-justice/fpsgame/server.cpp:644:84: error: ‘getclientcountry_code’ was not declared in this scope


Then again, i'm not too sure what i'm doing. Haha.
Just an idea. I think it would look great with country flags on the console.
Join the Red Eclipse discord! https://www.redeclipse.net/discord

Pupskuchen

oooh lemme try lemme try!

vampirefrog


Pupskuchen

#43
Quote from: vampirefrog on March 08, 2012, 04:25:55 PM
getclientcountrycode

1. Is this a real function?
If yes:
-> 2. Does that return stuff like "RO", "GB", "DE"?
-> If not:
--> 3. What does it return?

Edit: Asked because it's what I need now. Just wanted to ask^^

Edit 2: It doesn't seem to be a real function.

unixfreak

#44
I changed all instances of getclientcountry_code to getclientcountrycode (assuming the _ was the problem). Doesn't seem to change anything though.

Quote from: Pupskuchen on March 08, 2012, 04:45:54 PM
Edit: Asked because it's what I need now. Just wanted to ask^^

this returns iso-3166 codes (RO, GB, DE);

GeoIP_country_code_by_ipnum(geoip, endianswap32(c.peer->address.host));


Quote from: Pupskuchen on March 08, 2012, 04:45:54 PM
Edit 2: It doesn't seem to be a real function.
Because i tried to add it  :)


Join the Red Eclipse discord! https://www.redeclipse.net/discord

Pupskuchen

Oh lol I didn't notice your code stuff O.o

Well, I also tried it and I also fail.


/home/pups/hiso/fpsgame/server.cpp: In function \u2018void server::evbuffer_add_json_player(evbuffer*, server::clientinfo*, bool, bool)\u2019:
/home/pups/hiso/fpsgame/server.cpp:643: error: \u2018getclientcountrycode\u2019 was not declared in this scope

/home/pups/hiso/fpsgame/server.cpp: In static member function \u2018static void server::_icmd_getclientcountrycode<2935>::run(int*)\u2019:
/home/pups/hiso/fpsgame/server.cpp:2935: error: \u2018getclientcountrycode\u2019 was not declared in this scope

/home/pups/hiso/fpsgame/server.cpp: At global scope:
/home/pups/hiso/fpsgame/server.cpp:3037: warning: \u2018server::__dummy_clearbans\u2019 defined but not used


That's the only thing that doesn't work.

Pupskuchen

If only somebody would connect....Then I could see if it finally works....


unixfreak

Nice Pupskuchen, i see you got it working kind of, theres a german flag in place of a username on your console page.
Btw that is the exact same error i was getting.
Join the Red Eclipse discord! https://www.redeclipse.net/discord

Pupskuchen

I fixed everything, it works fine now.

Pupskuchen

I went on modding it. You can't take master now when somebody's logged in. Also, if somebody is master and you log in, master is taken.
It's useless, but an experience for me.

I just thought: If you are logged in (invisible admin), you don't want other ppl to claim master.

vampirefrog

what if you don't want them to know you're logged in either?

Pupskuchen

Then I could remove the server messages, and nobody gets it.
btw, you can still use /auth! (looking at eihrul) :D