magefree / mage

Magic Another Game Engine
http://xmage.today
MIT License
1.89k stars 773 forks source link

Admin Tools Needed #5388

Open LordNex opened 6 years ago

LordNex commented 6 years ago

I can see a huge need for Administration tools such as the ability to reset user passwords or email addresses, kicking or banning problem users. Closing Stuck Tables, and general moderation of the server. The server registration becomes a problem as if a user forgets their password or looses access to their email address, they basically have to create a whole new account.

LoRd_NeX www.powersofwar.com

JayDi85 commented 6 years ago

There are already server admin tool available with users mute/block, tables close, global message broadcast. It's not distributed with xmage client/server zip, but can be build from source code. Hmm...

shot_181015_024941

LordNex commented 6 years ago

Im just starting to learn JavaScript. Im pretty well versed in HTML and CSS and just starting to get my feet wet with Java but im still really green. Is there any "how too" or walk through on how to do this?

JayDi85 commented 6 years ago

I'm was builded current version. You can download admin console files from that link. Extract it to launcher dir (I'm put launcher file for dirs tree info).

You need:

You can find full scripts to run server and admin panel at zip file too.

JayDi85 commented 6 years ago

Command scripts example to run from launcher folder (for Windows).

Run server with admin password: run-z-server-service.cmd

set SERVER_DIR=.\xmage\mage-server
set JAVA_DIR=.\java\jre1.8.0_181\bin
pushd %CD%

cd /d %JAVA_DIR%
set JAVA_DIR=%CD%

popd
cd /d %SERVER_DIR%
set SERVER_DIR=%CD%

cd /d %SERVER_DIR%

%JAVA_DIR%\java.exe -jar %SERVER_DIR%\lib\mage-server-1.4.31.jar -adminPassword=123

Run admin panel : run-z-server-admin.cmd

set SERVER_DIR=.\xmage\mage-admin
set JAVA_DIR=.\java\jre1.8.0_181\bin
pushd %CD%

cd /d %JAVA_DIR%
set JAVA_DIR=%CD%

popd
cd /d %SERVER_DIR%
set SERVER_DIR=%CD%

cd /d %SERVER_DIR%

%JAVA_DIR%\java.exe -jar %SERVER_DIR%\lib\mage.server.console-1.4.31.jar
LordNex commented 6 years ago

Ok i modified my start batch script that gets fired off as a Windows Service and added the "-adminPassword=your_secret_password;" to the end of the call to start the server. and set a specific password.

So now I need to create 2 batch scripts shown above in the same directory as the startMage.bat file I use to start the server? Then Run those and connect with the admin pass I chose?

LordNex commented 6 years ago

Just so you know. I'm not using the launcher to start the server. I'm using a batch script that has been configured to run as a Windows Service

JayDi85 commented 6 years ago

You can run admin panel from your PC. Server needs only special command with admin password setup. All other scripts must run from client side (run it with same code as xmage client).

LordNex commented 6 years ago

I cant seem to find %SERVER_DIR%\lib\mage.server.console-1.4.31.jar on the server or locally on my PC. Is this something I need to download from GitHub? The link in your above post goes 404

LordNex commented 6 years ago

Got the link, had to copy and paste it to a new window

LordNex commented 6 years ago

Well I got the admin console to fire up but got the following when I attempted to connect to my server. Im pretty sure the server started with the admin password flag added so im not sure if this is something else or if it didnt gab the password flag right

LordNex commented 6 years ago

xmageadminerr

JayDi85 commented 6 years ago

It's can be a wrong password. Look at server's logs for error message.

shot_181015_045133

LordNex commented 6 years ago

Yea thats what its doing. I am using an @ sign in the password, Could that be throwing it off?

LordNex commented 6 years ago

Got it!

Went through and had to modify the actual service with a command argument. That did it. I put the AI back in and will continue to monitor it

Thanks again for all your help bro!. Hopefully the better I get with Java the more I'll be able to contribute!

LordNex commented 5 years ago

Is this something that has to be recompiled with each new version? Havent been able to get my console to work again since the latest updates. And ive had some issues lately with users that need kicked for various reasons

JayDi85 commented 5 years ago

Yes, it's must be recompiled. Or try that:

P.S. it's a windows file. If you have linux then can do same commands or take startServer.sh script from mage-server folder and change it to run mage.server.console-1.4.33.jar instead mage-server-1.4.33.jar

siyiye commented 5 years ago

https://github.com/magefree/mage/issues/xmage.today/X/mage.server.console-1.4.33.jar

this file is lost,PLS fix it ,THX!

JayDi85 commented 5 years ago

Use that link: http://xmage.today/X/mage.server.console-1.4.37.jar

siyiye commented 5 years ago

Use that link: http://xmage.today/X/mage.server.console-1.4.37.jar

