mirror of
https://github.com/mm201/pkmn-classic-framework.git
synced 2026-09-29 21:06:27 -05:00
Fixed issues with battle video server I found after testing.
This commit is contained in:
@@ -237,6 +237,7 @@ namespace PkmnFoundations.GlobalTerminalService
|
||||
break;
|
||||
}
|
||||
|
||||
response.Write(new byte[] { 0x00, 0x00 }, 0, 2); // result code (0 for OK)
|
||||
response.Write(BitConverter.GetBytes(record.PID), 0, 4);
|
||||
response.Write(BitConverter.GetBytes(record.SerialNumber), 0, 8);
|
||||
response.Write(record.Header.Data, 0, 0xe4);
|
||||
|
||||
@@ -904,7 +904,7 @@ namespace PkmnFoundations.Data
|
||||
{
|
||||
ulong key = (ulong)BattleVideoHeader4.SerialToKey(record.SerialNumber);
|
||||
|
||||
int rows = tran.ExecuteNonQuery("INSERT INTO TerminalBattleVideoPokemon4 " +
|
||||
int rows = tran.ExecuteNonQuery("INSERT INTO TerminalBattleVideos4 " +
|
||||
"(id, pid, SerialNumber, Header, Data, md5, TimeAdded, ParseVersion, TrainerName, " +
|
||||
"Metagame, Country, Region) " +
|
||||
"VALUES (@key, @pid, @serial, @header, @data, unhex(md5(CONCAT(@header, @data))), " +
|
||||
@@ -934,7 +934,7 @@ namespace PkmnFoundations.Data
|
||||
private void InsertBattleVideoParty(BattleVideoHeader4 header, ulong key, MySqlTransaction tran)
|
||||
{
|
||||
MySqlCommand cmd = new MySqlCommand("INSERT INTO " +
|
||||
"TermainalBattleVideoPokemon4 (video_id, Slot, Species) VALUES " +
|
||||
"TerminalBattleVideoPokemon4 (video_id, Slot, Species) VALUES " +
|
||||
"(@key, @slot, @species)", tran.Connection, tran);
|
||||
cmd.Parameters.Add("@key", MySqlDbType.UInt64).Value = key;
|
||||
cmd.Parameters.Add("@slot", MySqlDbType.UByte);
|
||||
@@ -1025,7 +1025,7 @@ namespace PkmnFoundations.Data
|
||||
"WHERE SerialNumber = @serial",
|
||||
new MySqlParameter("@serial", serial));
|
||||
|
||||
if (reader.HasRows)
|
||||
if (reader.Read())
|
||||
return BattleVideo4FromReader(reader);
|
||||
else return null;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace PkmnFoundations.Structures
|
||||
ushort[] result = new ushort[12];
|
||||
for (int x = 0; x < result.Length; x++)
|
||||
{
|
||||
result[x] = BitConverter.ToUInt16(Data, 0x7c + x * 2);
|
||||
result[x] = BitConverter.ToUInt16(Data, 0x80 + x * 2);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user