private void RealmLogon() { if (_mcpRealm is null) { _mcpRealm = Bncs.ListMcpRealms().First(); } var packet = Bncs.RealmLogon(_mcpRealm); Log.Information($"Connecting to {packet.McpIp}:{packet.McpPort}"); Mcp.Connect(packet.McpIp, packet.McpPort); Mcp.Logon(packet.McpCookie, packet.McpStatus, packet.McpChunk, packet.McpUniqueName); Log.Information($"Connected to {packet.McpIp}:{packet.McpPort}"); }
private bool RealmLogon() { if (_mcpRealm is null) { _mcpRealm = Bncs.ListMcpRealms()?.First(); } if (_mcpRealm == null) { Log.Warning("RealmLogin failed, no mcp realm found"); return(false); } if (!Bncs.IsConnected()) { return(false); } var packet = Bncs.RealmLogon(_mcpRealm); if (packet == null) { Log.Warning("RealmLogin failed"); return(false); } Log.Debug($"Connecting to {packet.McpIp}:{packet.McpPort}"); Mcp.Connect(packet.McpIp, packet.McpPort); if (!Mcp.Logon(packet.McpCookie, packet.McpStatus, packet.McpChunk, packet.McpUniqueName)) { Log.Warning("RealmLogin Connecting failed"); return(false); } Log.Debug($"Connected to MCP {packet.McpIp}:{packet.McpPort}"); return(true); }