FOnline Development > Questions and Answers
Remote Admin
Wipe:
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 and here, 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.
GecKoTDF:
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 ? -
Wipe:
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)
GecKoTDF:
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?
Wipe:
It can be anything as simple as
--- Code: ---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 );
}
}
--- End code ---
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)
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version