set` SERVER_DIR=.\xmage\mage-admin
set JAVA_DIR=.\java\jre1.8.0_201\bin
pushd %CD%

cd /d %JAVA_DIR%
set JAVA_DIR=%CD%

popd
cd /d %SERVER_DIR%
set SERVER_DIR=%CD%

cd /d %SERVER_DIR%

%JAVA_DIR%\java.exe -jar %SERVER_DIR%\lib\mage.server.console-1.4.37.jar

run "run-z-server-admin"——The DOS window appears, it is closed immediately, and the control panel is not open.

JayDi85 commented 5 years ago

Add at the end of file: pause to see error message after run. Maybe wrong path or missing files (you must copy that lib file after each update).

siyiye commented 5 years ago

1111111

Add at the end of file: pause to see error message after run. Maybe wrong path or missing files (you must copy that lib file after each update).

Error: Cannot find or can't load main class mage.server.console.ConsoleFrame

JayDi85 commented 5 years ago

Don't use admin tools (it's outdated). Download full release and copy mage.server.console-1.4.37.jar to xmage\mage-server\lib\ folder and use same run command file. That's all.

siyiye commented 5 years ago

Oh~i know!!!

1111

siyiye commented 5 years ago

@JayDi85

New question: I changed the java path of xmage (directly using the system installed java) Edit the corresponding path in "service.cmd" like this:

set SERVER_DIR=D:\GAME\Magic\Xmage\bin\Xmage-Release\mage-server
set JAVA_DIR=C:\Program Files\Java\jre1.8.0_191\bin

pushd %CD%

cd /d %JAVA_DIR%
set JAVA_DIR=%CD%

popd
cd /d %SERVER_DIR%
set SERVER_DIR=%CD%

cd /d %SERVER_DIR%

java.exe -jar %SERVER_DIR%\lib\mage.server.console-1.4.37.jar -adminPassword=123

The console appeared after running, but the server process was not running. (Just like only running "admin.cmd" directly.) 111

Normal should be like this: 222

How do I get it to work? THX

JayDi85 commented 5 years ago

Run server:

set SERVER_DIR=D:\GAME\Magic\Xmage\bin\Xmage-Release\mage-server
set JAVA_DIR=C:\Program Files\Java\jre1.8.0_191\bin

cd /d %SERVER_DIR%
%JAVA_DIR%\java.exe -jar %SERVER_DIR%\lib\mage-server-1.4.37.jar -adminPassword=123

Run admin tools:

set SERVER_DIR=D:\GAME\Magic\Xmage\bin\Xmage-Release\mage-server
set JAVA_DIR=C:\Program Files\Java\jre1.8.0_191\bin

cd /d %SERVER_DIR%
%JAVA_DIR%\java.exe -jar %SERVER_DIR%\lib\mage.server.console-1.4.37.jar
siyiye commented 5 years ago

THX! but fix it:JAVA_DIR="xxxx"

Run server:

set SERVER_DIR=D:\GAME\Magic\Xmage\bin\Xmage-Release\mage-server
set JAVA_DIR="C:\Program Files\Java\jre1.8.0_191\bin"

cd /d %SERVER_DIR%
%JAVA_DIR%\java.exe -jar %SERVER_DIR%\lib\mage-server-1.4.37.jar -adminPassword=123

Run admin tools:

set SERVER_DIR=D:\GAME\Magic\Xmage\bin\Xmage-Release\mage-server
set JAVA_DIR="C:\Program Files\Java\jre1.8.0_191\bin"

cd /d %SERVER_DIR%
%JAVA_DIR%\java.exe -jar %SERVER_DIR%\lib\mage.server.console-1.4.37.jar
siyiye commented 5 years ago

Use that link: http://xmage.today/X/mage.server.console-1.4.37.jar

pls,update “mage.server.console-1.4.38.jar”

THX~!

JayDi85 commented 5 years ago

Try to rename file name from 37 to 38. It's must work fine (new release do not have changes in client-server connection). If not help then I'll build new one.

siyiye commented 5 years ago

Try to rename file name from 37 to 38. It's must work fine (new release do not have changes in client-server connection). If not help then I'll build new one.

I test rename file,but it can't work

JayDi85 commented 5 years ago

New version: http://xmage.today/X/mage.server.console-1.4.38.jar

JayDi85 commented 5 years ago

New version: http://xmage.today/X/mage.server.console-1.4.39.jar

JayDi85 commented 4 years ago

New version: http://xmage.today/X/mage.server.console-1.4.40.jar

JayDi85 commented 4 years ago

New version: http://xmage.today/X/mage.server.console-1.4.41.jar

JayDi85 commented 4 years ago

New version: http://xmage.today/X/mage.server.console-1.4.42.jar

ChoochTheAnimalSteel commented 4 years ago

Is there an updated version of the admin tools for version 1.4.43. I tried using the old version of the admin tools with 1.4.43 and it fails upon launching with: Error: Could not find or load main class mage.server.console.ConsoleFrame

JayDi85 commented 4 years ago
JayDi85 commented 4 years ago

Latest version: http://xmage.today/X/mage-server-console-1.4.54.jar

siyiye commented 1 year ago

where is new “mage.server.console” version?

JayDi85 commented 1 year ago

@siyiye try to use link above. If it doesn't work then report — I’ll update. You don't need to update it after each new release/beta.