On XKore

Philippines

Moderators: waferbaron, Moderators

Forum rules
This server is currently not maintained and tables folder (including connection info) is outdated. Read the wiki for instructions on how to update those information. Please contribute your updated info. Contact Cozzie to join the team as a regular server supporter.
ryanblonna3
Human
Human
Posts: 30
Joined: 29 Jul 2010, 11:53
Noob?: No

On XKore

#1 Post by ryanblonna3 »

Hi guys, seems like this question has been asked before, but I never really found a clear answer. Here it is:
How do you set up XKore 2?
I realize that I can use XKore 1 on Windows with no problems, but I have a special use case here. I have a Windows 7 machine, with OpenKore running on Virtualbox in Ubuntu. I did this because I needed the Perl package Inline::Python, which I could only get to compile in Linux, to write a few OK plugins in Python (for the reason that I think it's a beautiful language, among others). Plus I find it easier to write scripts and such in Linux.

So...I need to run Ragnarok online on Windows and OK on Linux, essentially on two different computers (one inside the other). Any hints on how to do this?

I've followed instructions on extracting the xml in data.grf and such, but I've had no luck so far. BTW, I have Virtualbox set up in a NAT configuration.

Thanks. :)
wwaallaa
Noob
Noob
Posts: 9
Joined: 09 Jun 2010, 23:42
Noob?: Yes

Re: On XKore

#2 Post by wwaallaa »

gamit ka na lang ng 'wine' sa linux para makapaglaro ng ragnarok. need mo nga lang i-disable gameguard.

wala ba sa cpan yang Inline::Python ?
install ka na lang ng perl sa windows
ryanblonna3
Human
Human
Posts: 30
Joined: 29 Jul 2010, 11:53
Noob?: No

Re: On XKore

#3 Post by ryanblonna3 »

As I said above
I did this because I needed the Perl package Inline::Python, which I could only get to compile in Linux...
Malamang meron siya sa cpan, kita naman agad pag ginoogle mo. However, it still needs to be compiled/configured when it is installed. Unless you know how to hack the 700+-line makefile that comes with it, it doesn't detect the required configuration variables properly on Windows, whether using Cygwin, MSYS, or plain old Windows. On top of that, it does not compile on Windows.

Obviously, my gameguard is already disabled because I tried to make things work before posting, which is proper etiquette in forums. Tsaka hindi gumagana ang local process detection na ginagamit ng XKore 1 (apparently) sa Wine. So I still need XKore 2 to work.

Anyway I'll post here if I find a solution. If anybody figures it out before then, please let me know. :))
EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

Re: On XKore

#4 Post by EternalHarvest »

How do you set up XKore 2?
Change client's connection address in clientinfo.xml.
ryanblonna3
Human
Human
Posts: 30
Joined: 29 Jul 2010, 11:53
Noob?: No

Re: On XKore

#5 Post by ryanblonna3 »

Ok, I did that. BTW, my server is pRO Valkyrie.

Here's what I did:
-> I set XKore to 2 and set publicIP to my Virtual Machine's IP, since OK is running on it, and left the listenPort at 6900.
-> I changed the IP's contained in both fclientinfo.xml and valclientinfo.xml in fdata.grf.

OpenKore logged in normally, but as soon as I logged in using the client on my Windows machine, OpenKore registered a "Unknown Switch: 01DB" message. The client was not able to connect, saying that it "Failed to connect to server". Seems like XKore 2 is not intercepting the client's log-in packet? What to do?

I also tried setting XKore to proxy, and set listenIP to my Windows machine's IP, but OK still behaved like XKore 0. Isn't XKore proxy supposed to wait for the client to log in, instead of connecting straight away?

EDIT: Is there any chance that Xkore 2 and Xkore proxy are designed not to kick in when run on Linux? 2 and proxy both run like 0. /:|
ryanblonna3
Human
Human
Posts: 30
Joined: 29 Jul 2010, 11:53
Noob?: No

Re: On XKore

#6 Post by ryanblonna3 »

Hello again...

