( search forums )
simple c++ server message source
Soldat Forums - Soldat Talk - Developers Corner
October 14, 2005, 4:37 pm
Hi all, I wrote this quick prog a while ago for a soldat server I'm running. It sends a "/say something" message to the server every 10 minutes. It's extremely simple but it might be good for someone who wants to start something similar. It was just sitting on my hard drive so I thought I'd post the source: http://www.planetsoldat.com/s-com/viewtopic.php?id=127

i am ahab
October 14, 2005, 4:47 pm
hello dude.

i've got something similar im working on, also in c++. its only current goal is to kick and ban hakers on detection of the current crack thats going around. also the app im making has potential for some very quick banning of any user defined strings. and this will all happen remotely as long as the app exe is started.

but i'm having clanplanet authenticate it as non harmless and give option to implement it on all their servers BEFORE i make the application downloadable for the community.

reason being there have been concerns that have come to my attention regarding a previous application release made in the community that was supposed to record and ban ips.

im all ears though if you want to suggest some features. i'll have a look at your code, see if there are any improvements i can make to mine from yours. thanks for sharing though mate =)


October 14, 2005, 4:53 pm
too bad this is for windows, otherwise i'd definately use it

i am ahab
October 14, 2005, 5:01 pm
flab, ill make a linux one too. the winsock library c++ uses for win32 sockets is based on the berkley sockets used by linux, so a linux os should be easy enough to port too. i only made my winsock first as clanplanet (who use windows) got involved as you were busy.

October 14, 2005, 5:15 pm
ahab, there was a text file I made that had some ideas to expand on this, here it is:

- admin name protection based on ip
- kick based on name
- minplayers (adds bots if number of players is less than X)
- voting on gametypes (through talk command)
- 1 vs 1 mode, disable powerups when playing 1:1

The voting on gametypes looks like the most interesting, players could vote for M79 only or whatever, but I'm not sure if those commands can be sent to the server through a remote admin.

Best of luck with your project :)

i am ahab
October 14, 2005, 7:15 pm
thanks mate ;)

first off i want to release something very very simple. then i will build upon that.

as for your suggested features:
admin name protection based on ip
i'm not too sure what you mean. do you want a name reserved so that it can only be used by one ip? that is fairly easy to do, but what if your ip changes? most will as they are dynamic. a way i can see to do it would be to have an ini file where you give ip=name. this should allow easy editing but is something i would add after i have made a working model.

kick based on name
easy. and something i was considering. this is something that you could use this for: quote:banning of any user defined strings

minplayers (adds bots if number of players is less than X)
well i thought about this, and as i'm basically reading the game events, it should be easy to say something in game, and have the app notice a keyword and carry out your command if it recognises it.
imagine in game you have this:
[majour]\serverbot addbot 1
the '\serbot' gets spotted by the app. it recognises the addbot command and carries this out.
the difference between this and using an admin command is that ANY player could say the \serverbot command. perhaps to a limit of X times per game to stop abuse. i'm unsure about the pros v cons of such a service, but its easy enough to add.

1 vs 1 mode, disable powerups when playing 1:1
easy to do. but again not a priority. shall look at as optional.

but i still need to finish my prototype :)

October 15, 2005, 12:16 am
ahab, perhaps this is the point where you make your own thread to follow the development of your app?