Closed ifvictr closed 9 years ago
This is actually a proof of concept. You can run the PHP scripts directly on the PocketMine directory.
@PEMapModder So basically just drag and drop it, correct?
Right
@PEMapModder I still recommend making a tutorial, because if I don't understand it, I'm pretty sure most if not all the other users wouldn't understand too. Do you have to run a command(shell) to enable it?
I have never tested it.
You just need to run, for example on Windows, bin\php\php.exe wrapper.php
@PEMapModder Where exactly would I drop the files? This is the part I'm most confused with right now.
@Gamecrafter next to src or PocketMine-MP.phar
@PEMapModder Do you just drop the php
folder(along with functions.php
and wrapper.php
in it) or just functions.php
and wrapper.php
? Sorry if I'm asking too many questions. ;)
Doesn't matter, as long as your cwd is the PocketMine home directory.
So after I drag it into the PocketMine home directory. Then you run a command. And then the server will start, correct? Do you run the command from php.exe
or just the system's command shell?
Command shell.
And you just have to run bin\php\php.exe wrapper.php
for it to work? It didn't work for me. I'm pretty sure I'm doing something wrong.
What happened? Using latest version updated yesterday?
I just run bin\php\php.exe wrapper.php
and it says it can't find that directory. I'm pretty sure it's just the command part now.
Fixed. I have just tested it, and it seems to work well.
Planning to make a PocketMine-GUI in the future, in Java.
After you made instructions, I've made progress. But it still keeps saying: [FATAL] No PocketMine installation (source folder or .phar) found in C:\Windows !'
when I run it with PHP. And this is when I have functions.php
and wrapper.php
in the PocketMine-MP directory.
@Gamecrafter run it in the PocketMine-MP directory. Do you have a C:\Windows\PocketMine-MP.phar
?
I've been running it in the PocketMine directory, refer to the screenshot below. And no, I don't have a C:\Windows\PocketMine-MP.phar
. Did it work for you when you were testing it? Maybe add a __DIR__
into the code when looking for the file paths?
cd
command terminal to that directory, and then run bin\php\php.exe php\wrapper.php
?
@PEMapModder Thanks, it works now. But it doesn't work if one or more of your directories names have a space in them. No way to fix this, right?
Learn commands. You have to use file\ name
or "file name"
if you have a space.
And remember, your cwd must be the PocketMine directory.
@PEMapModder Yep. I ended up changing the names of my directories. This script works on non-Windows devices too, right?
It should, although it is not necessary, since you can run start.sh on most of other operating systems.
PocketMine is only designed to to be run on Linux, MacOS and Windows, and both Linux and MacOS can run start.sh, which supports the -l
option. I suppose the number of loops feature isn't really needed for most users.
Would it still be cd
on non-Window command shells?
Yes...
Would it be okay if I modified the script a little and build it into my RestartMe, but I give you all the credit for the script?
Read the license for this repo.
So I can use it in my plugin, but not modify it. And I have to give you credit. Does this sound right? I don't want to get sued.
No guarantees, but I don't think I would sue you :P after all, licenses like this usually don't have a lot legal significance.
but well, I'm ok with that.
Would it be okay if I renamed it to "Zap", but still give you all the credit for the script? Just want to make sure.
Sure.
BTW, you can add this script into the RestartMe.phar, and set the stub of RestartMe to <?php require_once "wrapper.php"; __HALT_COMPILER();
. In that way people can just run php plugins/RestartMe.phar
to run the server with auto restart.
Or just modify start.cmd to run plugins/RestartMe.phar
instead of PocketMine-MP.phar
Good suggestion, I'll try to add that. But I want it to be as easy as possible for the user, I want to keep the shell commands at the minimal. I'll figure out a way.
Can you add a tutorial on how to use the scripts? Thanks, because many people don't know how to use it, including me. :sob: