L2JMobius

Public Development => General Discussion => Topic started by: ClassicPLS on July 26, 2022, 02:35:32 PM

Title: How to make myself GM/Admin?
Post by: ClassicPLS on July 26, 2022, 02:35:32 PM
Hello again :)

Cant find a way to make myself GM/Admin in my own server. I want to access gm menu or something like that.

Or use some gm/admin commands? perhaps there is a list?

Appreciate any help :)   
Title: Re: How to make myself GM/Admin?
Post by: nasseka on July 26, 2022, 02:41:11 PM
In DB, make access level 100
Title: Re: How to make myself GM/Admin?
Post by: ClassicPLS on July 26, 2022, 03:44:25 PM
Hmm, not sure if i find it.

I found this code in:
C:\L2J_Mobius\db_installer\sql\login\Accounts.sql

DROP TABLE IF EXISTS `accounts`;
CREATE TABLE IF NOT EXISTS `accounts` (
  `login` VARCHAR(45) NOT NULL default '',
  `password` VARCHAR(45),
  `email` varchar(255) DEFAULT NULL,
  `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `lastactive` bigint(13) unsigned NOT NULL DEFAULT '0',
  `accessLevel` TINYINT NOT NULL DEFAULT 0,
  `lastIP` CHAR(15) NULL DEFAULT NULL,
  `lastServer` TINYINT DEFAULT 1,
  `pcIp` char(15) DEFAULT NULL,
  `hop1` char(15) DEFAULT NULL,
  `hop2` char(15) DEFAULT NULL,
  `hop3` char(15) DEFAULT NULL,
  `hop4` char(15) DEFAULT NULL,
  PRIMARY KEY (`login`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;



If i change access level line to
 `accessLevel` TINYINT NOT NULL DEFAULT 100,
Would it give gm to any new account ? do i understand correctly?

Where could i find list of all created accounts/characters and give access level individually?
Title: Re: How to make myself GM/Admin?
Post by: nasseka on July 26, 2022, 03:52:16 PM
Where could i find list of all created accounts/characters and give access level individually?

In database..
Title: Re: How to make myself GM/Admin?
Post by: MrNiceGuy on July 26, 2022, 03:54:46 PM
Hi
Right now you're editing Login server database. First things first, do not edit SQL file - it is meant for server installation and they should not be changed. What you did right now is giving access level 100 by default to all new accounts.

There are two places where you can apply elevated access level (but for different purposes):
1. Login server database - "accounts" table, you set your "accessLevel" to 100 = you will be able to login to server even if GMonly = true in Gameserver configs
2. Game server database - you need to find "characters" table (open with Navicat, HeidiSQL or any other MySQL manager), find your character row and then look for "accessLevel" column. While being offline (disconnected from game), set it to 100 and save. Login and if you see your nick is yellow - well done, you're admin :)

Again - you can not make this change in SQL installation file (at least the right way). Please consider using Navicat/HeidiSQL/PHPMyAdmin or anything else that is dedicated for MySQL database management - you will need that anyway :)
Title: Re: How to make myself GM/Admin?
Post by: ClassicPLS on July 26, 2022, 05:37:39 PM
Thanks alot MrNiceGuy! :)

I didnt know i needed SQL database manager hehe :) i was trying with notepad only, silly me. Now i installed Heidi and it worked, thanks a million :)
Title: Re: How to make myself GM/Admin?
Post by: Barbatos on July 29, 2022, 12:17:05 AM
You can edit your game/config/General.ini file to do it without installing a database manager.

Just search for DefaultAccessLevel and then set 100

Code: [Select]
# default = 0
DefaultAccessLevel = 100

Save changes, start your game server, create your account and a character, and then set 0 again (or leave 100, so everybody will be GM).

This will grant you a quick access to a GM account but I strongly recommend you to install a database manager.

I sugest you DBeaver or Heidisql
Title: Re: How to make myself GM/Admin?
Post by: SavitarGodOfSpeed on August 18, 2022, 02:08:08 AM
Stupid question how do you save in navicat? xD
Title: Re: How to make myself GM/Admin?
Post by: Index on August 18, 2022, 04:16:15 AM
Stupid question how do you save in navicat? xD
logout from game - make changes in navicat - login backnto game
Title: Re: How to make myself GM/Admin?
Post by: SavitarGodOfSpeed on August 18, 2022, 10:26:15 AM
no i didn't meant that. I know that in order the changes take effect the designated target needs to be logged out. My problem was that i couldn't locate the "Save" button in Navicat, But fortunately after some help i discovered that i had to press ctrl+S to save the to formula