empty characters bug + poseidon map change

Wrote new code? Fixed a bug? Want to discuss technical stuff? Feel free to post it here.

Moderator: Moderators

uPantcho
Human
Human
Posts: 42
Joined: 05 Nov 2009, 05:25
Noob?: Yes

empty characters bug + poseidon map change

#1 Post by uPantcho »

so, sometimes in bRO it happens when you bot get disconnected it receives an empty characters list

this code avoid this by checking if $char is defined. also it checks if char is "switch" and display relevant message

(imo no one switches acc like that so i think it will not be a problem)




the other change is relevant to poseidon. since we cannot be on char select screen anymore i switched to a smaller map

if there is any reason for the poseidon to be on new_1-1 just remove specific content

Code: Select all

Index: Misc.pm
===================================================================
--- Misc.pm	(revision 7930)
+++ Misc.pm	(working copy)
@@ -1175,7 +1175,13 @@
 	if (@chars) {
 		push @choices, T('Delete a character');
 	} else {
-		message T("There are no characters on this account.\n"), "connection";
+		if ($config{char} ne "switch" && defined($char)) {
+			message("No characters found besides previous records.\nUse \"conf char switch\" if you switched account.\n");
+			relog(30);
+			return;
+		} else {
+			message T("There are no characters on this account.\n"), "connection";
+		}
 	}
 	
 	my $choice = $interface->showMenu(
Index: Poseidon/RagnarokServer.pm
===================================================================
--- Poseidon/RagnarokServer.pm	(revision 7930)
+++ Poseidon/RagnarokServer.pm	(working copy)
@@ -151,7 +151,7 @@
 ## constants
 my $accountID = pack("a4", "acct");
 my $posX = 53;
-my $posY = 111;
+my $posY = 113;
 
 ## Globals
 my $charID = pack("a4", "char");
@@ -321,7 +321,7 @@
 		$clientdata{$index}{mode} = unpack('C1', substr($msg, 2, 1));
 
 		# '0071' => ['received_character_ID_and_Map', 'a4 Z16 a4 v1', [qw(charID mapName mapIP mapPort)]],
-		my $mapName = pack("a16", "new_1-1.gat");
+		my $mapName = pack("a16", "moc_prydb1.gat");
 		my $data = pack("C*", 0x71, 0x00) . $charID . $mapName . 
 			pack("C*", $ipElements[0], $ipElements[1], $ipElements[2], $ipElements[3]) . $port;
 		
Fr3DBr
Developers
Developers
Posts: 60
Joined: 05 Oct 2011, 09:21
Noob?: No
Location: Brazil

Re: empty characters bug + poseidon map change

#2 Post by Fr3DBr »

1) Thanks it will be added to our svn trunk as temporary measure.

2) Sure.
EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

Re: empty characters bug + poseidon map change

#3 Post by EternalHarvest »

It's fine, but I think it shouldn't change the default behavior, but be an additional option, "relog/quit on empty account".

Also, overcomplicating existing important options (like char here) isn't very good, in my opinion.
uPantcho
Human
Human
Posts: 42
Joined: 05 Nov 2009, 05:25
Noob?: Yes

Re: empty characters bug + poseidon map change

#4 Post by uPantcho »

i thought of creating a new variable for that but i think this is really intuitive and if ever happens that someone switches to an account without any character the person will be looking to the computer


is not like, for instance, the not respawn after death option that first time i looked for it i had no idea that was dcOnDeath -1