After looking at the code for XKore Proxy, it turned out that the config value for XKore to use proxy mode was '3', not 'proxy'. So I got it to start. Here's the output (with some sensitive info X-ed out):
X-Kore mode intialized.
Embed Poseidon Server initialized
Please read http://wiki.openkore.com/index.php?title=Poseidon for more information.

Checking for new portals... none found


Waiting Ragnarok Client to connect on (192.168.0.4:6900)
Proxying to [Philippines - pRO: Valkyrie]
Connecting (202.57.118.235:6900)... connected
Packet Parser: Unknown switch: 01DB
Packet Parser: Unknown switch: 01DD
-----------Account Info------------
Account ID: XXXXXXXX XX XX XX
Sex: Boy
Session ID: 14693 65 39 00 00
0 00 00 00 00
-----------------------------------
--------- Servers ----------
# Name Users IP Port
0 valkyrie 5419 202.57.117.112 5000
-------------------------------
Closing connection to Account Server
Disconnecting (202.57.118.235:6900)...disconnected
Connecting (202.57.117.112:5000)... connected
Received characters from Character Server
------------- Character List -------------
Slot 6: XXXXXXXXXXXXX (High Priest, level 99/70)
------------------------------------------
Config 'char' set to X (was X)
Received character ID and Map IP from Character Server
----------Game Info----------
Char ID: XX XX XX (XXXXX)
MAP Name: hugel.gat
MAP IP: 202.57.117.119
MAP Port: 5000
-----------------------------
Disconnecting (202.57.117.112:5000)...disconnected
...and my client disconnected, just like that. Not sure what caused it, hope somebody can enlighten me before I have a chance to dig through the code. I tried it again with debug set to 1, and I noticed these lines:

Code: Select all

Proxying to [Philippines - pRO: Valkyrie]
[Network::Receive] Network::Receive::mRO  (mode: new)
[Network::Send] Network::Send::mRO  (mode: new)
When run on Windows, OK would set my server type to 'pRO', but on Linux, it would set it to 'mRO'...I wonder if the disconnection from the map server has something to do with a config value for my server in config.txt or servers.txt...

Thanks for the feedback! :)

And BTW, here's my associated config:

Code: Select all

######## Login options and server-specific options ########

gameGuard 1

# 1 = hook into RO client, 2 = Act as stand-alone proxy, proxy = act as true proxy
XKore 3
XKore_silent 0
XKore_bypassBotDetection 0
XKore_exeName valexe.exe

# XKore 2 / Proxy configuration
XKore_listenIp 192.168.0.4
XKore_listenPort 6900
XKore_publicIp 192.168.0.4
ryanblonna3
Human
Human
Posts: 30
Joined: 29 Jul 2010, 11:53
Noob?: No

Re: On XKore

#7 Post by ryanblonna3 »

Well turned out the OpenKore code was missing 1 token for XKore proxy to work. I had to modify 1 line in ServerType0.pm. Here's the subroutine at line 5130:

Code: Select all

sub received_character_ID_and_Map {
	my ($self, $args) = @_;
	message T("Received character ID and Map IP from Character Server\n"), "connection";
	$net->setState(4);
	undef $conState_tries;
	$charID = $args->{charID};

	if ($net->version == 1) {
		undef $masterServer;
		$masterServer = $masterServers{$config{master}} if ($config{master} ne "");
	}

	my ($map) = $args->{mapName} =~ /([\s\S]*)\./; # cut off .gat
	my $map_noinstance;
	($map_noinstance, undef) = Field::nameToBaseName(undef, $map); # Hack to clean up InstanceID
	if (!$field || $map ne $field->name()) {
		eval {
			$field = new Field(name => $map);
		};
		if (my $e = caught('FileNotFoundException', 'IOException')) {
			error TF("Cannot load field %s: %s\n", $map_noinstance, $e);
			undef $field;
		} elsif ($@) {
			die $@;
		}
	}

	$map_ip = makeIP($args->{mapIP});
	$map_ip = $masterServer->{ip} if ($masterServer && $masterServer->{private});
	$map_port = $args->{mapPort};
	message TF("----------Game Info----------\n" .
		"Char ID: %s (%s)\n" .
		"MAP Name: %s\n" .
		"MAP IP: %s\n" .
		"MAP Port: %s\n" .
		"-----------------------------\n", getHex($charID), unpack("V1", $charID),
		$args->{mapName}, $map_ip, $map_port), "connection";
	checkAllowedMap($map_noinstance);
	message(T("Closing connection to Character Server\n"), "connection") unless ($net->version == 1);
	$net->serverDisconnect(); # <------------------------------------------------ I changed this to $net->serverDisconnect(1);
	main::initStatVars();
}
Is there any way to merge this to the SVN? Maybe make some kind of condition for XKore proxy on pRO? I don't feel comfortable changing existing OpenKore code.

