FOnline Development > Questions and Answers

Remote Admin

<< < (3/4) > >>

JovankaB:
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

Wipe:
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

JovankaB:

--- Quote from: Wipe on September 01, 2016, 03:46:31 pm ---Taking all the problems together - general idea is nice, but as you can see it works only on paper.
--- End quote ---

Phew, it would work in reality too! - just not 100% of the time :P

GecKoTDF:
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?

Wipe:
Just include _defines.fos (and get used to that, that file is required for virtually everything)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version