1

Topic: [C#] Questions about sending paramaters to a running server

Hi,
I am programming a server manager for TW. But I don´t how I can send parameters to a running TW server from my program. And I also don´t know, how I can send text to the remote console from my program. The program user don´t need to start TW for this. It should work without TW.

Hope you can help me,
thanks


derwunner

2

Re: [C#] Questions about sending paramaters to a running server

http://www.teeworlds.com/forum/viewtopic.php?id=3927

3

Re: [C#] Questions about sending paramaters to a running server

The official Teeworlds does not support sending rcon commands not from a client. I don't relly get what you mean by "sending parameters to a running tw sever", but if you mean to parse for example -f myconfig.cfg to a server, that's allready running, this of course not possible as well, simply because it is not the way parameters are being used. For real remote rcon access, Kottizen has allready provided a link to a patch.

4

Re: [C#] Questions about sending paramaters to a running server

You got two choices :
- Modifying a server and send him commands as you like.
- Connecting yourself as a real client, send the rcon password and then commands.

|ZPote| buffer[]'s posterous

5

Re: [C#] Questions about sending paramaters to a running server

@ Kottizen: This plugin is nice, but I don´t really understand the plugin. If i type my data inside the telnet program und press on the open button the program go just away and nothin results.
By the way: Sorry, but I didn´t know, that I have imitated TW moderators.

@All:
I need more help.
Please help me!

6

Re: [C#] Questions about sending paramaters to a running server

If you don't know anything about network, don't event try.
But if you do, watch Teeworlds code, nobody's gonna explain you all the code (although you'll get answer for specific questions).

And btw, Teewolrds isn't coded in Python, just a few script to generate stuff.
It's in C++.

|ZPote| buffer[]'s posterous

7

Re: [C#] Questions about sending paramaters to a running server

@buffer[]
I know important things about networks. But why do I need this? I just want to send parameters from a external program to TW.

8 (edited by ghost 2010-01-27 11:44:08)

Re: [C#] Questions about sending paramaters to a running server

Again, you can't send parameters to a running programm, that is simply not possible, and should not be! All you can do is send data to a specified address(in your case probably localhost/127.0.0.1) on a specified port. But the program must have a routine that recieves this data, and interprets it. To achieve this you have to use network functions. Exactly this is done in the patch, it adds support for telnet connections to the teeworlds server. If the server recieves data (via telnet with the port you specified and so on...) it processes it, meaning if it is a correct rcon command it executes this command, otherwise it will send you a message back, that you have entered an invalid command. So what you need to do is apply this patch to teeworlds and add some code to your program that lets it work as a telnet client(at least sort of).
So if you want your teeworlds server be controlled by another program, while allready running the only solution for you is to dig deeper into how network coding works, so you can let your program connect to the teeworlds server(protocol should be tcp/ip) and this way execute commands there. There is no other practicable way of doing this. I doubt the teeworlds community can help you much more with this issue, as we allready have told you about a (probably the best) solution. If you have further more questions about how to realize this whole networkthing i suggest you to read a tutorial on networkprogramming for your programming language(C#, if I understand your topic correctly), and for further questions ask in a forum that deals with this language, the'll probably be able to help you better, as those questions are probably not really tw specific.

9

Re: [C#] Questions about sending paramaters to a running server

tanks buffer[]
that helped me a lot! Ok, i am realizing that it will be a long way to code this. That´s not easy. And i am not really good at c#. But I alway look for new challenges in programming. I love programming! And also my apprenticeship handle about programming.

best wishes derwunner

10

Re: [C#] Questions about sending paramaters to a running server

If I were you, I'd use WPE Pro, that'll save you a lot of time, by looking directly packets on connecting instead of looking the full code

|ZPote| buffer[]'s posterous

11

Re: [C#] Questions about sending paramaters to a running server

derwunner: Apply the patch to your server. Read the README-file so you'll fin out what you have to put into your server-configuration-file. Then, connect to "localhost:****" with telnet, where **** is the port you specified in the configuration-file