1 (edited by toilette 2009-04-28 21:44:37)

Topic: [TOOL] remote rcon for teeworlds

Hello,
because I hate these situations :
          kicked on my own Server
          want to change configs but server is full (restart? takes to much time)
          want to play but Server is full (well it's not verry nice)

I've written this little Mod to connect on a running tee-worlds server with telnet.
It only works on linux (I've had some little errors on compiling with windows) and only local telnetclients are allowed to connect
(local means in this case: running on the same PC where the Server is running)

To connect just use SSH to get a connection to your server and there you can use telnet like this:

telnet localhost <port>

thats all.
for more infos read the README or the LIESMICH file

and here the link :
http://www.file-upload.net/download-161 … n.zip.html

2

Re: [TOOL] remote rcon for teeworlds

I've had this idea for a while but not done it because lack of time... as usual....

It's nice that you have done this and I would really like to introduce this into the mainline but it's ridden with problems in your implementation.

* Keep patches minimal. Looks like you removed all trailing spaces and tabs from lines (including blank lines) and this makes the patch very hard to read.
* You introduce C++ to the engine core. Strictly C should be used here.
* You use as you mention the BSD socket interface directly instead of using the net_* functions that exist.
* You made it threaded, which is nice, but it lacks synchronization like locks/mutex/semaphores. This will cause weird random errors and crashes when it's used.
* It deals with TCP as it was a line based protocol which it's not. It's stream based so you need to buffer bytes until you received a complete line and then process it. This can cause weird errors under more exotic circumstances.

Would also be nice if it supported more then one connection, but that's enough for a start.

3 (edited by toilette 2009-04-22 13:36:30)

Re: [TOOL] remote rcon for teeworlds

O.o

I haven't expected this reaction yet, but it's nice that you like it.
well you're right it's not the best solution, I've made this in a week and I'm not the best C / C++ programmer but well maybe you can fix the problems you have found. ;-)
(I'do not realy know how I should make it.)

I have no problems with my Server.

4

Re: [TOOL] remote rcon for teeworlds

oha, I've found your net_* functions. I'll see if I can make a little better mod ;-)

5

Re: [TOOL] remote rcon for teeworlds

toilette wrote:

O.o

I haven't expected this reaction yet, but it's nice that you like it.
well you're right it's not the best solution, I've made this in a week and I'm not the best C / C++ programmer but well maybe you can fix the problems you have found. ;-)
(I'do not realy know how I should make it.)

I have no problems with my Server.

The threading issues will be very random and not show up directly because they are very timing dependent, but they will happen, sooner or later.

6

Re: [TOOL] remote rcon for teeworlds

how can I solve this problem? Are there any functions / tutorials for this ??

7

Re: [TOOL] remote rcon for teeworlds

Great work! Only things we need to improve is to get it built for windows and for it to be added to other popular mods like race, freeze ect...

Bye.

8

Re: [TOOL] remote rcon for teeworlds

dinosmoothie wrote:

Great work! Only things we need to improve is to get it built for windows and for it to be added to other popular mods like race, freeze ect...

thanks ;-)
I'm sitting on a new version of this, that uses the net_* functions, that are defined in system_c and makes a windows compilation possible ;-).

9 (edited by toilette 2009-04-28 21:45:11)

Re: [TOOL] remote rcon for teeworlds

OK, the new Version of the mod is Ready.
Now you can compile it in windows too.
For those who have problems by reading the patch file, I've recreated the patch file without changed white spaces, so only things that are really necessary are standing in this file.

One word of warning :

Don't use the windows internal TelNet-client. This causes errors. Use PuTTY instead (http://the.earth.li/~sgtatham/putty/lat … /putty.exe)

I hope I've solved a lot of the errors  matricks has found. If not, well feel free to change it.

Here is the file http://www.file-upload.net/download-161 … n.zip.html
have fun toilette

P.S. to apply it into another mod (like race, ball or other) just patch the another mod first.
after that you can patch the rrcon mod into the patched file.

But ensure that no conflicts occur, and destroy your code.
Use

patch -p0 --dry-run < rrcon.patch

to check for conflicts and when no conflicts are shown use

patch -p0 < rrcon.patch

to apply it.

