I don't know python, so editing it is a lot of guesswork from the basics I know of programming. Does anyone see anything wrong with how !# functions? It seems to be the #1 cause for the script to crash (the server doesn't)
If someone could explain in more detail this part of the code to me
if (player in oplist) or (item in blocklist):
for i in range(int(num)):
proc.stdin.write('give %s %s\n' % (player, item))
time.sleep(0.1)
This is the one thing I don't understand too well
What does
for i in range(int(num)):
do?
Why do you need
\n'
in
proc.stdin.write('give %s %s\n' % (player, item))
I have a feeling if I understood these better, I might understand why this command crashes the script so much.
# Our givenum command
if('!#' in words):
i = words.index('!#')
if(len(words) < (i+3)):
p.stdin.write('say ERROR: Usage is !# num item\n')
time.sleep(0.1)
p.stderr.readline()
else:
player = words[i-1].strip('<>')
num = words[i+1]
item = words[i+2]
givenum(p, player, item, num)
The \n is a newline character - you want the commands to be written on separate lines. The sleep function introduces a delay of 0.1 seconds between interactions of the script with the server. The "for" etc. is just a classic for loop with an incrementing variable. I think you really shouldn't look to deep into the code unless you know programming basics - you wouldn't understand it. =)
The command you cited looks clean enough - you have to realize that the server is incredibly unstable and buggy and full of leaks all by itself, if it crashes for any reason it might be the wrapper, it might be the server itself, your particular software configuration or the planets not aligning right. If the server crashes try out one of the other scripts posted on the forum or wait till SMP is fixed and actually worth playing. I run my server as an experiment more than anything else.
Rollback Post to RevisionRollBack
War does not determine who is right - only who is left. - Bertrand Russell fCraft.net Freebuild Official - Official server of the fCraft custom server software
Basically, I clear the hundreds of 'give whoever whatever' from the log buffer in the script, which may help a little. I also made the items spawn a little slower, and eased up on the 0.1 second polling of the server.
I am running your new script without any modifications, been stress testing the !# command since its usually what causes the script to break first. It broke within a few minutes of light usage, I never spawned anything more than 10 at a time, and I have pretty long breaks in between. What would cause the script to stop running, shouldn't the script instead of crashing when a command doesn't go through, keep running? Why does the script stop functioning completely? Is there any way to start the script again without having to reload the server?
you have soiled the fun and meaning of SURVIVAL multiplayer.
..............................................------------
There is not much to survive right now, so meh.
Also, the item spawning can be turned off.
Also, I am unable to replicate this script crash as of now.
My server crashes within 5minutes of being up with your script. Let me know how to get you the information you need to fix this, and I'll be glad to. You can't replicate the crash with nobody on it, you need players. Also I'm using 64bit OS Win Server 2003 as well.
Rollback Post to RevisionRollBack
--
Lead coder for AuntJemima's Homestyle Survival server.
you have soiled the fun and meaning of SURVIVAL multiplayer.
..............................................------------
This is one of the most nonsensical posts I've ever seen, and I (quite shamefully) spend hours on /v/
I haven't been able to crash anything with the give command either. All the script does is repeat a command over and over, if anything it's a processing power issue on the server's end
Like I said, it's either a memory overflow (Not due to spamming commands) or it's something a player is doing causing a crash. Crafting? What would it be :tongue.gif:
Rollback Post to RevisionRollBack
--
Lead coder for AuntJemima's Homestyle Survival server.
I haven't been able to crash it yet with 3 players that used !# often. I am on windows 7 with 4GB ram, java V.1.6.0, and corei3-330M (it is a laptop). Try running it in the command-line by opening CMD, navigating to the observer folder, and typing run.bat. When the server crashes, screenshot the CMD session and post that along with a server.log
Because I cannot replicate this, it is difficult to diagnose.
Basically, I clear the hundreds of 'give whoever whatever' from the log buffer in the script, which may help a little. I also made the items spawn a little slower, and eased up on the 0.1 second polling of the server.
You should move the p.stdin.write('say BAN NOTICE: Player ' + target + ' was banned by ' + player + '!\n') and other ones to within the ban and op functions themselves after it verifies if the player has permissions or not, else you'll have people doing !op and it says they gave op to someone, then say no permissions.
Additionally, when the server "hangs" nothing comes up in the console, or gets posted in the server.log. It just seems to deadlock. When running the server through console directly to hope for exceptions, nothing is thrown. There is nothing, just a server hang. Nothing being said even prior, etc.
Rollback Post to RevisionRollBack
--
Lead coder for AuntJemima's Homestyle Survival server.
So, Ive redownloaded, to the most recent version. Ive got minecraft_server.jar file in the same folder as observer and run.bat. Ive installed Python 2.6.5, same version recommended to me by Koufu. Everytime I try to run either the run.bat, or the observer.py, the resulting command line hangs. It just sits there, acting like its trying to do something, but never does. Its very stubborn to close, and I cant use the typical CTRL+C to cancel the process.
Not sure if anyone needs specs to help here, but I have Win XP SP3, and Ive seen 2 others in this thread post a similiar problem. Its not the server hanging, its the actual command prompt hanging, the server never launches =/
There's a reason why I didn't post my fixed version. I'm trying to keep the actual exploit from being obviously revealed before the fix can be put in the opening post.
There's a reason why I didn't post my fixed version. I'm trying to keep the actual exploit from being obviously revealed before the fix can be put in the opening post.
Hint: If you found it, someone else has too.
The smart thing would be to post the fix so that people can apply it to their servers as soon as possible.
If someone could explain in more detail this part of the code to me
This is the one thing I don't understand too well
What does do?
Why do you need in
I have a feeling if I understood these better, I might understand why this command crashes the script so much.
What does do here?
The command you cited looks clean enough - you have to realize that the server is incredibly unstable and buggy and full of leaks all by itself, if it crashes for any reason it might be the wrapper, it might be the server itself, your particular software configuration or the planets not aligning right. If the server crashes try out one of the other scripts posted on the forum or wait till SMP is fixed and actually worth playing. I run my server as an experiment more than anything else.
fCraft.net Freebuild Official - Official server of the fCraft custom server software
http://www.mediafire.com/?hbpjpj1i9aaeetn
Basically, I clear the hundreds of 'give whoever whatever' from the log buffer in the script, which may help a little. I also made the items spawn a little slower, and eased up on the 0.1 second polling of the server.
..............................................------------
There is not much to survive right now, so meh.
Also, the item spawning can be turned off.
Also, I am unable to replicate this script crash as of now.
My server crashes within 5minutes of being up with your script. Let me know how to get you the information you need to fix this, and I'll be glad to. You can't replicate the crash with nobody on it, you need players. Also I'm using 64bit OS Win Server 2003 as well.
Lead coder for AuntJemima's Homestyle Survival server.
This is one of the most nonsensical posts I've ever seen, and I (quite shamefully) spend hours on /v/
I haven't been able to crash anything with the give command either. All the script does is repeat a command over and over, if anything it's a processing power issue on the server's end
steam : soundcloud : facebook
Lead coder for AuntJemima's Homestyle Survival server.
Because I cannot replicate this, it is difficult to diagnose.
You should move the p.stdin.write('say BAN NOTICE: Player ' + target + ' was banned by ' + player + '!\n') and other ones to within the ban and op functions themselves after it verifies if the player has permissions or not, else you'll have people doing !op and it says they gave op to someone, then say no permissions.
Additionally, when the server "hangs" nothing comes up in the console, or gets posted in the server.log. It just seems to deadlock. When running the server through console directly to hope for exceptions, nothing is thrown. There is nothing, just a server hang. Nothing being said even prior, etc.
Lead coder for AuntJemima's Homestyle Survival server.
Not sure if anyone needs specs to help here, but I have Win XP SP3, and Ive seen 2 others in this thread post a similiar problem. Its not the server hanging, its the actual command prompt hanging, the server never launches =/
Anyone? ANyone at all?
http://www.mediafire.com/?l9n6jgydxyxx3llFixed everything, added the starter pack
EDIT: Fixed a glitch with the item spawning
http://www.mediafire.com/?dog6a2dflc6pcf5Hint: If you found it, someone else has too.
The smart thing would be to post the fix so that people can apply it to their servers as soon as possible.