¶ LoginServer and WorldServer Changes
- Use the HTML file inside the zip /migration/thetascorpiidr2/logininitojson.zip
- Open LoginServer.ini and click ‘Edit’ to Select All, then ‘Edit’ again to ‘Copy’
- Open the logininitojson.html file
- Paste (Right Click and Paste) into the text pad field
- Click Convert to JSON, it will copy the result to the clipboard
- Create a new file in your server directory named “server_config.json” and paste the result contents into the file.
¶ WorldServer database changes in relation to slash commands and in-game features
update commands set handler=536 where command='target';
insert into commands set type=0,command='target_pet',subcommand='',handler=537;
update commands set handler=538 where command='set_consume_food';
alter table items add column classic_icon smallint(5) not null default 0;
¶ LoginServer and WorldServer WebServer Configuration
- Database changes to login database (eq2ls) and world database (eq2emu)
CREATE TABLE web_users (
id int(10) unsigned AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(50) NOT NULL default '',
passwd varchar(512) NOT NULL default '',
status int(10) unsigned not null default 0
);
CREATE TABLE web_routes (
status int(10) unsigned not null default 4294967295,
route varchar(512) NOT NULL default ''
);
Notes:
- By default all routes require user authentication. To disable a route, say expose /version, setting status of 0 in web_routes will result in not requiring user authentication, you can:
- insert into web_routes set route='/version', status=0;
- If the defined web_routes status is greater than 0, then the web_users entry that is authenticated must have the equal or higher status level to be authorized for the page.
- Any changes to web_routes (the status or entries) is only loaded on startup of the LoginServer or WorldServer.
- server_config.json has new fields in the WorldServer
"WorldServer": {
"webaddress": "10.1.1.182",
"webport": "9002",
"webcertfile": "cert.pem",
"webkeyfile": "key.pem",
"webkeypassword": "",
"webhardcodeuser": "image",
"webhardcodepassword": "test"
}
- server_config.json has new fields in the LoginConfig
"LoginConfig": {
"webloginaddress": "10.1.1.182",
"webloginport": "9101",
"webcertfile": "cert.pem",
"webkeyfile": "key.pem",
"webkeypassword": "",
"webhardcodeuser": "image",
"webhardcodepassword": "test"
}
Notes:
- Omitting the WorldServer webaddress, webport or the LoginConfig webloginaddress, webloginport will mean the web server is disabled by default respectively for that process (World/Login).
- It is not recommended to use the webhardcodeuser or webhardcodepassword. This is for testing purposes. Ideally use the database table ‘web_users’ which will exist independently both in the login server and world server databases.
- It is not recommended, but leaving the webcertfile/webkeyfile omitted will use HTTP instead of HTTPS for communication to the address:port.
- You can create a self signed certificate / key to use
- openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -sha256 -days 3650 -nodes -subj "/C=XX/ST=StateName/L=CityName/O=CompanyName/OU=ServerName/CN=ServerName"