Difference between revisions of "Server:MacSupport"

From The Al`Kabor Project Wiki
Jump to navigation Jump to search
Line 27: Line 27:


== Server Selection ==
== Server Selection ==
Mac Clients do not have a server select option.  As a result, server selection is passed to them after successful login.  While there is a way to have the client select a server based on an Apple IPC mechanism, the server is currently hardcoded as a configuration setting in [https://github.com/EQArchives/EQMacEmu/blob/09da8370ff01ea671fbc772511579b8d4876741e/loginserver/login_util/login.ini login.ini] as well as the <span style="font-weight:bold">loginserversettings`</span> table.
Mac Clients do not have a server select option.  As a result, server selection is passed to them after successful login.  While there is a way to have the client select a server based on an Apple IPC mechanism, the server is currently hardcoded as a configuration setting in [https://github.com/EQArchives/EQMacEmu/blob/09da8370ff01ea671fbc772511579b8d4876741e/loginserver/login_util/login.ini login.ini] as well as the <span style="font-weight:bold">loginserversettings</span> table.


The loginserversettings table is where you set your world server's URL in the "network_ip" setting.
The loginserversettings table is where you set your world server's URL in the "network_ip" setting.

Revision as of 01:28, 22 December 2023

Mac support requires special care to provide a server name to the client application. This is typically handled by the server, but it is possible to also manipulate it at client level using Apple IPC mechanisms (as Solar did for the PPC launcher).

Opcodes

All opcodes are found at login_opcodes_oldver.conf but the following are relevant to this discussion:

  • OP_SessionReady=0x5900
  • OP_LoginOSX=0x8e00
  • OP_LoginAccepted=0x0400
  • OP_LoginComplete=0x8800
  • OP_ServerName=0x4900
  • OP_LoginBanner=0x5200

Login

When a client first authenticates to the loginserver, it sends the OP_LoginOSX opcode followed by the username/password and eqworld-52.989studios.com as a UDP datagram. The url is no longer used but rather parsed server-side to validate mac clients (see OP_LoginOSX and handle_login behavior).

The key difference between a Windows Client and OSX client successfully authenticating is the following block of code in the loginserver source that sends an extra packet to the client telling it which world server to connect to:

string buf = server.options.GetNetworkIP();
auto outapp2 = new EQApplicationPacket(OP_ServerName, (uint32)buf.length() + 1);
strncpy((char*)outapp2->pBuffer, buf.c_str(), buf.length() + 1);
connection->QueuePacket(outapp2);
delete outapp2;
sentsessioninfo = true;

GetNetworkIP() pulls the world server's URL from you login.ini file and/or the database as mentioned previously. This leaves you with a packet containing "0x4900" and your server's URL which the client will then use to reach server select.

Server Selection

Mac Clients do not have a server select option. As a result, server selection is passed to them after successful login. While there is a way to have the client select a server based on an Apple IPC mechanism, the server is currently hardcoded as a configuration setting in login.ini as well as the loginserversettings table.

The loginserversettings table is where you set your world server's URL in the "network_ip" setting.

UPDATE loginserversettings (`type`, `value`, `category`, `description`, `defaults`) VALUES ("network_ip", "takp.example.com", "options", "World Server URL", "takp.example.com");

Your login.ini also has this setting:

network_ip = takp.example.com

You should use your server's short name for the subdomain in this use case. What you place here will determine what your client uses as part of your character's UI file names.

Finally, make sure the world->address field in your eqemu_config.json file is also set to this value:

"address": "takp.example.com"

The loginserver will use this value to match with its network_ip setting.