Please let me know if you merge this so I can update. Thanks!
EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

Re: On XKore

#8 Post by EternalHarvest »

ryanblonna3 wrote:OpenKore logged in normally, but as soon as I logged in using the client on my Windows machine, OpenKore registered a "Unknown Switch: 01DB" message. The client was not able to connect, saying that it "Failed to connect to server". Seems like XKore 2 is not intercepting the client's log-in packet? What to do?

...

EDIT: Is there any chance that Xkore 2 and Xkore proxy are designed not to kick in when run on Linux? 2 and proxy both run like 0. /:|
XKore 2 had no support for "secureLogin" used on pRO, now added in r7890. Not tested with original client so it may still have issues.

There's no OS-dependent design restrictions in XKore 2.
EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

Re: On XKore

#9 Post by EternalHarvest »

ryanblonna3 wrote:Well turned out the OpenKore code was missing 1 token for XKore proxy to work. I had to modify 1 line in ServerType0.pm. Here's the subroutine at line 5130:

...

Is there any way to merge this to the SVN? Maybe make some kind of condition for XKore proxy on pRO? I don't feel comfortable changing existing OpenKore code.
Merged in r7891. There's no need for per-server conditions here, it's needed on other servers too.
ryanblonna3
Human
Human
Posts: 30
Joined: 29 Jul 2010, 11:53
Noob?: No

Re: On XKore

#10 Post by ryanblonna3 »

Hi again...I wonder if I should make a new thread? This is actually the same problem I encountered last year. I'm encountering this again:

Code: Select all

X-Kore mode intialized.
Embed Poseidon Server initialized
Please read http://wiki.openkore.com/index.php?title=Poseidon for more information.

Checking for new portals... none found


Waiting Ragnarok Client to connect on (192.168.0.4:6900)
Proxying to [Philippines - pRO: Valkyrie]
Connecting (202.57.118.235:6900)... connected
Packet Parser: Unknown switch: 01DB
Packet Parser: Unknown switch: 01DD
-----------Account Info------------
Account ID: XXXXXXXX XX XX XX
Sex: Boy
Session ID: 14693 65 39 00 00
0 00 00 00 00
-----------------------------------
--------- Servers ----------
# Name Users IP Port
0 valkyrie 5419 202.57.117.112 5000
-------------------------------
Closing connection to Account Server
Disconnecting (202.57.118.235:6900)...disconnected
Connecting (202.57.117.112:5000)... connected
Received characters from Character Server
------------- Character List -------------
Slot 6: XXXXXXXXXXXXX (High Priest, level 99/70)
------------------------------------------
Config 'char' set to X (was X)
Received character ID and Map IP from Character Server
----------Game Info----------
Char ID: XX XX XX (XXXXX)
MAP Name: hugel.gat
MAP IP: 202.57.117.119
MAP Port: 5000
-----------------------------
Disconnecting (202.57.117.112:5000)...disconnected
...and poof goes the client.

What is up? The only thing that changed was my operating system (I'm now on Arch Linux as opposed to Windows 7)...and I'm using iptables to redirect the RO client's (running on WINE) packets through OpenKore's XKore proxy. I took a look at the received_character_ID_and_Map subroutine again, but I haven't yet found anything.

Any advice?

Thanks. :)