mirror of
https://github.com/GittyMac/OpenFK.git
synced 2026-03-21 17:44:31 -05:00
refactor: Separated GameForm into several classes
This commit is contained in:
parent
e0fb76e709
commit
cce4de10aa
|
|
@ -1,11 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace OpenFK
|
||||
|
|
@ -26,7 +19,8 @@ namespace OpenFK
|
|||
HTTPBox2.Text = Properties.Settings.Default.HTTPHost2;
|
||||
TCPHostBox.Text = Properties.Settings.Default.TCPHost;
|
||||
TCPPortBox.Text = Properties.Settings.Default.TCPPort;
|
||||
label8.Text = "OpenFK v" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
|
||||
string currentVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
|
||||
label8.Text = "OpenFK v" + currentVersion.Substring(0, currentVersion.LastIndexOf("."));
|
||||
UpdateTextboxes();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
namespace OpenFK
|
||||
{
|
||||
partial class DebugWindow
|
||||
partial class DebugForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
|
|
@ -29,6 +29,7 @@ namespace OpenFK
|
|||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DebugForm));
|
||||
this.generalLogs = new System.Windows.Forms.RichTextBox();
|
||||
this.tabControl1 = new System.Windows.Forms.TabControl();
|
||||
this.logTab = new System.Windows.Forms.TabPage();
|
||||
|
|
@ -92,6 +93,7 @@ namespace OpenFK
|
|||
// generalLogs
|
||||
//
|
||||
this.generalLogs.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.generalLogs.HideSelection = false;
|
||||
this.generalLogs.Location = new System.Drawing.Point(3, 3);
|
||||
this.generalLogs.Name = "generalLogs";
|
||||
this.generalLogs.ReadOnly = true;
|
||||
|
|
@ -140,6 +142,7 @@ namespace OpenFK
|
|||
// fileLogs
|
||||
//
|
||||
this.fileLogs.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.fileLogs.HideSelection = false;
|
||||
this.fileLogs.Location = new System.Drawing.Point(3, 3);
|
||||
this.fileLogs.Name = "fileLogs";
|
||||
this.fileLogs.ReadOnly = true;
|
||||
|
|
@ -161,6 +164,7 @@ namespace OpenFK
|
|||
// incomingLogs
|
||||
//
|
||||
this.incomingLogs.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.incomingLogs.HideSelection = false;
|
||||
this.incomingLogs.Location = new System.Drawing.Point(3, 3);
|
||||
this.incomingLogs.Name = "incomingLogs";
|
||||
this.incomingLogs.ReadOnly = true;
|
||||
|
|
@ -181,6 +185,7 @@ namespace OpenFK
|
|||
// outgoingLogs
|
||||
//
|
||||
this.outgoingLogs.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.outgoingLogs.HideSelection = false;
|
||||
this.outgoingLogs.Location = new System.Drawing.Point(0, 0);
|
||||
this.outgoingLogs.Name = "outgoingLogs";
|
||||
this.outgoingLogs.ReadOnly = true;
|
||||
|
|
@ -229,6 +234,7 @@ namespace OpenFK
|
|||
// CLoggerAll
|
||||
//
|
||||
this.CLoggerAll.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.CLoggerAll.HideSelection = false;
|
||||
this.CLoggerAll.Location = new System.Drawing.Point(3, 3);
|
||||
this.CLoggerAll.Name = "CLoggerAll";
|
||||
this.CLoggerAll.ReadOnly = true;
|
||||
|
|
@ -250,6 +256,7 @@ namespace OpenFK
|
|||
// CLoggerTrace
|
||||
//
|
||||
this.CLoggerTrace.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.CLoggerTrace.HideSelection = false;
|
||||
this.CLoggerTrace.Location = new System.Drawing.Point(3, 3);
|
||||
this.CLoggerTrace.Name = "CLoggerTrace";
|
||||
this.CLoggerTrace.ReadOnly = true;
|
||||
|
|
@ -270,6 +277,7 @@ namespace OpenFK
|
|||
// CLoggerDebug
|
||||
//
|
||||
this.CLoggerDebug.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.CLoggerDebug.HideSelection = false;
|
||||
this.CLoggerDebug.Location = new System.Drawing.Point(0, 0);
|
||||
this.CLoggerDebug.Name = "CLoggerDebug";
|
||||
this.CLoggerDebug.ReadOnly = true;
|
||||
|
|
@ -290,6 +298,7 @@ namespace OpenFK
|
|||
// CLoggerInfo
|
||||
//
|
||||
this.CLoggerInfo.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.CLoggerInfo.HideSelection = false;
|
||||
this.CLoggerInfo.Location = new System.Drawing.Point(0, 0);
|
||||
this.CLoggerInfo.Name = "CLoggerInfo";
|
||||
this.CLoggerInfo.ReadOnly = true;
|
||||
|
|
@ -310,6 +319,7 @@ namespace OpenFK
|
|||
// CLoggerWarning
|
||||
//
|
||||
this.CLoggerWarning.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.CLoggerWarning.HideSelection = false;
|
||||
this.CLoggerWarning.Location = new System.Drawing.Point(0, 0);
|
||||
this.CLoggerWarning.Name = "CLoggerWarning";
|
||||
this.CLoggerWarning.ReadOnly = true;
|
||||
|
|
@ -330,6 +340,7 @@ namespace OpenFK
|
|||
// CLoggerError
|
||||
//
|
||||
this.CLoggerError.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.CLoggerError.HideSelection = false;
|
||||
this.CLoggerError.Location = new System.Drawing.Point(0, 0);
|
||||
this.CLoggerError.Name = "CLoggerError";
|
||||
this.CLoggerError.ReadOnly = true;
|
||||
|
|
@ -350,6 +361,7 @@ namespace OpenFK
|
|||
// CLoggerFatal
|
||||
//
|
||||
this.CLoggerFatal.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.CLoggerFatal.HideSelection = false;
|
||||
this.CLoggerFatal.Location = new System.Drawing.Point(0, 0);
|
||||
this.CLoggerFatal.Name = "CLoggerFatal";
|
||||
this.CLoggerFatal.ReadOnly = true;
|
||||
|
|
@ -395,6 +407,7 @@ namespace OpenFK
|
|||
// NetworkAllLogs
|
||||
//
|
||||
this.NetworkAllLogs.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.NetworkAllLogs.HideSelection = false;
|
||||
this.NetworkAllLogs.Location = new System.Drawing.Point(3, 3);
|
||||
this.NetworkAllLogs.Name = "NetworkAllLogs";
|
||||
this.NetworkAllLogs.ReadOnly = true;
|
||||
|
|
@ -416,6 +429,7 @@ namespace OpenFK
|
|||
// NetworkGetLogs
|
||||
//
|
||||
this.NetworkGetLogs.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.NetworkGetLogs.HideSelection = false;
|
||||
this.NetworkGetLogs.Location = new System.Drawing.Point(3, 3);
|
||||
this.NetworkGetLogs.Name = "NetworkGetLogs";
|
||||
this.NetworkGetLogs.ReadOnly = true;
|
||||
|
|
@ -436,6 +450,7 @@ namespace OpenFK
|
|||
// NetworkPostLogs
|
||||
//
|
||||
this.NetworkPostLogs.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.NetworkPostLogs.HideSelection = false;
|
||||
this.NetworkPostLogs.Location = new System.Drawing.Point(0, 0);
|
||||
this.NetworkPostLogs.Name = "NetworkPostLogs";
|
||||
this.NetworkPostLogs.ReadOnly = true;
|
||||
|
|
@ -457,6 +472,7 @@ namespace OpenFK
|
|||
// NetworkCommandLogs
|
||||
//
|
||||
this.NetworkCommandLogs.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.NetworkCommandLogs.HideSelection = false;
|
||||
this.NetworkCommandLogs.Location = new System.Drawing.Point(3, 3);
|
||||
this.NetworkCommandLogs.Name = "NetworkCommandLogs";
|
||||
this.NetworkCommandLogs.ReadOnly = true;
|
||||
|
|
@ -477,6 +493,7 @@ namespace OpenFK
|
|||
// staticStorageLogs
|
||||
//
|
||||
this.staticStorageLogs.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.staticStorageLogs.HideSelection = false;
|
||||
this.staticStorageLogs.Location = new System.Drawing.Point(0, 0);
|
||||
this.staticStorageLogs.Name = "staticStorageLogs";
|
||||
this.staticStorageLogs.ReadOnly = true;
|
||||
|
|
@ -484,13 +501,14 @@ namespace OpenFK
|
|||
this.staticStorageLogs.TabIndex = 0;
|
||||
this.staticStorageLogs.Text = "";
|
||||
//
|
||||
// DebugWindow
|
||||
// DebugForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(607, 455);
|
||||
this.Controls.Add(this.tabControl1);
|
||||
this.Name = "DebugWindow";
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.Name = "DebugForm";
|
||||
this.Text = "OpenFK - Debug";
|
||||
this.tabControl1.ResumeLayout(false);
|
||||
this.logTab.ResumeLayout(false);
|
||||
|
|
@ -1,19 +1,12 @@
|
|||
using OpenFK.OFK.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace OpenFK
|
||||
{
|
||||
public partial class DebugWindow : Form
|
||||
public partial class DebugForm : Form
|
||||
{
|
||||
public DebugWindow()
|
||||
public DebugForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
2492
OpenFK/DebugForm.resx
Normal file
2492
OpenFK/DebugForm.resx
Normal file
File diff suppressed because it is too large
Load Diff
|
|
@ -1,120 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
1162
OpenFK/Form1.cs
1162
OpenFK/Form1.cs
File diff suppressed because it is too large
Load Diff
|
|
@ -1,6 +1,6 @@
|
|||
namespace OpenFK
|
||||
{
|
||||
partial class Form1
|
||||
partial class GameForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(GameForm));
|
||||
this.AS2Container = new OpenFK.FlashRightClick();
|
||||
this.AS3Container = new OpenFK.FlashRightClick();
|
||||
((System.ComponentModel.ISupportInitialize)(this.AS2Container)).BeginInit();
|
||||
|
|
@ -55,17 +55,19 @@
|
|||
this.AS3Container.Size = new System.Drawing.Size(800, 600);
|
||||
this.AS3Container.TabIndex = 1;
|
||||
//
|
||||
// Form1
|
||||
// GameForm
|
||||
//
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
||||
this.ClientSize = new System.Drawing.Size(800, 600);
|
||||
this.Controls.Add(this.AS2Container);
|
||||
this.Controls.Add(this.AS3Container);
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.Name = "Form1";
|
||||
this.KeyPreview = true;
|
||||
this.Name = "GameForm";
|
||||
this.Text = "OpenFK";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form_FormClosing);
|
||||
this.Load += new System.EventHandler(this.Form1_Load);
|
||||
this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.GameForm_KeyPress);
|
||||
((System.ComponentModel.ISupportInitialize)(this.AS2Container)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.AS3Container)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
409
OpenFK/GameForm.cs
Normal file
409
OpenFK/GameForm.cs
Normal file
|
|
@ -0,0 +1,409 @@
|
|||
using AxShockwaveFlashObjects;
|
||||
using OpenFK.OFK.Common;
|
||||
using OpenFK.OFK.Core;
|
||||
using OpenFK.OFK.Net;
|
||||
using OpenFK.Properties;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.Xml;
|
||||
|
||||
namespace OpenFK
|
||||
{
|
||||
|
||||
// ===================================
|
||||
// Game Form
|
||||
// OpenFK's Primary Container
|
||||
// ===================================
|
||||
|
||||
public partial class GameForm : Form
|
||||
{
|
||||
//Rich Presence Data
|
||||
|
||||
|
||||
public GameForm(string[] args)
|
||||
{
|
||||
InitializeComponent();
|
||||
if (args.Contains("/debug"))
|
||||
{
|
||||
Globals.IsDebug = true;
|
||||
DebugForm debug = new DebugForm();
|
||||
debug.Show();
|
||||
}
|
||||
}
|
||||
|
||||
private void Form1_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!File.Exists(Directory.GetCurrentDirectory() + @"\Main.swf"))
|
||||
{
|
||||
MessageBox.Show("Could not find Main.swf!", "OpenFK", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
Application.Exit();
|
||||
}
|
||||
|
||||
if (Settings.Default.RPC == true)
|
||||
{
|
||||
RichPresenceManager.InitRPC();
|
||||
}
|
||||
|
||||
AS2Container.Quality = Settings.Default.Quality;
|
||||
AS2Container.Quality2 = "High";
|
||||
AS2Container.ScaleMode = Settings.Default.ScaleMode;
|
||||
AS2Container.Movie = Directory.GetCurrentDirectory() + @"\Main.swf";
|
||||
AS2Container.Play();
|
||||
LogManager.LogGeneral("[AS2Container] Main.swf is Loaded");
|
||||
AS2Container.FSCommand += new _IShockwaveFlashEvents_FSCommandEventHandler(flashPlayer_FSCommand); //This sets up the FSCommand handler, which CCommunicator likes to use a lot.
|
||||
|
||||
try
|
||||
{
|
||||
AS3Container.Quality = Settings.Default.Quality;
|
||||
AS3Container.Quality2 = "High";
|
||||
AS3Container.ScaleMode = Settings.Default.ScaleMode;
|
||||
AS3Container.Movie = Directory.GetCurrentDirectory() + @"\MainAS3.swf";
|
||||
LogManager.LogGeneral("[AS3Container] MainAS3.swf is Loaded");
|
||||
AS3Container.FSCommand += new _IShockwaveFlashEvents_FSCommandEventHandler(flashPlayerAS3_FSCommand);
|
||||
AS3Container.FlashCall += new _IShockwaveFlashEvents_FlashCallEventHandler(flashPlayerAS3_FlashCall);
|
||||
}
|
||||
catch
|
||||
{
|
||||
LogManager.LogGeneral("[AS3Container] AS3 Failed to Load! Potentially an older version.");
|
||||
}
|
||||
|
||||
//Globals
|
||||
Globals.GameForm = this;
|
||||
Globals.AS2Container = AS2Container;
|
||||
Globals.AS3Container = AS3Container;
|
||||
|
||||
BittyManager.InitBitty();
|
||||
}
|
||||
|
||||
private void flashPlayerAS3_FSCommand(object sender, _IShockwaveFlashEvents_FSCommandEvent e)
|
||||
{
|
||||
string[] commandsList;
|
||||
|
||||
try
|
||||
{
|
||||
commandsList = CommandParser.ParseReceivedMessage(e.args);
|
||||
}
|
||||
catch
|
||||
{
|
||||
LogManager.LogGeneral($"[AS3] [SendMsg] [Error] Failed to parse message! - {e.args}");
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (string command in commandsList)
|
||||
{
|
||||
string[] commandInfo = CommandParser.ParseCommand(command);
|
||||
if (commandInfo[0] != "log" || commandInfo[0] != "staticstorage")
|
||||
{
|
||||
LogManager.LogIncoming("[AS3] [SendMsg] " + e.args);
|
||||
}
|
||||
switch (commandInfo[0])
|
||||
{
|
||||
case "save_jpeg":
|
||||
FileManager.SaveJPEG(commandInfo[1], commandInfo[2], commandInfo[3]);
|
||||
break;
|
||||
case "as3_transit":
|
||||
SetVar(command); //Sends the AS3 command to AS2.
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void flashPlayerAS3_FlashCall(object sender, _IShockwaveFlashEvents_FlashCallEvent e)
|
||||
{
|
||||
string[] commandsList;
|
||||
|
||||
try
|
||||
{
|
||||
commandsList = CommandParser.ParseReceivedMessage(e.request);
|
||||
}
|
||||
catch
|
||||
{
|
||||
LogManager.LogGeneral($"[AS3] [FlashCall] [Error] Failed to parse message! - {e.request}");
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (string command in commandsList)
|
||||
{
|
||||
string[] commandInfo = CommandParser.ParseCommand(command);
|
||||
if (commandInfo[0] != "log" || commandInfo[0] != "staticstorage")
|
||||
{
|
||||
LogManager.LogIncoming("[AS3] [SendMsg] " + e.request);
|
||||
}
|
||||
switch (commandInfo[0])
|
||||
{
|
||||
case "as3_loaded":
|
||||
SetVar(@"<?xml version=""1.0"" encoding=""UTF - 8""?><commands><as3_loaded id=""1"" path=""MainAS3.swf"" result=""0"" err="""" /></commands>");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void flashPlayer_FSCommand(object sender, _IShockwaveFlashEvents_FSCommandEvent e)
|
||||
{
|
||||
string[] commandsList;
|
||||
|
||||
try
|
||||
{
|
||||
commandsList = CommandParser.ParseReceivedMessage(e.args);
|
||||
}
|
||||
catch
|
||||
{
|
||||
LogManager.LogGeneral($"[AS2] [SendMsg] [Error] Failed to parse message! - {e.args}");
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (string command in commandsList)
|
||||
{
|
||||
string[] commandInfo = CommandParser.ParseCommand(command);
|
||||
if (commandInfo[0] != "log" && commandInfo[0] != "staticstorage")
|
||||
{
|
||||
LogManager.LogIncoming("[AS2] [SendMsg] " + e.args);
|
||||
}
|
||||
|
||||
switch (commandInfo[0])
|
||||
{
|
||||
// ----------------------------- FileManager ---------------------------- \\
|
||||
case "load":
|
||||
SetVar(FileManager.LoadFile(commandInfo[1], commandInfo[2]));
|
||||
break;
|
||||
case "save":
|
||||
FileManager.SaveFile(commandInfo[1], commandInfo[2], command);
|
||||
break;
|
||||
case "createuser":
|
||||
FileManager.CreateUser(commandInfo[1], commandInfo[2], commandInfo[3], commandInfo[4], commandInfo[5]);
|
||||
break;
|
||||
|
||||
// ----------------------------- HttpManager ---------------------------- \\
|
||||
case "netcommands":
|
||||
LogManager.LogNetwork("Netcommand called.", "NetCommand");
|
||||
|
||||
string tnurl = "";
|
||||
if (e.args.Contains("<save_level "))
|
||||
{
|
||||
XmlDocument request = new XmlDocument();
|
||||
request.LoadXml(e.args);
|
||||
XmlNodeList xnList = request.SelectNodes("/netcommands/save_level");
|
||||
foreach (XmlNode xn in xnList)
|
||||
{
|
||||
tnurl = xn.Attributes["tnurl"].Value;
|
||||
}
|
||||
|
||||
using (var client = new WebClient())
|
||||
{
|
||||
client.UploadFile(HttpManager.UGHost + "/" + tnurl, "PUT", Directory.GetCurrentDirectory() + @"\" + tnurl);
|
||||
}
|
||||
}
|
||||
|
||||
if (Settings.Default.IsOnline)
|
||||
{
|
||||
//Sends the result of the POST request. It's usually a command for the game to handle.
|
||||
SetVar(HttpManager.HTTPPost(command, HttpManager.GXHost).ToString());
|
||||
}
|
||||
break;
|
||||
|
||||
// ---------------------------- UpdateManager --------------------------- \\
|
||||
case "checkupdate":
|
||||
UpdateManager.CheckUpdate();
|
||||
break;
|
||||
case "loadupdate":
|
||||
UpdateManager.LoadUpdate();
|
||||
break;
|
||||
|
||||
// ------------------------------ LogManager ---------------------------- \\
|
||||
case "log":
|
||||
var log = new XmlDocument();
|
||||
log.LoadXml(e.args);
|
||||
var node = log.SelectSingleNode("/log");
|
||||
string message = node.InnerText;
|
||||
LogManager.LogLog(message, commandInfo[1]);
|
||||
break;
|
||||
case "staticstorage":
|
||||
string key = WebUtility.UrlDecode(commandInfo[3]);
|
||||
|
||||
switch (commandInfo[4])
|
||||
{
|
||||
case "get":
|
||||
string value = WebUtility.UrlDecode(commandInfo[1]);
|
||||
string defaultValue = WebUtility.UrlDecode(commandInfo[2]);
|
||||
LogManager.LogStaticStorageGet(key, value, defaultValue);
|
||||
break;
|
||||
|
||||
case "set":
|
||||
string oldValue = WebUtility.UrlDecode(commandInfo[2]);
|
||||
string newValue = WebUtility.UrlDecode(commandInfo[1]);
|
||||
LogManager.LogStaticStorageSet(key, oldValue, newValue);
|
||||
break;
|
||||
|
||||
case "delete":
|
||||
string original = WebUtility.UrlDecode(commandInfo[2]);
|
||||
LogManager.LogStaticStorageDelete(key, original);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
// ------------------------------ GameForm ----------------------------- \\
|
||||
case "radicaclose":
|
||||
RadicaClose();
|
||||
break;
|
||||
case "fullscreen":
|
||||
if (commandInfo[1] == "1") //Fullscreen Mode
|
||||
{
|
||||
this.FormBorderStyle = FormBorderStyle.None;
|
||||
this.WindowState = FormWindowState.Maximized;
|
||||
}
|
||||
else if (commandInfo[1] == "0") //Window Mode
|
||||
{
|
||||
this.FormBorderStyle = FormBorderStyle.Sizable;
|
||||
}
|
||||
break;
|
||||
case "loaded":
|
||||
SetVar(@"<bitybyte id=""FFFFFFF000000000"" />");
|
||||
break;
|
||||
case "as3_load":
|
||||
AS3Container.Play();
|
||||
AS2Container.SendToBack();
|
||||
SetVar(@"<getstaticdata />");
|
||||
SetVar(@"<getgamedata />");
|
||||
SetVar(@"<getugsettings />");
|
||||
break;
|
||||
case "as3_close":
|
||||
SetVar(@"<leavegame />");
|
||||
AS3Container.SendToBack();
|
||||
AS3Container.Stop();
|
||||
break;
|
||||
case "as3_setcurrentid":
|
||||
//The game unescapes this string. "<commands><setid id="0" /></commands>" is the string. Unsure if it does anything, but it does not give a failure.
|
||||
AS3Container.CallFunction(@"<invoke name=""WrapperCall"" returntype=""xml""><arguments><string>setid</string><string>%3c%63%6f%6d%6d%61%6e%64%73%3e%3c%73%65%74%69%64%20%69%64%3d%22%30%22%20%2f%3e%3c%2f%63%6f%6d%6d%61%6e%64%73%3e</string><string>%3c%63%6f%6d%6d%61%6e%64%73%3e%3c%73%65%74%69%64%20%69%64%3d%22%30%22%20%2f%3e%3c%2f%63%6f%6d%6d%61%6e%64%73%3e</string></arguments></invoke>");
|
||||
AS3Container.SendToBack();
|
||||
Directory.Delete(Directory.GetCurrentDirectory() + @"\misc\tmp\", true); //Deletes the temporary folder used for the results.
|
||||
break;
|
||||
case "checktrunkupdate":
|
||||
SetVar(@"<checktrunkupdate result=""0"" reason=""Everything is up to date."" />");
|
||||
break;
|
||||
case "readytorecieve":
|
||||
break;
|
||||
default:
|
||||
LogManager.LogGeneral($"[AS2] [SendMsg] Unhandled command! - {command}");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void Form_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
e.Cancel = (e.CloseReason == CloseReason.UserClosing);
|
||||
if (e.CloseReason == CloseReason.UserClosing)
|
||||
{
|
||||
SetVar(@"<radicaclose />");
|
||||
}
|
||||
if (e.CloseReason == CloseReason.WindowsShutDown)
|
||||
{
|
||||
DisposeElements();
|
||||
Application.Exit();
|
||||
}
|
||||
}
|
||||
|
||||
public void RadicaClose()
|
||||
{
|
||||
LogManager.LogGeneral("[OpenFK] Radicaclose was called");
|
||||
DisposeElements();
|
||||
StartUpdate();
|
||||
Application.Exit();
|
||||
}
|
||||
|
||||
void DisposeElements()
|
||||
{
|
||||
if (Settings.Default.RPC == true)
|
||||
{
|
||||
RichPresenceManager.Client.Dispose();
|
||||
}
|
||||
if (Settings.Default.USBSupport == true)
|
||||
{
|
||||
try
|
||||
{
|
||||
Process process = Process.GetProcessesByName("MegaByte")[0];
|
||||
process.Kill();
|
||||
}
|
||||
catch
|
||||
{
|
||||
StartUpdate();
|
||||
Application.Exit();
|
||||
}
|
||||
}
|
||||
if (Settings.Default.customF == true)
|
||||
{
|
||||
try
|
||||
{
|
||||
Process process = Process.GetProcessesByName("FunkeySelectorGUI")[0];
|
||||
process.Kill();
|
||||
}
|
||||
catch
|
||||
{
|
||||
StartUpdate();
|
||||
Application.Exit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void StartUpdate()
|
||||
{
|
||||
if (Globals.WasUpdated)
|
||||
{
|
||||
ProcessStartInfo updatescript = new ProcessStartInfo(Directory.GetCurrentDirectory() + @"\tmpdl\OpenFK.exe");
|
||||
updatescript.Arguments = "/update";
|
||||
updatescript.WorkingDirectory = Directory.GetCurrentDirectory() + @"\tmpdl";
|
||||
updatescript.UseShellExecute = false;
|
||||
Process.Start(updatescript);
|
||||
}
|
||||
}
|
||||
|
||||
public void SetVar(string msg)
|
||||
{
|
||||
LogManager.LogOutgoing("[SetVar/Return] Returned Message - " + msg);
|
||||
AS2Container.SetVariable("msg", msg);
|
||||
}
|
||||
|
||||
const int WM_COPYDATA = 0x004A;
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct COPYDATASTRUCT
|
||||
{
|
||||
public IntPtr dwData;
|
||||
public int cbData;
|
||||
public IntPtr lpData;
|
||||
}
|
||||
|
||||
//Receives the Bitty Code from MegaByte and FSGUI.
|
||||
protected override void WndProc(ref Message m)
|
||||
{
|
||||
if (m.Msg == WM_COPYDATA)
|
||||
{
|
||||
COPYDATASTRUCT cds = (COPYDATASTRUCT)m.GetLParam(typeof(COPYDATASTRUCT));
|
||||
|
||||
// Convert lpData to a string
|
||||
byte[] buffer = new byte[cds.cbData];
|
||||
Marshal.Copy(cds.lpData, buffer, 0, buffer.Length);
|
||||
string receivedData = Encoding.ASCII.GetString(buffer);
|
||||
|
||||
LogManager.LogGeneral($"[Bitty] USB Bitty - {receivedData}");
|
||||
BittyManager.SetBitty(receivedData, true);
|
||||
}
|
||||
base.WndProc(ref m);
|
||||
}
|
||||
|
||||
private void GameForm_KeyPress(object sender, KeyPressEventArgs e)
|
||||
{
|
||||
if (e.KeyChar == '`')
|
||||
{
|
||||
BittyManager.ShowGUI();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
11
OpenFK/Globals.cs
Normal file
11
OpenFK/Globals.cs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
namespace OpenFK
|
||||
{
|
||||
static class Globals
|
||||
{
|
||||
public static FlashRightClick AS2Container;
|
||||
public static FlashRightClick AS3Container;
|
||||
public static GameForm GameForm;
|
||||
public static bool WasUpdated;
|
||||
public static bool IsDebug;
|
||||
}
|
||||
}
|
||||
79
OpenFK/OFK.Common/CommandParser.cs
Normal file
79
OpenFK/OFK.Common/CommandParser.cs
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace OpenFK.OFK.Common
|
||||
{
|
||||
static class CommandParser
|
||||
{
|
||||
/// <summary>
|
||||
/// Breaks each message into their own XML string.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// A string array with each raw command in the message.
|
||||
/// </returns>
|
||||
public static string[] ParseReceivedMessage(string xmlCommand)
|
||||
{
|
||||
List<string> commandsList = new List<string>();
|
||||
|
||||
xmlCommand = xmlCommand.Replace("\0", string.Empty);
|
||||
|
||||
XDocument breakableXMLMessage = XDocument.Parse(xmlCommand);
|
||||
XElement commandRoot = breakableXMLMessage.Root;
|
||||
if(commandRoot.Name.LocalName != "commands")
|
||||
{
|
||||
commandsList.Add(xmlCommand);
|
||||
return commandsList.ToArray();
|
||||
}
|
||||
|
||||
foreach (var comElement in breakableXMLMessage.Descendants("commands").Elements())
|
||||
{
|
||||
commandsList.Add(comElement.ToString());
|
||||
}
|
||||
|
||||
return commandsList.ToArray();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Parses the command's parameters and descendants.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// A string array with the first element being the command name, and the subsequent elements being the parameters, then descendants.
|
||||
/// </returns>
|
||||
public static string[] ParseCommand(string command)
|
||||
{
|
||||
List<string> commandInfo = new List<string>();
|
||||
|
||||
XDocument commandXML = XDocument.Parse(command);
|
||||
XElement commandRoot = commandXML.Root;
|
||||
|
||||
commandInfo.Add(commandRoot.Name.LocalName);
|
||||
|
||||
var attrNames = (
|
||||
from a in commandRoot.Attributes()
|
||||
select a.Value
|
||||
);
|
||||
|
||||
foreach (string value in attrNames)
|
||||
{
|
||||
commandInfo.Add(value);
|
||||
}
|
||||
|
||||
//Allows parsing of descendant elements.
|
||||
foreach (XElement element in commandRoot.Descendants())
|
||||
{
|
||||
var desAttrNames = (
|
||||
from a in element.Attributes()
|
||||
select a.Value
|
||||
);
|
||||
|
||||
foreach (string value in desAttrNames)
|
||||
{
|
||||
commandInfo.Add(value);
|
||||
}
|
||||
}
|
||||
|
||||
return commandInfo.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,9 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace OpenFK.OFK.Common
|
||||
|
|
@ -20,13 +16,16 @@ namespace OpenFK.OFK.Common
|
|||
|
||||
private static void AppendLine(RichTextBox richTextBox, string message)
|
||||
{
|
||||
try
|
||||
if (Globals.IsDebug)
|
||||
{
|
||||
richTextBox.AppendText("\n" + message);
|
||||
}
|
||||
catch
|
||||
{
|
||||
Debug.WriteLine($"[{richTextBox.Name}] {message}");
|
||||
try
|
||||
{
|
||||
richTextBox.AppendText("\n" + message);
|
||||
}
|
||||
catch
|
||||
{
|
||||
Debug.WriteLine($"[{richTextBox.Name}] {message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
117
OpenFK/OFK.Common/RDFManager.cs
Normal file
117
OpenFK/OFK.Common/RDFManager.cs
Normal file
|
|
@ -0,0 +1,117 @@
|
|||
using System.Text;
|
||||
|
||||
namespace OpenFK
|
||||
{
|
||||
class RDFManager
|
||||
{
|
||||
private static char[] code = new char[] { (char)0x00, (char)0x01, (char)0x02, (char)0x03, (char)0x04, (char)0x05, (char)0x06, (char)0x07, (char)0x08, (char)0x09, (char)0x0A, (char)0x0B, (char)0x0C, (char)0x0D, (char)0x0E, (char)0x0F, (char)0x10, (char)0x11, (char)0x12, (char)0x13, (char)0x14, (char)0x15, (char)0x16, (char)0x17, (char)0x18, (char)0x19, (char)0x1A, (char)0x1B, (char)0x1C, (char)0x1D, (char)0x1E, (char)0x1F, (char)0x20, (char)0x21, (char)0x22, (char)0x23, (char)0x24, (char)0x25, (char)0x26, (char)0x27, (char)0x28, (char)0x29, (char)0x2A, (char)0x2B, (char)0x2C, (char)0x2D, (char)0x2E, (char)0x2F, (char)0x30, (char)0x31, (char)0x32, (char)0x33, (char)0x34, (char)0x35, (char)0x36, (char)0x37, (char)0x38, (char)0x39, (char)0x3A, (char)0x3B, (char)0x3C, (char)0x3D, (char)0x3E, (char)0x3F, (char)0x40, (char)0x41, (char)0x42, (char)0x43, (char)0x44, (char)0x45, (char)0x46, (char)0x47, (char)0x48, (char)0x49, (char)0x4A, (char)0x4B, (char)0x4C, (char)0x4D, (char)0x4E, (char)0x4F, (char)0x50, (char)0x51, (char)0x52, (char)0x53, (char)0x54, (char)0x55, (char)0x56, (char)0x57, (char)0x58, (char)0x59, (char)0x5A, (char)0x5B, (char)0x5C, (char)0x5D, (char)0x5E, (char)0x5F, (char)0x60, (char)0x61, (char)0x62, (char)0x63, (char)0x64, (char)0x65, (char)0x66, (char)0x67, (char)0x68, (char)0x69, (char)0x6A, (char)0x6B, (char)0x6C, (char)0x6D, (char)0x6E, (char)0x6F, (char)0x70, (char)0x71, (char)0x72, (char)0x73, (char)0x74, (char)0x75, (char)0x76, (char)0x77, (char)0x78, (char)0x79, (char)0x7A, (char)0x7B, (char)0x7C, (char)0x7D, (char)0x7E, (char)0x7F, (char)0x80, (char)0x81, (char)0x82, (char)0x83, (char)0x84, (char)0x85, (char)0x86, (char)0x87, (char)0x88, (char)0x89, (char)0x8A, (char)0x8B, (char)0x8C, (char)0x8D, (char)0x8E, (char)0x8F, (char)0x90, (char)0x91, (char)0x92, (char)0x93, (char)0x94, (char)0x95, (char)0x96, (char)0x97, (char)0x98, (char)0x99, (char)0x9A, (char)0x9B, (char)0x9C, (char)0x9D, (char)0x9E, (char)0x9F, (char)0xA0, (char)0xA1, (char)0xA2, (char)0xA3, (char)0xA4, (char)0xA5, (char)0xA6, (char)0xA7, (char)0xA8, (char)0xA9, (char)0xAA, (char)0xAB, (char)0xAC, (char)0xAD, (char)0xAE, (char)0xAF, (char)0xB0, (char)0xB1, (char)0xB2, (char)0xB3, (char)0xB4, (char)0xB5, (char)0xB6, (char)0xB7, (char)0xB8, (char)0xB9, (char)0xBA, (char)0xBB, (char)0xBC, (char)0xBD, (char)0xBE, (char)0xBF, (char)0xC0, (char)0xC1, (char)0xC2, (char)0xC3, (char)0xC4, (char)0xC5, (char)0xC6, (char)0xC7, (char)0xC8, (char)0xC9, (char)0xCA, (char)0xCB, (char)0xCC, (char)0xCD, (char)0xCE, (char)0xCF, (char)0xD0, (char)0xD1, (char)0xD2, (char)0xD3, (char)0xD4, (char)0xD5, (char)0xD6, (char)0xD7, (char)0xD8, (char)0xD9, (char)0xDA, (char)0xDB, (char)0xDC, (char)0xDD, (char)0xDE, (char)0xDF, (char)0xE0, (char)0xE1, (char)0xE2, (char)0xE3, (char)0xE4, (char)0xE5, (char)0xE6, (char)0xE7, (char)0xE8, (char)0xE9, (char)0xEA, (char)0xEB, (char)0xEC, (char)0xED, (char)0xEE, (char)0xEF, (char)0xF0, (char)0xF1, (char)0xF2, (char)0xF3, (char)0xF4, (char)0xF5, (char)0xF6, (char)0xF7, (char)0xF8, (char)0xF9, (char)0xFA, (char)0xFB, (char)0xFC, (char)0xFD, (char)0xFE, (char)0xFF };
|
||||
|
||||
/// <summary>
|
||||
/// the column to roll
|
||||
/// </summary>
|
||||
private static char[][] col = new char[][]
|
||||
{
|
||||
new char[] {(char)0x44, (char)0x45, (char)0x46, (char)0x47, (char)0x40, (char)0x41, (char)0x42, (char)0x43, (char)0x4C, (char)0x4D, (char)0x4E, (char)0x4F, (char)0x48, (char)0x49, (char)0x4A, (char)0x4B, (char)0x54, (char)0x55, (char)0x56, (char)0x57, (char)0x50, (char)0x51, (char)0x52, (char)0x53, (char)0x5C, (char)0x5D, (char)0x5E, (char)0x5F, (char)0x58, (char)0x59, (char)0x5A, (char)0x5B, (char)0x64, (char)0x65, (char)0x66, (char)0x67, (char)0x60, (char)0x61, (char)0x62, (char)0x63, (char)0x6C, (char)0x6D, (char)0x6E, (char)0x6F, (char)0x68, (char)0x69, (char)0x6A, (char)0x6B, (char)0x74, (char)0x75, (char)0x76, (char)0x77, (char)0x70, (char)0x71, (char)0x72, (char)0x73, (char)0x7C, (char)0x7D, (char)0x7E, (char)0x7F, (char)0x78, (char)0x79, (char)0x7A, (char)0x7B, (char)0x04, (char)0x05, (char)0x06, (char)0x07, (char)0x00, (char)0x01, (char)0x02, (char)0x03, (char)0x0C, (char)0x0D, (char)0x0E, (char)0x0F, (char)0x08, (char)0x09, (char)0x0A, (char)0x0B, (char)0x14, (char)0x15, (char)0x16, (char)0x17, (char)0x10, (char)0x11, (char)0x12, (char)0x13, (char)0x1C, (char)0x1D, (char)0x1E, (char)0x1F, (char)0x18, (char)0x19, (char)0x1A, (char)0x1B, (char)0x24, (char)0x25, (char)0x26, (char)0x27, (char)0x20, (char)0x21, (char)0x22, (char)0x23, (char)0x2C, (char)0x2D, (char)0x2E, (char)0x2F, (char)0x28, (char)0x29, (char)0x2A, (char)0x2B, (char)0x34, (char)0x35, (char)0x36, (char)0x37, (char)0x30, (char)0x31, (char)0x32, (char)0x33, (char)0x3C, (char)0x3D, (char)0x3E, (char)0x3F, (char)0x38, (char)0x39, (char)0x3A, (char)0x3B, (char)0x84, (char)0x85, (char)0x86, (char)0x87, (char)0x80, (char)0x81, (char)0x82, (char)0x83, (char)0x8C, (char)0x8D, (char)0x8E, (char)0x8F, (char)0x88, (char)0x89, (char)0x8A, (char)0x8B, (char)0x94, (char)0x95, (char)0x96, (char)0x97, (char)0x90, (char)0x91, (char)0x92, (char)0x93, (char)0x9C, (char)0x9D, (char)0x9E, (char)0x9F, (char)0x98, (char)0x99, (char)0x9A, (char)0x9B, (char)0xA4, (char)0xA5, (char)0xA6, (char)0xA7, (char)0xA0, (char)0xA1, (char)0xA2, (char)0xA3, (char)0xAC, (char)0xAD, (char)0xAE, (char)0xAF, (char)0xA8, (char)0xA9, (char)0xAA, (char)0xAB, (char)0xB4, (char)0xB5, (char)0xB6, (char)0xB7, (char)0xB0, (char)0xB1, (char)0xB2, (char)0xB3, (char)0xBC, (char)0xBD, (char)0xBE, (char)0xBF, (char)0xB8, (char)0xB9, (char)0xBA, (char)0xBB, (char)0xC4, (char)0xC5, (char)0xC6, (char)0xC7, (char)0xC0, (char)0xC1, (char)0xC2, (char)0xC3, (char)0xCC, (char)0xCD, (char)0xCE, (char)0xCF, (char)0xC8, (char)0xC9, (char)0xCA, (char)0xCB, (char)0xD4, (char)0xD5, (char)0xD6, (char)0xD7, (char)0xD0, (char)0xD1, (char)0xD2, (char)0xD3, (char)0xDC, (char)0xDD, (char)0xDE, (char)0xDF, (char)0xD8, (char)0xD9, (char)0xDA, (char)0xDB, (char)0xE4, (char)0xE5, (char)0xE6, (char)0xE7, (char)0xE0, (char)0xE1, (char)0xE2, (char)0xE3, (char)0xEC, (char)0xED, (char)0xEE, (char)0xEF, (char)0xE8, (char)0xE9, (char)0xEA, (char)0xEB, (char)0xF4, (char)0xF5, (char)0xF6, (char)0xF7, (char)0xF0, (char)0xF1, (char)0xF2, (char)0xF3, (char)0xFC, (char)0xFD, (char)0xFE, (char)0xFF, (char)0xF8, (char)0xF9, (char)0xFA, (char)0xFB},
|
||||
new char[] {(char)0x32, (char)0x33, (char)0x30, (char)0x31, (char)0x36, (char)0x37, (char)0x34, (char)0x35, (char)0x3A, (char)0x3B, (char)0x38, (char)0x39, (char)0x3E, (char)0x3F, (char)0x3C, (char)0x3D, (char)0x22, (char)0x23, (char)0x20, (char)0x21, (char)0x26, (char)0x27, (char)0x24, (char)0x25, (char)0x2A, (char)0x2B, (char)0x28, (char)0x29, (char)0x2E, (char)0x2F, (char)0x2C, (char)0x2D, (char)0x12, (char)0x13, (char)0x10, (char)0x11, (char)0x16, (char)0x17, (char)0x14, (char)0x15, (char)0x1A, (char)0x1B, (char)0x18, (char)0x19, (char)0x1E, (char)0x1F, (char)0x1C, (char)0x1D, (char)0x02, (char)0x03, (char)0x00, (char)0x01, (char)0x06, (char)0x07, (char)0x04, (char)0x05, (char)0x0A, (char)0x0B, (char)0x08, (char)0x09, (char)0x0E, (char)0x0F, (char)0x0C, (char)0x0D, (char)0x72, (char)0x73, (char)0x70, (char)0x71, (char)0x76, (char)0x77, (char)0x74, (char)0x75, (char)0x7A, (char)0x7B, (char)0x78, (char)0x79, (char)0x7E, (char)0x7F, (char)0x7C, (char)0x7D, (char)0x62, (char)0x63, (char)0x60, (char)0x61, (char)0x66, (char)0x67, (char)0x64, (char)0x65, (char)0x6A, (char)0x6B, (char)0x68, (char)0x69, (char)0x6E, (char)0x6F, (char)0x6C, (char)0x6D, (char)0x52, (char)0x53, (char)0x50, (char)0x51, (char)0x56, (char)0x57, (char)0x54, (char)0x55, (char)0x5A, (char)0x5B, (char)0x58, (char)0x59, (char)0x5E, (char)0x5F, (char)0x5C, (char)0x5D, (char)0x42, (char)0x43, (char)0x40, (char)0x41, (char)0x46, (char)0x47, (char)0x44, (char)0x45, (char)0x4A, (char)0x4B, (char)0x48, (char)0x49, (char)0x4E, (char)0x4F, (char)0x4C, (char)0x4D, (char)0xF2, (char)0xF3, (char)0xF0, (char)0xF1, (char)0xF6, (char)0xF7, (char)0xF4, (char)0xF5, (char)0xFA, (char)0xFB, (char)0xF8, (char)0xF9, (char)0xFE, (char)0xFF, (char)0xFC, (char)0xFD, (char)0xE2, (char)0xE3, (char)0xE0, (char)0xE1, (char)0xE6, (char)0xE7, (char)0xE4, (char)0xE5, (char)0xEA, (char)0xEB, (char)0xE8, (char)0xE9, (char)0xEE, (char)0xEF, (char)0xEC, (char)0xED, (char)0xD2, (char)0xD3, (char)0xD0, (char)0xD1, (char)0xD6, (char)0xD7, (char)0xD4, (char)0xD5, (char)0xDA, (char)0xDB, (char)0xD8, (char)0xD9, (char)0xDE, (char)0xDF, (char)0xDC, (char)0xDD, (char)0xC2, (char)0xC3, (char)0xC0, (char)0xC1, (char)0xC6, (char)0xC7, (char)0xC4, (char)0xC5, (char)0xCA, (char)0xCB, (char)0xC8, (char)0xC9, (char)0xCE, (char)0xCF, (char)0xCC, (char)0xCD, (char)0xB2, (char)0xB3, (char)0xB0, (char)0xB1, (char)0xB6, (char)0xB7, (char)0xB4, (char)0xB5, (char)0xBA, (char)0xBB, (char)0xB8, (char)0xB9, (char)0xBE, (char)0xBF, (char)0xBC, (char)0xBD, (char)0xA2, (char)0xA3, (char)0xA0, (char)0xA1, (char)0xA6, (char)0xA7, (char)0xA4, (char)0xA5, (char)0xAA, (char)0xAB, (char)0xA8, (char)0xA9, (char)0xAE, (char)0xAF, (char)0xAC, (char)0xAD, (char)0x92, (char)0x93, (char)0x90, (char)0x91, (char)0x96, (char)0x97, (char)0x94, (char)0x95, (char)0x9A, (char)0x9B, (char)0x98, (char)0x99, (char)0x9E, (char)0x9F, (char)0x9C, (char)0x9D, (char)0x82, (char)0x83, (char)0x80, (char)0x81, (char)0x86, (char)0x87, (char)0x84, (char)0x85, (char)0x8A, (char)0x8B, (char)0x88, (char)0x89, (char)0x8E, (char)0x8F, (char)0x8C, (char)0x8D},
|
||||
new char[] {(char)0x6C, (char)0x6D, (char)0x6E, (char)0x6F, (char)0x68, (char)0x69, (char)0x6A, (char)0x6B, (char)0x64, (char)0x65, (char)0x66, (char)0x67, (char)0x60, (char)0x61, (char)0x62, (char)0x63, (char)0x7C, (char)0x7D, (char)0x7E, (char)0x7F, (char)0x78, (char)0x79, (char)0x7A, (char)0x7B, (char)0x74, (char)0x75, (char)0x76, (char)0x77, (char)0x70, (char)0x71, (char)0x72, (char)0x73, (char)0x4C, (char)0x4D, (char)0x4E, (char)0x4F, (char)0x48, (char)0x49, (char)0x4A, (char)0x4B, (char)0x44, (char)0x45, (char)0x46, (char)0x47, (char)0x40, (char)0x41, (char)0x42, (char)0x43, (char)0x5C, (char)0x5D, (char)0x5E, (char)0x5F, (char)0x58, (char)0x59, (char)0x5A, (char)0x5B, (char)0x54, (char)0x55, (char)0x56, (char)0x57, (char)0x50, (char)0x51, (char)0x52, (char)0x53, (char)0x2C, (char)0x2D, (char)0x2E, (char)0x2F, (char)0x28, (char)0x29, (char)0x2A, (char)0x2B, (char)0x24, (char)0x25, (char)0x26, (char)0x27, (char)0x20, (char)0x21, (char)0x22, (char)0x23, (char)0x3C, (char)0x3D, (char)0x3E, (char)0x3F, (char)0x38, (char)0x39, (char)0x3A, (char)0x3B, (char)0x34, (char)0x35, (char)0x36, (char)0x37, (char)0x30, (char)0x31, (char)0x32, (char)0x33, (char)0x0C, (char)0x0D, (char)0x0E, (char)0x0F, (char)0x08, (char)0x09, (char)0x0A, (char)0x0B, (char)0x04, (char)0x05, (char)0x06, (char)0x07, (char)0x00, (char)0x01, (char)0x02, (char)0x03, (char)0x1C, (char)0x1D, (char)0x1E, (char)0x1F, (char)0x18, (char)0x19, (char)0x1A, (char)0x1B, (char)0x14, (char)0x15, (char)0x16, (char)0x17, (char)0x10, (char)0x11, (char)0x12, (char)0x13, (char)0xAC, (char)0xAD, (char)0xAE, (char)0xAF, (char)0xA8, (char)0xA9, (char)0xAA, (char)0xAB, (char)0xA4, (char)0xA5, (char)0xA6, (char)0xA7, (char)0xA0, (char)0xA1, (char)0xA2, (char)0xA3, (char)0xBC, (char)0xBD, (char)0xBE, (char)0xBF, (char)0xB8, (char)0xB9, (char)0xBA, (char)0xBB, (char)0xB4, (char)0xB5, (char)0xB6, (char)0xB7, (char)0xB0, (char)0xB1, (char)0xB2, (char)0xB3, (char)0x8C, (char)0x8D, (char)0x8E, (char)0x8F, (char)0x88, (char)0x89, (char)0x8A, (char)0x8B, (char)0x84, (char)0x85, (char)0x86, (char)0x87, (char)0x80, (char)0x81, (char)0x82, (char)0x83, (char)0x9C, (char)0x9D, (char)0x9E, (char)0x9F, (char)0x98, (char)0x99, (char)0x9A, (char)0x9B, (char)0x94, (char)0x95, (char)0x96, (char)0x97, (char)0x90, (char)0x91, (char)0x92, (char)0x93, (char)0xEC, (char)0xED, (char)0xEE, (char)0xEF, (char)0xE8, (char)0xE9, (char)0xEA, (char)0xEB, (char)0xE4, (char)0xE5, (char)0xE6, (char)0xE7, (char)0xE0, (char)0xE1, (char)0xE2, (char)0xE3, (char)0xFC, (char)0xFD, (char)0xFE, (char)0xFF, (char)0xF8, (char)0xF9, (char)0xFA, (char)0xFB, (char)0xF4, (char)0xF5, (char)0xF6, (char)0xF7, (char)0xF0, (char)0xF1, (char)0xF2, (char)0xF3, (char)0xCC, (char)0xCD, (char)0xCE, (char)0xCF, (char)0xC8, (char)0xC9, (char)0xCA, (char)0xCB, (char)0xC4, (char)0xC5, (char)0xC6, (char)0xC7, (char)0xC0, (char)0xC1, (char)0xC2, (char)0xC3, (char)0xDC, (char)0xDE, (char)0xDF, (char)0xDF, (char)0xD8, (char)0xD9, (char)0xDA, (char)0xDB, (char)0xD4, (char)0xD5, (char)0xD6, (char)0xD7, (char)0xD0, (char)0xD1, (char)0xD2, (char)0xD3},
|
||||
new char[] {(char)0xE5, (char)0xE4, (char)0xE7, (char)0xE6, (char)0xE1, (char)0xE0, (char)0xE3, (char)0xE2, (char)0xED, (char)0xEC, (char)0xEF, (char)0xEE, (char)0xE9, (char)0xE8, (char)0xEB, (char)0xEA, (char)0xF5, (char)0xF4, (char)0xF7, (char)0xF6, (char)0xF1, (char)0xF0, (char)0xF3, (char)0xF2, (char)0xFD, (char)0xFC, (char)0xFF, (char)0xFE, (char)0xF9, (char)0xF8, (char)0xFB, (char)0xFA, (char)0xC5, (char)0xC4, (char)0xC7, (char)0xC6, (char)0xC1, (char)0xC0, (char)0xC3, (char)0xC2, (char)0xCD, (char)0xCC, (char)0xCF, (char)0xCE, (char)0xC9, (char)0xC8, (char)0xCB, (char)0xCA, (char)0xD5, (char)0xD4, (char)0xD7, (char)0xD6, (char)0xD1, (char)0xD0, (char)0xD3, (char)0xD2, (char)0xDD, (char)0xDC, (char)0xDF, (char)0xDE, (char)0xD9, (char)0xD8, (char)0xDB, (char)0xDA, (char)0xA5, (char)0xA4, (char)0xA7, (char)0xA6, (char)0xA1, (char)0xA0, (char)0xA3, (char)0xA2, (char)0xAD, (char)0xAC, (char)0xAF, (char)0xAE, (char)0xA9, (char)0xA8, (char)0xAB, (char)0xAA, (char)0xB5, (char)0xB4, (char)0xB7, (char)0xB6, (char)0xB1, (char)0xB0, (char)0xB3, (char)0xB2, (char)0xBD, (char)0xBC, (char)0xBF, (char)0xBE, (char)0xB9, (char)0xB8, (char)0xBB, (char)0xBA, (char)0x85, (char)0x84, (char)0x87, (char)0x86, (char)0x81, (char)0x80, (char)0x83, (char)0x82, (char)0x8D, (char)0x8C, (char)0x8F, (char)0x8E, (char)0x89, (char)0x88, (char)0x8B, (char)0x8A, (char)0x95, (char)0x94, (char)0x97, (char)0x96, (char)0x91, (char)0x90, (char)0x93, (char)0x92, (char)0x9D, (char)0x9C, (char)0x9F, (char)0x9E, (char)0x99, (char)0x98, (char)0x9B, (char)0x9A, (char)0x25, (char)0x24, (char)0x27, (char)0x26, (char)0x21, (char)0x20, (char)0x23, (char)0x22, (char)0x2D, (char)0x2C, (char)0x2F, (char)0x2E, (char)0x29, (char)0x28, (char)0x2B, (char)0x2A, (char)0x35, (char)0x34, (char)0x37, (char)0x36, (char)0x31, (char)0x30, (char)0x33, (char)0x32, (char)0x3D, (char)0x3C, (char)0x3F, (char)0x3E, (char)0x39, (char)0x38, (char)0x3B, (char)0x3A, (char)0x05, (char)0x04, (char)0x07, (char)0x06, (char)0x01, (char)0x00, (char)0x03, (char)0x02, (char)0x0D, (char)0x0C, (char)0x0F, (char)0x0E, (char)0x09, (char)0x08, (char)0x0B, (char)0x0A, (char)0x15, (char)0x14, (char)0x17, (char)0x16, (char)0x11, (char)0x10, (char)0x13, (char)0x12, (char)0x1D, (char)0x1C, (char)0x1F, (char)0x1E, (char)0x19, (char)0x18, (char)0x1B, (char)0x1A, (char)0x65, (char)0x64, (char)0x67, (char)0x66, (char)0x61, (char)0x60, (char)0x63, (char)0x62, (char)0x6D, (char)0x6C, (char)0x6F, (char)0x6E, (char)0x69, (char)0x68, (char)0x6B, (char)0x6A, (char)0x75, (char)0x74, (char)0x77, (char)0x76, (char)0x71, (char)0x70, (char)0x73, (char)0x72, (char)0x7D, (char)0x7C, (char)0x7F, (char)0x7E, (char)0x79, (char)0x78, (char)0x7B, (char)0x7A, (char)0x45, (char)0x44, (char)0x47, (char)0x46, (char)0x41, (char)0x40, (char)0x43, (char)0x42, (char)0x4D, (char)0x4C, (char)0x4F, (char)0x4E, (char)0x49, (char)0x48, (char)0x4B, (char)0x4A, (char)0x55, (char)0x54, (char)0x57, (char)0x56, (char)0x51, (char)0x50, (char)0x53, (char)0x52, (char)0x5D, (char)0x5C, (char)0x5F, (char)0x5E, (char)0x59, (char)0x58, (char)0x5B, (char)0x5A},
|
||||
new char[] {(char)0x88, (char)0x89, (char)0x8A, (char)0x8B, (char)0x8C, (char)0x8D, (char)0x8E, (char)0x8F, (char)0x80, (char)0x81, (char)0x82, (char)0x83, (char)0x84, (char)0x85, (char)0x86, (char)0x87, (char)0x98, (char)0x99, (char)0x9A, (char)0x9B, (char)0x9C, (char)0x9D, (char)0x9E, (char)0x9F, (char)0x90, (char)0x91, (char)0x92, (char)0x93, (char)0x94, (char)0x95, (char)0x96, (char)0x97, (char)0xA8, (char)0xA9, (char)0xAA, (char)0xAB, (char)0xAC, (char)0xAD, (char)0xAE, (char)0xAF, (char)0xA0, (char)0xA1, (char)0xA2, (char)0xA3, (char)0xA4, (char)0xA5, (char)0xA6, (char)0xA7, (char)0xB8, (char)0xB9, (char)0xBA, (char)0xBB, (char)0xBC, (char)0xBD, (char)0xBE, (char)0xBF, (char)0xB0, (char)0xB1, (char)0xB2, (char)0xB3, (char)0xB4, (char)0xB5, (char)0xB6, (char)0xB7, (char)0xC8, (char)0xC9, (char)0xCA, (char)0xCB, (char)0xCC, (char)0xCD, (char)0xCE, (char)0xCF, (char)0xC0, (char)0xC1, (char)0xC2, (char)0xC3, (char)0xC4, (char)0xC5, (char)0xC6, (char)0xC7, (char)0xD8, (char)0xD9, (char)0xDA, (char)0xDB, (char)0xDC, (char)0xDD, (char)0xDE, (char)0xDF, (char)0xD0, (char)0xD1, (char)0xD2, (char)0xD3, (char)0xD4, (char)0xD5, (char)0xD6, (char)0xD7, (char)0xE8, (char)0xE9, (char)0xEA, (char)0xEB, (char)0xEC, (char)0xED, (char)0xEE, (char)0xEF, (char)0xE0, (char)0xE1, (char)0xE2, (char)0xE3, (char)0xE4, (char)0xE5, (char)0xE6, (char)0xE7, (char)0xF8, (char)0xF9, (char)0xFA, (char)0xFB, (char)0xFC, (char)0xFD, (char)0xFE, (char)0xFF, (char)0xF0, (char)0xF1, (char)0xF2, (char)0xF3, (char)0xF4, (char)0xF5, (char)0xF6, (char)0xF7, (char)0x48, (char)0x49, (char)0x4A, (char)0x4B, (char)0x4C, (char)0x4D, (char)0x4E, (char)0x4F, (char)0x40, (char)0x41, (char)0x42, (char)0x43, (char)0x44, (char)0x45, (char)0x46, (char)0x47, (char)0x58, (char)0x59, (char)0x5A, (char)0x5B, (char)0x5C, (char)0x5D, (char)0x5E, (char)0x5F, (char)0x50, (char)0x51, (char)0x52, (char)0x53, (char)0x54, (char)0x55, (char)0x56, (char)0x57, (char)0x68, (char)0x69, (char)0x6A, (char)0x6B, (char)0x6C, (char)0x6D, (char)0x6E, (char)0x6F, (char)0x60, (char)0x61, (char)0x62, (char)0x63, (char)0x64, (char)0x65, (char)0x66, (char)0x67, (char)0x78, (char)0x79, (char)0x7A, (char)0x7B, (char)0x7C, (char)0x7D, (char)0x7E, (char)0x7F, (char)0x70, (char)0x71, (char)0x72, (char)0x73, (char)0x74, (char)0x75, (char)0x76, (char)0x77, (char)0x08, (char)0x09, (char)0x0A, (char)0x0B, (char)0x0C, (char)0x0D, (char)0x0E, (char)0x0F, (char)0x00, (char)0x01, (char)0x02, (char)0x03, (char)0x04, (char)0x05, (char)0x06, (char)0x07, (char)0x18, (char)0x19, (char)0x1A, (char)0x1B, (char)0x1C, (char)0x1D, (char)0x1E, (char)0x1F, (char)0x10, (char)0x11, (char)0x12, (char)0x13, (char)0x14, (char)0x15, (char)0x16, (char)0x17, (char)0x28, (char)0x29, (char)0x2A, (char)0x2B, (char)0x2C, (char)0x2D, (char)0x2E, (char)0x2F, (char)0x20, (char)0x21, (char)0x22, (char)0x23, (char)0x24, (char)0x25, (char)0x26, (char)0x27, (char)0x38, (char)0x39, (char)0x3A, (char)0x3B, (char)0x3C, (char)0x3D, (char)0x3E, (char)0x3F, (char)0x30, (char)0x31, (char)0x32, (char)0x33, (char)0x34, (char)0x35, (char)0x36, (char)0x37},
|
||||
new char[] {(char)0x79, (char)0x78, (char)0x7B, (char)0x7A, (char)0x7D, (char)0x7C, (char)0x7F, (char)0x7E, (char)0x71, (char)0x70, (char)0x73, (char)0x72, (char)0x75, (char)0x74, (char)0x77, (char)0x76, (char)0x69, (char)0x68, (char)0x6B, (char)0x6A, (char)0x6D, (char)0x6C, (char)0x6F, (char)0x6E, (char)0x61, (char)0x60, (char)0x63, (char)0x62, (char)0x65, (char)0x64, (char)0x67, (char)0x66, (char)0x59, (char)0x58, (char)0x5B, (char)0x5A, (char)0x5D, (char)0x5C, (char)0x5F, (char)0x5E, (char)0x51, (char)0x50, (char)0x53, (char)0x52, (char)0x55, (char)0x54, (char)0x57, (char)0x56, (char)0x49, (char)0x48, (char)0x4B, (char)0x4A, (char)0x4D, (char)0x4C, (char)0x4F, (char)0x4E, (char)0x41, (char)0x40, (char)0x43, (char)0x42, (char)0x45, (char)0x44, (char)0x47, (char)0x46, (char)0x39, (char)0x38, (char)0x3B, (char)0x3A, (char)0x3D, (char)0x3C, (char)0x3F, (char)0x3E, (char)0x31, (char)0x30, (char)0x33, (char)0x32, (char)0x35, (char)0x34, (char)0x37, (char)0x36, (char)0x29, (char)0x28, (char)0x2B, (char)0x2A, (char)0x2D, (char)0x2C, (char)0x2F, (char)0x2E, (char)0x21, (char)0x20, (char)0x23, (char)0x22, (char)0x25, (char)0x24, (char)0x27, (char)0x26, (char)0x19, (char)0x18, (char)0x1B, (char)0x1A, (char)0x1D, (char)0x1C, (char)0x1F, (char)0x1E, (char)0x11, (char)0x10, (char)0x13, (char)0x12, (char)0x15, (char)0x14, (char)0x17, (char)0x16, (char)0x09, (char)0x08, (char)0x0B, (char)0x0A, (char)0x0D, (char)0x0C, (char)0x0F, (char)0x0E, (char)0x01, (char)0x00, (char)0x03, (char)0x02, (char)0x05, (char)0x04, (char)0x07, (char)0x06, (char)0xB9, (char)0xB8, (char)0xBB, (char)0xBA, (char)0xBD, (char)0xBC, (char)0xBF, (char)0xBE, (char)0xB1, (char)0xB0, (char)0xB3, (char)0xB2, (char)0xB5, (char)0xB4, (char)0xB7, (char)0xB6, (char)0xA9, (char)0xA8, (char)0xAB, (char)0xAA, (char)0xAD, (char)0xAC, (char)0xAF, (char)0xAE, (char)0xA1, (char)0xA0, (char)0xA3, (char)0xA2, (char)0xA5, (char)0xA4, (char)0xA7, (char)0xA6, (char)0x99, (char)0x98, (char)0x9B, (char)0x9A, (char)0x9D, (char)0x9C, (char)0x9F, (char)0x9E, (char)0x91, (char)0x90, (char)0x93, (char)0x92, (char)0x95, (char)0x94, (char)0x97, (char)0x96, (char)0x89, (char)0x88, (char)0x8B, (char)0x8A, (char)0x8D, (char)0x8C, (char)0x8F, (char)0x8E, (char)0x81, (char)0x80, (char)0x83, (char)0x82, (char)0x85, (char)0x84, (char)0x87, (char)0x86, (char)0xF9, (char)0xF8, (char)0xFB, (char)0xFA, (char)0xFD, (char)0xFC, (char)0xFF, (char)0xFE, (char)0xF1, (char)0xF0, (char)0xF3, (char)0xF2, (char)0xF5, (char)0xF4, (char)0xF7, (char)0xF6, (char)0xE9, (char)0xE8, (char)0xEB, (char)0xEA, (char)0xED, (char)0xEC, (char)0xEF, (char)0xEE, (char)0xE1, (char)0xE0, (char)0xE3, (char)0xE2, (char)0xE5, (char)0xE4, (char)0xE7, (char)0xE6, (char)0xD9, (char)0xD8, (char)0xDB, (char)0xDA, (char)0xDD, (char)0xDC, (char)0xDF, (char)0xDE, (char)0xD1, (char)0xD0, (char)0xD3, (char)0xD2, (char)0xD5, (char)0xD4, (char)0xD7, (char)0xD6, (char)0xC9, (char)0xC8, (char)0xCB, (char)0xCA, (char)0xCD, (char)0xCC, (char)0xCF, (char)0xCE, (char)0xC1, (char)0xC0, (char)0xC3, (char)0xC2, (char)0xC5, (char)0xC4, (char)0xC7, (char)0xC6},
|
||||
new char[] {(char)0x7F, (char)0x7E, (char)0x7D, (char)0x7C, (char)0x7B, (char)0x7A, (char)0x79, (char)0x78, (char)0x77, (char)0x76, (char)0x75, (char)0x74, (char)0x73, (char)0x72, (char)0x71, (char)0x70, (char)0x6F, (char)0x6E, (char)0x6D, (char)0x6C, (char)0x6B, (char)0x6A, (char)0x69, (char)0x68, (char)0x67, (char)0x66, (char)0x65, (char)0x64, (char)0x63, (char)0x62, (char)0x61, (char)0x60, (char)0x5F, (char)0x5E, (char)0x5D, (char)0x5C, (char)0x5B, (char)0x5A, (char)0x59, (char)0x58, (char)0x57, (char)0x56, (char)0x55, (char)0x54, (char)0x53, (char)0x52, (char)0x51, (char)0x50, (char)0x4F, (char)0x4E, (char)0x4D, (char)0x4C, (char)0x4B, (char)0x4A, (char)0x49, (char)0x48, (char)0x47, (char)0x46, (char)0x45, (char)0x44, (char)0x43, (char)0x42, (char)0x41, (char)0x40, (char)0x3F, (char)0x3E, (char)0x3D, (char)0x3C, (char)0x3B, (char)0x3A, (char)0x39, (char)0x38, (char)0x37, (char)0x36, (char)0x35, (char)0x34, (char)0x33, (char)0x32, (char)0x31, (char)0x30, (char)0x2F, (char)0x2E, (char)0x2D, (char)0x2C, (char)0x2B, (char)0x2A, (char)0x29, (char)0x28, (char)0x27, (char)0x26, (char)0x25, (char)0x24, (char)0x23, (char)0x22, (char)0x21, (char)0x20, (char)0x1F, (char)0x1E, (char)0x1D, (char)0x1C, (char)0x1B, (char)0x1A, (char)0x19, (char)0x18, (char)0x17, (char)0x16, (char)0x15, (char)0x14, (char)0x13, (char)0x12, (char)0x11, (char)0x10, (char)0x0F, (char)0x0E, (char)0x0D, (char)0x0C, (char)0x0B, (char)0x0A, (char)0x09, (char)0x08, (char)0x07, (char)0x06, (char)0x05, (char)0x04, (char)0x03, (char)0x02, (char)0x01, (char)0x00, (char)0xBF, (char)0xBE, (char)0xBD, (char)0xBC, (char)0xBB, (char)0xBA, (char)0xB9, (char)0xB8, (char)0xB7, (char)0xB6, (char)0xB5, (char)0xB4, (char)0xB3, (char)0xB2, (char)0xB1, (char)0xB0, (char)0xAF, (char)0xAE, (char)0xAD, (char)0xAC, (char)0xAB, (char)0xAA, (char)0xA9, (char)0xA8, (char)0xA7, (char)0xA6, (char)0xA5, (char)0xA4, (char)0xA3, (char)0xA2, (char)0xA1, (char)0xA0, (char)0x9F, (char)0x9E, (char)0x9D, (char)0x9C, (char)0x9B, (char)0x9A, (char)0x99, (char)0x98, (char)0x97, (char)0x96, (char)0x95, (char)0x94, (char)0x93, (char)0x92, (char)0x91, (char)0x90, (char)0x8F, (char)0x8E, (char)0x8D, (char)0x8C, (char)0x8B, (char)0x8A, (char)0x89, (char)0x88, (char)0x87, (char)0x86, (char)0x85, (char)0x84, (char)0x83, (char)0x82, (char)0x81, (char)0x80, (char)0xFF, (char)0xFE, (char)0xFD, (char)0xFC, (char)0xFB, (char)0xFA, (char)0xF9, (char)0xF8, (char)0xF7, (char)0xF6, (char)0xF5, (char)0xF4, (char)0xF3, (char)0xF2, (char)0xF1, (char)0xF0, (char)0xEF, (char)0xEE, (char)0xED, (char)0xEC, (char)0xEB, (char)0xEA, (char)0xE9, (char)0xE8, (char)0xE7, (char)0xE6, (char)0xE5, (char)0xE4, (char)0xE3, (char)0xE2, (char)0xE1, (char)0xE0, (char)0xDF, (char)0xDE, (char)0xDD, (char)0xDC, (char)0xDB, (char)0xDA, (char)0xD9, (char)0xD8, (char)0xD7, (char)0xD6, (char)0xD5, (char)0xD4, (char)0xD3, (char)0xD2, (char)0xD1, (char)0xD0, (char)0xCF, (char)0xCE, (char)0xCD, (char)0xCC, (char)0xCB, (char)0xCA, (char)0xC9, (char)0xC8, (char)0xC7, (char)0xC6, (char)0xC5, (char)0xC4, (char)0xC3, (char)0xC2, (char)0xC1, (char)0xC0},
|
||||
new char[] {(char)0x95, (char)0x94, (char)0x97, (char)0x96, (char)0x91, (char)0x90, (char)0x93, (char)0x92, (char)0x9D, (char)0x9C, (char)0x9F, (char)0x9E, (char)0x99, (char)0x98, (char)0x9B, (char)0x9A, (char)0x85, (char)0x84, (char)0x87, (char)0x86, (char)0x81, (char)0x80, (char)0x83, (char)0x82, (char)0x8D, (char)0x8C, (char)0x8F, (char)0x8E, (char)0x89, (char)0x88, (char)0x8B, (char)0x8A, (char)0xB5, (char)0xB4, (char)0xB7, (char)0xB6, (char)0xB1, (char)0xB0, (char)0xB3, (char)0xB2, (char)0xBD, (char)0xBC, (char)0xBF, (char)0xBE, (char)0xB9, (char)0xB8, (char)0xBB, (char)0xBA, (char)0xA5, (char)0xA4, (char)0xA7, (char)0xA6, (char)0xA1, (char)0xA0, (char)0xA3, (char)0xA2, (char)0xAD, (char)0xAC, (char)0xAF, (char)0xAE, (char)0xA9, (char)0xA8, (char)0xAB, (char)0xAA, (char)0xD5, (char)0xD4, (char)0xD7, (char)0xD6, (char)0xD1, (char)0xD0, (char)0xD3, (char)0xD2, (char)0xDD, (char)0xDC, (char)0xDF, (char)0xDE, (char)0xD9, (char)0xD8, (char)0xDB, (char)0xDA, (char)0xC5, (char)0xC4, (char)0xC7, (char)0xC6, (char)0xC1, (char)0xC0, (char)0xC3, (char)0xC2, (char)0xCD, (char)0xCC, (char)0xCF, (char)0xCE, (char)0xC9, (char)0xC8, (char)0xCB, (char)0xCA, (char)0xF5, (char)0xF4, (char)0xF7, (char)0xF6, (char)0xF1, (char)0xF0, (char)0xF3, (char)0xF2, (char)0xFD, (char)0xFC, (char)0xFF, (char)0xFE, (char)0xF9, (char)0xF8, (char)0xFB, (char)0xFA, (char)0xE5, (char)0xE4, (char)0xE7, (char)0xE6, (char)0xE1, (char)0xE0, (char)0xE3, (char)0xE2, (char)0xED, (char)0xEC, (char)0xEF, (char)0xEE, (char)0xE9, (char)0xE8, (char)0xEB, (char)0xEA, (char)0x55, (char)0x54, (char)0x57, (char)0x56, (char)0x51, (char)0x50, (char)0x53, (char)0x52, (char)0x5D, (char)0x5C, (char)0x5F, (char)0x5E, (char)0x59, (char)0x58, (char)0x5B, (char)0x5A, (char)0x45, (char)0x44, (char)0x47, (char)0x46, (char)0x41, (char)0x40, (char)0x43, (char)0x42, (char)0x4D, (char)0x4C, (char)0x4F, (char)0x4E, (char)0x49, (char)0x48, (char)0x4B, (char)0x4A, (char)0x75, (char)0x74, (char)0x77, (char)0x76, (char)0x71, (char)0x70, (char)0x73, (char)0x72, (char)0x7D, (char)0x7C, (char)0x7F, (char)0x7E, (char)0x79, (char)0x78, (char)0x7B, (char)0x7A, (char)0x65, (char)0x64, (char)0x67, (char)0x66, (char)0x61, (char)0x60, (char)0x63, (char)0x62, (char)0x6D, (char)0x6C, (char)0x6F, (char)0x6E, (char)0x69, (char)0x68, (char)0x6B, (char)0x6A, (char)0x15, (char)0x14, (char)0x17, (char)0x16, (char)0x11, (char)0x10, (char)0x13, (char)0x12, (char)0x1D, (char)0x1C, (char)0x1F, (char)0x1E, (char)0x19, (char)0x18, (char)0x1B, (char)0x1A, (char)0x05, (char)0x04, (char)0x07, (char)0x06, (char)0x01, (char)0x00, (char)0x03, (char)0x02, (char)0x0D, (char)0x0C, (char)0x0F, (char)0x0E, (char)0x09, (char)0x08, (char)0x0B, (char)0x0A, (char)0x35, (char)0x34, (char)0x37, (char)0x36, (char)0x31, (char)0x30, (char)0x33, (char)0x32, (char)0x3D, (char)0x3C, (char)0x3F, (char)0x3E, (char)0x39, (char)0x38, (char)0x3B, (char)0x3A, (char)0x25, (char)0x24, (char)0x27, (char)0x26, (char)0x21, (char)0x20, (char)0x23, (char)0x22, (char)0x2D, (char)0x2C, (char)0x2F, (char)0x2E, (char)0x29, (char)0x28, (char)0x2B, (char)0x2A}
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// the endings for each column
|
||||
/// </summary>
|
||||
private static char[][] end = new char[][]
|
||||
{
|
||||
new char[] {(char)0x44, (char)0x32, (char)0x6C, (char)0xE5, (char)0x8B},
|
||||
new char[] {(char)0x32, (char)0x6C, (char)0xE5, (char)0x8C},
|
||||
new char[] {(char)0x6C, (char)0xE5, (char)0x8D},
|
||||
new char[] {(char)0xE5, (char)0x8E},
|
||||
new char[] {(char)0x8F},
|
||||
new char[] {(char)0x79, (char)0x7F, (char)0x95, (char)0x44, (char)0x32, (char)0x6C, (char)0xE5, (char)0x88},
|
||||
new char[] {(char)0x7F, (char)0x95, (char)0x44, (char)0x32, (char)0x6C, (char)0xE5, (char)0x88},
|
||||
new char[] {(char)0x95, (char)0x44, (char)0x32, (char)0x6C, (char)0xE5, (char)0x88}
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// the start of each column
|
||||
/// </summary>
|
||||
private static char[] start = new char[] { (char)0xFF, (char)0x00, (char)0xFF, (char)0xAC, (char)0xEB, (char)0x96, (char)0xC4, (char)0x2A };
|
||||
|
||||
/// <summary>
|
||||
/// Decodes an RDF file.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// A string containing the plain-text XML data.
|
||||
/// </returns>
|
||||
public static string DecodeRDF(string encoded)
|
||||
{
|
||||
int currentCol = 0;
|
||||
char[] arr = encoded.ToCharArray();
|
||||
char[] ret = new char[arr.Length];
|
||||
int pos = 0;
|
||||
int endchar = 0;
|
||||
foreach (char character in arr)
|
||||
{
|
||||
for (int i = 0; i < 256; i++)
|
||||
{
|
||||
if (col[currentCol][i] == character)
|
||||
{
|
||||
ret[pos++] = code[i];
|
||||
if (code[i] == (char)0x3E)
|
||||
{
|
||||
endchar = pos;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
currentCol++;
|
||||
if (currentCol > 7)
|
||||
{
|
||||
currentCol = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return new string(ret).Substring(start.Length, endchar - start.Length);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Encodes a plain-text XML file.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// A string containing the encoded RDF data.
|
||||
/// </returns>
|
||||
public static string EncodeXML(string decoded)
|
||||
{
|
||||
Encoding iso_8859_1 = Encoding.GetEncoding("iso-8859-1");
|
||||
int currentCol = 0;
|
||||
char[] arr = decoded.ToCharArray();
|
||||
char[] ret = new char[arr.Length];
|
||||
int pos = 0;
|
||||
foreach (char character in arr)
|
||||
{
|
||||
for (int i = 0; i < 256; i++)
|
||||
{
|
||||
if (code[i] == character)
|
||||
{
|
||||
ret[pos++] = col[currentCol][i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
currentCol++;
|
||||
if (currentCol > 7)
|
||||
{
|
||||
currentCol = 0;
|
||||
}
|
||||
}
|
||||
return new string(iso_8859_1.GetChars(iso_8859_1.GetBytes(new string(start) + new string(ret) + new string(end[currentCol]))));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
167
OpenFK/OFK.Core/BittyManager.cs
Normal file
167
OpenFK/OFK.Core/BittyManager.cs
Normal file
|
|
@ -0,0 +1,167 @@
|
|||
using Microsoft.Win32;
|
||||
using OpenFK.OFK.Net;
|
||||
using OpenFK.Properties;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Xml;
|
||||
|
||||
namespace OpenFK.OFK.Core
|
||||
{
|
||||
static class BittyManager
|
||||
{
|
||||
// ===================================
|
||||
// Bitty Manager
|
||||
// Handles the Bitty transmission via both MegaByte and customF.
|
||||
// ===================================
|
||||
|
||||
private static FileSystemWatcher BittyWatcher;
|
||||
private static string BittyID;
|
||||
|
||||
//For MegaByte's config.
|
||||
[DllImport("user32.dll", CharSet = CharSet.Auto)]
|
||||
static extern int GetClassName(IntPtr hwnd, StringBuilder lpClassName, int nMaxCount);
|
||||
|
||||
//FSGUI Focusing
|
||||
private const int SW_SHOWNORMAL = 1;
|
||||
private const int SW_MINIMIZE = 6;
|
||||
const uint SWP_NOSIZE = 0x0001;
|
||||
const uint SWP_NOZORDER = 0x0004;
|
||||
|
||||
[DllImport("user32.dll", EntryPoint = "FindWindow")]
|
||||
public static extern IntPtr FindWindowByCaption(IntPtr ZeroOnly, string lpWindowName);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
static extern bool IsIconic(IntPtr hWnd);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true)]
|
||||
static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags);
|
||||
|
||||
public static void InitBitty()
|
||||
{
|
||||
//customF Initialization
|
||||
if (Settings.Default.customF == true)
|
||||
{
|
||||
BittyWatcher = new FileSystemWatcher();
|
||||
BittyWatcher.Path = Directory.GetCurrentDirectory();
|
||||
BittyWatcher.NotifyFilter = NotifyFilters.LastAccess | NotifyFilters.LastWrite
|
||||
| NotifyFilters.FileName | NotifyFilters.DirectoryName;
|
||||
BittyWatcher.Filter = "customF.txt";
|
||||
BittyWatcher.Changed += OnChanged;
|
||||
BittyWatcher.SynchronizingObject = Globals.AS2Container;
|
||||
BittyWatcher.EnableRaisingEvents = true;
|
||||
|
||||
if (File.Exists(Directory.GetCurrentDirectory() + @"\FunkeySelectorGUI.exe"))
|
||||
{
|
||||
Process.Start(Directory.GetCurrentDirectory() + @"\FunkeySelectorGUI.exe");
|
||||
Thread.Sleep(500);
|
||||
ShowGUI();
|
||||
}
|
||||
}
|
||||
|
||||
if (Settings.Default.USBSupport == true)
|
||||
{
|
||||
//WinForms uses a randomized class name, so we fill in Config.ini with OpenFK's info.
|
||||
var className = new StringBuilder(256);
|
||||
GetClassName(Globals.GameForm.Handle, className, className.Capacity);
|
||||
|
||||
string configFile = Directory.GetParent(Directory.GetCurrentDirectory()) + @"\Config.ini";
|
||||
string[] configLines = File.ReadAllLines(configFile);
|
||||
configLines[11] = @"ClassName=""" + className.ToString() + @"""";
|
||||
configLines[12] = @"WindowName=""OpenFK""";
|
||||
File.WriteAllLines(configFile, configLines);
|
||||
|
||||
var key = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers", true);
|
||||
if (key == null)
|
||||
throw new InvalidOperationException(@"Cannot open registry key HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers.");
|
||||
using (key)
|
||||
key.SetValue(Directory.GetParent(Directory.GetCurrentDirectory()) + @"\MegaByte\" + "MegaByte.exe", "VISTASP2");
|
||||
Process MBRun = new Process();
|
||||
ProcessStartInfo MBData = new ProcessStartInfo();
|
||||
MBData.FileName = Directory.GetParent(Directory.GetCurrentDirectory()) + @"\MegaByte\" + "MegaByte.exe";
|
||||
MBData.Arguments = "-MBRun -MBDebug";
|
||||
MBData.UseShellExecute = false;
|
||||
MBData.WindowStyle = ProcessWindowStyle.Minimized;
|
||||
MBRun.StartInfo = MBData;
|
||||
MBRun.Start();
|
||||
}
|
||||
}
|
||||
|
||||
static void OnChanged(object sender, FileSystemEventArgs e)
|
||||
{
|
||||
try //Runs a loop to keep reading until the file is not being saved.
|
||||
{
|
||||
SetBitty(File.ReadAllText(Directory.GetCurrentDirectory() + @"\customF.txt").Remove(0, 14), false);
|
||||
}
|
||||
catch
|
||||
{
|
||||
OnChanged(sender, e);
|
||||
}
|
||||
}
|
||||
|
||||
public static void SetBitty(string localBittyID, bool isMB)
|
||||
{
|
||||
if (BittyID != localBittyID)
|
||||
{
|
||||
if (isMB)
|
||||
{
|
||||
string mbBitty = Regex.Replace(localBittyID, @"[^\w\d]", "");
|
||||
Globals.GameForm.SetVar(@$"<bitybyte id=""{mbBitty}"" />");
|
||||
}
|
||||
else
|
||||
{
|
||||
Globals.GameForm.SetVar(@$"<bitybyte id=""{localBittyID}00000000"" />");
|
||||
}
|
||||
BittyID = localBittyID;
|
||||
|
||||
RichPresenceManager.CurrentBitty = localBittyID.ToLower();
|
||||
if (Settings.Default.RPC == true)
|
||||
{
|
||||
try
|
||||
{
|
||||
XmlNodeList nodes = RichPresenceManager.BittyData.SelectNodes("//funkey[@id='" + localBittyID + "']");
|
||||
foreach (XmlNode xn in nodes)
|
||||
{
|
||||
RichPresenceManager.CurrentBittyName = xn.Attributes["name"].Value;
|
||||
}
|
||||
RichPresenceManager.SetRP(RichPresenceManager.CurrentWorld, RichPresenceManager.CurrentActivity, RichPresenceManager.CurrentBitty, RichPresenceManager.CurrentBittyName);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void ShowGUI()
|
||||
{
|
||||
//TODO - There's an issue with opening anything other than the primary form.
|
||||
try
|
||||
{
|
||||
IntPtr hwnd = FindWindowByCaption(IntPtr.Zero, "FunkeySelectorGUI");
|
||||
if (IsIconic(hwnd))
|
||||
{
|
||||
ShowWindow(hwnd, SW_SHOWNORMAL);
|
||||
int gameFormCenterX = Globals.GameForm.Location.X + 50;
|
||||
int gameFormCenterY = Globals.GameForm.Location.Y + 50;
|
||||
SetWindowPos(hwnd, IntPtr.Zero, gameFormCenterX, gameFormCenterY, gameFormCenterX, gameFormCenterY, SWP_NOSIZE | SWP_NOZORDER);
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowWindow(hwnd, SW_MINIMIZE);
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
}
|
||||
226
OpenFK/OFK.Core/FileManager.cs
Normal file
226
OpenFK/OFK.Core/FileManager.cs
Normal file
|
|
@ -0,0 +1,226 @@
|
|||
using OpenFK.OFK.Common;
|
||||
using OpenFK.OFK.Net;
|
||||
using OpenFK.Properties;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Xml;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace OpenFK.OFK.Core
|
||||
{
|
||||
static class FileManager
|
||||
{
|
||||
// ===================================
|
||||
// File Manager
|
||||
// Handles the modification/access of RDF files.
|
||||
// ===================================
|
||||
|
||||
static XmlDocument UserData;
|
||||
|
||||
/// <summary>
|
||||
/// Loads a specified data file and sends the contents to Flash.
|
||||
/// </summary>
|
||||
/// <param name="section">The file name to load.</param>
|
||||
/// <param name="name">The profile directory the file is located in.</param>
|
||||
public static string LoadFile(string section, string name)
|
||||
{
|
||||
LogManager.LogFile($"[Load] {name}/{section}");
|
||||
Encoding iso_8859_1 = Encoding.GetEncoding("iso-8859-1");
|
||||
string response;
|
||||
string filedata;
|
||||
try
|
||||
{
|
||||
if (Settings.Default.RDF == true)
|
||||
{
|
||||
byte[] RDFData = File.ReadAllBytes(Directory.GetCurrentDirectory() + @"\data\" + name + @"\" + section + ".rdf");
|
||||
filedata = RDFManager.DecodeRDF(iso_8859_1.GetString(RDFData));
|
||||
}
|
||||
else filedata = File.ReadAllText(Directory.GetCurrentDirectory() + @"\data\" + name + @"\" + section + ".xml");
|
||||
response = @"<commands><load section=""" + section + @""" name=""" + name + @""" result=""0"" reason="""">" + filedata + @"</load></commands>";
|
||||
|
||||
switch (section)
|
||||
{
|
||||
case "funkeys":
|
||||
RichPresenceManager.BittyData = new XmlDocument();
|
||||
RichPresenceManager.BittyData.LoadXml(filedata);
|
||||
break;
|
||||
case "users":
|
||||
UserData = new XmlDocument();
|
||||
UserData.LoadXml(filedata);
|
||||
break;
|
||||
case "config":
|
||||
XmlDocument configData = new XmlDocument();
|
||||
configData.LoadXml(filedata);
|
||||
|
||||
if (Settings.Default.IsOnline)
|
||||
{
|
||||
XmlAttribute host = (XmlAttribute)configData.SelectSingleNode("/settings/host/@value");
|
||||
host.Value = Settings.Default.HTTPHost1;
|
||||
|
||||
XmlAttribute host1 = (XmlAttribute)configData.SelectSingleNode("/settings/host1/@value");
|
||||
host1.Value = Settings.Default.HTTPHost2;
|
||||
|
||||
XmlAttribute tcpHost = (XmlAttribute)configData.SelectSingleNode("/settings/arkone_host/@value");
|
||||
tcpHost.Value = Settings.Default.TCPHost;
|
||||
|
||||
XmlAttribute tcpPort = (XmlAttribute)configData.SelectSingleNode("/settings/arkone_port/@value");
|
||||
tcpPort.Value = Settings.Default.TCPPort;
|
||||
|
||||
filedata = configData.OuterXml;
|
||||
response = @"<commands><load section=""" + section + @""" name=""" + name + @""" result=""0"" reason="""">" + filedata + @"</load></commands>";
|
||||
}
|
||||
|
||||
XmlNodeList xnList1 = configData.SelectNodes("/settings/host");
|
||||
foreach (XmlNode xn in xnList1)
|
||||
{
|
||||
HttpManager.GXHost = xn.Attributes["value"].Value;
|
||||
}
|
||||
|
||||
XmlNodeList xnList2 = configData.SelectNodes("/settings/host1");
|
||||
foreach (XmlNode xn in xnList2)
|
||||
{
|
||||
HttpManager.UGHost = xn.Attributes["value"].Value;
|
||||
}
|
||||
|
||||
XmlNodeList xnList3 = configData.SelectNodes("/settings/store");
|
||||
foreach (XmlNode xn in xnList3)
|
||||
{
|
||||
HttpManager.FileStore = xn.Attributes["value"].Value;
|
||||
}
|
||||
|
||||
XmlNodeList xnList4 = configData.SelectNodes("/settings/trunkstore");
|
||||
foreach (XmlNode xn in xnList4)
|
||||
{
|
||||
HttpManager.TrunkStore = xn.Attributes["value"].Value;
|
||||
}
|
||||
break;
|
||||
|
||||
case "city":
|
||||
RichPresenceManager.ChangeLocation("Funkeystown");
|
||||
break;
|
||||
case "lava":
|
||||
RichPresenceManager.ChangeLocation("Magma Gorge");
|
||||
break;
|
||||
case "space":
|
||||
RichPresenceManager.ChangeLocation("Laputta Station");
|
||||
break;
|
||||
case "underwater":
|
||||
RichPresenceManager.ChangeLocation("Kelpy Basin");
|
||||
break;
|
||||
case "island":
|
||||
RichPresenceManager.ChangeLocation("Funkiki Island");
|
||||
break;
|
||||
case "racer":
|
||||
RichPresenceManager.ChangeLocation("Royalton Racing Complex");
|
||||
break;
|
||||
case "night":
|
||||
RichPresenceManager.ChangeLocation("Nightmare Rift");
|
||||
break;
|
||||
case "day":
|
||||
RichPresenceManager.ChangeLocation("Daydream Oasis");
|
||||
break;
|
||||
case "realm":
|
||||
RichPresenceManager.ChangeLocation("Hidden Realm");
|
||||
break;
|
||||
case "ssl":
|
||||
RichPresenceManager.ChangeLocation("Angus Manor");
|
||||
break;
|
||||
case "green":
|
||||
RichPresenceManager.ChangeLocation("Paradox Green");
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
catch
|
||||
{
|
||||
//UGLevels requires an error to proceed.
|
||||
response = @"<commands><load section=""" + section + @""" name=""" + name + @""" result=""1"" reason=""Error loading file!"" /></commands>";
|
||||
}
|
||||
LogManager.LogFile($"[Load] [Success] {name}/{section}");
|
||||
return response.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Saves the contents inside of the command to a specified data file.
|
||||
/// </summary>
|
||||
/// <param name="section">The file name to save.</param>
|
||||
/// <param name="name">The profile directory used to save in.</param>
|
||||
/// <param name="data">The raw command that will be used as the output.</param>
|
||||
public static void SaveFile(string section, string name, string data)
|
||||
{
|
||||
LogManager.LogFile($"[Save] {name}/{section}");
|
||||
|
||||
XDocument args = XDocument.Parse(data);
|
||||
|
||||
XElement firstChild = args.Root.Elements().First();
|
||||
|
||||
XDocument output = new XDocument(new XDeclaration("1.0", "utf-8", "yes"),
|
||||
firstChild);
|
||||
|
||||
if (!Directory.Exists(Directory.GetCurrentDirectory() + @"\data\" + name))
|
||||
{
|
||||
Directory.CreateDirectory(Directory.GetCurrentDirectory() + @"\data\" + name);
|
||||
}
|
||||
if (Settings.Default.RDF == true)
|
||||
{
|
||||
Encoding iso_8859_1 = Encoding.GetEncoding("iso-8859-1");
|
||||
byte[] RDFData = iso_8859_1.GetBytes(output.ToString());
|
||||
File.WriteAllBytes(Directory.GetCurrentDirectory() + @"\data\" + name + @"\" + section + ".rdf", iso_8859_1.GetBytes(RDFManager.EncodeXML(iso_8859_1.GetString(RDFData))));
|
||||
}
|
||||
else File.WriteAllText(Directory.GetCurrentDirectory() + @"\data\" + name + @"\" + section + ".xml", output.ToString()); //saves
|
||||
LogManager.LogFile($"[Save] [Success] {name}/{section}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a specified file. Only used for UG thumbnails.
|
||||
/// </summary>
|
||||
public static void DeleteFile(string path)
|
||||
{
|
||||
LogManager.LogFile($"[Delete] {path}");
|
||||
File.Delete(Directory.GetCurrentDirectory() + @"\" + path);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Saves a Base64 encoded JPEG file to a specified location.
|
||||
/// </summary>
|
||||
/// <param name="idfrom">The AS3 ID that is requesting the save.</param>
|
||||
/// <param name="str">The Base64 encoded JPEG data.</param>
|
||||
/// <param name="name">The location to save the JPEG.</param>
|
||||
public static void SaveJPEG(string idfrom, string str, string name)
|
||||
{
|
||||
var bytes = Convert.FromBase64String(str);
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(Directory.GetCurrentDirectory() + @"\" + name));
|
||||
using (var jpegToSave = new FileStream(Directory.GetCurrentDirectory() + @"\" + name, FileMode.Create))
|
||||
{
|
||||
jpegToSave.Write(bytes, 0, bytes.Length);
|
||||
jpegToSave.Flush();
|
||||
}
|
||||
Globals.AS3Container.CallFunction(@"<invoke name=""WrapperCall"" returntype=""xml""><arguments><string>save_jpeg</string><string>0</string><string></string></arguments></invoke>");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a user account in older versions by adding the user's entry in users.rdf.
|
||||
/// </summary>
|
||||
public static void CreateUser(string hinta, string hintq, string savepassword, string password, string name)
|
||||
{
|
||||
LogManager.LogFile("[Load] File Requested - system/users");
|
||||
LoadFile("users", "system");
|
||||
string userString = UserData.OuterXml;
|
||||
string data2send = userString.Replace("</users>", "") + @"<user gname=""" + name + @""" hinta=""" + hinta + @""" hintq=""" + hintq + @""" savepassword=""" + savepassword + @""" password=""" + password + @""" name=""" + name + @""" /></users>";
|
||||
if (!Directory.Exists(Directory.GetCurrentDirectory() + @"\data\" + "system"))
|
||||
{
|
||||
Directory.CreateDirectory(Directory.GetCurrentDirectory() + @"\data\" + "system");
|
||||
}
|
||||
if (Settings.Default.RDF == true)
|
||||
{
|
||||
Encoding iso_8859_1 = Encoding.GetEncoding("iso-8859-1");
|
||||
byte[] RDFData = iso_8859_1.GetBytes(data2send.ToString());
|
||||
File.WriteAllBytes(Directory.GetCurrentDirectory() + @"\data\" + "system" + @"\" + "users" + ".rdf", iso_8859_1.GetBytes(RDFManager.EncodeXML(iso_8859_1.GetString(RDFData))));
|
||||
}
|
||||
else File.WriteAllText(Directory.GetCurrentDirectory() + @"\data\" + "system" + @"\" + "users" + ".xml", data2send.ToString());
|
||||
LogManager.LogFile("[UserAdd] [Success] " + name);
|
||||
}
|
||||
}
|
||||
}
|
||||
149
OpenFK/OFK.Net/HttpManager.cs
Normal file
149
OpenFK/OFK.Net/HttpManager.cs
Normal file
|
|
@ -0,0 +1,149 @@
|
|||
using OpenFK.OFK.Common;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Xml;
|
||||
|
||||
namespace OpenFK.OFK.Net
|
||||
{
|
||||
static class HttpManager
|
||||
{
|
||||
// ===================================
|
||||
// HTTP Manager
|
||||
// Handles anything to do with Galaxy and HTTP.
|
||||
// ===================================
|
||||
|
||||
/// <summary>
|
||||
/// The hostname for the Galaxy server.
|
||||
/// </summary>
|
||||
public static string GXHost;
|
||||
|
||||
/// <summary>
|
||||
/// The hostname for the UGC (Funkey Tools) server.
|
||||
/// </summary>
|
||||
public static string UGHost;
|
||||
|
||||
/// <summary>
|
||||
/// The address to the remote game files. Used for updates.
|
||||
/// </summary>
|
||||
public static string FileStore;
|
||||
|
||||
/// <summary>
|
||||
/// The address to the trunk files. Used for Funkey Trunk updates.
|
||||
/// </summary>
|
||||
public static string TrunkStore;
|
||||
|
||||
/// <summary>
|
||||
/// Sends a NetCommand to the Galaxy/UG server via POST.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// A string containing the server's response command that will be sent back to Flash.
|
||||
/// </returns>
|
||||
public static string HTTPPost(string info, string uri)
|
||||
{
|
||||
LogManager.LogNetwork($"{uri} {info}", "POST");
|
||||
|
||||
var request = (HttpWebRequest)WebRequest.Create(uri);
|
||||
var data = Encoding.ASCII.GetBytes(info);
|
||||
request.Method = "POST";
|
||||
request.ContentType = "application/xml";
|
||||
request.ContentLength = data.Length;
|
||||
using (var stream = request.GetRequestStream())
|
||||
{
|
||||
stream.Write(data, 0, data.Length);
|
||||
}
|
||||
var response = (HttpWebResponse)request.GetResponse();
|
||||
var responseString = new StreamReader(response.GetResponseStream()).ReadToEnd();
|
||||
|
||||
string tnurl = "";
|
||||
|
||||
//TODO - Simplify these get_CATEGORY thumbnail requests as they are all the same.
|
||||
if (responseString.Contains("<get_level "))
|
||||
{
|
||||
XmlDocument xRequest = new XmlDocument(); //e.args to xml
|
||||
xRequest.LoadXml(responseString);
|
||||
XmlNodeList xnList = xRequest.SelectNodes("/get_level/level"); //filters xml to the load info
|
||||
foreach (XmlNode xn in xnList)
|
||||
{
|
||||
if (xn.Attributes.GetNamedItem("tnurl") != null)
|
||||
{
|
||||
tnurl = xn.Attributes["tnurl"].Value;
|
||||
}
|
||||
}
|
||||
|
||||
if (tnurl != "")
|
||||
{
|
||||
using (var client = new System.Net.WebClient())
|
||||
{
|
||||
client.DownloadFile(UGHost + "/" + tnurl, Directory.GetCurrentDirectory() + @"\" + tnurl);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (responseString.Contains("<get_top "))
|
||||
{
|
||||
XmlDocument xRequest = new XmlDocument(); //e.args to xml
|
||||
xRequest.LoadXml(responseString);
|
||||
XmlNodeList xnList = xRequest.SelectNodes("/get_top/levels/level"); //filters xml to the load info
|
||||
foreach (XmlNode xn in xnList)
|
||||
{
|
||||
if (xn.Attributes.GetNamedItem("tnurl") != null)
|
||||
{
|
||||
tnurl = xn.Attributes["tnurl"].Value;
|
||||
}
|
||||
if (tnurl != "")
|
||||
{
|
||||
using (var client = new System.Net.WebClient())
|
||||
{
|
||||
client.DownloadFile(UGHost + "/" + tnurl, Directory.GetCurrentDirectory() + @"\" + tnurl);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (responseString.Contains("<get_sh_levels "))
|
||||
{
|
||||
XmlDocument xRequest = new XmlDocument(); //e.args to xml
|
||||
xRequest.LoadXml(responseString);
|
||||
XmlNodeList xnList = xRequest.SelectNodes("/get_sh_levels/levels/level"); //filters xml to the load info
|
||||
foreach (XmlNode xn in xnList)
|
||||
{
|
||||
if (xn.Attributes.GetNamedItem("tnurl") != null)
|
||||
{
|
||||
tnurl = xn.Attributes["tnurl"].Value;
|
||||
}
|
||||
if (tnurl != "")
|
||||
{
|
||||
using (var client = new System.Net.WebClient())
|
||||
{
|
||||
client.DownloadFile(UGHost + "/" + tnurl, Directory.GetCurrentDirectory() + @"\" + tnurl);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return responseString;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves a plain text file from an external server.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// A string containing the file's contents.
|
||||
/// </returns>
|
||||
public static string HTTPGet(string uri)
|
||||
{
|
||||
LogManager.LogNetwork(uri, "GET");
|
||||
|
||||
ServicePointManager.Expect100Continue = true;
|
||||
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
|
||||
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
|
||||
request.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate;
|
||||
|
||||
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
|
||||
using (Stream stream = response.GetResponseStream())
|
||||
using (StreamReader reader = new StreamReader(stream))
|
||||
{
|
||||
return reader.ReadToEnd();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
58
OpenFK/OFK.Net/RichPresenceManager.cs
Normal file
58
OpenFK/OFK.Net/RichPresenceManager.cs
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
using DiscordRPC;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml;
|
||||
|
||||
namespace OpenFK.OFK.Net
|
||||
{
|
||||
static class RichPresenceManager
|
||||
{
|
||||
// ===================================
|
||||
// Rich Presence Manager
|
||||
// Handles Discord Rich Presence.
|
||||
// ===================================
|
||||
|
||||
public static DiscordRpcClient Client;
|
||||
public static XmlDocument BittyData;
|
||||
public static string CurrentBitty;
|
||||
public static string CurrentBittyName;
|
||||
public static string CurrentWorld;
|
||||
public static string CurrentActivity;
|
||||
|
||||
public static void InitRPC()
|
||||
{
|
||||
Client = new DiscordRpcClient("506150783893504001");
|
||||
Client.Initialize();
|
||||
SetRP("Main Menu", "At the main menu", "fffffff0", "U.B.");
|
||||
}
|
||||
|
||||
public static void SetRP(string title, string info, string bittyID, string bittyName)
|
||||
{
|
||||
CurrentWorld = title;
|
||||
CurrentActivity = info;
|
||||
CurrentBitty = bittyID;
|
||||
CurrentBittyName = bittyName;
|
||||
Client.SetPresence(new RichPresence()
|
||||
{
|
||||
Details = info,
|
||||
State = title,
|
||||
Assets = new Assets()
|
||||
{
|
||||
LargeImageKey = bittyID,
|
||||
LargeImageText = bittyName
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void ChangeLocation(string location)
|
||||
{
|
||||
if (Properties.Settings.Default.RPC)
|
||||
{
|
||||
SetRP("Exploring", location, CurrentBitty, CurrentBittyName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
184
OpenFK/OFK.Net/UpdateManager.cs
Normal file
184
OpenFK/OFK.Net/UpdateManager.cs
Normal file
|
|
@ -0,0 +1,184 @@
|
|||
using OpenFK.OFK.Common;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace OpenFK.OFK.Net
|
||||
{
|
||||
static class UpdateManager
|
||||
{
|
||||
// ===================================
|
||||
// Update Manager
|
||||
// Handles OpenFK and FSGUI updates.
|
||||
// ===================================
|
||||
static XDocument UpdateStore;
|
||||
static XDocument FSUpdateStore;
|
||||
|
||||
/// <summary>
|
||||
/// Checks a remote XML store to find an update for OpenFK and FunkeySelectorGUI.
|
||||
/// </summary>
|
||||
public static void CheckUpdate()
|
||||
{
|
||||
//OpenFK version
|
||||
string localVerNum = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
|
||||
localVerNum = localVerNum.Substring(0, localVerNum.LastIndexOf("."));
|
||||
string localVersion = $"OpenFK v{localVerNum}";
|
||||
|
||||
//FSGUI version - Checks the new and old name, favors the new one.
|
||||
bool isFSGUIHere = false;
|
||||
string fslocalVerNum = "";
|
||||
string fslocalVersion = "";
|
||||
if (File.Exists(Directory.GetCurrentDirectory() + @"\FunkeySelectorGUI.exe"))
|
||||
{
|
||||
isFSGUIHere = true;
|
||||
fslocalVerNum = FileVersionInfo.GetVersionInfo(Directory.GetCurrentDirectory() + @"\FunkeySelectorGUI.exe").FileVersion;
|
||||
fslocalVerNum = localVerNum.Substring(0, localVerNum.LastIndexOf("."));
|
||||
}
|
||||
else if (File.Exists(Directory.GetCurrentDirectory() + @"\FunkeySelector.exe"))
|
||||
{
|
||||
isFSGUIHere = true;
|
||||
fslocalVerNum = FileVersionInfo.GetVersionInfo(Directory.GetCurrentDirectory() + @"\FunkeySelector.exe").FileVersion;
|
||||
fslocalVerNum = localVerNum.Substring(0, localVerNum.LastIndexOf("."));
|
||||
}
|
||||
|
||||
if (isFSGUIHere)
|
||||
{
|
||||
fslocalVersion = $"FunkeySelectorGUI v{fslocalVerNum}";
|
||||
}
|
||||
|
||||
LogManager.LogNetwork("[Update] Update Requested", "NetCommand");
|
||||
Globals.GameForm.SetVar(@"<progress percent=""0.25"" />");
|
||||
|
||||
Globals.GameForm.SetVar(@"<progress percent=""25.00"" />");
|
||||
try
|
||||
{
|
||||
LogManager.LogNetwork("[Update] Downloading Update.xml from GitHub", "NetCommand");
|
||||
UpdateStore = XDocument.Parse(HttpManager.HTTPGet(@"https://raw.githubusercontent.com/GittyMac/OpenFK/master/update.xml"));
|
||||
LogManager.LogNetwork("[Update] Update.xml was downloaded", "NetCommand");
|
||||
string netVersion = UpdateStore.Root.Attribute("name").Value;
|
||||
string netVersionNum = UpdateStore.Root.Attribute("version").Value;
|
||||
string netVersionSize = UpdateStore.Root.Attribute("size").Value;
|
||||
Globals.GameForm.SetVar(@"<progress percent=""50.00"" />");
|
||||
if (localVerNum != netVersionNum)
|
||||
{
|
||||
LogManager.LogNetwork("[Update] An update is needed", "NetCommand");
|
||||
UpdateStore.Save(Directory.GetCurrentDirectory() + @"\update.xml");
|
||||
Globals.GameForm.SetVar(@"<checkupdate result=""2"" reason=""New version of OpenFK found."" version=""2009_07_16_544"" size=""" + netVersionSize + @""" curversion=""" + localVerNum + @""" extversion=""" + netVersionNum + @""" extname=""" + netVersion + @""" />");
|
||||
}
|
||||
else if (isFSGUIHere)
|
||||
{
|
||||
Globals.GameForm.SetVar(@"<progress percent=""75.00"" />");
|
||||
try
|
||||
{
|
||||
LogManager.LogNetwork("[Update] Downloading FSGUI Update.xml from GitHub", "NetCommand");
|
||||
FSUpdateStore = XDocument.Parse(HttpManager.HTTPGet(@"https://raw.githubusercontent.com/GittyMac/FunkeySelectorGUI/master/update.xml"));
|
||||
LogManager.LogNetwork("[Update] FSGUI Update.xml was downloaded", "NetCommand");
|
||||
string fsnetVersion = FSUpdateStore.Root.Attribute("name").Value;
|
||||
string fsnetVersionNum = FSUpdateStore.Root.Attribute("version").Value;
|
||||
string fsnetVersionSize = FSUpdateStore.Root.Attribute("size").Value;
|
||||
Globals.GameForm.SetVar(@"<progress percent=""90.00"" />");
|
||||
if (fslocalVerNum != fsnetVersionNum)
|
||||
{
|
||||
try
|
||||
{
|
||||
Process process = Process.GetProcessesByName("FunkeySelectorGUI")[0];
|
||||
process.Kill();
|
||||
}
|
||||
catch
|
||||
{
|
||||
LogManager.LogNetwork("[Update] Cannot close FSGUI", "NetCommand");
|
||||
}
|
||||
LogManager.LogNetwork("[Update] A FSGUI update is needed", "NetCommand");
|
||||
Globals.GameForm.SetVar(@"<checkupdate result=""2"" reason=""New version of FSGUI found."" version=""2009_07_16_544"" size=""" + fsnetVersionSize + @""" curversion=""" + fslocalVerNum + @""" extversion=""" + fsnetVersionNum + @""" extname=""" + fsnetVersion + @""" />");
|
||||
}
|
||||
else
|
||||
{
|
||||
Globals.GameForm.SetVar(@"<checkupdate result=""0"" reason=""Everything is up to date."" />");
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
LogManager.LogNetwork("[Update] [Error] Failed to check FSGUI update.", "NetCommand");
|
||||
Globals.GameForm.SetVar(@"<checkupdate result=""1"" reason=""Could not find the FunkeySelectorGUI update!"" />");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Globals.GameForm.SetVar(@"<checkupdate result=""0"" reason=""Everything is up to date."" />");
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
LogManager.LogNetwork("[Update] [Error] Failed to check OpenFK update.", "NetCommand");
|
||||
Globals.GameForm.SetVar(@"<checkupdate result=""1"" reason=""Could not find the OpenFK update!"" />");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Downloads the newly found update.
|
||||
/// </summary>
|
||||
public static void LoadUpdate()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (FSUpdateStore != null)
|
||||
{
|
||||
string fsnetDL = FSUpdateStore.Root.Attribute("url").Value;
|
||||
using (var client = new WebClient())
|
||||
{
|
||||
ServicePointManager.Expect100Continue = true;
|
||||
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
|
||||
client.DownloadFile(fsnetDL, Directory.GetCurrentDirectory() + @"\FunkeySelectorGUI.exe");
|
||||
}
|
||||
Globals.GameForm.SetVar(@"<loadupdate result=""0"" reason=""good"" />");
|
||||
LogManager.LogNetwork("[Update] Updated FSGUI successfuly.", "NetCommand");
|
||||
}
|
||||
else
|
||||
{
|
||||
string netDL = "";
|
||||
if (Environment.Is64BitProcess)
|
||||
{
|
||||
netDL = UpdateStore.Root.Attribute("url64").Value;
|
||||
}
|
||||
else
|
||||
{
|
||||
netDL = UpdateStore.Root.Attribute("url32").Value;
|
||||
}
|
||||
|
||||
using (var client = new WebClient())
|
||||
{
|
||||
ServicePointManager.Expect100Continue = true;
|
||||
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
|
||||
client.DownloadFile(netDL, Directory.GetCurrentDirectory() + @"\tmpdl.zip");
|
||||
}
|
||||
UpdateStore.Save(Directory.GetCurrentDirectory() + @"\update.xml");
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(Directory.GetCurrentDirectory() + @"\tmpdl\"));
|
||||
System.IO.Compression.ZipFile.ExtractToDirectory(Directory.GetCurrentDirectory() + @"\tmpdl.zip", Directory.GetCurrentDirectory() + @"\tmpdl\");
|
||||
Globals.GameForm.SetVar(@"<loadupdate result=""0"" reason=""good"" />");
|
||||
LogManager.LogNetwork("[Update] OpenFK update loaded successfuly.", "NetCommand");
|
||||
Globals.WasUpdated = true;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
LogManager.LogNetwork("[Update] [Error] Failed to download update.", "NetCommand");
|
||||
Globals.GameForm.SetVar(@"<loadupdate result=""1"" reason=""The update has failed! Try restarting OpenFK..."" />");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Copies tmpdl during the /update stage of OpenFK.
|
||||
/// </summary>
|
||||
public static void InstallUpdate()
|
||||
{
|
||||
foreach (var file in Directory.GetFiles(Directory.GetCurrentDirectory()))
|
||||
File.Copy(file, Path.Combine(Directory.GetParent(Directory.GetCurrentDirectory()).ToString(), Path.GetFileName(file)), true);
|
||||
ProcessStartInfo updateRestart = new ProcessStartInfo(Directory.GetParent(Directory.GetCurrentDirectory()) + @"\OpenFK.exe");
|
||||
updateRestart.WorkingDirectory = Directory.GetParent(Directory.GetCurrentDirectory()).ToString();
|
||||
updateRestart.UseShellExecute = false;
|
||||
Process.Start(updateRestart);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -90,11 +90,11 @@
|
|||
<Reference Include="Costura, Version=4.1.0.0, Culture=neutral, PublicKeyToken=9919ef960d84173d, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Costura.Fody.4.1.0\lib\net40\Costura.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DiscordRPC, Version=1.0.150.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\DiscordRichPresence.1.0.150\lib\net35\DiscordRPC.dll</HintPath>
|
||||
<Reference Include="DiscordRPC, Version=1.2.1.24, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\DiscordRichPresence.1.2.1.24\lib\net45\DiscordRPC.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.12.0.2\lib\net40\Newtonsoft.Json.dll</HintPath>
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
|
|
@ -117,33 +117,40 @@
|
|||
<Compile Include="ConfigForm.Designer.cs">
|
||||
<DependentUpon>ConfigForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="DebugWindow.cs">
|
||||
<Compile Include="DebugForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="DebugWindow.Designer.cs">
|
||||
<DependentUpon>DebugWindow.cs</DependentUpon>
|
||||
<Compile Include="DebugForm.Designer.cs">
|
||||
<DependentUpon>DebugForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="FlashRightClick.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Form1.cs">
|
||||
<Compile Include="GameForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Form1.Designer.cs">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
<Compile Include="GameForm.Designer.cs">
|
||||
<DependentUpon>GameForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Globals.cs" />
|
||||
<Compile Include="OFK.Common\CommandParser.cs" />
|
||||
<Compile Include="OFK.Common\LogManager.cs" />
|
||||
<Compile Include="OFK.Core\BittyManager.cs" />
|
||||
<Compile Include="OFK.Core\FileManager.cs" />
|
||||
<Compile Include="OFK.Net\HttpManager.cs" />
|
||||
<Compile Include="OFK.Net\RichPresenceManager.cs" />
|
||||
<Compile Include="OFK.Net\UpdateManager.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="RDFTool.cs" />
|
||||
<Compile Include="OFK.Common\RDFManager.cs" />
|
||||
<EmbeddedResource Include="ConfigForm.resx">
|
||||
<DependentUpon>ConfigForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="DebugWindow.resx">
|
||||
<DependentUpon>DebugWindow.cs</DependentUpon>
|
||||
<EmbeddedResource Include="DebugForm.resx">
|
||||
<DependentUpon>DebugForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Form1.resx">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
<EmbeddedResource Include="GameForm.resx">
|
||||
<DependentUpon>GameForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
|
|
@ -196,13 +203,14 @@
|
|||
<ItemGroup>
|
||||
<WCFMetadata Include="Connected Services\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\packages\Fody.6.0.0\build\Fody.targets" Condition="Exists('..\packages\Fody.6.0.0\build\Fody.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\Fody.6.0.0\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.6.0.0\build\Fody.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\Costura.Fody.4.1.0\build\Costura.Fody.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Costura.Fody.4.1.0\build\Costura.Fody.props'))" />
|
||||
<Error Condition="!Exists('..\packages\Fody.6.8.0\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.6.8.0\build\Fody.targets'))" />
|
||||
</Target>
|
||||
<Import Project="..\packages\Fody.6.8.0\build\Fody.targets" Condition="Exists('..\packages\Fody.6.8.0\build\Fody.targets')" />
|
||||
</Project>
|
||||
|
|
@ -1,9 +1,10 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using OpenFK.OFK.Net;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace OpenFK
|
||||
|
|
@ -18,17 +19,30 @@ namespace OpenFK
|
|||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
if (File.Exists(Directory.GetCurrentDirectory() + @"\update.bat"))
|
||||
|
||||
if (args.Contains("/update"))
|
||||
{
|
||||
File.Delete(Directory.GetCurrentDirectory() + @"\update.bat");
|
||||
Thread.Sleep(500);
|
||||
UpdateManager.InstallUpdate();
|
||||
return;
|
||||
}
|
||||
else if (Directory.Exists(Directory.GetCurrentDirectory() + @"\tmpdl"))
|
||||
{
|
||||
Thread.Sleep(500);
|
||||
Directory.Delete(Directory.GetCurrentDirectory() + @"\tmpdl", true);
|
||||
if (File.Exists(Directory.GetCurrentDirectory() + @"\tmpdl.zip"))
|
||||
{
|
||||
File.Delete(Directory.GetCurrentDirectory() + @"\tmpdl.zip");
|
||||
}
|
||||
}
|
||||
|
||||
if (args.Contains("/config"))
|
||||
{
|
||||
Application.Run(new ConfigForm());
|
||||
}
|
||||
else if (File.Exists(Directory.GetCurrentDirectory() + @"\Flash.ocx"))
|
||||
{
|
||||
if(CalculateMD5(Directory.GetCurrentDirectory() + @"\Flash.ocx") == "0c8fbd12f40dcd5a1975b671f9989900" ||
|
||||
if (CalculateMD5(Directory.GetCurrentDirectory() + @"\Flash.ocx") == "0c8fbd12f40dcd5a1975b671f9989900" ||
|
||||
CalculateMD5(Directory.GetCurrentDirectory() + @"\Flash.ocx") == "28642aa6626e42701677a1f3822306b0")
|
||||
{
|
||||
if (MessageBox.Show("The current Flash.ocx is a buggy version! It causes several problems in the game. Do you want to fetch a compatible OCX?", "OpenFK", MessageBoxButtons.YesNo, MessageBoxIcon.Error) == DialogResult.Yes)
|
||||
|
|
@ -45,7 +59,7 @@ namespace OpenFK
|
|||
{
|
||||
try
|
||||
{
|
||||
Application.Run(new Form1(args));
|
||||
Application.Run(new GameForm(args));
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
|
@ -57,14 +71,16 @@ namespace OpenFK
|
|||
{
|
||||
try
|
||||
{
|
||||
Application.Run(new Form1(args));
|
||||
Application.Run(new GameForm(args));
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
MessageBox.Show("There was an error starting the game! This could happen because of a 64 bit OCX running on a 32 bit OpenFK.", "OpenFK", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
}else if (MessageBox.Show("Flash.ocx is not found! Do you want to fetch a compatible OCX?", "OpenFK", MessageBoxButtons.YesNo, MessageBoxIcon.Error) == DialogResult.Yes)
|
||||
}
|
||||
else if (MessageBox.Show("Flash.ocx is not found! Do you want to fetch a compatible OCX?", "OpenFK", MessageBoxButtons.YesNo, MessageBoxIcon.Error) == DialogResult.Yes)
|
||||
{
|
||||
File.WriteAllText(Directory.GetCurrentDirectory() + @"\FetchOCX.bat", Properties.Resources.FetchOCX);
|
||||
ProcessStartInfo fetchocx = new ProcessStartInfo(Directory.GetCurrentDirectory() + @"\FetchOCX.bat");
|
||||
|
|
@ -80,7 +96,7 @@ namespace OpenFK
|
|||
{
|
||||
using (var md5 = MD5.Create())
|
||||
{
|
||||
using (var stream = File.OpenRead(filename))
|
||||
using (var stream = File.OpenRead(filename))
|
||||
{
|
||||
var hash = md5.ComputeHash(stream); //Computes the MD5 hash of the swf.
|
||||
return BitConverter.ToString(hash).Replace("-", "").ToLowerInvariant(); //Converts the hash to a readable string to compare.
|
||||
|
|
|
|||
|
|
@ -6,11 +6,11 @@ using System.Runtime.InteropServices;
|
|||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("OpenFK")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyDescription("An open source replacement for the U.B. Funkeys executable.")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("GittyMac")]
|
||||
[assembly: AssemblyCompany("Lako")]
|
||||
[assembly: AssemblyProduct("OpenFK")]
|
||||
[assembly: AssemblyCopyright("Copyright © GittyMac 2023")]
|
||||
[assembly: AssemblyCopyright("Copyright © Lako 2024")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
|
|
|
|||
|
|
@ -1,109 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OpenFK
|
||||
{
|
||||
class RDFTool
|
||||
{
|
||||
private static char[] code = new char[] { (char)0x00, (char)0x01, (char)0x02, (char)0x03, (char)0x04, (char)0x05, (char)0x06, (char)0x07, (char)0x08, (char)0x09, (char)0x0A, (char)0x0B, (char)0x0C, (char)0x0D, (char)0x0E, (char)0x0F, (char)0x10, (char)0x11, (char)0x12, (char)0x13, (char)0x14, (char)0x15, (char)0x16, (char)0x17, (char)0x18, (char)0x19, (char)0x1A, (char)0x1B, (char)0x1C, (char)0x1D, (char)0x1E, (char)0x1F, (char)0x20, (char)0x21, (char)0x22, (char)0x23, (char)0x24, (char)0x25, (char)0x26, (char)0x27, (char)0x28, (char)0x29, (char)0x2A, (char)0x2B, (char)0x2C, (char)0x2D, (char)0x2E, (char)0x2F, (char)0x30, (char)0x31, (char)0x32, (char)0x33, (char)0x34, (char)0x35, (char)0x36, (char)0x37, (char)0x38, (char)0x39, (char)0x3A, (char)0x3B, (char)0x3C, (char)0x3D, (char)0x3E, (char)0x3F, (char)0x40, (char)0x41, (char)0x42, (char)0x43, (char)0x44, (char)0x45, (char)0x46, (char)0x47, (char)0x48, (char)0x49, (char)0x4A, (char)0x4B, (char)0x4C, (char)0x4D, (char)0x4E, (char)0x4F, (char)0x50, (char)0x51, (char)0x52, (char)0x53, (char)0x54, (char)0x55, (char)0x56, (char)0x57, (char)0x58, (char)0x59, (char)0x5A, (char)0x5B, (char)0x5C, (char)0x5D, (char)0x5E, (char)0x5F, (char)0x60, (char)0x61, (char)0x62, (char)0x63, (char)0x64, (char)0x65, (char)0x66, (char)0x67, (char)0x68, (char)0x69, (char)0x6A, (char)0x6B, (char)0x6C, (char)0x6D, (char)0x6E, (char)0x6F, (char)0x70, (char)0x71, (char)0x72, (char)0x73, (char)0x74, (char)0x75, (char)0x76, (char)0x77, (char)0x78, (char)0x79, (char)0x7A, (char)0x7B, (char)0x7C, (char)0x7D, (char)0x7E, (char)0x7F, (char)0x80, (char)0x81, (char)0x82, (char)0x83, (char)0x84, (char)0x85, (char)0x86, (char)0x87, (char)0x88, (char)0x89, (char)0x8A, (char)0x8B, (char)0x8C, (char)0x8D, (char)0x8E, (char)0x8F, (char)0x90, (char)0x91, (char)0x92, (char)0x93, (char)0x94, (char)0x95, (char)0x96, (char)0x97, (char)0x98, (char)0x99, (char)0x9A, (char)0x9B, (char)0x9C, (char)0x9D, (char)0x9E, (char)0x9F, (char)0xA0, (char)0xA1, (char)0xA2, (char)0xA3, (char)0xA4, (char)0xA5, (char)0xA6, (char)0xA7, (char)0xA8, (char)0xA9, (char)0xAA, (char)0xAB, (char)0xAC, (char)0xAD, (char)0xAE, (char)0xAF, (char)0xB0, (char)0xB1, (char)0xB2, (char)0xB3, (char)0xB4, (char)0xB5, (char)0xB6, (char)0xB7, (char)0xB8, (char)0xB9, (char)0xBA, (char)0xBB, (char)0xBC, (char)0xBD, (char)0xBE, (char)0xBF, (char)0xC0, (char)0xC1, (char)0xC2, (char)0xC3, (char)0xC4, (char)0xC5, (char)0xC6, (char)0xC7, (char)0xC8, (char)0xC9, (char)0xCA, (char)0xCB, (char)0xCC, (char)0xCD, (char)0xCE, (char)0xCF, (char)0xD0, (char)0xD1, (char)0xD2, (char)0xD3, (char)0xD4, (char)0xD5, (char)0xD6, (char)0xD7, (char)0xD8, (char)0xD9, (char)0xDA, (char)0xDB, (char)0xDC, (char)0xDD, (char)0xDE, (char)0xDF, (char)0xE0, (char)0xE1, (char)0xE2, (char)0xE3, (char)0xE4, (char)0xE5, (char)0xE6, (char)0xE7, (char)0xE8, (char)0xE9, (char)0xEA, (char)0xEB, (char)0xEC, (char)0xED, (char)0xEE, (char)0xEF, (char)0xF0, (char)0xF1, (char)0xF2, (char)0xF3, (char)0xF4, (char)0xF5, (char)0xF6, (char)0xF7, (char)0xF8, (char)0xF9, (char)0xFA, (char)0xFB, (char)0xFC, (char)0xFD, (char)0xFE, (char)0xFF };
|
||||
|
||||
/// <summary>
|
||||
/// the column to roll
|
||||
/// </summary>
|
||||
private static char[][] col = new char[][]
|
||||
{
|
||||
new char[] {(char)0x44, (char)0x45, (char)0x46, (char)0x47, (char)0x40, (char)0x41, (char)0x42, (char)0x43, (char)0x4C, (char)0x4D, (char)0x4E, (char)0x4F, (char)0x48, (char)0x49, (char)0x4A, (char)0x4B, (char)0x54, (char)0x55, (char)0x56, (char)0x57, (char)0x50, (char)0x51, (char)0x52, (char)0x53, (char)0x5C, (char)0x5D, (char)0x5E, (char)0x5F, (char)0x58, (char)0x59, (char)0x5A, (char)0x5B, (char)0x64, (char)0x65, (char)0x66, (char)0x67, (char)0x60, (char)0x61, (char)0x62, (char)0x63, (char)0x6C, (char)0x6D, (char)0x6E, (char)0x6F, (char)0x68, (char)0x69, (char)0x6A, (char)0x6B, (char)0x74, (char)0x75, (char)0x76, (char)0x77, (char)0x70, (char)0x71, (char)0x72, (char)0x73, (char)0x7C, (char)0x7D, (char)0x7E, (char)0x7F, (char)0x78, (char)0x79, (char)0x7A, (char)0x7B, (char)0x04, (char)0x05, (char)0x06, (char)0x07, (char)0x00, (char)0x01, (char)0x02, (char)0x03, (char)0x0C, (char)0x0D, (char)0x0E, (char)0x0F, (char)0x08, (char)0x09, (char)0x0A, (char)0x0B, (char)0x14, (char)0x15, (char)0x16, (char)0x17, (char)0x10, (char)0x11, (char)0x12, (char)0x13, (char)0x1C, (char)0x1D, (char)0x1E, (char)0x1F, (char)0x18, (char)0x19, (char)0x1A, (char)0x1B, (char)0x24, (char)0x25, (char)0x26, (char)0x27, (char)0x20, (char)0x21, (char)0x22, (char)0x23, (char)0x2C, (char)0x2D, (char)0x2E, (char)0x2F, (char)0x28, (char)0x29, (char)0x2A, (char)0x2B, (char)0x34, (char)0x35, (char)0x36, (char)0x37, (char)0x30, (char)0x31, (char)0x32, (char)0x33, (char)0x3C, (char)0x3D, (char)0x3E, (char)0x3F, (char)0x38, (char)0x39, (char)0x3A, (char)0x3B, (char)0x84, (char)0x85, (char)0x86, (char)0x87, (char)0x80, (char)0x81, (char)0x82, (char)0x83, (char)0x8C, (char)0x8D, (char)0x8E, (char)0x8F, (char)0x88, (char)0x89, (char)0x8A, (char)0x8B, (char)0x94, (char)0x95, (char)0x96, (char)0x97, (char)0x90, (char)0x91, (char)0x92, (char)0x93, (char)0x9C, (char)0x9D, (char)0x9E, (char)0x9F, (char)0x98, (char)0x99, (char)0x9A, (char)0x9B, (char)0xA4, (char)0xA5, (char)0xA6, (char)0xA7, (char)0xA0, (char)0xA1, (char)0xA2, (char)0xA3, (char)0xAC, (char)0xAD, (char)0xAE, (char)0xAF, (char)0xA8, (char)0xA9, (char)0xAA, (char)0xAB, (char)0xB4, (char)0xB5, (char)0xB6, (char)0xB7, (char)0xB0, (char)0xB1, (char)0xB2, (char)0xB3, (char)0xBC, (char)0xBD, (char)0xBE, (char)0xBF, (char)0xB8, (char)0xB9, (char)0xBA, (char)0xBB, (char)0xC4, (char)0xC5, (char)0xC6, (char)0xC7, (char)0xC0, (char)0xC1, (char)0xC2, (char)0xC3, (char)0xCC, (char)0xCD, (char)0xCE, (char)0xCF, (char)0xC8, (char)0xC9, (char)0xCA, (char)0xCB, (char)0xD4, (char)0xD5, (char)0xD6, (char)0xD7, (char)0xD0, (char)0xD1, (char)0xD2, (char)0xD3, (char)0xDC, (char)0xDD, (char)0xDE, (char)0xDF, (char)0xD8, (char)0xD9, (char)0xDA, (char)0xDB, (char)0xE4, (char)0xE5, (char)0xE6, (char)0xE7, (char)0xE0, (char)0xE1, (char)0xE2, (char)0xE3, (char)0xEC, (char)0xED, (char)0xEE, (char)0xEF, (char)0xE8, (char)0xE9, (char)0xEA, (char)0xEB, (char)0xF4, (char)0xF5, (char)0xF6, (char)0xF7, (char)0xF0, (char)0xF1, (char)0xF2, (char)0xF3, (char)0xFC, (char)0xFD, (char)0xFE, (char)0xFF, (char)0xF8, (char)0xF9, (char)0xFA, (char)0xFB},
|
||||
new char[] {(char)0x32, (char)0x33, (char)0x30, (char)0x31, (char)0x36, (char)0x37, (char)0x34, (char)0x35, (char)0x3A, (char)0x3B, (char)0x38, (char)0x39, (char)0x3E, (char)0x3F, (char)0x3C, (char)0x3D, (char)0x22, (char)0x23, (char)0x20, (char)0x21, (char)0x26, (char)0x27, (char)0x24, (char)0x25, (char)0x2A, (char)0x2B, (char)0x28, (char)0x29, (char)0x2E, (char)0x2F, (char)0x2C, (char)0x2D, (char)0x12, (char)0x13, (char)0x10, (char)0x11, (char)0x16, (char)0x17, (char)0x14, (char)0x15, (char)0x1A, (char)0x1B, (char)0x18, (char)0x19, (char)0x1E, (char)0x1F, (char)0x1C, (char)0x1D, (char)0x02, (char)0x03, (char)0x00, (char)0x01, (char)0x06, (char)0x07, (char)0x04, (char)0x05, (char)0x0A, (char)0x0B, (char)0x08, (char)0x09, (char)0x0E, (char)0x0F, (char)0x0C, (char)0x0D, (char)0x72, (char)0x73, (char)0x70, (char)0x71, (char)0x76, (char)0x77, (char)0x74, (char)0x75, (char)0x7A, (char)0x7B, (char)0x78, (char)0x79, (char)0x7E, (char)0x7F, (char)0x7C, (char)0x7D, (char)0x62, (char)0x63, (char)0x60, (char)0x61, (char)0x66, (char)0x67, (char)0x64, (char)0x65, (char)0x6A, (char)0x6B, (char)0x68, (char)0x69, (char)0x6E, (char)0x6F, (char)0x6C, (char)0x6D, (char)0x52, (char)0x53, (char)0x50, (char)0x51, (char)0x56, (char)0x57, (char)0x54, (char)0x55, (char)0x5A, (char)0x5B, (char)0x58, (char)0x59, (char)0x5E, (char)0x5F, (char)0x5C, (char)0x5D, (char)0x42, (char)0x43, (char)0x40, (char)0x41, (char)0x46, (char)0x47, (char)0x44, (char)0x45, (char)0x4A, (char)0x4B, (char)0x48, (char)0x49, (char)0x4E, (char)0x4F, (char)0x4C, (char)0x4D, (char)0xF2, (char)0xF3, (char)0xF0, (char)0xF1, (char)0xF6, (char)0xF7, (char)0xF4, (char)0xF5, (char)0xFA, (char)0xFB, (char)0xF8, (char)0xF9, (char)0xFE, (char)0xFF, (char)0xFC, (char)0xFD, (char)0xE2, (char)0xE3, (char)0xE0, (char)0xE1, (char)0xE6, (char)0xE7, (char)0xE4, (char)0xE5, (char)0xEA, (char)0xEB, (char)0xE8, (char)0xE9, (char)0xEE, (char)0xEF, (char)0xEC, (char)0xED, (char)0xD2, (char)0xD3, (char)0xD0, (char)0xD1, (char)0xD6, (char)0xD7, (char)0xD4, (char)0xD5, (char)0xDA, (char)0xDB, (char)0xD8, (char)0xD9, (char)0xDE, (char)0xDF, (char)0xDC, (char)0xDD, (char)0xC2, (char)0xC3, (char)0xC0, (char)0xC1, (char)0xC6, (char)0xC7, (char)0xC4, (char)0xC5, (char)0xCA, (char)0xCB, (char)0xC8, (char)0xC9, (char)0xCE, (char)0xCF, (char)0xCC, (char)0xCD, (char)0xB2, (char)0xB3, (char)0xB0, (char)0xB1, (char)0xB6, (char)0xB7, (char)0xB4, (char)0xB5, (char)0xBA, (char)0xBB, (char)0xB8, (char)0xB9, (char)0xBE, (char)0xBF, (char)0xBC, (char)0xBD, (char)0xA2, (char)0xA3, (char)0xA0, (char)0xA1, (char)0xA6, (char)0xA7, (char)0xA4, (char)0xA5, (char)0xAA, (char)0xAB, (char)0xA8, (char)0xA9, (char)0xAE, (char)0xAF, (char)0xAC, (char)0xAD, (char)0x92, (char)0x93, (char)0x90, (char)0x91, (char)0x96, (char)0x97, (char)0x94, (char)0x95, (char)0x9A, (char)0x9B, (char)0x98, (char)0x99, (char)0x9E, (char)0x9F, (char)0x9C, (char)0x9D, (char)0x82, (char)0x83, (char)0x80, (char)0x81, (char)0x86, (char)0x87, (char)0x84, (char)0x85, (char)0x8A, (char)0x8B, (char)0x88, (char)0x89, (char)0x8E, (char)0x8F, (char)0x8C, (char)0x8D},
|
||||
new char[] {(char)0x6C, (char)0x6D, (char)0x6E, (char)0x6F, (char)0x68, (char)0x69, (char)0x6A, (char)0x6B, (char)0x64, (char)0x65, (char)0x66, (char)0x67, (char)0x60, (char)0x61, (char)0x62, (char)0x63, (char)0x7C, (char)0x7D, (char)0x7E, (char)0x7F, (char)0x78, (char)0x79, (char)0x7A, (char)0x7B, (char)0x74, (char)0x75, (char)0x76, (char)0x77, (char)0x70, (char)0x71, (char)0x72, (char)0x73, (char)0x4C, (char)0x4D, (char)0x4E, (char)0x4F, (char)0x48, (char)0x49, (char)0x4A, (char)0x4B, (char)0x44, (char)0x45, (char)0x46, (char)0x47, (char)0x40, (char)0x41, (char)0x42, (char)0x43, (char)0x5C, (char)0x5D, (char)0x5E, (char)0x5F, (char)0x58, (char)0x59, (char)0x5A, (char)0x5B, (char)0x54, (char)0x55, (char)0x56, (char)0x57, (char)0x50, (char)0x51, (char)0x52, (char)0x53, (char)0x2C, (char)0x2D, (char)0x2E, (char)0x2F, (char)0x28, (char)0x29, (char)0x2A, (char)0x2B, (char)0x24, (char)0x25, (char)0x26, (char)0x27, (char)0x20, (char)0x21, (char)0x22, (char)0x23, (char)0x3C, (char)0x3D, (char)0x3E, (char)0x3F, (char)0x38, (char)0x39, (char)0x3A, (char)0x3B, (char)0x34, (char)0x35, (char)0x36, (char)0x37, (char)0x30, (char)0x31, (char)0x32, (char)0x33, (char)0x0C, (char)0x0D, (char)0x0E, (char)0x0F, (char)0x08, (char)0x09, (char)0x0A, (char)0x0B, (char)0x04, (char)0x05, (char)0x06, (char)0x07, (char)0x00, (char)0x01, (char)0x02, (char)0x03, (char)0x1C, (char)0x1D, (char)0x1E, (char)0x1F, (char)0x18, (char)0x19, (char)0x1A, (char)0x1B, (char)0x14, (char)0x15, (char)0x16, (char)0x17, (char)0x10, (char)0x11, (char)0x12, (char)0x13, (char)0xAC, (char)0xAD, (char)0xAE, (char)0xAF, (char)0xA8, (char)0xA9, (char)0xAA, (char)0xAB, (char)0xA4, (char)0xA5, (char)0xA6, (char)0xA7, (char)0xA0, (char)0xA1, (char)0xA2, (char)0xA3, (char)0xBC, (char)0xBD, (char)0xBE, (char)0xBF, (char)0xB8, (char)0xB9, (char)0xBA, (char)0xBB, (char)0xB4, (char)0xB5, (char)0xB6, (char)0xB7, (char)0xB0, (char)0xB1, (char)0xB2, (char)0xB3, (char)0x8C, (char)0x8D, (char)0x8E, (char)0x8F, (char)0x88, (char)0x89, (char)0x8A, (char)0x8B, (char)0x84, (char)0x85, (char)0x86, (char)0x87, (char)0x80, (char)0x81, (char)0x82, (char)0x83, (char)0x9C, (char)0x9D, (char)0x9E, (char)0x9F, (char)0x98, (char)0x99, (char)0x9A, (char)0x9B, (char)0x94, (char)0x95, (char)0x96, (char)0x97, (char)0x90, (char)0x91, (char)0x92, (char)0x93, (char)0xEC, (char)0xED, (char)0xEE, (char)0xEF, (char)0xE8, (char)0xE9, (char)0xEA, (char)0xEB, (char)0xE4, (char)0xE5, (char)0xE6, (char)0xE7, (char)0xE0, (char)0xE1, (char)0xE2, (char)0xE3, (char)0xFC, (char)0xFD, (char)0xFE, (char)0xFF, (char)0xF8, (char)0xF9, (char)0xFA, (char)0xFB, (char)0xF4, (char)0xF5, (char)0xF6, (char)0xF7, (char)0xF0, (char)0xF1, (char)0xF2, (char)0xF3, (char)0xCC, (char)0xCD, (char)0xCE, (char)0xCF, (char)0xC8, (char)0xC9, (char)0xCA, (char)0xCB, (char)0xC4, (char)0xC5, (char)0xC6, (char)0xC7, (char)0xC0, (char)0xC1, (char)0xC2, (char)0xC3, (char)0xDC, (char)0xDE, (char)0xDF, (char)0xDF, (char)0xD8, (char)0xD9, (char)0xDA, (char)0xDB, (char)0xD4, (char)0xD5, (char)0xD6, (char)0xD7, (char)0xD0, (char)0xD1, (char)0xD2, (char)0xD3},
|
||||
new char[] {(char)0xE5, (char)0xE4, (char)0xE7, (char)0xE6, (char)0xE1, (char)0xE0, (char)0xE3, (char)0xE2, (char)0xED, (char)0xEC, (char)0xEF, (char)0xEE, (char)0xE9, (char)0xE8, (char)0xEB, (char)0xEA, (char)0xF5, (char)0xF4, (char)0xF7, (char)0xF6, (char)0xF1, (char)0xF0, (char)0xF3, (char)0xF2, (char)0xFD, (char)0xFC, (char)0xFF, (char)0xFE, (char)0xF9, (char)0xF8, (char)0xFB, (char)0xFA, (char)0xC5, (char)0xC4, (char)0xC7, (char)0xC6, (char)0xC1, (char)0xC0, (char)0xC3, (char)0xC2, (char)0xCD, (char)0xCC, (char)0xCF, (char)0xCE, (char)0xC9, (char)0xC8, (char)0xCB, (char)0xCA, (char)0xD5, (char)0xD4, (char)0xD7, (char)0xD6, (char)0xD1, (char)0xD0, (char)0xD3, (char)0xD2, (char)0xDD, (char)0xDC, (char)0xDF, (char)0xDE, (char)0xD9, (char)0xD8, (char)0xDB, (char)0xDA, (char)0xA5, (char)0xA4, (char)0xA7, (char)0xA6, (char)0xA1, (char)0xA0, (char)0xA3, (char)0xA2, (char)0xAD, (char)0xAC, (char)0xAF, (char)0xAE, (char)0xA9, (char)0xA8, (char)0xAB, (char)0xAA, (char)0xB5, (char)0xB4, (char)0xB7, (char)0xB6, (char)0xB1, (char)0xB0, (char)0xB3, (char)0xB2, (char)0xBD, (char)0xBC, (char)0xBF, (char)0xBE, (char)0xB9, (char)0xB8, (char)0xBB, (char)0xBA, (char)0x85, (char)0x84, (char)0x87, (char)0x86, (char)0x81, (char)0x80, (char)0x83, (char)0x82, (char)0x8D, (char)0x8C, (char)0x8F, (char)0x8E, (char)0x89, (char)0x88, (char)0x8B, (char)0x8A, (char)0x95, (char)0x94, (char)0x97, (char)0x96, (char)0x91, (char)0x90, (char)0x93, (char)0x92, (char)0x9D, (char)0x9C, (char)0x9F, (char)0x9E, (char)0x99, (char)0x98, (char)0x9B, (char)0x9A, (char)0x25, (char)0x24, (char)0x27, (char)0x26, (char)0x21, (char)0x20, (char)0x23, (char)0x22, (char)0x2D, (char)0x2C, (char)0x2F, (char)0x2E, (char)0x29, (char)0x28, (char)0x2B, (char)0x2A, (char)0x35, (char)0x34, (char)0x37, (char)0x36, (char)0x31, (char)0x30, (char)0x33, (char)0x32, (char)0x3D, (char)0x3C, (char)0x3F, (char)0x3E, (char)0x39, (char)0x38, (char)0x3B, (char)0x3A, (char)0x05, (char)0x04, (char)0x07, (char)0x06, (char)0x01, (char)0x00, (char)0x03, (char)0x02, (char)0x0D, (char)0x0C, (char)0x0F, (char)0x0E, (char)0x09, (char)0x08, (char)0x0B, (char)0x0A, (char)0x15, (char)0x14, (char)0x17, (char)0x16, (char)0x11, (char)0x10, (char)0x13, (char)0x12, (char)0x1D, (char)0x1C, (char)0x1F, (char)0x1E, (char)0x19, (char)0x18, (char)0x1B, (char)0x1A, (char)0x65, (char)0x64, (char)0x67, (char)0x66, (char)0x61, (char)0x60, (char)0x63, (char)0x62, (char)0x6D, (char)0x6C, (char)0x6F, (char)0x6E, (char)0x69, (char)0x68, (char)0x6B, (char)0x6A, (char)0x75, (char)0x74, (char)0x77, (char)0x76, (char)0x71, (char)0x70, (char)0x73, (char)0x72, (char)0x7D, (char)0x7C, (char)0x7F, (char)0x7E, (char)0x79, (char)0x78, (char)0x7B, (char)0x7A, (char)0x45, (char)0x44, (char)0x47, (char)0x46, (char)0x41, (char)0x40, (char)0x43, (char)0x42, (char)0x4D, (char)0x4C, (char)0x4F, (char)0x4E, (char)0x49, (char)0x48, (char)0x4B, (char)0x4A, (char)0x55, (char)0x54, (char)0x57, (char)0x56, (char)0x51, (char)0x50, (char)0x53, (char)0x52, (char)0x5D, (char)0x5C, (char)0x5F, (char)0x5E, (char)0x59, (char)0x58, (char)0x5B, (char)0x5A},
|
||||
new char[] {(char)0x88, (char)0x89, (char)0x8A, (char)0x8B, (char)0x8C, (char)0x8D, (char)0x8E, (char)0x8F, (char)0x80, (char)0x81, (char)0x82, (char)0x83, (char)0x84, (char)0x85, (char)0x86, (char)0x87, (char)0x98, (char)0x99, (char)0x9A, (char)0x9B, (char)0x9C, (char)0x9D, (char)0x9E, (char)0x9F, (char)0x90, (char)0x91, (char)0x92, (char)0x93, (char)0x94, (char)0x95, (char)0x96, (char)0x97, (char)0xA8, (char)0xA9, (char)0xAA, (char)0xAB, (char)0xAC, (char)0xAD, (char)0xAE, (char)0xAF, (char)0xA0, (char)0xA1, (char)0xA2, (char)0xA3, (char)0xA4, (char)0xA5, (char)0xA6, (char)0xA7, (char)0xB8, (char)0xB9, (char)0xBA, (char)0xBB, (char)0xBC, (char)0xBD, (char)0xBE, (char)0xBF, (char)0xB0, (char)0xB1, (char)0xB2, (char)0xB3, (char)0xB4, (char)0xB5, (char)0xB6, (char)0xB7, (char)0xC8, (char)0xC9, (char)0xCA, (char)0xCB, (char)0xCC, (char)0xCD, (char)0xCE, (char)0xCF, (char)0xC0, (char)0xC1, (char)0xC2, (char)0xC3, (char)0xC4, (char)0xC5, (char)0xC6, (char)0xC7, (char)0xD8, (char)0xD9, (char)0xDA, (char)0xDB, (char)0xDC, (char)0xDD, (char)0xDE, (char)0xDF, (char)0xD0, (char)0xD1, (char)0xD2, (char)0xD3, (char)0xD4, (char)0xD5, (char)0xD6, (char)0xD7, (char)0xE8, (char)0xE9, (char)0xEA, (char)0xEB, (char)0xEC, (char)0xED, (char)0xEE, (char)0xEF, (char)0xE0, (char)0xE1, (char)0xE2, (char)0xE3, (char)0xE4, (char)0xE5, (char)0xE6, (char)0xE7, (char)0xF8, (char)0xF9, (char)0xFA, (char)0xFB, (char)0xFC, (char)0xFD, (char)0xFE, (char)0xFF, (char)0xF0, (char)0xF1, (char)0xF2, (char)0xF3, (char)0xF4, (char)0xF5, (char)0xF6, (char)0xF7, (char)0x48, (char)0x49, (char)0x4A, (char)0x4B, (char)0x4C, (char)0x4D, (char)0x4E, (char)0x4F, (char)0x40, (char)0x41, (char)0x42, (char)0x43, (char)0x44, (char)0x45, (char)0x46, (char)0x47, (char)0x58, (char)0x59, (char)0x5A, (char)0x5B, (char)0x5C, (char)0x5D, (char)0x5E, (char)0x5F, (char)0x50, (char)0x51, (char)0x52, (char)0x53, (char)0x54, (char)0x55, (char)0x56, (char)0x57, (char)0x68, (char)0x69, (char)0x6A, (char)0x6B, (char)0x6C, (char)0x6D, (char)0x6E, (char)0x6F, (char)0x60, (char)0x61, (char)0x62, (char)0x63, (char)0x64, (char)0x65, (char)0x66, (char)0x67, (char)0x78, (char)0x79, (char)0x7A, (char)0x7B, (char)0x7C, (char)0x7D, (char)0x7E, (char)0x7F, (char)0x70, (char)0x71, (char)0x72, (char)0x73, (char)0x74, (char)0x75, (char)0x76, (char)0x77, (char)0x08, (char)0x09, (char)0x0A, (char)0x0B, (char)0x0C, (char)0x0D, (char)0x0E, (char)0x0F, (char)0x00, (char)0x01, (char)0x02, (char)0x03, (char)0x04, (char)0x05, (char)0x06, (char)0x07, (char)0x18, (char)0x19, (char)0x1A, (char)0x1B, (char)0x1C, (char)0x1D, (char)0x1E, (char)0x1F, (char)0x10, (char)0x11, (char)0x12, (char)0x13, (char)0x14, (char)0x15, (char)0x16, (char)0x17, (char)0x28, (char)0x29, (char)0x2A, (char)0x2B, (char)0x2C, (char)0x2D, (char)0x2E, (char)0x2F, (char)0x20, (char)0x21, (char)0x22, (char)0x23, (char)0x24, (char)0x25, (char)0x26, (char)0x27, (char)0x38, (char)0x39, (char)0x3A, (char)0x3B, (char)0x3C, (char)0x3D, (char)0x3E, (char)0x3F, (char)0x30, (char)0x31, (char)0x32, (char)0x33, (char)0x34, (char)0x35, (char)0x36, (char)0x37},
|
||||
new char[] {(char)0x79, (char)0x78, (char)0x7B, (char)0x7A, (char)0x7D, (char)0x7C, (char)0x7F, (char)0x7E, (char)0x71, (char)0x70, (char)0x73, (char)0x72, (char)0x75, (char)0x74, (char)0x77, (char)0x76, (char)0x69, (char)0x68, (char)0x6B, (char)0x6A, (char)0x6D, (char)0x6C, (char)0x6F, (char)0x6E, (char)0x61, (char)0x60, (char)0x63, (char)0x62, (char)0x65, (char)0x64, (char)0x67, (char)0x66, (char)0x59, (char)0x58, (char)0x5B, (char)0x5A, (char)0x5D, (char)0x5C, (char)0x5F, (char)0x5E, (char)0x51, (char)0x50, (char)0x53, (char)0x52, (char)0x55, (char)0x54, (char)0x57, (char)0x56, (char)0x49, (char)0x48, (char)0x4B, (char)0x4A, (char)0x4D, (char)0x4C, (char)0x4F, (char)0x4E, (char)0x41, (char)0x40, (char)0x43, (char)0x42, (char)0x45, (char)0x44, (char)0x47, (char)0x46, (char)0x39, (char)0x38, (char)0x3B, (char)0x3A, (char)0x3D, (char)0x3C, (char)0x3F, (char)0x3E, (char)0x31, (char)0x30, (char)0x33, (char)0x32, (char)0x35, (char)0x34, (char)0x37, (char)0x36, (char)0x29, (char)0x28, (char)0x2B, (char)0x2A, (char)0x2D, (char)0x2C, (char)0x2F, (char)0x2E, (char)0x21, (char)0x20, (char)0x23, (char)0x22, (char)0x25, (char)0x24, (char)0x27, (char)0x26, (char)0x19, (char)0x18, (char)0x1B, (char)0x1A, (char)0x1D, (char)0x1C, (char)0x1F, (char)0x1E, (char)0x11, (char)0x10, (char)0x13, (char)0x12, (char)0x15, (char)0x14, (char)0x17, (char)0x16, (char)0x09, (char)0x08, (char)0x0B, (char)0x0A, (char)0x0D, (char)0x0C, (char)0x0F, (char)0x0E, (char)0x01, (char)0x00, (char)0x03, (char)0x02, (char)0x05, (char)0x04, (char)0x07, (char)0x06, (char)0xB9, (char)0xB8, (char)0xBB, (char)0xBA, (char)0xBD, (char)0xBC, (char)0xBF, (char)0xBE, (char)0xB1, (char)0xB0, (char)0xB3, (char)0xB2, (char)0xB5, (char)0xB4, (char)0xB7, (char)0xB6, (char)0xA9, (char)0xA8, (char)0xAB, (char)0xAA, (char)0xAD, (char)0xAC, (char)0xAF, (char)0xAE, (char)0xA1, (char)0xA0, (char)0xA3, (char)0xA2, (char)0xA5, (char)0xA4, (char)0xA7, (char)0xA6, (char)0x99, (char)0x98, (char)0x9B, (char)0x9A, (char)0x9D, (char)0x9C, (char)0x9F, (char)0x9E, (char)0x91, (char)0x90, (char)0x93, (char)0x92, (char)0x95, (char)0x94, (char)0x97, (char)0x96, (char)0x89, (char)0x88, (char)0x8B, (char)0x8A, (char)0x8D, (char)0x8C, (char)0x8F, (char)0x8E, (char)0x81, (char)0x80, (char)0x83, (char)0x82, (char)0x85, (char)0x84, (char)0x87, (char)0x86, (char)0xF9, (char)0xF8, (char)0xFB, (char)0xFA, (char)0xFD, (char)0xFC, (char)0xFF, (char)0xFE, (char)0xF1, (char)0xF0, (char)0xF3, (char)0xF2, (char)0xF5, (char)0xF4, (char)0xF7, (char)0xF6, (char)0xE9, (char)0xE8, (char)0xEB, (char)0xEA, (char)0xED, (char)0xEC, (char)0xEF, (char)0xEE, (char)0xE1, (char)0xE0, (char)0xE3, (char)0xE2, (char)0xE5, (char)0xE4, (char)0xE7, (char)0xE6, (char)0xD9, (char)0xD8, (char)0xDB, (char)0xDA, (char)0xDD, (char)0xDC, (char)0xDF, (char)0xDE, (char)0xD1, (char)0xD0, (char)0xD3, (char)0xD2, (char)0xD5, (char)0xD4, (char)0xD7, (char)0xD6, (char)0xC9, (char)0xC8, (char)0xCB, (char)0xCA, (char)0xCD, (char)0xCC, (char)0xCF, (char)0xCE, (char)0xC1, (char)0xC0, (char)0xC3, (char)0xC2, (char)0xC5, (char)0xC4, (char)0xC7, (char)0xC6},
|
||||
new char[] {(char)0x7F, (char)0x7E, (char)0x7D, (char)0x7C, (char)0x7B, (char)0x7A, (char)0x79, (char)0x78, (char)0x77, (char)0x76, (char)0x75, (char)0x74, (char)0x73, (char)0x72, (char)0x71, (char)0x70, (char)0x6F, (char)0x6E, (char)0x6D, (char)0x6C, (char)0x6B, (char)0x6A, (char)0x69, (char)0x68, (char)0x67, (char)0x66, (char)0x65, (char)0x64, (char)0x63, (char)0x62, (char)0x61, (char)0x60, (char)0x5F, (char)0x5E, (char)0x5D, (char)0x5C, (char)0x5B, (char)0x5A, (char)0x59, (char)0x58, (char)0x57, (char)0x56, (char)0x55, (char)0x54, (char)0x53, (char)0x52, (char)0x51, (char)0x50, (char)0x4F, (char)0x4E, (char)0x4D, (char)0x4C, (char)0x4B, (char)0x4A, (char)0x49, (char)0x48, (char)0x47, (char)0x46, (char)0x45, (char)0x44, (char)0x43, (char)0x42, (char)0x41, (char)0x40, (char)0x3F, (char)0x3E, (char)0x3D, (char)0x3C, (char)0x3B, (char)0x3A, (char)0x39, (char)0x38, (char)0x37, (char)0x36, (char)0x35, (char)0x34, (char)0x33, (char)0x32, (char)0x31, (char)0x30, (char)0x2F, (char)0x2E, (char)0x2D, (char)0x2C, (char)0x2B, (char)0x2A, (char)0x29, (char)0x28, (char)0x27, (char)0x26, (char)0x25, (char)0x24, (char)0x23, (char)0x22, (char)0x21, (char)0x20, (char)0x1F, (char)0x1E, (char)0x1D, (char)0x1C, (char)0x1B, (char)0x1A, (char)0x19, (char)0x18, (char)0x17, (char)0x16, (char)0x15, (char)0x14, (char)0x13, (char)0x12, (char)0x11, (char)0x10, (char)0x0F, (char)0x0E, (char)0x0D, (char)0x0C, (char)0x0B, (char)0x0A, (char)0x09, (char)0x08, (char)0x07, (char)0x06, (char)0x05, (char)0x04, (char)0x03, (char)0x02, (char)0x01, (char)0x00, (char)0xBF, (char)0xBE, (char)0xBD, (char)0xBC, (char)0xBB, (char)0xBA, (char)0xB9, (char)0xB8, (char)0xB7, (char)0xB6, (char)0xB5, (char)0xB4, (char)0xB3, (char)0xB2, (char)0xB1, (char)0xB0, (char)0xAF, (char)0xAE, (char)0xAD, (char)0xAC, (char)0xAB, (char)0xAA, (char)0xA9, (char)0xA8, (char)0xA7, (char)0xA6, (char)0xA5, (char)0xA4, (char)0xA3, (char)0xA2, (char)0xA1, (char)0xA0, (char)0x9F, (char)0x9E, (char)0x9D, (char)0x9C, (char)0x9B, (char)0x9A, (char)0x99, (char)0x98, (char)0x97, (char)0x96, (char)0x95, (char)0x94, (char)0x93, (char)0x92, (char)0x91, (char)0x90, (char)0x8F, (char)0x8E, (char)0x8D, (char)0x8C, (char)0x8B, (char)0x8A, (char)0x89, (char)0x88, (char)0x87, (char)0x86, (char)0x85, (char)0x84, (char)0x83, (char)0x82, (char)0x81, (char)0x80, (char)0xFF, (char)0xFE, (char)0xFD, (char)0xFC, (char)0xFB, (char)0xFA, (char)0xF9, (char)0xF8, (char)0xF7, (char)0xF6, (char)0xF5, (char)0xF4, (char)0xF3, (char)0xF2, (char)0xF1, (char)0xF0, (char)0xEF, (char)0xEE, (char)0xED, (char)0xEC, (char)0xEB, (char)0xEA, (char)0xE9, (char)0xE8, (char)0xE7, (char)0xE6, (char)0xE5, (char)0xE4, (char)0xE3, (char)0xE2, (char)0xE1, (char)0xE0, (char)0xDF, (char)0xDE, (char)0xDD, (char)0xDC, (char)0xDB, (char)0xDA, (char)0xD9, (char)0xD8, (char)0xD7, (char)0xD6, (char)0xD5, (char)0xD4, (char)0xD3, (char)0xD2, (char)0xD1, (char)0xD0, (char)0xCF, (char)0xCE, (char)0xCD, (char)0xCC, (char)0xCB, (char)0xCA, (char)0xC9, (char)0xC8, (char)0xC7, (char)0xC6, (char)0xC5, (char)0xC4, (char)0xC3, (char)0xC2, (char)0xC1, (char)0xC0},
|
||||
new char[] {(char)0x95, (char)0x94, (char)0x97, (char)0x96, (char)0x91, (char)0x90, (char)0x93, (char)0x92, (char)0x9D, (char)0x9C, (char)0x9F, (char)0x9E, (char)0x99, (char)0x98, (char)0x9B, (char)0x9A, (char)0x85, (char)0x84, (char)0x87, (char)0x86, (char)0x81, (char)0x80, (char)0x83, (char)0x82, (char)0x8D, (char)0x8C, (char)0x8F, (char)0x8E, (char)0x89, (char)0x88, (char)0x8B, (char)0x8A, (char)0xB5, (char)0xB4, (char)0xB7, (char)0xB6, (char)0xB1, (char)0xB0, (char)0xB3, (char)0xB2, (char)0xBD, (char)0xBC, (char)0xBF, (char)0xBE, (char)0xB9, (char)0xB8, (char)0xBB, (char)0xBA, (char)0xA5, (char)0xA4, (char)0xA7, (char)0xA6, (char)0xA1, (char)0xA0, (char)0xA3, (char)0xA2, (char)0xAD, (char)0xAC, (char)0xAF, (char)0xAE, (char)0xA9, (char)0xA8, (char)0xAB, (char)0xAA, (char)0xD5, (char)0xD4, (char)0xD7, (char)0xD6, (char)0xD1, (char)0xD0, (char)0xD3, (char)0xD2, (char)0xDD, (char)0xDC, (char)0xDF, (char)0xDE, (char)0xD9, (char)0xD8, (char)0xDB, (char)0xDA, (char)0xC5, (char)0xC4, (char)0xC7, (char)0xC6, (char)0xC1, (char)0xC0, (char)0xC3, (char)0xC2, (char)0xCD, (char)0xCC, (char)0xCF, (char)0xCE, (char)0xC9, (char)0xC8, (char)0xCB, (char)0xCA, (char)0xF5, (char)0xF4, (char)0xF7, (char)0xF6, (char)0xF1, (char)0xF0, (char)0xF3, (char)0xF2, (char)0xFD, (char)0xFC, (char)0xFF, (char)0xFE, (char)0xF9, (char)0xF8, (char)0xFB, (char)0xFA, (char)0xE5, (char)0xE4, (char)0xE7, (char)0xE6, (char)0xE1, (char)0xE0, (char)0xE3, (char)0xE2, (char)0xED, (char)0xEC, (char)0xEF, (char)0xEE, (char)0xE9, (char)0xE8, (char)0xEB, (char)0xEA, (char)0x55, (char)0x54, (char)0x57, (char)0x56, (char)0x51, (char)0x50, (char)0x53, (char)0x52, (char)0x5D, (char)0x5C, (char)0x5F, (char)0x5E, (char)0x59, (char)0x58, (char)0x5B, (char)0x5A, (char)0x45, (char)0x44, (char)0x47, (char)0x46, (char)0x41, (char)0x40, (char)0x43, (char)0x42, (char)0x4D, (char)0x4C, (char)0x4F, (char)0x4E, (char)0x49, (char)0x48, (char)0x4B, (char)0x4A, (char)0x75, (char)0x74, (char)0x77, (char)0x76, (char)0x71, (char)0x70, (char)0x73, (char)0x72, (char)0x7D, (char)0x7C, (char)0x7F, (char)0x7E, (char)0x79, (char)0x78, (char)0x7B, (char)0x7A, (char)0x65, (char)0x64, (char)0x67, (char)0x66, (char)0x61, (char)0x60, (char)0x63, (char)0x62, (char)0x6D, (char)0x6C, (char)0x6F, (char)0x6E, (char)0x69, (char)0x68, (char)0x6B, (char)0x6A, (char)0x15, (char)0x14, (char)0x17, (char)0x16, (char)0x11, (char)0x10, (char)0x13, (char)0x12, (char)0x1D, (char)0x1C, (char)0x1F, (char)0x1E, (char)0x19, (char)0x18, (char)0x1B, (char)0x1A, (char)0x05, (char)0x04, (char)0x07, (char)0x06, (char)0x01, (char)0x00, (char)0x03, (char)0x02, (char)0x0D, (char)0x0C, (char)0x0F, (char)0x0E, (char)0x09, (char)0x08, (char)0x0B, (char)0x0A, (char)0x35, (char)0x34, (char)0x37, (char)0x36, (char)0x31, (char)0x30, (char)0x33, (char)0x32, (char)0x3D, (char)0x3C, (char)0x3F, (char)0x3E, (char)0x39, (char)0x38, (char)0x3B, (char)0x3A, (char)0x25, (char)0x24, (char)0x27, (char)0x26, (char)0x21, (char)0x20, (char)0x23, (char)0x22, (char)0x2D, (char)0x2C, (char)0x2F, (char)0x2E, (char)0x29, (char)0x28, (char)0x2B, (char)0x2A}
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// the endings for each column
|
||||
/// </summary>
|
||||
private static char[][] end = new char[][]
|
||||
{
|
||||
new char[] {(char)0x44, (char)0x32, (char)0x6C, (char)0xE5, (char)0x8B},
|
||||
new char[] {(char)0x32, (char)0x6C, (char)0xE5, (char)0x8C},
|
||||
new char[] {(char)0x6C, (char)0xE5, (char)0x8D},
|
||||
new char[] {(char)0xE5, (char)0x8E},
|
||||
new char[] {(char)0x8F},
|
||||
new char[] {(char)0x79, (char)0x7F, (char)0x95, (char)0x44, (char)0x32, (char)0x6C, (char)0xE5, (char)0x88},
|
||||
new char[] {(char)0x7F, (char)0x95, (char)0x44, (char)0x32, (char)0x6C, (char)0xE5, (char)0x88},
|
||||
new char[] {(char)0x95, (char)0x44, (char)0x32, (char)0x6C, (char)0xE5, (char)0x88}
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// the start of each column
|
||||
/// </summary>
|
||||
private static char[] start = new char[] { (char)0xFF, (char)0x00, (char)0xFF, (char)0xAC, (char)0xEB, (char)0x96, (char)0xC4, (char)0x2A };
|
||||
|
||||
public static string decode(string encoded)
|
||||
{
|
||||
int currentCol = 0;
|
||||
char[] arr = encoded.ToCharArray();
|
||||
char[] ret = new char[arr.Length];
|
||||
int pos = 0;
|
||||
int endchar = 0;
|
||||
foreach (char character in arr)
|
||||
{
|
||||
for (int i = 0; i < 256; i++)
|
||||
{
|
||||
if (col[currentCol][i] == character)
|
||||
{
|
||||
ret[pos++] = code[i];
|
||||
if (code[i] == (char)0x3E)
|
||||
{
|
||||
endchar = pos;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
currentCol++;
|
||||
if (currentCol > 7)
|
||||
{
|
||||
currentCol = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return new string(ret).Substring(start.Length, endchar - start.Length);
|
||||
|
||||
}
|
||||
|
||||
public static string encode(string decoded)
|
||||
{
|
||||
Encoding iso_8859_1 = Encoding.GetEncoding("iso-8859-1");
|
||||
int currentCol = 0;
|
||||
char[] arr = decoded.ToCharArray();
|
||||
char[] ret = new char[arr.Length];
|
||||
int pos = 0;
|
||||
foreach (char character in arr)
|
||||
{
|
||||
for (int i = 0; i < 256; i++)
|
||||
{
|
||||
if (code[i] == character)
|
||||
{
|
||||
ret[pos++] = col[currentCol][i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
currentCol++;
|
||||
if (currentCol > 7)
|
||||
{
|
||||
currentCol = 0;
|
||||
}
|
||||
}
|
||||
return new string(iso_8859_1.GetChars(iso_8859_1.GetBytes(new string(start) + new string(ret) + new string(end[currentCol]))));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user