fodev.net
FOnline Development => Questions and Answers => Topic started by: GecKoTDF on August 30, 2016, 03:52:35 pm
-
Hi guys, I was building a server and find in the config file a "Remote Admin Port" it's in 0 by default - I try to change it to another port, and the put this port in the client or something like that but not work - It's posible to get a remote admin control? Not loged in the game? or that config it's just a forget function ?
-
If you want control without being logged ingame, why do you try to connect with a client? :P
-
Jaja well I mean a remote admin without enter the game, I check the client you can change de port - I was imagine if you put the port of the "Admin panel" you don't load the game just a console to send commands or stuff like that but I believe its impossible - And there's no information about the admin panel port or how to log using that port.-
-
Just use telnet, connect, and type password. Then just use hardcoded ~commands like you'd do in client after getaccess -- be warned lot of them won't work :P
In my opinion it ain't worth it... some of design choices are silly, annoying, or simply dangerous; but hey, it's just me.
-
Ahhh you are the best! - Great well I know its probably a "beta" of that but its a good option have a possible telnet connection for any quick access.-
By the way, there's a way to send a Global Message in admin mode? Like... "~say_global Hello" something like that
-
No. None of hardcoded commands can be (ab)used to pass strings~
If you know bit C++ you can check my attempt on admin panel via dll, which one of purposes was to bypass exactly this limitation; never had a chance to test it on live server so beware :P Everything is in here (https://github.com/rotators/fo2238/blob/master/Server/extensions/DevConnect) and here (https://github.com/rotators/fo2238/blob/master/Server/scripts/devconnect.fos), except actual starting whole thing, which should be done by calling InitDevConnect(port) in main@init and ProcessDevConnect() in main@loop.
Highly experimental, untested, unsafe (if you don't modify dev_login() function), probably bit slow... but at least you can edit it any way you like and -most important i think- it's prepared for two-way communication and tied to game scripts, instead of hardcoded commands (which can, in most cases, be simulated by scripts anyway).
Luckily, that's really small amount of code so it should be pretty easy to understand for anyone who worked with fonline dlls before.
-
I see, so by default there's no way to send a message if you are and admin in a "global" way to all connected users ? -
-
Best i can think of is - predefined messages with assigned id numbers and ~run command which sends them (by providing message id as one of params)
-
That exactly what i mean Wipe - Im a noob in coding, but you can give me an example of predefined message and how to call it?
-
It can be anything as simple as
void msg( Critter&, int, int, int type )
{
string msg;
if( type == 1 )
msg = "Yay!";
else if( type == 2 )
msg = "Wee!";
else
return;
array<Critter@> players;
for( uint p=0, pLen=GetAllPlayers(players); p<pLen; p++ )
{
players[p].Say( SAY_NETMSG, msg );
}
}
and called as ~run some_modulke msg 0 0 1
Oh, and remember to never access Critter object in any function called from admin panel... In best case it will result in script exception, in worst - server crash (don't remember AS behaviour now)
-
Can't you just send ascii values with ~run commands one by one, store them in a buffer and then a special command to "show whole message"? :D
And then modify the admin panel to make this automatically, you just write "say hello" and the panel sends all necesary ~run commands
-
Technically yes, but!
- There's no way to detect who said hello
- If you say hello to specific player, you'll never see if/what s/he answered
- Probably would need external application to send messages
- As you can pass maximum 3 characters during one call, you'd have to call the function at least 2 times even for such short message as "hello". And that's where problems begin (see point 1)... consider following scenario:
- Admin#1 wants to greet player with a nice, warm "hello". That string have 5 bytes, so we need to call function at least 2 times
- After receiving first 3 bytes, we store it somewhere in scripts
- At same time, Admin#2 decides to Interact With Playerbase, by sending his greetings. He's very excited to do that so decides to send text "hi!". We don't know yet if it's the end of message so we store it somewhere... in scripts...
- Second part of Admin#1's message comes in - "lo" and end-of-string marker (let it be '\n' to makes things easier)
- We add received string to already cached value... but... oh noes! Our cached var value is now "helhi!lo"
- Our message has been sent to player. It's horrible, it's gibberish, and it probably will make player post GM ABUSE thread.
WHAT A DISASTER - But wait, there's more! Just millisecond later there comes end-of-string marker from Admin#2. Now not only we sent gibberish but also a blank line.
GAEM LITERALLY UNPLAYABLE
Taking all the problems together - general idea is nice, but as you can see it works only on paper. Please address mentioned issues when updating your suggestion.
Sincerely,
#Rotators
-
Taking all the problems together - general idea is nice, but as you can see it works only on paper.
Phew, it would work in reality too! - just not 100% of the time :P
-
Hi Wipe,
Well I made a few test but no luck - Im sure im doing something wrong, I copy the code and create a .fos file call it "text" and save it into script folder of the server then load that in script.cfg like "@ server module text" and no luck fail to start the server say "'SAY_NETMSG' is not declared" then try to load id in "_scripts.fos" the server load but in the "chat" I type "run text msg 0 0 1" and still no luck to made it work.-
Im wrong in the load of the code?
-
Just include _defines.fos (and get used to that, that file is required for virtually everything)
-
Hell Yeah! work like a charm - Thank you very much Mr. Wipe! - Now understand a bit more the lenguage of the motor.-
Now another question about the server admin - For example when you launch FOnlineServer.exe you can create a batch who clear the temporary files, and with -start open the .exe and do a automatic start of the server.-
But looking at the lenguage, its possible to create a script with a 24 timer for example or at certain hour of the actual day - Do this:
- Save WorldMap
- Execute a .bat file ?
Because it's this is posible when you call the msg 0 0 1 check a .txt file, see the information in line 1 and thats the message - This give you the chance to change the message without restart the server
-
You could, i guess. It really sounds like reverse of our solution to redirect +requesthelp messages to IRC channel.
Basic idea is to store each message somewhere in server folder and frequently checking them. That's where you need AS extension to collect filenames in given directory, pass a list back to scripts, open and process messages and back dll which deletes processed files. Easy.
Here (http://angelcode.com/angelscript/sdk/docs/manual/doc_register_api_topic.html) you can read about how to add new functions to scripts, and i'm sure there are some examples on creating own dlls somewhere in SDK. Remember to keep server<->outside communication as fast as possible or you will end with pretty lagging server :)