mirror of
https://github.com/Lorenzooone/PokemonGB_Online_Trades.git
synced 2026-04-26 08:18:52 -05:00
Implement patch sets checks for mail
This commit is contained in:
parent
0765b746db
commit
c2151d6f36
1
useful_data/gsc/japanese_mail_patch_set.bin
Normal file
1
useful_data/gsc/japanese_mail_patch_set.bin
Normal file
|
|
@ -0,0 +1 @@
|
|||
'(QR{|ウ椀巐
|
||||
1
useful_data/gsc/mail_patch_set.bin
Normal file
1
useful_data/gsc/mail_patch_set.bin
Normal file
|
|
@ -0,0 +1 @@
|
|||
'(56CDQR
|
||||
|
|
@ -1 +0,0 @@
|
|||
<EFBFBD><EFBFBD>PPPPPPP
|
||||
Binary file not shown.
|
|
@ -503,7 +503,7 @@ class GSCTrading:
|
|||
|
||||
# Prepare sanity checks stuff
|
||||
self.checks.prepare_text_buffer()
|
||||
checks.prepare_patch_sets_buffer()
|
||||
self.checks.prepare_patch_sets_buffer()
|
||||
self.checks.prepare_species_buffer()
|
||||
|
||||
if not buffered:
|
||||
|
|
@ -971,8 +971,8 @@ class GSCTrading:
|
|||
pokemon_data, pokemon_data_other = self.read_section(1, send_data[1], buffered)
|
||||
# Get and apply patches for the Pokémon data
|
||||
patches_data, patches_data_other = self.read_section(2, send_data[2], buffered)
|
||||
self.utils_class.apply_patches(pokemon_data, patches_data)
|
||||
self.utils_class.apply_patches(pokemon_data_other, patches_data_other)
|
||||
self.utils_class.apply_patches(pokemon_data, patches_data, self.utils_class)
|
||||
self.utils_class.apply_patches(pokemon_data_other, patches_data_other, self.utils_class)
|
||||
|
||||
pokemon_own = self.party_reader(pokemon_data)
|
||||
pokemon_other = self.party_reader(pokemon_data_other)
|
||||
|
|
@ -1004,8 +1004,8 @@ class GSCTrading:
|
|||
self.comms.send_mail_data_only(mail_data)
|
||||
|
||||
# Apply patches for the mail data
|
||||
self.utils_class.apply_patches(mail_data, mail_data, is_mail=True)
|
||||
self.utils_class.apply_patches(mail_data_other, mail_data_other, is_mail=True)
|
||||
self.utils_class.apply_patches(mail_data, mail_data, self.utils_class, is_mail=True)
|
||||
self.utils_class.apply_patches(mail_data_other, mail_data_other, self.utils_class, is_mail=True)
|
||||
|
||||
return [random_data, pokemon_data, mail_data], [random_data_other, pokemon_data_other, mail_data_other]
|
||||
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ class GSCUtils:
|
|||
stat_id_base_conv_table = [0,1,2,5,3,4]
|
||||
stat_id_iv_conv_table = [0,0,1,2,3,3]
|
||||
stat_id_exp_conv_table = [0,1,2,3,4,4]
|
||||
patch_set_base_pos = [0x13, 0, 0]
|
||||
patch_set_base_pos = [0x13, 0xC6, 0]
|
||||
patch_set_start_info_pos = [7, 0x11A, 0xFC]
|
||||
egg_value = 0x38
|
||||
min_level = 2
|
||||
|
|
@ -935,8 +935,8 @@ class GSCTradingData:
|
|||
if self.pokemon[i].mail is not None:
|
||||
GSCUtilsMisc.copy_to_data(data[3], self.trading_pokemon_mail_pos + (i * self.trading_mail_length), self.pokemon[i].mail.values)
|
||||
GSCUtilsMisc.copy_to_data(data[3], self.trading_pokemon_mail_sender_pos + (i * self.trading_mail_sender_length), self.pokemon[i].mail_sender.values, self.trading_mail_sender_length)
|
||||
self.utils_class.create_patches_data(data[1], data[2])
|
||||
self.utils_class.create_patches_data(data[3], data[3], is_mail=True)
|
||||
self.utils_class.create_patches_data(data[1], data[2], self.utils_class)
|
||||
self.utils_class.create_patches_data(data[3], data[3], self.utils_class, is_mail=True)
|
||||
return data
|
||||
|
||||
class GSCChecks:
|
||||
|
|
@ -1299,10 +1299,12 @@ class GSCChecks:
|
|||
def check_patch_set(self, val, patch_sets):
|
||||
if self.curr_patch_set >= len(patch_sets):
|
||||
return self.no_conversion_patch
|
||||
if val == self.end_of_patch
|
||||
if val == self.end_of_patch:
|
||||
self.curr_patch_set += 1
|
||||
return val
|
||||
return GSCUtilsMisc.check_normal_list(patch_sets[self.curr_patch_set], val)
|
||||
if GSCUtilsMisc.check_normal_list(patch_sets[self.curr_patch_set], val):
|
||||
return val
|
||||
return self.no_conversion_patch
|
||||
|
||||
@clean_check_sanity_checks
|
||||
def clean_pokemon_patch_set(self, val):
|
||||
|
|
|
|||
|
|
@ -83,6 +83,8 @@ class GSCJPMailConverter:
|
|||
return self.convert(data, self.mail_conversion_table_int)
|
||||
|
||||
def convert(self, to_convert, converter):
|
||||
self.mail_conv_pos = -1
|
||||
self.sender_conv_pos = -1
|
||||
ret = [0] * len(converter)
|
||||
for i in range(len(converter)):
|
||||
ret[i] = converter[i](to_convert)
|
||||
|
|
@ -121,8 +123,6 @@ class GSCJPMailConverter:
|
|||
return self.end_of_line
|
||||
|
||||
def do_20(self, data):
|
||||
self.mail_conv_pos = -1
|
||||
self.sender_conv_pos = -1
|
||||
return 0x20
|
||||
|
||||
class GSCTradingJP(GSCTrading):
|
||||
|
|
@ -149,7 +149,7 @@ class GSCTradingJP(GSCTrading):
|
|||
0x13B + (single_text_len * 9): [5, end_of_line],
|
||||
0x13B + (single_text_len * 10): [5, end_of_line],
|
||||
0x13B + (single_text_len * 11): [5, end_of_line]
|
||||
}, {}, {}]
|
||||
}, {}, {}, {}]
|
||||
special_sections_starter = [next_section, next_section, next_section, mail_next_section, mail_next_section]
|
||||
drop_bytes_checks = [[0xA, 0x1B9, 0xC5, 0x181, 0x11D], [next_section, next_section, mail_next_section, no_input, no_input], [0,4,0,0,0]]
|
||||
|
||||
|
|
@ -181,11 +181,11 @@ class GSCTradingJP(GSCTrading):
|
|||
"""
|
||||
if data is not None:
|
||||
if to_device:
|
||||
self.utils_class.apply_patches(data, data, is_mail=True)
|
||||
self.utils_class.apply_patches(data, data, self.utils_class, is_mail=True)
|
||||
data = self.jp_mail_converter.convert_to_jp(data)
|
||||
self.utils_class.create_patches_data(data, data, is_mail=True, is_japanese=True)
|
||||
self.utils_class.create_patches_data(data, data, self.utils_class, is_mail=True, is_japanese=True)
|
||||
else:
|
||||
self.utils_class.apply_patches(data, data, is_mail=True, is_japanese=True)
|
||||
self.utils_class.apply_patches(data, data, self.utils_class, is_mail=True, is_japanese=True)
|
||||
data = self.jp_mail_converter.convert_to_int(data)
|
||||
self.utils_class.create_patches_data(data, data, is_mail=True)
|
||||
self.utils_class.create_patches_data(data, data, self.utils_class, is_mail=True)
|
||||
return data
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user