patch for windows can be found here (http://gnuwin32.sourceforge.net/downlin … in-zip.php)

10

Re: [TOOL] remote rcon for teeworlds

so is it any commands that I need to put on the recon ore something to get this to work ?

MertenNor

->My 24/7 servers: [NOR] Norwegian HUB <- Back Online !! big_smile
( My grammar is getting better ! smile I think.. )
-Norway

11

Re: [TOOL] remote rcon for teeworlds

MertenNor wrote:

so is it any commands that I need to put on the recon ore something to get this to work ?

MertenNor

Well, I do not realy knw what you mean, but I guess.

If you want to know witch commands you will need to use this mod read the readme or the liesmich file first. there is a list of all commands that are available in this mod.
for a connection to the server you need a telnet client like putty or the linux telnet. the MS client wont work.

12

Re: [TOOL] remote rcon for teeworlds

Hello all. I am sorry, but can somebody post a compiled Windows version here?
I cant patch it, because of I cant compile - in MinGW instalation it shows me error
Thanks

Goodbye all. Account inactive since March 2011.

13 (edited by DinoSmoothie 2009-04-23 18:07:38)

Re: [TOOL] remote rcon for teeworlds

khubajsn wrote:

Hello all. I am sorry, but can somebody post a compiled Windows version here?
I cant patch it, because of I cant compile - in MinGW instalation it shows me error
Thanks

Toilette posted the zip file further up.

http://www.file-upload.net/download-160 … n.zip.html

Its already compiled for windows in the zip file.

Soon i will make this for the other mods wink

Bye.

14

Re: [TOOL] remote rcon for teeworlds

Hi.. smile

here is a Download link for Intel and PPC Macs smile

rrcon_Intel.zip

rrcon_PPC.zip

MertenNor

->My 24/7 servers: [NOR] Norwegian HUB <- Back Online !! big_smile
( My grammar is getting better ! smile I think.. )
-Norway

15 (edited by DinoSmoothie 2009-04-23 21:41:13)

Re: [TOOL] remote rcon for teeworlds

hey guys, i patched most of the mods around these days and i have windows binaries for them.

Mods that the zip file consists of:
Instagib - Awesome mod by Somerunce
Race Mod - by Rajh, Redix.
[N]race mod - All the Race Mod stuff, but with more flexible functions. By Nox Nebula and Aede.
Tag/Xtreme mod - Great mod by Tom94 !
Defusion Mod - Great mod presented by Oy but i don't know who made it.
Domination Mod - Great mod by some people(i dont know who made it).
Mario Mod - Another great mod by Tom94 !
Hprace, hammer party and so on... - Very good mod by Lord Skelethom
Hold the Flag(HTF) -  Mod by Shamfoozius.
gCTF fire mod - Made by clarus.
and Flagball Mod - Beautiful mod originally by Datag and converted to 0.5.1 by Oy .

Thats's all i have so far smile

Mods that didn't compile:
Scosu's Modpack :'( We all love it. - Well done scosu big_smile
Ifreeze+/instagib + :'( Its a great mod. - Another by Tom94, One of the best ever mods!

I couldn't compile these, two patchfiles in one was kinda hard for my comp ;D

Anyway, down to the point. Here's the download with all the mods in it:http://filebin.ca/qmgdf/rrcon_mods_2.zip So you get all those mods and you can access them from outside the server smile thanks toilette for making this mod tongue

Thx,
Dino

Please Note: These are the most popular mods, i may have missed some out and i will fix that later. - check here: http://www.teeworlds.com/forum/viewtopic.php?id=3929 - Also sry for making such a big deal about this post big_smile

Bye.

16

Re: [TOOL] remote rcon for teeworlds

I think i will wait to implent this into my mods, till the bugs which matricks mentioned are fixed.
I really dont want to create unstable mods, so i mhope you understand sad
If you really need the features, then just add them to my mod. If patching doesnt work, then try to open the .patch file and do it manually (search for parts of the line to patch, so you might be successful).
A person with time and a smart mind should easily be able to do it.
However feel free to release my mods with this mod under my and toilettes credits, but mention, that it might be unstable. wink

Great mod btw, i look forward for it to be ready tzo be implented in my official releases! big_smile

~{MonkeyStyle}~ - Instagib Teeworlds Clan
VISIT US: http://monkeystyle.xooit.com/
Check out our IRC channel: #monkeystyle on QuakeNet || Also check out the TeeWiki: http://teewiki.info

17 (edited by DinoSmoothie 2009-04-23 21:21:24)

Re: [TOOL] remote rcon for teeworlds

Okay smile i just want to get the rest of your mods on this, i know they are unstable but i will update them when toilette releases a further version of this mod. Then you can release them officially tongue

*New mods adding to list soon*

Bye.

18 (edited by toilette 2009-04-28 21:46:04)

Re: [TOOL] remote rcon for teeworlds

OK final Version uploaded. Both threads are synchronized and the Server should run stable now.

here is the file : http://www.file-upload.net/download-161 … n.zip.html
now lots of fun, and thanks to dinosmoothie for patching the other great mods with this together.

@dinosmoothie
you don't have to repatch all mods again, just replace the src/engine/telnet.h with the new version of it.

19

Re: [TOOL] remote rcon for teeworlds

Great work wink

The linux version works fine but it seems that the windows version has a problem : the server won't start, it crashes after loading the map.

20

Re: [TOOL] remote rcon for teeworlds

Ok thanks smile but i deleted all the srcs so i'll get to that soon wink

Also - Can you please explain more how to use it on windows with Putty? Im kind of confused because the commands dont work and then the windows closes. sad

thx

Bye.

21 (edited by toilette 2009-04-28 21:46:27)

Re: [TOOL] remote rcon for teeworlds

InconnuConnu wrote:

Great work wink

The linux version works fine but it seems that the windows version has a problem : the server won't start, it crashes after loading the map.

Ooops,

it seems, that I've packed the wrong version of the exe in this package. Here is the package with the correct exe :

http://www.file-upload.net/download-161 … n.zip.html

dinosmoothie wrote:

Ok thanks smile but i deleted all the srcs so i'll get to that soon wink

Also - Can you please explain more how to use it on windows with Putty? Im kind of confused because the commands dont work and then the windows closes. sad

thx

You can only connect, if your IP address is 127.0.0.1 . Its a reserved address normally used for the local computer where you're sitting in front of.
if PuTTY fills the wrong address in the ip-field (not 127.0.0.1) fill in this address : 127.0.0.1;
After that check the port. It must be the same as defined in your config file. If ready check the radio button Telnet and press OK (connect or whatever). your connection should be ready then.

http://www.pic-upload.de/thumb/27.04.09/ec7a29.png

http://www.pic-upload.de/thumb/27.04.09/fdbqc7.png

22

Re: [TOOL] remote rcon for teeworlds

Some more feedback based on the latest patch:

1. Don't do the implementation in the header file.
2. Don't define bool, true and false, use an int instead.
3. It deals with TCP as it was a line based protocol which it's not. It's stream based so you need to buffer bytes until you received a complete line and then process it. This can cause weird errors under more exotic circumstances.
4. Your string handling is a bit weird. str_clear() could be just { *str = 0; }. This has to be redone when nr 3 is fixed.
5. The locking is incorrectly done. It can access the same socket from two different threads at the same time causing problems (net_tcp_send, net_tcp_recv). This could cause crashes.

Cheers

23 (edited by toilette 2009-04-28 13:55:11)

Re: [TOOL] remote rcon for teeworlds

Hi and thanks for your feedback

matricks wrote:

1. Don't do the implementation in the header file.

I have to do this because I do not realy understand your compilation process. If I rename the same file with the same content from telnet.h to telnet.c I can't compile it.
If I rename it to telnet.cpp I can compile it. And if I use the name telnet.h oha... I can compile it too. So if nobody can explain me how I should change the files and why, I wont change the filename. A program is working stable, even the source filename isn't c or c++ or what else.
Sorry.

matricks wrote:

2. Don't define bool, true and false, use an int instead.

Okay I do it.

matricks wrote:

3. It deals with TCP as it was a line based protocol which it's not. It's stream based so you need to buffer bytes until you received a complete line and then process it. This can cause weird errors under more exotic circumstances.

4. Your string handling is a bit weird. str_clear() could be just { *str = 0; }. This has to be redone when nr 3 is fixed.

If youre meaning, that I should check the last character for a '\n' or a '\r', and process it then, I will make it. If not, I don't know what you're meaning

matricks wrote:

5. The locking is incorrectly done. It can access the same socket from two different threads at the same time causing problems (net_tcp_send, net_tcp_recv). This could cause crashes.

why did'nt you say that earlier big_smile. I haven't known what you're meaning, till now. But I will do it.

24

Re: [TOOL] remote rcon for teeworlds

On the compile thing. Name the file es_telnet.c and put it in src/engine/server and it should be compiled when you run bam.

On the TCP thing. You should assume that you will get anything form 1 byte to max_size byte at the time from net_tcp_recv. Each time you received data, you should check for complete lines that you can parse and parse those lines. There might be data left for an uncompleted line as well that you must save in the buffer and continue to read.

25 (edited by DinoSmoothie 2009-04-28 21:32:50)

Re: [TOOL] remote rcon for teeworlds

toilette wrote:

You can only connect, if your IP address is 127.0.0.1 . Its a reserved address normally used for the local computer where you're sitting in front of.
if PuTTY fills the wrong address in the ip-field (not 127.0.0.1) fill in this address : 127.0.0.1;
After that check the port. It must be the same as defined in your config file. If ready check the radio button Telnet and press OK (connect or whatever). your connection should be ready then.

http://www.pic-upload.de/thumb/27.04.09/ec7a29.png

http://www.pic-upload.de/thumb/27.04.09/fdbqc7.png

Thanks for the help smile

EDIT:
But now i can't download the new version because the link is broken sad and also that method you told me won't work either sad

Bye.