1.18. 4
This commit is contained in:
parent
7864c56ffd
commit
e1a8c41b55
|
|
@ -412,7 +412,7 @@ function CSServer(Port,PlayerLimit)
|
|||
end
|
||||
end
|
||||
|
||||
function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,Ticket)
|
||||
function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,IconType,Ticket)
|
||||
if (rbxlegacyversion == "delta" or rbxlegacyversion == "delta-gamma" or rbxlegacyversion == "omega" or rbxlegacyversion == "delta-pre-gamma" or rbxlegacyversion == "delta-omega" or rbxlegacyversion == "delta-beta") then
|
||||
pcall(function() game:SetPlaceID(-1, false) end);
|
||||
pcall(function() game:GetService("Players"):SetChatStyle(Enum.ChatStyle.ClassicAndBubble) end);
|
||||
|
|
@ -496,7 +496,17 @@ function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,He
|
|||
end
|
||||
end
|
||||
pcall(function() Player:SetUnder13(false) end);
|
||||
pcall(function() Player:SetMembershipType(Enum.MembershipType.BuildersClub) end);
|
||||
if (rbxlegacyversion == "delta" or rbxlegacyversion == "omega" or rbxlegacyversion == "delta-omega") then
|
||||
if (IconType == "BC") then
|
||||
Player:SetMembershipType(Enum.MembershipType.BuildersClub);
|
||||
elseif (IconType == "TBC") then
|
||||
Player:SetMembershipType(Enum.MembershipType.TurboBuildersClub);
|
||||
elseif (IconType == "OBC") then
|
||||
Player:SetMembershipType(Enum.MembershipType.OutrageousBuildersClub);
|
||||
elseif (IconType == "NBC") then
|
||||
Player:SetMembershipType(Enum.MembershipType.None);
|
||||
end
|
||||
end
|
||||
pcall(function() Player:SetAccountAge(365) end);
|
||||
Player:SetSuperSafeChat(false);
|
||||
Player.CharacterAppearance=0;
|
||||
|
|
@ -523,7 +533,6 @@ function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,He
|
|||
player = game:GetService("Players"):CreateLocalPlayer(UserID)
|
||||
player:SetSuperSafeChat(false)
|
||||
pcall(function() player:SetUnder13(false) end);
|
||||
pcall(function() player:SetMembershipType(Enum.MembershipType.BuildersClub) end);
|
||||
pcall(function() player:SetAccountAge(365) end);
|
||||
player.CharacterAppearance=0;
|
||||
pcall(function() player.Name=PlayerName or ""; end);
|
||||
|
|
@ -602,7 +611,7 @@ function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,He
|
|||
end
|
||||
end
|
||||
|
||||
function CSSolo(UserID,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID)
|
||||
function CSSolo(UserID,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,IconType)
|
||||
if (rbxlegacyversion == "omega" or rbxlegacyversion == "delta-omega") then
|
||||
game:GetService("RunService"):Run();
|
||||
else
|
||||
|
|
@ -630,6 +639,19 @@ function CSSolo(UserID,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,
|
|||
local plr = game.Players:CreateLocalPlayer(UserID);
|
||||
plr.Name = PlayerName;
|
||||
plr:LoadCharacter();
|
||||
pcall(function() plr:SetUnder13(false) end);
|
||||
if (rbxlegacyversion == "delta" or rbxlegacyversion == "omega" or rbxlegacyversion == "delta-omega") then
|
||||
if (IconType == "BC") then
|
||||
plr:SetMembershipType(Enum.MembershipType.BuildersClub);
|
||||
elseif (IconType == "TBC") then
|
||||
plr:SetMembershipType(Enum.MembershipType.TurboBuildersClub);
|
||||
elseif (IconType == "OBC") then
|
||||
plr:SetMembershipType(Enum.MembershipType.OutrageousBuildersClub);
|
||||
elseif (IconType == "NBC") then
|
||||
plr:SetMembershipType(Enum.MembershipType.None);
|
||||
end
|
||||
end
|
||||
pcall(function() plr:SetAccountAge(365) end);
|
||||
plr.CharacterAppearance=0;
|
||||
InitalizeClientAppearance(plr,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID);
|
||||
LoadCharacterNew(newWaitForChild(plr,"Appearance"),plr.Character);
|
||||
|
|
|
|||
3601
CoreGui2011.rbxm
3601
CoreGui2011.rbxm
File diff suppressed because it is too large
Load Diff
3601
CoreGui2012.rbxm
3601
CoreGui2012.rbxm
File diff suppressed because it is too large
Load Diff
|
|
@ -39,46 +39,189 @@ namespace RBXLegacyLauncher
|
|||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CharacterCustomization));
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.button2 = new System.Windows.Forms.Button();
|
||||
this.button3 = new System.Windows.Forms.Button();
|
||||
this.radioButton1 = new System.Windows.Forms.RadioButton();
|
||||
this.radioButton2 = new System.Windows.Forms.RadioButton();
|
||||
this.radioButton3 = new System.Windows.Forms.RadioButton();
|
||||
this.radioButton4 = new System.Windows.Forms.RadioButton();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.textBox1 = new System.Windows.Forms.TextBox();
|
||||
this.textBox2 = new System.Windows.Forms.TextBox();
|
||||
this.textBox3 = new System.Windows.Forms.TextBox();
|
||||
this.textBox4 = new System.Windows.Forms.TextBox();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Location = new System.Drawing.Point(9, 12);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(243, 54);
|
||||
this.button1.Size = new System.Drawing.Size(116, 36);
|
||||
this.button1.TabIndex = 31;
|
||||
this.button1.Text = "Character Colors";
|
||||
this.button1.Text = "Body Colors";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.Button1Click);
|
||||
//
|
||||
// button2
|
||||
//
|
||||
this.button2.Location = new System.Drawing.Point(9, 72);
|
||||
this.button2.Location = new System.Drawing.Point(135, 12);
|
||||
this.button2.Name = "button2";
|
||||
this.button2.Size = new System.Drawing.Size(243, 54);
|
||||
this.button2.Size = new System.Drawing.Size(116, 36);
|
||||
this.button2.TabIndex = 32;
|
||||
this.button2.Text = "Hats";
|
||||
this.button2.Text = "Accessories";
|
||||
this.button2.UseVisualStyleBackColor = true;
|
||||
this.button2.Click += new System.EventHandler(this.Button2Click);
|
||||
//
|
||||
// button3
|
||||
// radioButton1
|
||||
//
|
||||
this.button3.Location = new System.Drawing.Point(9, 132);
|
||||
this.button3.Name = "button3";
|
||||
this.button3.Size = new System.Drawing.Size(242, 54);
|
||||
this.button3.TabIndex = 33;
|
||||
this.button3.Text = "Clothing";
|
||||
this.button3.UseVisualStyleBackColor = true;
|
||||
this.button3.Click += new System.EventHandler(this.Button3Click);
|
||||
this.radioButton1.Location = new System.Drawing.Point(29, 190);
|
||||
this.radioButton1.Name = "radioButton1";
|
||||
this.radioButton1.Size = new System.Drawing.Size(40, 16);
|
||||
this.radioButton1.TabIndex = 34;
|
||||
this.radioButton1.Text = "BC";
|
||||
this.radioButton1.UseVisualStyleBackColor = true;
|
||||
this.radioButton1.CheckedChanged += new System.EventHandler(this.RadioButton1CheckedChanged);
|
||||
//
|
||||
// radioButton2
|
||||
//
|
||||
this.radioButton2.Location = new System.Drawing.Point(75, 190);
|
||||
this.radioButton2.Name = "radioButton2";
|
||||
this.radioButton2.Size = new System.Drawing.Size(50, 16);
|
||||
this.radioButton2.TabIndex = 35;
|
||||
this.radioButton2.Text = "TBC";
|
||||
this.radioButton2.UseVisualStyleBackColor = true;
|
||||
this.radioButton2.CheckedChanged += new System.EventHandler(this.RadioButton2CheckedChanged);
|
||||
//
|
||||
// radioButton3
|
||||
//
|
||||
this.radioButton3.Location = new System.Drawing.Point(124, 190);
|
||||
this.radioButton3.Name = "radioButton3";
|
||||
this.radioButton3.Size = new System.Drawing.Size(50, 16);
|
||||
this.radioButton3.TabIndex = 36;
|
||||
this.radioButton3.Text = "OBC";
|
||||
this.radioButton3.UseVisualStyleBackColor = true;
|
||||
this.radioButton3.CheckedChanged += new System.EventHandler(this.RadioButton3CheckedChanged);
|
||||
//
|
||||
// radioButton4
|
||||
//
|
||||
this.radioButton4.Checked = true;
|
||||
this.radioButton4.Location = new System.Drawing.Point(180, 190);
|
||||
this.radioButton4.Name = "radioButton4";
|
||||
this.radioButton4.Size = new System.Drawing.Size(53, 16);
|
||||
this.radioButton4.TabIndex = 37;
|
||||
this.radioButton4.TabStop = true;
|
||||
this.radioButton4.Text = "None";
|
||||
this.radioButton4.UseVisualStyleBackColor = true;
|
||||
this.radioButton4.CheckedChanged += new System.EventHandler(this.RadioButton4CheckedChanged);
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.Location = new System.Drawing.Point(94, 170);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(60, 17);
|
||||
this.label1.TabIndex = 38;
|
||||
this.label1.Text = "Icon Type";
|
||||
//
|
||||
// textBox1
|
||||
//
|
||||
this.textBox1.Location = new System.Drawing.Point(71, 69);
|
||||
this.textBox1.Name = "textBox1";
|
||||
this.textBox1.Size = new System.Drawing.Size(180, 20);
|
||||
this.textBox1.TabIndex = 39;
|
||||
this.textBox1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
this.textBox1.TextChanged += new System.EventHandler(this.TextBox1TextChanged);
|
||||
//
|
||||
// textBox2
|
||||
//
|
||||
this.textBox2.Location = new System.Drawing.Point(71, 95);
|
||||
this.textBox2.Name = "textBox2";
|
||||
this.textBox2.Size = new System.Drawing.Size(180, 20);
|
||||
this.textBox2.TabIndex = 40;
|
||||
this.textBox2.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
this.textBox2.TextChanged += new System.EventHandler(this.TextBox2TextChanged);
|
||||
//
|
||||
// textBox3
|
||||
//
|
||||
this.textBox3.Location = new System.Drawing.Point(71, 121);
|
||||
this.textBox3.Name = "textBox3";
|
||||
this.textBox3.Size = new System.Drawing.Size(180, 20);
|
||||
this.textBox3.TabIndex = 41;
|
||||
this.textBox3.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
this.textBox3.TextChanged += new System.EventHandler(this.TextBox3TextChanged);
|
||||
//
|
||||
// textBox4
|
||||
//
|
||||
this.textBox4.Location = new System.Drawing.Point(71, 147);
|
||||
this.textBox4.Name = "textBox4";
|
||||
this.textBox4.Size = new System.Drawing.Size(180, 20);
|
||||
this.textBox4.TabIndex = 42;
|
||||
this.textBox4.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
this.textBox4.TextChanged += new System.EventHandler(this.TextBox4TextChanged);
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.Location = new System.Drawing.Point(12, 147);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(49, 15);
|
||||
this.label4.TabIndex = 46;
|
||||
this.label4.Text = "Face ID";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.Location = new System.Drawing.Point(12, 124);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(49, 15);
|
||||
this.label3.TabIndex = 45;
|
||||
this.label3.Text = "Pants ID";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.Location = new System.Drawing.Point(12, 98);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(42, 15);
|
||||
this.label2.TabIndex = 44;
|
||||
this.label2.Text = "Shirt ID";
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.Location = new System.Drawing.Point(12, 72);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(53, 15);
|
||||
this.label5.TabIndex = 43;
|
||||
this.label5.Text = "T-Shirt ID";
|
||||
//
|
||||
// label6
|
||||
//
|
||||
this.label6.Location = new System.Drawing.Point(9, 51);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(242, 15);
|
||||
this.label6.TabIndex = 47;
|
||||
this.label6.Text = "Clothing";
|
||||
this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// CharacterCustomization
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.SystemColors.ControlLightLight;
|
||||
this.ClientSize = new System.Drawing.Size(263, 198);
|
||||
this.Controls.Add(this.button3);
|
||||
this.ClientSize = new System.Drawing.Size(263, 218);
|
||||
this.Controls.Add(this.label6);
|
||||
this.Controls.Add(this.label4);
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.label5);
|
||||
this.Controls.Add(this.textBox4);
|
||||
this.Controls.Add(this.textBox3);
|
||||
this.Controls.Add(this.textBox2);
|
||||
this.Controls.Add(this.textBox1);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.radioButton4);
|
||||
this.Controls.Add(this.radioButton3);
|
||||
this.Controls.Add(this.radioButton2);
|
||||
this.Controls.Add(this.radioButton1);
|
||||
this.Controls.Add(this.button2);
|
||||
this.Controls.Add(this.button1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||
|
|
@ -88,8 +231,22 @@ namespace RBXLegacyLauncher
|
|||
this.Text = "Character Customization";
|
||||
this.Load += new System.EventHandler(this.CharacterCustomizationLoad);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
}
|
||||
private System.Windows.Forms.Button button3;
|
||||
private System.Windows.Forms.Label label6;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.TextBox textBox4;
|
||||
private System.Windows.Forms.TextBox textBox3;
|
||||
private System.Windows.Forms.TextBox textBox2;
|
||||
private System.Windows.Forms.TextBox textBox1;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.RadioButton radioButton4;
|
||||
private System.Windows.Forms.RadioButton radioButton3;
|
||||
private System.Windows.Forms.RadioButton radioButton2;
|
||||
private System.Windows.Forms.RadioButton radioButton1;
|
||||
private System.Windows.Forms.Button button2;
|
||||
private System.Windows.Forms.Button button1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,6 +36,26 @@ namespace RBXLegacyLauncher
|
|||
|
||||
void CharacterCustomizationLoad(object sender, EventArgs e)
|
||||
{
|
||||
textBox1.Text = GlobalVars.Custom_TShirt.ToString();
|
||||
textBox2.Text = GlobalVars.Custom_Shirt.ToString();
|
||||
textBox3.Text = GlobalVars.Custom_Pants.ToString();
|
||||
textBox4.Text = GlobalVars.Custom_Face.ToString();
|
||||
if (GlobalVars.Custom_IconType.Equals("BC"))
|
||||
{
|
||||
radioButton1.Checked = true;
|
||||
}
|
||||
else if (GlobalVars.Custom_IconType.Equals("TBC"))
|
||||
{
|
||||
radioButton2.Checked = true;
|
||||
}
|
||||
else if (GlobalVars.Custom_IconType.Equals("OBC"))
|
||||
{
|
||||
radioButton3.Checked = true;
|
||||
}
|
||||
else if (GlobalVars.Custom_IconType.Equals("NBC"))
|
||||
{
|
||||
radioButton4.Checked = true;
|
||||
}
|
||||
string hatdir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\charcustom\\hats";
|
||||
if (Directory.Exists(hatdir))
|
||||
{
|
||||
|
|
@ -59,10 +79,104 @@ namespace RBXLegacyLauncher
|
|||
chats.Show();
|
||||
}
|
||||
|
||||
void Button3Click(object sender, EventArgs e)
|
||||
void TextBox1TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
CharacterCustomization_ClothingMenu clothes = new CharacterCustomization_ClothingMenu();
|
||||
clothes.Show();
|
||||
int parsedValue;
|
||||
if (int.TryParse(textBox1.Text, out parsedValue))
|
||||
{
|
||||
if (textBox1.Text.Equals(""))
|
||||
{
|
||||
GlobalVars.Custom_TShirt = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
GlobalVars.Custom_TShirt = Convert.ToInt32(textBox1.Text);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
GlobalVars.Custom_TShirt = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void TextBox2TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
int parsedValue;
|
||||
if (int.TryParse(textBox2.Text, out parsedValue))
|
||||
{
|
||||
if (textBox2.Text.Equals(""))
|
||||
{
|
||||
GlobalVars.Custom_Shirt = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
GlobalVars.Custom_Shirt = Convert.ToInt32(textBox2.Text);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
GlobalVars.Custom_Shirt = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void TextBox3TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
int parsedValue;
|
||||
if (int.TryParse(textBox3.Text, out parsedValue))
|
||||
{
|
||||
if (textBox3.Text.Equals(""))
|
||||
{
|
||||
GlobalVars.Custom_Pants = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
GlobalVars.Custom_Pants = Convert.ToInt32(textBox3.Text);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
GlobalVars.Custom_Pants = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void TextBox4TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
int parsedValue;
|
||||
if (int.TryParse(textBox4.Text, out parsedValue))
|
||||
{
|
||||
if (textBox4.Text.Equals(""))
|
||||
{
|
||||
GlobalVars.Custom_Face = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
GlobalVars.Custom_Face = Convert.ToInt32(textBox4.Text);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
GlobalVars.Custom_Face = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void RadioButton1CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
GlobalVars.Custom_IconType = "BC";
|
||||
}
|
||||
|
||||
void RadioButton2CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
GlobalVars.Custom_IconType = "TBC";
|
||||
}
|
||||
|
||||
void RadioButton3CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
GlobalVars.Custom_IconType = "OBC";
|
||||
}
|
||||
|
||||
void RadioButton4CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
GlobalVars.Custom_IconType = "NBC";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,120 +0,0 @@
|
|||
/*
|
||||
* Created by SharpDevelop.
|
||||
* User: BITL
|
||||
* Date: 6/17/2017
|
||||
* Time: 8:41 AM
|
||||
*
|
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers.
|
||||
*/
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace RBXLegacyLauncher
|
||||
{
|
||||
/// <summary>
|
||||
/// Description of CharacterCustomization_ClothingMenu.
|
||||
/// </summary>
|
||||
public partial class CharacterCustomization_ClothingMenu : Form
|
||||
{
|
||||
public CharacterCustomization_ClothingMenu()
|
||||
{
|
||||
//
|
||||
// The InitializeComponent() call is required for Windows Forms designer support.
|
||||
//
|
||||
InitializeComponent();
|
||||
|
||||
//
|
||||
// TODO: Add constructor code after the InitializeComponent() call.
|
||||
//
|
||||
}
|
||||
|
||||
void TextBox1TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
int parsedValue;
|
||||
if (int.TryParse(textBox1.Text, out parsedValue))
|
||||
{
|
||||
if (textBox1.Text.Equals(""))
|
||||
{
|
||||
GlobalVars.Custom_TShirt = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
GlobalVars.Custom_TShirt = Convert.ToInt32(textBox1.Text);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
GlobalVars.Custom_TShirt = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void TextBox2TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
int parsedValue;
|
||||
if (int.TryParse(textBox2.Text, out parsedValue))
|
||||
{
|
||||
if (textBox2.Text.Equals(""))
|
||||
{
|
||||
GlobalVars.Custom_Shirt = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
GlobalVars.Custom_Shirt = Convert.ToInt32(textBox2.Text);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
GlobalVars.Custom_Shirt = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void TextBox3TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
int parsedValue;
|
||||
if (int.TryParse(textBox3.Text, out parsedValue))
|
||||
{
|
||||
if (textBox3.Text.Equals(""))
|
||||
{
|
||||
GlobalVars.Custom_Pants = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
GlobalVars.Custom_Pants = Convert.ToInt32(textBox3.Text);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
GlobalVars.Custom_Pants = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void TextBox4TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
int parsedValue;
|
||||
if (int.TryParse(textBox4.Text, out parsedValue))
|
||||
{
|
||||
if (textBox4.Text.Equals(""))
|
||||
{
|
||||
GlobalVars.Custom_Face = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
GlobalVars.Custom_Face = Convert.ToInt32(textBox4.Text);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
GlobalVars.Custom_Face = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void CharacterCustomization_ClothingMenuLoad(object sender, EventArgs e)
|
||||
{
|
||||
textBox1.Text = GlobalVars.Custom_TShirt.ToString();
|
||||
textBox2.Text = GlobalVars.Custom_Shirt.ToString();
|
||||
textBox3.Text = GlobalVars.Custom_Pants.ToString();
|
||||
textBox4.Text = GlobalVars.Custom_Face.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -10,11 +10,13 @@
|
|||
public static string SharedArgs = "";
|
||||
public static string DefaultScript = "";
|
||||
public static string DefaultScriptMD5 = "";
|
||||
public static bool AdminMode = false;
|
||||
//vars for loader
|
||||
public static bool ReadyToLaunch = false;
|
||||
//server settings.
|
||||
public static string Map = "Baseplate.rbxl";
|
||||
public static int RobloxPort = 53640;
|
||||
public static int ServerPort = 53640;
|
||||
public static int DefaultRobloxPort = 53640;
|
||||
public static int PlayerLimit = 12;
|
||||
//player settings
|
||||
|
|
@ -40,6 +42,11 @@
|
|||
public static bool ClientCreator_LegacyMode = false;
|
||||
public static string ClientCreator_SelectedClientMD5 = "";
|
||||
public static string ClientCreator_SelectedClientVersion = "";
|
||||
//infoeditor
|
||||
public static string InfoEditor_Version = "";
|
||||
public static string InfoEditor_DefaultClient = "";
|
||||
public static string InfoEditor_ScriptPath = "";
|
||||
public static string InfoEditor_ScriptMD5 = "";
|
||||
//charcustom
|
||||
public static string Custom_Hat1ID_Offline = "NoHat.rbxm";
|
||||
public static string Custom_Hat2ID_Offline = "NoHat.rbxm";
|
||||
|
|
@ -48,18 +55,17 @@
|
|||
public static int Custom_Shirt = 0;
|
||||
public static int Custom_Pants = 0;
|
||||
public static int Custom_Face = 0;
|
||||
public static string Custom_IconType = "NBC";
|
||||
public static int HeadColorID = 24;
|
||||
public static int TorsoColorID = 23;
|
||||
public static int LeftArmColorID = 24;
|
||||
public static int RightArmColorID = 24;
|
||||
public static int LeftLegColorID = 119;
|
||||
public static int RightLegColorID = 119;
|
||||
//color menu.
|
||||
public static string ColorMenu_HeadColor = "Color [A=255, R=245, G=205, B=47]";
|
||||
public static string ColorMenu_TorsoColor = "Color [A=255, R=13, G=105, B=172]";
|
||||
public static string ColorMenu_LeftArmColor = "Color [A=255, R=245, G=205, B=47]";
|
||||
public static string ColorMenu_RightArmColor = "Color [A=255, R=245, G=205, B=47]";
|
||||
public static string ColorMenu_LeftLegColor = "Color [A=255, R=164, G=189, B=71]";
|
||||
public static string ColorMenu_RightLegColor = "Color [A=255, R=164, G=189, B=71]";
|
||||
public static bool AdminMode = false;
|
||||
}
|
||||
|
|
@ -1,14 +1,14 @@
|
|||
/*
|
||||
* Created by SharpDevelop.
|
||||
* User: BITL
|
||||
* Date: 6/17/2017
|
||||
* Time: 8:41 AM
|
||||
* User: BITL-Gaming
|
||||
* Date: 11/28/2016
|
||||
* Time: 7:55 AM
|
||||
*
|
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers.
|
||||
*/
|
||||
namespace RBXLegacyLauncher
|
||||
{
|
||||
partial class CharacterCustomization_ClothingMenu
|
||||
partial class InfoEditor
|
||||
{
|
||||
/// <summary>
|
||||
/// Designer variable used to keep track of non-visual components.
|
||||
|
|
@ -36,110 +36,149 @@ namespace RBXLegacyLauncher
|
|||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CharacterCustomization_ClothingMenu));
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(InfoEditor));
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.button2 = new System.Windows.Forms.Button();
|
||||
this.button3 = new System.Windows.Forms.Button();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.textBox1 = new System.Windows.Forms.TextBox();
|
||||
this.textBox2 = new System.Windows.Forms.TextBox();
|
||||
this.textBox3 = new System.Windows.Forms.TextBox();
|
||||
this.textBox4 = new System.Windows.Forms.TextBox();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Location = new System.Drawing.Point(166, 204);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(154, 30);
|
||||
this.button1.TabIndex = 7;
|
||||
this.button1.Text = "Save";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.Button1Click);
|
||||
//
|
||||
// button2
|
||||
//
|
||||
this.button2.Location = new System.Drawing.Point(7, 204);
|
||||
this.button2.Name = "button2";
|
||||
this.button2.Size = new System.Drawing.Size(150, 30);
|
||||
this.button2.TabIndex = 10;
|
||||
this.button2.Text = "Load";
|
||||
this.button2.UseVisualStyleBackColor = true;
|
||||
this.button2.Click += new System.EventHandler(this.Button2Click);
|
||||
//
|
||||
// button3
|
||||
//
|
||||
this.button3.Location = new System.Drawing.Point(8, 175);
|
||||
this.button3.Name = "button3";
|
||||
this.button3.Size = new System.Drawing.Size(312, 23);
|
||||
this.button3.TabIndex = 12;
|
||||
this.button3.Text = "New info.txt";
|
||||
this.button3.UseVisualStyleBackColor = true;
|
||||
this.button3.Click += new System.EventHandler(this.Button3Click);
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.Location = new System.Drawing.Point(12, 9);
|
||||
this.label1.Location = new System.Drawing.Point(7, 2);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(53, 15);
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Text = "T-Shirt ID";
|
||||
this.label1.Size = new System.Drawing.Size(44, 15);
|
||||
this.label1.TabIndex = 13;
|
||||
this.label1.Text = "Version";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.Location = new System.Drawing.Point(12, 37);
|
||||
this.label2.Location = new System.Drawing.Point(7, 43);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(42, 15);
|
||||
this.label2.TabIndex = 2;
|
||||
this.label2.Text = "Shirt ID";
|
||||
this.label2.Size = new System.Drawing.Size(76, 17);
|
||||
this.label2.TabIndex = 14;
|
||||
this.label2.Text = "Default Client";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.Location = new System.Drawing.Point(12, 62);
|
||||
this.label3.Location = new System.Drawing.Point(7, 86);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(49, 15);
|
||||
this.label3.TabIndex = 3;
|
||||
this.label3.Text = "Pants ID";
|
||||
this.label3.Size = new System.Drawing.Size(76, 18);
|
||||
this.label3.TabIndex = 15;
|
||||
this.label3.Text = "Script Path";
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.Location = new System.Drawing.Point(7, 130);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(71, 16);
|
||||
this.label4.TabIndex = 16;
|
||||
this.label4.Text = "Script MD5";
|
||||
//
|
||||
// textBox1
|
||||
//
|
||||
this.textBox1.Location = new System.Drawing.Point(71, 6);
|
||||
this.textBox1.Location = new System.Drawing.Point(8, 20);
|
||||
this.textBox1.Name = "textBox1";
|
||||
this.textBox1.Size = new System.Drawing.Size(100, 20);
|
||||
this.textBox1.TabIndex = 4;
|
||||
this.textBox1.Size = new System.Drawing.Size(311, 20);
|
||||
this.textBox1.TabIndex = 17;
|
||||
this.textBox1.TextChanged += new System.EventHandler(this.TextBox1TextChanged);
|
||||
//
|
||||
// textBox2
|
||||
//
|
||||
this.textBox2.Location = new System.Drawing.Point(71, 32);
|
||||
this.textBox2.Location = new System.Drawing.Point(7, 63);
|
||||
this.textBox2.Name = "textBox2";
|
||||
this.textBox2.Size = new System.Drawing.Size(100, 20);
|
||||
this.textBox2.TabIndex = 5;
|
||||
this.textBox2.Size = new System.Drawing.Size(313, 20);
|
||||
this.textBox2.TabIndex = 18;
|
||||
this.textBox2.TextChanged += new System.EventHandler(this.TextBox2TextChanged);
|
||||
//
|
||||
// textBox3
|
||||
//
|
||||
this.textBox3.Location = new System.Drawing.Point(71, 59);
|
||||
this.textBox3.Location = new System.Drawing.Point(8, 107);
|
||||
this.textBox3.Name = "textBox3";
|
||||
this.textBox3.Size = new System.Drawing.Size(100, 20);
|
||||
this.textBox3.TabIndex = 6;
|
||||
this.textBox3.Size = new System.Drawing.Size(312, 20);
|
||||
this.textBox3.TabIndex = 19;
|
||||
this.textBox3.TextChanged += new System.EventHandler(this.TextBox3TextChanged);
|
||||
//
|
||||
// textBox4
|
||||
//
|
||||
this.textBox4.Location = new System.Drawing.Point(71, 86);
|
||||
this.textBox4.Location = new System.Drawing.Point(8, 149);
|
||||
this.textBox4.Name = "textBox4";
|
||||
this.textBox4.Size = new System.Drawing.Size(100, 20);
|
||||
this.textBox4.TabIndex = 7;
|
||||
this.textBox4.Size = new System.Drawing.Size(311, 20);
|
||||
this.textBox4.TabIndex = 20;
|
||||
this.textBox4.TextChanged += new System.EventHandler(this.TextBox4TextChanged);
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.Location = new System.Drawing.Point(12, 89);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(49, 15);
|
||||
this.label4.TabIndex = 8;
|
||||
this.label4.Text = "Face ID";
|
||||
//
|
||||
// CharacterCustomization_ClothingMenu
|
||||
// InfoEditor
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.SystemColors.ControlLightLight;
|
||||
this.ClientSize = new System.Drawing.Size(179, 113);
|
||||
this.Controls.Add(this.label4);
|
||||
this.ClientSize = new System.Drawing.Size(332, 247);
|
||||
this.Controls.Add(this.textBox4);
|
||||
this.Controls.Add(this.textBox3);
|
||||
this.Controls.Add(this.textBox2);
|
||||
this.Controls.Add(this.textBox1);
|
||||
this.Controls.Add(this.label4);
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.label1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||
this.Controls.Add(this.button3);
|
||||
this.Controls.Add(this.button2);
|
||||
this.Controls.Add(this.button1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.Name = "CharacterCustomization_ClothingMenu";
|
||||
this.Text = "Clothing";
|
||||
this.Load += new System.EventHandler(this.CharacterCustomization_ClothingMenuLoad);
|
||||
this.Name = "InfoEditor";
|
||||
this.Text = "Info Editor";
|
||||
this.Load += new System.EventHandler(this.ClientinfoCreatorLoad);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
}
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.TextBox textBox4;
|
||||
private System.Windows.Forms.TextBox textBox3;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.TextBox textBox2;
|
||||
private System.Windows.Forms.TextBox textBox1;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Button button3;
|
||||
private System.Windows.Forms.Button button2;
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.TextBox textBox1;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,142 @@
|
|||
/*
|
||||
* Created by SharpDevelop.
|
||||
* User: BITL-Gaming
|
||||
* Date: 11/28/2016
|
||||
* Time: 7:55 AM
|
||||
*
|
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers.
|
||||
*/
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
using System.IO;
|
||||
using System.Diagnostics;
|
||||
using System.Threading;
|
||||
|
||||
namespace RBXLegacyLauncher
|
||||
{
|
||||
/// <summary>
|
||||
/// Description of ClientinfoCreator.
|
||||
/// </summary>
|
||||
public partial class InfoEditor : Form
|
||||
{
|
||||
public InfoEditor()
|
||||
{
|
||||
//
|
||||
// The InitializeComponent() call is required for Windows Forms designer support.
|
||||
//
|
||||
InitializeComponent();
|
||||
|
||||
//
|
||||
// TODO: Add constructor code after the InitializeComponent() call.
|
||||
//
|
||||
}
|
||||
|
||||
void Button2Click(object sender, EventArgs e)
|
||||
{
|
||||
using (var ofd = new OpenFileDialog())
|
||||
{
|
||||
ofd.Filter = "Text files (*.txt)|*.txt";
|
||||
ofd.FilterIndex = 2;
|
||||
ofd.FileName = "info.txt";
|
||||
ofd.Title = "Load info.txt";
|
||||
if (ofd.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
string line1;
|
||||
string Decryptline1, Decryptline2, Decryptline3, Decryptline4;
|
||||
|
||||
using(StreamReader reader = new StreamReader(ofd.FileName))
|
||||
{
|
||||
line1 = reader.ReadLine();
|
||||
}
|
||||
|
||||
if (!SecurityFuncs.IsBase64String(line1))
|
||||
return;
|
||||
|
||||
string ConvertedLine = SecurityFuncs.Base64Decode(line1);
|
||||
string[] result = ConvertedLine.Split('|');
|
||||
Decryptline1 = SecurityFuncs.Base64Decode(result[0]);
|
||||
Decryptline2 = SecurityFuncs.Base64Decode(result[1]);
|
||||
Decryptline3 = SecurityFuncs.Base64Decode(result[2]);
|
||||
Decryptline4 = SecurityFuncs.Base64Decode(result[3]);
|
||||
|
||||
GlobalVars.InfoEditor_Version = Decryptline1;
|
||||
GlobalVars.InfoEditor_DefaultClient = Decryptline2;
|
||||
GlobalVars.InfoEditor_ScriptPath = Decryptline3;
|
||||
GlobalVars.InfoEditor_ScriptMD5 = Decryptline4;
|
||||
|
||||
textBox1.Text = GlobalVars.InfoEditor_Version;
|
||||
textBox2.Text = GlobalVars.InfoEditor_DefaultClient;
|
||||
textBox3.Text = GlobalVars.InfoEditor_ScriptPath;
|
||||
textBox4.Text = GlobalVars.InfoEditor_ScriptMD5.ToUpper();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Button1Click(object sender, EventArgs e)
|
||||
{
|
||||
using (var sfd = new SaveFileDialog())
|
||||
{
|
||||
sfd.Filter = "Text files (*.txt)|*.txt";
|
||||
sfd.FilterIndex = 2;
|
||||
sfd.FileName = "info.txt";
|
||||
sfd.Title = "Save info.txt";
|
||||
|
||||
if (sfd.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
string[] lines = {
|
||||
SecurityFuncs.Base64Encode(GlobalVars.InfoEditor_Version.ToString()),
|
||||
SecurityFuncs.Base64Encode(GlobalVars.InfoEditor_DefaultClient.ToString()),
|
||||
SecurityFuncs.Base64Encode(GlobalVars.InfoEditor_ScriptPath.ToString()),
|
||||
SecurityFuncs.Base64Encode(GlobalVars.InfoEditor_ScriptMD5.ToString())
|
||||
};
|
||||
File.WriteAllText(sfd.FileName, SecurityFuncs.Base64Encode(string.Join("|",lines)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ClientinfoCreatorLoad(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Button3Click(object sender, EventArgs e)
|
||||
{
|
||||
GlobalVars.InfoEditor_Version = "";
|
||||
GlobalVars.InfoEditor_DefaultClient = "";
|
||||
GlobalVars.InfoEditor_ScriptPath = "";
|
||||
GlobalVars.InfoEditor_ScriptMD5 = "";
|
||||
textBox1.Text = GlobalVars.InfoEditor_Version;
|
||||
textBox2.Text = GlobalVars.InfoEditor_DefaultClient;
|
||||
textBox3.Text = GlobalVars.InfoEditor_ScriptPath;
|
||||
textBox4.Text = GlobalVars.InfoEditor_ScriptMD5.ToUpper();
|
||||
}
|
||||
|
||||
void TextBox1TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
GlobalVars.InfoEditor_Version = textBox1.Text;
|
||||
}
|
||||
|
||||
void TextBox2TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
GlobalVars.InfoEditor_DefaultClient = textBox2.Text;
|
||||
}
|
||||
|
||||
void TextBox3TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
GlobalVars.InfoEditor_ScriptPath = textBox3.Text;
|
||||
}
|
||||
|
||||
void TextBox4TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
textBox4.Text = textBox4.Text.ToUpper();
|
||||
GlobalVars.InfoEditor_ScriptMD5 = textBox4.Text.ToUpper();
|
||||
}
|
||||
|
||||
void Button4Click(object sender, EventArgs e)
|
||||
{
|
||||
DocForm doc = new DocForm();
|
||||
doc.Show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -31,7 +31,7 @@ namespace RBXLegacyLauncher
|
|||
public static void ReadConfigValues(string cfgpath)
|
||||
{
|
||||
string line1;
|
||||
string Decryptline1, Decryptline2, Decryptline3, Decryptline4, Decryptline5, Decryptline6, Decryptline7, Decryptline8, Decryptline9, Decryptline10, Decryptline11, Decryptline12, Decryptline13, Decryptline14, Decryptline15, Decryptline16, Decryptline17, Decryptline18, Decryptline19, Decryptline20, Decryptline21, Decryptline22, Decryptline23, Decryptline24, Decryptline25, Decryptline26;
|
||||
string Decryptline1, Decryptline2, Decryptline3, Decryptline4, Decryptline5, Decryptline6, Decryptline7, Decryptline8, Decryptline9, Decryptline10, Decryptline11, Decryptline12, Decryptline13, Decryptline14, Decryptline15, Decryptline16, Decryptline17, Decryptline18, Decryptline19, Decryptline20, Decryptline21, Decryptline22, Decryptline23, Decryptline24, Decryptline25, Decryptline26, Decryptline27;
|
||||
|
||||
using(StreamReader reader = new StreamReader(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\config.txt"))
|
||||
{
|
||||
|
|
@ -69,6 +69,7 @@ namespace RBXLegacyLauncher
|
|||
Decryptline24 = SecurityFuncs.Base64Decode(result[23]);
|
||||
Decryptline25 = SecurityFuncs.Base64Decode(result[24]);
|
||||
Decryptline26 = SecurityFuncs.Base64Decode(result[25]);
|
||||
Decryptline27 = SecurityFuncs.Base64Decode(result[26]);
|
||||
|
||||
bool bline1 = Convert.ToBoolean(Decryptline1);
|
||||
GlobalVars.CloseOnLaunch = bline1;
|
||||
|
|
@ -83,7 +84,7 @@ namespace RBXLegacyLauncher
|
|||
GlobalVars.Map = Decryptline5;
|
||||
|
||||
int iline6 = Convert.ToInt32(Decryptline6);
|
||||
GlobalVars.RobloxPort = iline6;
|
||||
GlobalVars.ServerPort = iline6;
|
||||
|
||||
GlobalVars.Custom_Hat1ID_Offline = Decryptline7;
|
||||
GlobalVars.Custom_Hat2ID_Offline = Decryptline8;
|
||||
|
|
@ -116,7 +117,7 @@ namespace RBXLegacyLauncher
|
|||
|
||||
int iline22 = Convert.ToInt32(Decryptline22);
|
||||
GlobalVars.PlayerLimit = iline22;
|
||||
|
||||
|
||||
int iline23 = Convert.ToInt32(Decryptline23);
|
||||
GlobalVars.Custom_TShirt = iline23;
|
||||
int iline24 = Convert.ToInt32(Decryptline24);
|
||||
|
|
@ -125,6 +126,7 @@ namespace RBXLegacyLauncher
|
|||
GlobalVars.Custom_Pants = iline25;
|
||||
int iline26 = Convert.ToInt32(Decryptline26);
|
||||
GlobalVars.Custom_Face = iline26;
|
||||
GlobalVars.Custom_IconType = Decryptline27;
|
||||
}
|
||||
|
||||
public static void WriteConfigValues(string cfgpath)
|
||||
|
|
@ -135,7 +137,7 @@ namespace RBXLegacyLauncher
|
|||
SecurityFuncs.Base64Encode(GlobalVars.PlayerName.ToString()),
|
||||
SecurityFuncs.Base64Encode(GlobalVars.SelectedClient.ToString()),
|
||||
SecurityFuncs.Base64Encode(GlobalVars.Map.ToString()),
|
||||
SecurityFuncs.Base64Encode(GlobalVars.RobloxPort.ToString()),
|
||||
SecurityFuncs.Base64Encode(GlobalVars.ServerPort.ToString()),
|
||||
SecurityFuncs.Base64Encode(GlobalVars.Custom_Hat1ID_Offline.ToString()),
|
||||
SecurityFuncs.Base64Encode(GlobalVars.Custom_Hat2ID_Offline.ToString()),
|
||||
SecurityFuncs.Base64Encode(GlobalVars.Custom_Hat3ID_Offline.ToString()),
|
||||
|
|
@ -155,19 +157,33 @@ namespace RBXLegacyLauncher
|
|||
SecurityFuncs.Base64Encode(GlobalVars.Custom_TShirt.ToString()),
|
||||
SecurityFuncs.Base64Encode(GlobalVars.Custom_Shirt.ToString()),
|
||||
SecurityFuncs.Base64Encode(GlobalVars.Custom_Pants.ToString()),
|
||||
SecurityFuncs.Base64Encode(GlobalVars.Custom_Face.ToString())
|
||||
SecurityFuncs.Base64Encode(GlobalVars.Custom_Face.ToString()),
|
||||
SecurityFuncs.Base64Encode(GlobalVars.Custom_IconType.ToString())
|
||||
};
|
||||
File.WriteAllText(cfgpath, SecurityFuncs.Base64Encode(string.Join("|",lines)));
|
||||
}
|
||||
|
||||
public static void ResetConfigValues()
|
||||
{
|
||||
string line1;
|
||||
string Decryptline2;
|
||||
using(StreamReader reader = new StreamReader(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\info.txt"))
|
||||
{
|
||||
line1 = reader.ReadLine();
|
||||
}
|
||||
|
||||
if (!SecurityFuncs.IsBase64String(line1))
|
||||
return;
|
||||
string ConvertedLine = SecurityFuncs.Base64Decode(line1);
|
||||
string[] result = ConvertedLine.Split('|');
|
||||
Decryptline2 = SecurityFuncs.Base64Decode(result[1]);
|
||||
|
||||
GlobalVars.CloseOnLaunch = false;
|
||||
GlobalVars.UserID = 0;
|
||||
GlobalVars.PlayerName = "Player";
|
||||
GlobalVars.SelectedClient = "Mid-2008";
|
||||
GlobalVars.SelectedClient = Decryptline2;
|
||||
GlobalVars.Map = "Baseplate.rbxl";
|
||||
GlobalVars.RobloxPort = 53640;
|
||||
GlobalVars.ServerPort = 53640;
|
||||
GlobalVars.Custom_Hat1ID_Offline = "NoHat.rbxm";
|
||||
GlobalVars.Custom_Hat2ID_Offline = "NoHat.rbxm";
|
||||
GlobalVars.Custom_Hat3ID_Offline = "NoHat.rbxm";
|
||||
|
|
@ -188,6 +204,7 @@ namespace RBXLegacyLauncher
|
|||
GlobalVars.Custom_Shirt = 0;
|
||||
GlobalVars.Custom_Pants = 0;
|
||||
GlobalVars.Custom_Face = 0;
|
||||
GlobalVars.Custom_IconType = "NBC";
|
||||
}
|
||||
|
||||
public static void ReadClientValues(string clientpath)
|
||||
|
|
@ -274,18 +291,5 @@ namespace RBXLegacyLauncher
|
|||
//2147483647 is max id.
|
||||
GlobalVars.UserID = randomID;
|
||||
}
|
||||
|
||||
public static bool IsProcessOpen(string name)
|
||||
{
|
||||
foreach (Process clsProcess in Process.GetProcesses())
|
||||
{
|
||||
if (clsProcess.ProcessName.Contains(name))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,26 +85,32 @@ namespace RBXLegacyLauncher
|
|||
string HatIDOffline3 = GlobalVars.Custom_Hat3ID_Offline;
|
||||
if (GlobalVars.UsesPlayerName == true && GlobalVars.UsesID == true)
|
||||
{
|
||||
args = "-script " + quote + "dofile('" + GlobalVars.DefaultScript + "'); _G.SetRBXLegacyVersion('" + GlobalVars.SelectedClientVersion + "'); _G.CSConnect(" + GlobalVars.UserID + ",'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'" + GlobalVars.PlayerName + "','" + HatIDOffline1 + "','" + HatIDOffline2 + "','" + HatIDOffline3 + "'," + GlobalVars.HeadColorID + "," + GlobalVars.TorsoColorID + "," + GlobalVars.LeftArmColorID + "," + GlobalVars.RightArmColorID + "," + GlobalVars.LeftLegColorID + "," + GlobalVars.RightLegColorID + ",'" + GlobalVars.Custom_TShirt + "','" + GlobalVars.Custom_Shirt + "','" + GlobalVars.Custom_Pants + "','" + GlobalVars.Custom_Face + "');" + quote;
|
||||
args = "-script " + quote + "dofile('" + GlobalVars.DefaultScript + "'); _G.SetRBXLegacyVersion('" + GlobalVars.SelectedClientVersion + "'); _G.CSConnect(" + GlobalVars.UserID + ",'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'" + GlobalVars.PlayerName + "','" + HatIDOffline1 + "','" + HatIDOffline2 + "','" + HatIDOffline3 + "'," + GlobalVars.HeadColorID + "," + GlobalVars.TorsoColorID + "," + GlobalVars.LeftArmColorID + "," + GlobalVars.RightArmColorID + "," + GlobalVars.LeftLegColorID + "," + GlobalVars.RightLegColorID + ",'" + GlobalVars.Custom_TShirt + "','" + GlobalVars.Custom_Shirt + "','" + GlobalVars.Custom_Pants + "','" + GlobalVars.Custom_Face + "','" + GlobalVars.Custom_IconType + "');" + quote;
|
||||
}
|
||||
else if (GlobalVars.UsesPlayerName == false && GlobalVars.UsesID == true)
|
||||
{
|
||||
args = "-script " + quote + "dofile('" + GlobalVars.DefaultScript + "'); _G.SetRBXLegacyVersion('" + GlobalVars.SelectedClientVersion + "'); _G.CSConnect(" + GlobalVars.UserID + ",'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'Player','" + HatIDOffline1 + "','" + HatIDOffline2 + "','" + HatIDOffline3 + "'," + GlobalVars.HeadColorID + "," + GlobalVars.TorsoColorID + "," + GlobalVars.LeftArmColorID + "," + GlobalVars.RightArmColorID + "," + GlobalVars.LeftLegColorID + "," + GlobalVars.RightLegColorID + ",'" + GlobalVars.Custom_TShirt + "','" + GlobalVars.Custom_Shirt + "','" + GlobalVars.Custom_Pants + "','" + GlobalVars.Custom_Face + "');" + quote;
|
||||
args = "-script " + quote + "dofile('" + GlobalVars.DefaultScript + "'); _G.SetRBXLegacyVersion('" + GlobalVars.SelectedClientVersion + "'); _G.CSConnect(" + GlobalVars.UserID + ",'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'Player','" + HatIDOffline1 + "','" + HatIDOffline2 + "','" + HatIDOffline3 + "'," + GlobalVars.HeadColorID + "," + GlobalVars.TorsoColorID + "," + GlobalVars.LeftArmColorID + "," + GlobalVars.RightArmColorID + "," + GlobalVars.LeftLegColorID + "," + GlobalVars.RightLegColorID + ",'" + GlobalVars.Custom_TShirt + "','" + GlobalVars.Custom_Shirt + "','" + GlobalVars.Custom_Pants + "','" + GlobalVars.Custom_Face + "','" + GlobalVars.Custom_IconType + "');" + quote;
|
||||
}
|
||||
else if (GlobalVars.UsesPlayerName == true && GlobalVars.UsesID == false)
|
||||
{
|
||||
args = "-script " + quote + "dofile('" + GlobalVars.DefaultScript + "'); _G.SetRBXLegacyVersion('" + GlobalVars.SelectedClientVersion + "'); _G.CSConnect(0,'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'" + GlobalVars.PlayerName + "','" + HatIDOffline1 + "','" + HatIDOffline2 + "','" + HatIDOffline3 + "'," + GlobalVars.HeadColorID + "," + GlobalVars.TorsoColorID + "," + GlobalVars.LeftArmColorID + "," + GlobalVars.RightArmColorID + "," + GlobalVars.LeftLegColorID + "," + GlobalVars.RightLegColorID + ",'" + GlobalVars.Custom_TShirt + "','" + GlobalVars.Custom_Shirt + "','" + GlobalVars.Custom_Pants + "','" + GlobalVars.Custom_Face + "');" + quote;
|
||||
args = "-script " + quote + "dofile('" + GlobalVars.DefaultScript + "'); _G.SetRBXLegacyVersion('" + GlobalVars.SelectedClientVersion + "'); _G.CSConnect(0,'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'" + GlobalVars.PlayerName + "','" + HatIDOffline1 + "','" + HatIDOffline2 + "','" + HatIDOffline3 + "'," + GlobalVars.HeadColorID + "," + GlobalVars.TorsoColorID + "," + GlobalVars.LeftArmColorID + "," + GlobalVars.RightArmColorID + "," + GlobalVars.LeftLegColorID + "," + GlobalVars.RightLegColorID + ",'" + GlobalVars.Custom_TShirt + "','" + GlobalVars.Custom_Shirt + "','" + GlobalVars.Custom_Pants + "','" + GlobalVars.Custom_Face + "','" + GlobalVars.Custom_IconType + "');" + quote;
|
||||
}
|
||||
else if (GlobalVars.UsesPlayerName == false && GlobalVars.UsesID == false)
|
||||
{
|
||||
args = "-script " + quote + "dofile('" + GlobalVars.DefaultScript + "'); _G.SetRBXLegacyVersion('" + GlobalVars.SelectedClientVersion + "'); _G.CSConnect(0,'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'Player','" + HatIDOffline1 + "','" + HatIDOffline2 + "','" + HatIDOffline3 + "'," + GlobalVars.HeadColorID + "," + GlobalVars.TorsoColorID + "," + GlobalVars.LeftArmColorID + "," + GlobalVars.RightArmColorID + "," + GlobalVars.LeftLegColorID + "," + GlobalVars.RightLegColorID + ",'" + GlobalVars.Custom_TShirt + "','" + GlobalVars.Custom_Shirt + "','" + GlobalVars.Custom_Pants + "','" + GlobalVars.Custom_Face + "');" + quote;
|
||||
args = "-script " + quote + "dofile('" + GlobalVars.DefaultScript + "'); _G.SetRBXLegacyVersion('" + GlobalVars.SelectedClientVersion + "'); _G.CSConnect(0,'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'Player','" + HatIDOffline1 + "','" + HatIDOffline2 + "','" + HatIDOffline3 + "'," + GlobalVars.HeadColorID + "," + GlobalVars.TorsoColorID + "," + GlobalVars.LeftArmColorID + "," + GlobalVars.RightArmColorID + "," + GlobalVars.LeftLegColorID + "," + GlobalVars.RightLegColorID + ",'" + GlobalVars.Custom_TShirt + "','" + GlobalVars.Custom_Shirt + "','" + GlobalVars.Custom_Pants + "','" + GlobalVars.Custom_Face + "','" + GlobalVars.Custom_IconType + "');" + quote;
|
||||
}
|
||||
try
|
||||
{
|
||||
if (SecurityFuncs.checkClientMD5(client) == true)
|
||||
{
|
||||
Process.Start(rbxexe, args);
|
||||
this.Close();
|
||||
Process pclient = new Process();
|
||||
pclient.StartInfo.FileName = rbxexe;
|
||||
pclient.StartInfo.Arguments = args;
|
||||
pclient.EnableRaisingEvents = true;
|
||||
pclient.Exited += new EventHandler(ClientExited);
|
||||
pclient.Start();
|
||||
this.ShowInTaskbar = false;
|
||||
this.WindowState = FormWindowState.Minimized;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -122,6 +128,27 @@ namespace RBXLegacyLauncher
|
|||
}
|
||||
}
|
||||
|
||||
void ClientExited(object sender, EventArgs e)
|
||||
{
|
||||
Process[] sudp = Process.GetProcessesByName("sudppipe");
|
||||
if (sudp != null)
|
||||
{
|
||||
foreach (var process in sudp)
|
||||
{
|
||||
process.Kill();
|
||||
}
|
||||
}
|
||||
|
||||
Process[] self = Process.GetProcessesByName("RBXLegacyLauncher");
|
||||
if (self != null)
|
||||
{
|
||||
foreach (var process in self)
|
||||
{
|
||||
process.Kill();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void CheckIfFinished(object state)
|
||||
{
|
||||
if (GlobalVars.ReadyToLaunch == false)
|
||||
|
|
@ -137,7 +164,12 @@ namespace RBXLegacyLauncher
|
|||
string port = SecurityFuncs.Base64Decode(SplitArg[1]);
|
||||
string client = SecurityFuncs.Base64Decode(SplitArg[2]);
|
||||
label1.Text = "Launching " + client + " Game...";
|
||||
Process.Start("sudppipe.exe", "-p " + ip + " " + port + " " + port);
|
||||
Process sudp = new Process();
|
||||
sudp.StartInfo.FileName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\sudppipe.exe";
|
||||
sudp.StartInfo.Arguments = "-p " + ip + " " + port + " " + port;
|
||||
sudp.StartInfo.UseShellExecute = false;
|
||||
sudp.StartInfo.CreateNoWindow = true;
|
||||
sudp.Start();
|
||||
StartGame();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,6 +40,9 @@ namespace RBXLegacyLauncher
|
|||
this.pictureBox1 = new System.Windows.Forms.PictureBox();
|
||||
this.tabControl1 = new System.Windows.Forms.TabControl();
|
||||
this.tabPage1 = new System.Windows.Forms.TabPage();
|
||||
this.button11 = new System.Windows.Forms.Button();
|
||||
this.label35 = new System.Windows.Forms.Label();
|
||||
this.textBox4 = new System.Windows.Forms.TextBox();
|
||||
this.label42 = new System.Windows.Forms.Label();
|
||||
this.button19 = new System.Windows.Forms.Button();
|
||||
this.button10 = new System.Windows.Forms.Button();
|
||||
|
|
@ -50,6 +53,10 @@ namespace RBXLegacyLauncher
|
|||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.textBox1 = new System.Windows.Forms.TextBox();
|
||||
this.tabPage2 = new System.Windows.Forms.TabPage();
|
||||
this.label45 = new System.Windows.Forms.Label();
|
||||
this.textBox7 = new System.Windows.Forms.TextBox();
|
||||
this.textBox3 = new System.Windows.Forms.TextBox();
|
||||
this.label29 = new System.Windows.Forms.Label();
|
||||
this.label40 = new System.Windows.Forms.Label();
|
||||
this.button20 = new System.Windows.Forms.Button();
|
||||
this.button18 = new System.Windows.Forms.Button();
|
||||
|
|
@ -80,21 +87,6 @@ namespace RBXLegacyLauncher
|
|||
this.listBox3 = new System.Windows.Forms.ListBox();
|
||||
this.label21 = new System.Windows.Forms.Label();
|
||||
this.label14 = new System.Windows.Forms.Label();
|
||||
this.tabPage5 = new System.Windows.Forms.TabPage();
|
||||
this.textBox3 = new System.Windows.Forms.TextBox();
|
||||
this.label29 = new System.Windows.Forms.Label();
|
||||
this.button11 = new System.Windows.Forms.Button();
|
||||
this.button9 = new System.Windows.Forms.Button();
|
||||
this.button8 = new System.Windows.Forms.Button();
|
||||
this.button7 = new System.Windows.Forms.Button();
|
||||
this.label35 = new System.Windows.Forms.Label();
|
||||
this.textBox4 = new System.Windows.Forms.TextBox();
|
||||
this.label34 = new System.Windows.Forms.Label();
|
||||
this.label12 = new System.Windows.Forms.Label();
|
||||
this.label33 = new System.Windows.Forms.Label();
|
||||
this.label31 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.checkBox3 = new System.Windows.Forms.CheckBox();
|
||||
this.tabPage7 = new System.Windows.Forms.TabPage();
|
||||
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
|
||||
this.tabPage8 = new System.Windows.Forms.TabPage();
|
||||
|
|
@ -107,6 +99,10 @@ namespace RBXLegacyLauncher
|
|||
this.label7 = new System.Windows.Forms.Label();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.button21 = new System.Windows.Forms.Button();
|
||||
this.button9 = new System.Windows.Forms.Button();
|
||||
this.button8 = new System.Windows.Forms.Button();
|
||||
this.checkBox3 = new System.Windows.Forms.CheckBox();
|
||||
this.checkBox1 = new System.Windows.Forms.CheckBox();
|
||||
this.button3 = new System.Windows.Forms.Button();
|
||||
this.label13 = new System.Windows.Forms.Label();
|
||||
|
|
@ -121,18 +117,13 @@ namespace RBXLegacyLauncher
|
|||
this.label26 = new System.Windows.Forms.Label();
|
||||
this.label27 = new System.Windows.Forms.Label();
|
||||
this.label28 = new System.Windows.Forms.Label();
|
||||
this.button6 = new System.Windows.Forms.Button();
|
||||
this.textBox5 = new System.Windows.Forms.TextBox();
|
||||
this.label43 = new System.Windows.Forms.Label();
|
||||
this.label44 = new System.Windows.Forms.Label();
|
||||
this.button21 = new System.Windows.Forms.Button();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
|
||||
this.tabControl1.SuspendLayout();
|
||||
this.tabPage1.SuspendLayout();
|
||||
this.tabPage2.SuspendLayout();
|
||||
this.tabPage3.SuspendLayout();
|
||||
this.tabPage6.SuspendLayout();
|
||||
this.tabPage5.SuspendLayout();
|
||||
this.tabPage7.SuspendLayout();
|
||||
this.tabPage8.SuspendLayout();
|
||||
this.tabPage4.SuspendLayout();
|
||||
|
|
@ -159,7 +150,6 @@ namespace RBXLegacyLauncher
|
|||
this.tabControl1.Controls.Add(this.tabPage2);
|
||||
this.tabControl1.Controls.Add(this.tabPage3);
|
||||
this.tabControl1.Controls.Add(this.tabPage6);
|
||||
this.tabControl1.Controls.Add(this.tabPage5);
|
||||
this.tabControl1.Controls.Add(this.tabPage7);
|
||||
this.tabControl1.Controls.Add(this.tabPage8);
|
||||
this.tabControl1.Controls.Add(this.tabPage4);
|
||||
|
|
@ -175,6 +165,9 @@ namespace RBXLegacyLauncher
|
|||
//
|
||||
// tabPage1
|
||||
//
|
||||
this.tabPage1.Controls.Add(this.button11);
|
||||
this.tabPage1.Controls.Add(this.label35);
|
||||
this.tabPage1.Controls.Add(this.textBox4);
|
||||
this.tabPage1.Controls.Add(this.label42);
|
||||
this.tabPage1.Controls.Add(this.button19);
|
||||
this.tabPage1.Controls.Add(this.button10);
|
||||
|
|
@ -194,6 +187,35 @@ namespace RBXLegacyLauncher
|
|||
this.tabPage1.ToolTipText = "Join a server via IP Address";
|
||||
this.tabPage1.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// button11
|
||||
//
|
||||
this.button11.Location = new System.Drawing.Point(213, 47);
|
||||
this.button11.Name = "button11";
|
||||
this.button11.Size = new System.Drawing.Size(177, 20);
|
||||
this.button11.TabIndex = 41;
|
||||
this.button11.Text = "SAVE PORT";
|
||||
this.button11.UseVisualStyleBackColor = true;
|
||||
this.button11.Click += new System.EventHandler(this.Button11Click);
|
||||
//
|
||||
// label35
|
||||
//
|
||||
this.label35.Location = new System.Drawing.Point(268, 5);
|
||||
this.label35.Name = "label35";
|
||||
this.label35.Size = new System.Drawing.Size(72, 16);
|
||||
this.label35.TabIndex = 40;
|
||||
this.label35.Text = "Server Port";
|
||||
this.label35.TextAlign = System.Drawing.ContentAlignment.TopCenter;
|
||||
//
|
||||
// textBox4
|
||||
//
|
||||
this.textBox4.Location = new System.Drawing.Point(214, 24);
|
||||
this.textBox4.Name = "textBox4";
|
||||
this.textBox4.Size = new System.Drawing.Size(176, 20);
|
||||
this.textBox4.TabIndex = 39;
|
||||
this.textBox4.Text = "53640";
|
||||
this.textBox4.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
this.textBox4.TextChanged += new System.EventHandler(this.TextBox4TextChanged);
|
||||
//
|
||||
// label42
|
||||
//
|
||||
this.label42.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
|
||||
|
|
@ -206,7 +228,7 @@ namespace RBXLegacyLauncher
|
|||
//
|
||||
this.button19.Location = new System.Drawing.Point(213, 217);
|
||||
this.button19.Name = "button19";
|
||||
this.button19.Size = new System.Drawing.Size(88, 54);
|
||||
this.button19.Size = new System.Drawing.Size(174, 54);
|
||||
this.button19.TabIndex = 16;
|
||||
this.button19.Text = "PLAY SOLO";
|
||||
this.button19.UseVisualStyleBackColor = true;
|
||||
|
|
@ -214,11 +236,11 @@ namespace RBXLegacyLauncher
|
|||
//
|
||||
// button10
|
||||
//
|
||||
this.button10.Location = new System.Drawing.Point(86, 47);
|
||||
this.button10.Location = new System.Drawing.Point(16, 47);
|
||||
this.button10.Name = "button10";
|
||||
this.button10.Size = new System.Drawing.Size(241, 20);
|
||||
this.button10.Size = new System.Drawing.Size(177, 20);
|
||||
this.button10.TabIndex = 15;
|
||||
this.button10.Text = "ADD SERVER TO SAVED SERVERS LIST";
|
||||
this.button10.Text = "SAVE SERVER";
|
||||
this.button10.UseVisualStyleBackColor = true;
|
||||
this.button10.Click += new System.EventHandler(this.Button10Click);
|
||||
//
|
||||
|
|
@ -258,9 +280,9 @@ namespace RBXLegacyLauncher
|
|||
//
|
||||
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.button1.Location = new System.Drawing.Point(111, 217);
|
||||
this.button1.Location = new System.Drawing.Point(13, 217);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(88, 54);
|
||||
this.button1.Size = new System.Drawing.Size(186, 54);
|
||||
this.button1.TabIndex = 3;
|
||||
this.button1.Text = "JOIN SERVER";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
|
|
@ -270,9 +292,9 @@ namespace RBXLegacyLauncher
|
|||
//
|
||||
this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.label3.Location = new System.Drawing.Point(131, 5);
|
||||
this.label3.Location = new System.Drawing.Point(43, 5);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(148, 13);
|
||||
this.label3.Size = new System.Drawing.Size(128, 13);
|
||||
this.label3.TabIndex = 1;
|
||||
this.label3.Text = "Server IP Address";
|
||||
this.label3.TextAlign = System.Drawing.ContentAlignment.TopCenter;
|
||||
|
|
@ -281,9 +303,9 @@ namespace RBXLegacyLauncher
|
|||
//
|
||||
this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.textBox1.Location = new System.Drawing.Point(86, 21);
|
||||
this.textBox1.Location = new System.Drawing.Point(16, 24);
|
||||
this.textBox1.Name = "textBox1";
|
||||
this.textBox1.Size = new System.Drawing.Size(241, 20);
|
||||
this.textBox1.Size = new System.Drawing.Size(177, 20);
|
||||
this.textBox1.TabIndex = 0;
|
||||
this.textBox1.Text = "localhost";
|
||||
this.textBox1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
|
|
@ -291,6 +313,10 @@ namespace RBXLegacyLauncher
|
|||
//
|
||||
// tabPage2
|
||||
//
|
||||
this.tabPage2.Controls.Add(this.label45);
|
||||
this.tabPage2.Controls.Add(this.textBox7);
|
||||
this.tabPage2.Controls.Add(this.textBox3);
|
||||
this.tabPage2.Controls.Add(this.label29);
|
||||
this.tabPage2.Controls.Add(this.label40);
|
||||
this.tabPage2.Controls.Add(this.button20);
|
||||
this.tabPage2.Controls.Add(this.button18);
|
||||
|
|
@ -309,6 +335,44 @@ namespace RBXLegacyLauncher
|
|||
this.tabPage2.ToolTipText = "Start a server for other players to play";
|
||||
this.tabPage2.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// label45
|
||||
//
|
||||
this.label45.Location = new System.Drawing.Point(208, 131);
|
||||
this.label45.Name = "label45";
|
||||
this.label45.Size = new System.Drawing.Size(191, 18);
|
||||
this.label45.TabIndex = 45;
|
||||
this.label45.Text = "Port";
|
||||
this.label45.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// textBox7
|
||||
//
|
||||
this.textBox7.Location = new System.Drawing.Point(203, 152);
|
||||
this.textBox7.Name = "textBox7";
|
||||
this.textBox7.Size = new System.Drawing.Size(196, 20);
|
||||
this.textBox7.TabIndex = 44;
|
||||
this.textBox7.Text = "53640";
|
||||
this.textBox7.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
this.textBox7.TextChanged += new System.EventHandler(this.TextBox7TextChanged);
|
||||
//
|
||||
// textBox3
|
||||
//
|
||||
this.textBox3.Location = new System.Drawing.Point(6, 152);
|
||||
this.textBox3.Name = "textBox3";
|
||||
this.textBox3.Size = new System.Drawing.Size(191, 20);
|
||||
this.textBox3.TabIndex = 43;
|
||||
this.textBox3.Text = "12";
|
||||
this.textBox3.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
this.textBox3.TextChanged += new System.EventHandler(this.TextBox3TextChanged);
|
||||
//
|
||||
// label29
|
||||
//
|
||||
this.label29.Location = new System.Drawing.Point(6, 131);
|
||||
this.label29.Name = "label29";
|
||||
this.label29.Size = new System.Drawing.Size(196, 18);
|
||||
this.label29.TabIndex = 42;
|
||||
this.label29.Text = "Player Limit";
|
||||
this.label29.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// label40
|
||||
//
|
||||
this.label40.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
|
||||
|
|
@ -341,9 +405,9 @@ namespace RBXLegacyLauncher
|
|||
//
|
||||
this.label32.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.label32.ForeColor = System.Drawing.Color.Red;
|
||||
this.label32.Location = new System.Drawing.Point(12, 171);
|
||||
this.label32.Location = new System.Drawing.Point(12, 177);
|
||||
this.label32.Name = "label32";
|
||||
this.label32.Size = new System.Drawing.Size(378, 53);
|
||||
this.label32.Size = new System.Drawing.Size(378, 47);
|
||||
this.label32.TabIndex = 19;
|
||||
this.label32.Text = "NOTE: Be sure you have port forwarded the server\'s port before you start a public" +
|
||||
" server. This port can be found and changed in the OPTIONS tab.";
|
||||
|
|
@ -362,7 +426,7 @@ namespace RBXLegacyLauncher
|
|||
//
|
||||
this.label19.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.label19.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
|
||||
this.label19.Location = new System.Drawing.Point(6, 165);
|
||||
this.label19.Location = new System.Drawing.Point(6, 175);
|
||||
this.label19.Name = "label19";
|
||||
this.label19.Size = new System.Drawing.Size(393, 2);
|
||||
this.label19.TabIndex = 13;
|
||||
|
|
@ -383,7 +447,7 @@ namespace RBXLegacyLauncher
|
|||
//
|
||||
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.label1.Location = new System.Drawing.Point(152, 3);
|
||||
this.label1.Location = new System.Drawing.Point(162, 3);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(87, 16);
|
||||
this.label1.TabIndex = 1;
|
||||
|
|
@ -398,7 +462,7 @@ namespace RBXLegacyLauncher
|
|||
this.listBox1.FormattingEnabled = true;
|
||||
this.listBox1.Location = new System.Drawing.Point(6, 22);
|
||||
this.listBox1.Name = "listBox1";
|
||||
this.listBox1.Size = new System.Drawing.Size(393, 134);
|
||||
this.listBox1.Size = new System.Drawing.Size(393, 108);
|
||||
this.listBox1.TabIndex = 0;
|
||||
this.listBox1.SelectedIndexChanged += new System.EventHandler(this.ListBox1SelectedIndexChanged);
|
||||
//
|
||||
|
|
@ -556,31 +620,35 @@ namespace RBXLegacyLauncher
|
|||
//
|
||||
this.label38.Location = new System.Drawing.Point(213, 261);
|
||||
this.label38.Name = "label38";
|
||||
this.label38.Size = new System.Drawing.Size(120, 20);
|
||||
this.label38.Size = new System.Drawing.Size(177, 20);
|
||||
this.label38.TabIndex = 7;
|
||||
this.label38.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// label39
|
||||
//
|
||||
this.label39.Location = new System.Drawing.Point(213, 249);
|
||||
this.label39.Name = "label39";
|
||||
this.label39.Size = new System.Drawing.Size(149, 12);
|
||||
this.label39.Size = new System.Drawing.Size(186, 12);
|
||||
this.label39.TabIndex = 6;
|
||||
this.label39.Text = "CURRENT SERVER PORT:";
|
||||
this.label39.TextAlign = System.Drawing.ContentAlignment.TopCenter;
|
||||
//
|
||||
// label37
|
||||
//
|
||||
this.label37.Location = new System.Drawing.Point(6, 261);
|
||||
this.label37.Name = "label37";
|
||||
this.label37.Size = new System.Drawing.Size(120, 20);
|
||||
this.label37.Size = new System.Drawing.Size(186, 20);
|
||||
this.label37.TabIndex = 5;
|
||||
this.label37.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// label36
|
||||
//
|
||||
this.label36.Location = new System.Drawing.Point(6, 249);
|
||||
this.label36.Name = "label36";
|
||||
this.label36.Size = new System.Drawing.Size(136, 12);
|
||||
this.label36.Size = new System.Drawing.Size(186, 12);
|
||||
this.label36.TabIndex = 4;
|
||||
this.label36.Text = "CURRENT SERVER IP:";
|
||||
this.label36.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// listBox4
|
||||
//
|
||||
|
|
@ -616,160 +684,6 @@ namespace RBXLegacyLauncher
|
|||
this.label14.TabIndex = 0;
|
||||
this.label14.Text = "SERVERS";
|
||||
//
|
||||
// tabPage5
|
||||
//
|
||||
this.tabPage5.Controls.Add(this.button21);
|
||||
this.tabPage5.Controls.Add(this.label44);
|
||||
this.tabPage5.Controls.Add(this.label43);
|
||||
this.tabPage5.Controls.Add(this.textBox3);
|
||||
this.tabPage5.Controls.Add(this.label29);
|
||||
this.tabPage5.Controls.Add(this.button11);
|
||||
this.tabPage5.Controls.Add(this.button9);
|
||||
this.tabPage5.Controls.Add(this.button8);
|
||||
this.tabPage5.Controls.Add(this.button7);
|
||||
this.tabPage5.Controls.Add(this.label35);
|
||||
this.tabPage5.Controls.Add(this.textBox4);
|
||||
this.tabPage5.Controls.Add(this.label34);
|
||||
this.tabPage5.Controls.Add(this.label12);
|
||||
this.tabPage5.Controls.Add(this.label33);
|
||||
this.tabPage5.Controls.Add(this.label31);
|
||||
this.tabPage5.Controls.Add(this.label2);
|
||||
this.tabPage5.Controls.Add(this.checkBox3);
|
||||
this.tabPage5.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPage5.Name = "tabPage5";
|
||||
this.tabPage5.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabPage5.Size = new System.Drawing.Size(405, 284);
|
||||
this.tabPage5.TabIndex = 5;
|
||||
this.tabPage5.Text = "OPTIONS";
|
||||
this.tabPage5.ToolTipText = "Configure specific aspects of your server, launcher, and player appearance";
|
||||
this.tabPage5.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// textBox3
|
||||
//
|
||||
this.textBox3.Location = new System.Drawing.Point(201, 167);
|
||||
this.textBox3.Name = "textBox3";
|
||||
this.textBox3.Size = new System.Drawing.Size(100, 20);
|
||||
this.textBox3.TabIndex = 41;
|
||||
this.textBox3.TextChanged += new System.EventHandler(this.TextBox3TextChanged);
|
||||
//
|
||||
// label29
|
||||
//
|
||||
this.label29.Location = new System.Drawing.Point(134, 170);
|
||||
this.label29.Name = "label29";
|
||||
this.label29.Size = new System.Drawing.Size(61, 18);
|
||||
this.label29.TabIndex = 40;
|
||||
this.label29.Text = "Player Limit";
|
||||
//
|
||||
// button11
|
||||
//
|
||||
this.button11.Location = new System.Drawing.Point(95, 143);
|
||||
this.button11.Name = "button11";
|
||||
this.button11.Size = new System.Drawing.Size(212, 20);
|
||||
this.button11.TabIndex = 38;
|
||||
this.button11.Text = "SAVE PORT TO SAVED PORTS LIST";
|
||||
this.button11.UseVisualStyleBackColor = true;
|
||||
this.button11.Click += new System.EventHandler(this.Button11Click);
|
||||
//
|
||||
// button9
|
||||
//
|
||||
this.button9.Location = new System.Drawing.Point(54, 212);
|
||||
this.button9.Name = "button9";
|
||||
this.button9.Size = new System.Drawing.Size(100, 33);
|
||||
this.button9.TabIndex = 37;
|
||||
this.button9.Text = "Reset Config";
|
||||
this.button9.UseVisualStyleBackColor = true;
|
||||
this.button9.Click += new System.EventHandler(this.Button9Click);
|
||||
//
|
||||
// button8
|
||||
//
|
||||
this.button8.Location = new System.Drawing.Point(96, 19);
|
||||
this.button8.Name = "button8";
|
||||
this.button8.Size = new System.Drawing.Size(212, 52);
|
||||
this.button8.TabIndex = 35;
|
||||
this.button8.Text = "Customize Character";
|
||||
this.button8.UseVisualStyleBackColor = true;
|
||||
this.button8.Click += new System.EventHandler(this.Button8Click);
|
||||
//
|
||||
// button7
|
||||
//
|
||||
this.button7.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.button7.Location = new System.Drawing.Point(54, 248);
|
||||
this.button7.Name = "button7";
|
||||
this.button7.Size = new System.Drawing.Size(100, 33);
|
||||
this.button7.TabIndex = 34;
|
||||
this.button7.Text = "Save Config";
|
||||
this.button7.UseVisualStyleBackColor = true;
|
||||
this.button7.Click += new System.EventHandler(this.Button7Click);
|
||||
//
|
||||
// label35
|
||||
//
|
||||
this.label35.Location = new System.Drawing.Point(83, 103);
|
||||
this.label35.Name = "label35";
|
||||
this.label35.Size = new System.Drawing.Size(234, 16);
|
||||
this.label35.TabIndex = 33;
|
||||
this.label35.Text = "PORT (Used for starting and joining servers)";
|
||||
this.label35.TextAlign = System.Drawing.ContentAlignment.TopCenter;
|
||||
//
|
||||
// textBox4
|
||||
//
|
||||
this.textBox4.Location = new System.Drawing.Point(96, 122);
|
||||
this.textBox4.Name = "textBox4";
|
||||
this.textBox4.Size = new System.Drawing.Size(211, 20);
|
||||
this.textBox4.TabIndex = 32;
|
||||
this.textBox4.Text = "53640";
|
||||
this.textBox4.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
this.textBox4.TextChanged += new System.EventHandler(this.TextBox4TextChanged);
|
||||
//
|
||||
// label34
|
||||
//
|
||||
this.label34.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
|
||||
this.label34.Location = new System.Drawing.Point(14, 194);
|
||||
this.label34.Name = "label34";
|
||||
this.label34.Size = new System.Drawing.Size(378, 2);
|
||||
this.label34.TabIndex = 31;
|
||||
//
|
||||
// label12
|
||||
//
|
||||
this.label12.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
|
||||
this.label12.Location = new System.Drawing.Point(14, 80);
|
||||
this.label12.Name = "label12";
|
||||
this.label12.Size = new System.Drawing.Size(378, 2);
|
||||
this.label12.TabIndex = 30;
|
||||
//
|
||||
// label33
|
||||
//
|
||||
this.label33.Location = new System.Drawing.Point(293, 196);
|
||||
this.label33.Name = "label33";
|
||||
this.label33.Size = new System.Drawing.Size(79, 13);
|
||||
this.label33.TabIndex = 29;
|
||||
this.label33.Text = "LAN OPTIONS";
|
||||
//
|
||||
// label31
|
||||
//
|
||||
this.label31.Location = new System.Drawing.Point(150, 86);
|
||||
this.label31.Name = "label31";
|
||||
this.label31.Size = new System.Drawing.Size(110, 14);
|
||||
this.label31.TabIndex = 28;
|
||||
this.label31.Text = "SERVER SETTINGS";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.Location = new System.Drawing.Point(95, 3);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(222, 13);
|
||||
this.label2.TabIndex = 27;
|
||||
this.label2.Text = "PLAYER OPTIONS AND CUSTOMIZATION";
|
||||
//
|
||||
// checkBox3
|
||||
//
|
||||
this.checkBox3.Location = new System.Drawing.Point(282, 212);
|
||||
this.checkBox3.Name = "checkBox3";
|
||||
this.checkBox3.Size = new System.Drawing.Size(108, 18);
|
||||
this.checkBox3.TabIndex = 22;
|
||||
this.checkBox3.Text = "Local Play Mode";
|
||||
this.checkBox3.UseVisualStyleBackColor = true;
|
||||
this.checkBox3.CheckedChanged += new System.EventHandler(this.CheckBox3CheckedChanged);
|
||||
//
|
||||
// tabPage7
|
||||
//
|
||||
this.tabPage7.BackColor = System.Drawing.SystemColors.ControlText;
|
||||
|
|
@ -779,7 +693,7 @@ namespace RBXLegacyLauncher
|
|||
this.tabPage7.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabPage7.Size = new System.Drawing.Size(405, 284);
|
||||
this.tabPage7.TabIndex = 7;
|
||||
this.tabPage7.Text = "CMD";
|
||||
this.tabPage7.Text = "CONSOLE";
|
||||
//
|
||||
// richTextBox1
|
||||
//
|
||||
|
|
@ -896,15 +810,58 @@ namespace RBXLegacyLauncher
|
|||
this.label5.Text = "label5";
|
||||
this.label5.TextAlign = System.Drawing.ContentAlignment.TopCenter;
|
||||
//
|
||||
// button21
|
||||
//
|
||||
this.button21.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F);
|
||||
this.button21.Location = new System.Drawing.Point(338, 89);
|
||||
this.button21.Name = "button21";
|
||||
this.button21.Size = new System.Drawing.Size(87, 20);
|
||||
this.button21.TabIndex = 44;
|
||||
this.button21.Text = "Install URI";
|
||||
this.button21.UseVisualStyleBackColor = true;
|
||||
this.button21.Click += new System.EventHandler(this.Button21Click);
|
||||
//
|
||||
// button9
|
||||
//
|
||||
this.button9.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F);
|
||||
this.button9.Location = new System.Drawing.Point(248, 111);
|
||||
this.button9.Name = "button9";
|
||||
this.button9.Size = new System.Drawing.Size(85, 20);
|
||||
this.button9.TabIndex = 37;
|
||||
this.button9.Text = "Reset Config";
|
||||
this.button9.UseVisualStyleBackColor = true;
|
||||
this.button9.Click += new System.EventHandler(this.Button9Click);
|
||||
//
|
||||
// button8
|
||||
//
|
||||
this.button8.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
|
||||
this.button8.Location = new System.Drawing.Point(127, 107);
|
||||
this.button8.Name = "button8";
|
||||
this.button8.Size = new System.Drawing.Size(109, 24);
|
||||
this.button8.TabIndex = 35;
|
||||
this.button8.Text = "Customization";
|
||||
this.button8.UseVisualStyleBackColor = true;
|
||||
this.button8.Click += new System.EventHandler(this.Button8Click);
|
||||
//
|
||||
// checkBox3
|
||||
//
|
||||
this.checkBox3.Location = new System.Drawing.Point(248, 68);
|
||||
this.checkBox3.Name = "checkBox3";
|
||||
this.checkBox3.Size = new System.Drawing.Size(177, 18);
|
||||
this.checkBox3.TabIndex = 22;
|
||||
this.checkBox3.Text = "Local Play Mode";
|
||||
this.checkBox3.UseVisualStyleBackColor = true;
|
||||
this.checkBox3.CheckedChanged += new System.EventHandler(this.CheckBox3CheckedChanged);
|
||||
//
|
||||
// checkBox1
|
||||
//
|
||||
this.checkBox1.Checked = true;
|
||||
this.checkBox1.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.checkBox1.Location = new System.Drawing.Point(248, 48);
|
||||
this.checkBox1.Name = "checkBox1";
|
||||
this.checkBox1.Size = new System.Drawing.Size(158, 19);
|
||||
this.checkBox1.Size = new System.Drawing.Size(177, 19);
|
||||
this.checkBox1.TabIndex = 5;
|
||||
this.checkBox1.Text = "Close Launcher on Launch";
|
||||
this.checkBox1.Text = "Minimize Launcher on Launch";
|
||||
this.checkBox1.UseCompatibleTextRendering = true;
|
||||
this.checkBox1.UseVisualStyleBackColor = true;
|
||||
this.checkBox1.CheckedChanged += new System.EventHandler(this.CheckBox1CheckedChanged);
|
||||
|
|
@ -913,11 +870,11 @@ namespace RBXLegacyLauncher
|
|||
//
|
||||
this.button3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.button3.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.button3.Location = new System.Drawing.Point(250, 65);
|
||||
this.button3.Location = new System.Drawing.Point(248, 89);
|
||||
this.button3.Name = "button3";
|
||||
this.button3.Size = new System.Drawing.Size(171, 20);
|
||||
this.button3.Size = new System.Drawing.Size(87, 20);
|
||||
this.button3.TabIndex = 6;
|
||||
this.button3.Text = "Launch ROBLOX Studio";
|
||||
this.button3.Text = "Open Studio";
|
||||
this.button3.UseVisualStyleBackColor = true;
|
||||
this.button3.Click += new System.EventHandler(this.Button3Click);
|
||||
//
|
||||
|
|
@ -931,20 +888,20 @@ namespace RBXLegacyLauncher
|
|||
//
|
||||
// button4
|
||||
//
|
||||
this.button4.Location = new System.Drawing.Point(12, 105);
|
||||
this.button4.Location = new System.Drawing.Point(12, 107);
|
||||
this.button4.Name = "button4";
|
||||
this.button4.Size = new System.Drawing.Size(224, 26);
|
||||
this.button4.Size = new System.Drawing.Size(109, 24);
|
||||
this.button4.TabIndex = 9;
|
||||
this.button4.Text = "Regenerate Player ID";
|
||||
this.button4.Text = "Generate New ID";
|
||||
this.button4.UseVisualStyleBackColor = true;
|
||||
this.button4.Click += new System.EventHandler(this.Button4Click);
|
||||
//
|
||||
// button5
|
||||
//
|
||||
this.button5.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.button5.Location = new System.Drawing.Point(250, 111);
|
||||
this.button5.Location = new System.Drawing.Point(338, 111);
|
||||
this.button5.Name = "button5";
|
||||
this.button5.Size = new System.Drawing.Size(171, 20);
|
||||
this.button5.Size = new System.Drawing.Size(87, 20);
|
||||
this.button5.TabIndex = 10;
|
||||
this.button5.Text = "Save Config";
|
||||
this.button5.UseVisualStyleBackColor = true;
|
||||
|
|
@ -1026,17 +983,6 @@ namespace RBXLegacyLauncher
|
|||
this.label28.TabIndex = 19;
|
||||
this.label28.Text = "Baseplate.rbxl";
|
||||
//
|
||||
// button6
|
||||
//
|
||||
this.button6.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.button6.Location = new System.Drawing.Point(250, 89);
|
||||
this.button6.Name = "button6";
|
||||
this.button6.Size = new System.Drawing.Size(171, 20);
|
||||
this.button6.TabIndex = 3;
|
||||
this.button6.Text = "Clientinfo Editor";
|
||||
this.button6.UseVisualStyleBackColor = true;
|
||||
this.button6.Click += new System.EventHandler(this.Button6Click);
|
||||
//
|
||||
// textBox5
|
||||
//
|
||||
this.textBox5.Location = new System.Drawing.Point(59, 86);
|
||||
|
|
@ -1048,32 +994,6 @@ namespace RBXLegacyLauncher
|
|||
this.textBox5.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
this.textBox5.TextChanged += new System.EventHandler(this.TextBox5TextChanged);
|
||||
//
|
||||
// label43
|
||||
//
|
||||
this.label43.Location = new System.Drawing.Point(54, 196);
|
||||
this.label43.Name = "label43";
|
||||
this.label43.Size = new System.Drawing.Size(100, 13);
|
||||
this.label43.TabIndex = 42;
|
||||
this.label43.Text = "CONFIG OPTIONS";
|
||||
//
|
||||
// label44
|
||||
//
|
||||
this.label44.Location = new System.Drawing.Point(183, 196);
|
||||
this.label44.Name = "label44";
|
||||
this.label44.Size = new System.Drawing.Size(77, 13);
|
||||
this.label44.TabIndex = 43;
|
||||
this.label44.Text = "URI OPTIONS";
|
||||
//
|
||||
// button21
|
||||
//
|
||||
this.button21.Location = new System.Drawing.Point(183, 224);
|
||||
this.button21.Name = "button21";
|
||||
this.button21.Size = new System.Drawing.Size(75, 39);
|
||||
this.button21.TabIndex = 44;
|
||||
this.button21.Text = "Install URI";
|
||||
this.button21.UseVisualStyleBackColor = true;
|
||||
this.button21.Click += new System.EventHandler(this.Button21Click);
|
||||
//
|
||||
// MainForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
|
|
@ -1081,18 +1001,21 @@ namespace RBXLegacyLauncher
|
|||
this.BackColor = System.Drawing.SystemColors.ControlLightLight;
|
||||
this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
|
||||
this.ClientSize = new System.Drawing.Size(427, 459);
|
||||
this.Controls.Add(this.button21);
|
||||
this.Controls.Add(this.textBox5);
|
||||
this.Controls.Add(this.button6);
|
||||
this.Controls.Add(this.label28);
|
||||
this.Controls.Add(this.label27);
|
||||
this.Controls.Add(this.label26);
|
||||
this.Controls.Add(this.label25);
|
||||
this.Controls.Add(this.label24);
|
||||
this.Controls.Add(this.button9);
|
||||
this.Controls.Add(this.label23);
|
||||
this.Controls.Add(this.button8);
|
||||
this.Controls.Add(this.label22);
|
||||
this.Controls.Add(this.label15);
|
||||
this.Controls.Add(this.textBox2);
|
||||
this.Controls.Add(this.button5);
|
||||
this.Controls.Add(this.checkBox3);
|
||||
this.Controls.Add(this.button4);
|
||||
this.Controls.Add(this.label13);
|
||||
this.Controls.Add(this.button3);
|
||||
|
|
@ -1111,19 +1034,18 @@ namespace RBXLegacyLauncher
|
|||
this.tabPage1.ResumeLayout(false);
|
||||
this.tabPage1.PerformLayout();
|
||||
this.tabPage2.ResumeLayout(false);
|
||||
this.tabPage2.PerformLayout();
|
||||
this.tabPage3.ResumeLayout(false);
|
||||
this.tabPage3.PerformLayout();
|
||||
this.tabPage6.ResumeLayout(false);
|
||||
this.tabPage5.ResumeLayout(false);
|
||||
this.tabPage5.PerformLayout();
|
||||
this.tabPage7.ResumeLayout(false);
|
||||
this.tabPage8.ResumeLayout(false);
|
||||
this.tabPage4.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
}
|
||||
private System.Windows.Forms.Label label43;
|
||||
private System.Windows.Forms.Label label44;
|
||||
private System.Windows.Forms.TextBox textBox7;
|
||||
private System.Windows.Forms.Label label45;
|
||||
private System.Windows.Forms.Button button21;
|
||||
private System.Windows.Forms.Label label41;
|
||||
private System.Windows.Forms.Label label40;
|
||||
|
|
@ -1158,17 +1080,10 @@ namespace RBXLegacyLauncher
|
|||
private System.Windows.Forms.TextBox textBox6;
|
||||
private System.Windows.Forms.Button button8;
|
||||
private System.Windows.Forms.TextBox textBox5;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label31;
|
||||
private System.Windows.Forms.Label label33;
|
||||
private System.Windows.Forms.Label label34;
|
||||
private System.Windows.Forms.TextBox textBox4;
|
||||
private System.Windows.Forms.Label label35;
|
||||
private System.Windows.Forms.Button button7;
|
||||
private System.Windows.Forms.TabPage tabPage5;
|
||||
private System.Windows.Forms.Label label32;
|
||||
private System.Windows.Forms.Label label30;
|
||||
private System.Windows.Forms.Button button6;
|
||||
private System.Windows.Forms.Label label28;
|
||||
private System.Windows.Forms.Label label27;
|
||||
private System.Windows.Forms.CheckBox checkBox3;
|
||||
|
|
@ -1185,7 +1100,6 @@ namespace RBXLegacyLauncher
|
|||
private System.Windows.Forms.Button button5;
|
||||
private System.Windows.Forms.Button button4;
|
||||
private System.Windows.Forms.Label label13;
|
||||
private System.Windows.Forms.Label label12;
|
||||
private System.Windows.Forms.Label label19;
|
||||
private System.Windows.Forms.Label label20;
|
||||
private System.Windows.Forms.Label label16;
|
||||
|
|
|
|||
|
|
@ -91,12 +91,17 @@ namespace RBXLegacyLauncher
|
|||
}
|
||||
|
||||
WriteConfigValues();
|
||||
Process.Start("sudppipe.exe", "-p " + GlobalVars.IP + " " + GlobalVars.RobloxPort + " " + GlobalVars.RobloxPort);
|
||||
Process sudp = new Process();
|
||||
sudp.StartInfo.FileName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\sudppipe.exe";
|
||||
sudp.StartInfo.Arguments = "-p " + GlobalVars.IP + " " + GlobalVars.RobloxPort + " " + GlobalVars.RobloxPort;
|
||||
sudp.StartInfo.UseShellExecute = false;
|
||||
sudp.StartInfo.CreateNoWindow = true;
|
||||
sudp.Start();
|
||||
StartClient();
|
||||
|
||||
if (GlobalVars.CloseOnLaunch == true)
|
||||
{
|
||||
this.Close();
|
||||
this.WindowState = FormWindowState.Minimized;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -107,7 +112,7 @@ namespace RBXLegacyLauncher
|
|||
|
||||
if (GlobalVars.CloseOnLaunch == true)
|
||||
{
|
||||
this.Close();
|
||||
this.WindowState = FormWindowState.Minimized;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -121,7 +126,7 @@ namespace RBXLegacyLauncher
|
|||
StartStudio();
|
||||
if (GlobalVars.CloseOnLaunch == true)
|
||||
{
|
||||
this.Close();
|
||||
this.WindowState = FormWindowState.Minimized;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -357,12 +362,6 @@ namespace RBXLegacyLauncher
|
|||
}
|
||||
}
|
||||
|
||||
void Button6Click(object sender, EventArgs e)
|
||||
{
|
||||
ClientinfoEditor cie = new ClientinfoEditor();
|
||||
cie.Show();
|
||||
}
|
||||
|
||||
void Button7Click(object sender, EventArgs e)
|
||||
{
|
||||
WriteConfigValues();
|
||||
|
|
@ -425,18 +424,30 @@ namespace RBXLegacyLauncher
|
|||
|
||||
void ListBox3SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
GlobalVars.IP = listBox3.SelectedItem.ToString();
|
||||
textBox1.Text = GlobalVars.IP;
|
||||
checkBox3.Enabled = false;
|
||||
GlobalVars.LocalPlayMode = false;
|
||||
label37.Text = GlobalVars.IP;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
void ListBox4SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
GlobalVars.RobloxPort = Convert.ToInt32(listBox4.SelectedItem.ToString());
|
||||
textBox4.Text = GlobalVars.RobloxPort.ToString();
|
||||
label38.Text = GlobalVars.RobloxPort.ToString();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
void Button10Click(object sender, EventArgs e)
|
||||
|
|
@ -510,7 +521,7 @@ namespace RBXLegacyLauncher
|
|||
|
||||
if (GlobalVars.CloseOnLaunch == true)
|
||||
{
|
||||
this.Close();
|
||||
this.WindowState = FormWindowState.Minimized;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -522,7 +533,7 @@ namespace RBXLegacyLauncher
|
|||
|
||||
if (GlobalVars.CloseOnLaunch == true)
|
||||
{
|
||||
this.Close();
|
||||
this.WindowState = FormWindowState.Minimized;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -585,6 +596,27 @@ namespace RBXLegacyLauncher
|
|||
}
|
||||
}
|
||||
|
||||
void TextBox7TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
int parsedValue;
|
||||
if (int.TryParse(textBox7.Text, out parsedValue))
|
||||
{
|
||||
if (textBox7.Text.Equals(""))
|
||||
{
|
||||
//set it to the normal port, 53640. it wouldn't make any sense if we set it to 0.
|
||||
GlobalVars.ServerPort = GlobalVars.DefaultRobloxPort;
|
||||
}
|
||||
else
|
||||
{
|
||||
GlobalVars.ServerPort = Convert.ToInt32(textBox7.Text);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
GlobalVars.ServerPort = GlobalVars.DefaultRobloxPort;
|
||||
}
|
||||
}
|
||||
|
||||
void ResetConfigValues()
|
||||
{
|
||||
LauncherFuncs.ResetConfigValues();
|
||||
|
|
@ -640,26 +672,31 @@ namespace RBXLegacyLauncher
|
|||
string HatIDOffline3 = GlobalVars.Custom_Hat3ID_Offline;
|
||||
if (GlobalVars.UsesPlayerName == true && GlobalVars.UsesID == true)
|
||||
{
|
||||
args = "-script " + quote + "dofile('" + GlobalVars.DefaultScript + "'); _G.SetRBXLegacyVersion('" + GlobalVars.SelectedClientVersion + "'); _G.CSConnect(" + GlobalVars.UserID + ",'localhost'," + GlobalVars.RobloxPort + ",'" + GlobalVars.PlayerName + "','" + HatIDOffline1 + "','" + HatIDOffline2 + "','" + HatIDOffline3 + "'," + GlobalVars.HeadColorID + "," + GlobalVars.TorsoColorID + "," + GlobalVars.LeftArmColorID + "," + GlobalVars.RightArmColorID + "," + GlobalVars.LeftLegColorID + "," + GlobalVars.RightLegColorID + ",'" + GlobalVars.Custom_TShirt + "','" + GlobalVars.Custom_Shirt + "','" + GlobalVars.Custom_Pants + "','" + GlobalVars.Custom_Face + "');" + quote;
|
||||
args = "-script " + quote + "dofile('" + GlobalVars.DefaultScript + "'); _G.SetRBXLegacyVersion('" + GlobalVars.SelectedClientVersion + "'); _G.CSConnect(" + GlobalVars.UserID + ",'localhost'," + GlobalVars.RobloxPort + ",'" + GlobalVars.PlayerName + "','" + HatIDOffline1 + "','" + HatIDOffline2 + "','" + HatIDOffline3 + "'," + GlobalVars.HeadColorID + "," + GlobalVars.TorsoColorID + "," + GlobalVars.LeftArmColorID + "," + GlobalVars.RightArmColorID + "," + GlobalVars.LeftLegColorID + "," + GlobalVars.RightLegColorID + ",'" + GlobalVars.Custom_TShirt + "','" + GlobalVars.Custom_Shirt + "','" + GlobalVars.Custom_Pants + "','" + GlobalVars.Custom_Face + "','" + GlobalVars.Custom_IconType + "');" + quote;
|
||||
}
|
||||
else if (GlobalVars.UsesPlayerName == false && GlobalVars.UsesID == true)
|
||||
{
|
||||
args = "-script " + quote + "dofile('" + GlobalVars.DefaultScript + "'); _G.SetRBXLegacyVersion('" + GlobalVars.SelectedClientVersion + "'); _G.CSConnect(" + GlobalVars.UserID + ",'localhost'," + GlobalVars.RobloxPort + ",'Player','" + HatIDOffline1 + "','" + HatIDOffline2 + "','" + HatIDOffline3 + "'," + GlobalVars.HeadColorID + "," + GlobalVars.TorsoColorID + "," + GlobalVars.LeftArmColorID + "," + GlobalVars.RightArmColorID + "," + GlobalVars.LeftLegColorID + "," + GlobalVars.RightLegColorID + ",'" + GlobalVars.Custom_TShirt + "','" + GlobalVars.Custom_Shirt + "','" + GlobalVars.Custom_Pants + "','" + GlobalVars.Custom_Face + "');" + quote;
|
||||
args = "-script " + quote + "dofile('" + GlobalVars.DefaultScript + "'); _G.SetRBXLegacyVersion('" + GlobalVars.SelectedClientVersion + "'); _G.CSConnect(" + GlobalVars.UserID + ",'localhost'," + GlobalVars.RobloxPort + ",'Player','" + HatIDOffline1 + "','" + HatIDOffline2 + "','" + HatIDOffline3 + "'," + GlobalVars.HeadColorID + "," + GlobalVars.TorsoColorID + "," + GlobalVars.LeftArmColorID + "," + GlobalVars.RightArmColorID + "," + GlobalVars.LeftLegColorID + "," + GlobalVars.RightLegColorID + ",'" + GlobalVars.Custom_TShirt + "','" + GlobalVars.Custom_Shirt + "','" + GlobalVars.Custom_Pants + "','" + GlobalVars.Custom_Face + "','" + GlobalVars.Custom_IconType + "');" + quote;
|
||||
}
|
||||
else if (GlobalVars.UsesPlayerName == true && GlobalVars.UsesID == false)
|
||||
{
|
||||
args = "-script " + quote + "dofile('" + GlobalVars.DefaultScript + "'); _G.SetRBXLegacyVersion('" + GlobalVars.SelectedClientVersion + "'); _G.CSConnect(0,'localhost'," + GlobalVars.RobloxPort + ",'" + GlobalVars.PlayerName + "','" + HatIDOffline1 + "','" + HatIDOffline2 + "','" + HatIDOffline3 + "'," + GlobalVars.HeadColorID + "," + GlobalVars.TorsoColorID + "," + GlobalVars.LeftArmColorID + "," + GlobalVars.RightArmColorID + "," + GlobalVars.LeftLegColorID + "," + GlobalVars.RightLegColorID + ",'" + GlobalVars.Custom_TShirt + "','" + GlobalVars.Custom_Shirt + "','" + GlobalVars.Custom_Pants + "','" + GlobalVars.Custom_Face + "');" + quote;
|
||||
args = "-script " + quote + "dofile('" + GlobalVars.DefaultScript + "'); _G.SetRBXLegacyVersion('" + GlobalVars.SelectedClientVersion + "'); _G.CSConnect(0,'localhost'," + GlobalVars.RobloxPort + ",'" + GlobalVars.PlayerName + "','" + HatIDOffline1 + "','" + HatIDOffline2 + "','" + HatIDOffline3 + "'," + GlobalVars.HeadColorID + "," + GlobalVars.TorsoColorID + "," + GlobalVars.LeftArmColorID + "," + GlobalVars.RightArmColorID + "," + GlobalVars.LeftLegColorID + "," + GlobalVars.RightLegColorID + ",'" + GlobalVars.Custom_TShirt + "','" + GlobalVars.Custom_Shirt + "','" + GlobalVars.Custom_Pants + "','" + GlobalVars.Custom_Face + "','" + GlobalVars.Custom_IconType + "');" + quote;
|
||||
}
|
||||
else if (GlobalVars.UsesPlayerName == false && GlobalVars.UsesID == false)
|
||||
{
|
||||
args = "-script " + quote + "dofile('" + GlobalVars.DefaultScript + "'); _G.SetRBXLegacyVersion('" + GlobalVars.SelectedClientVersion + "'); _G.CSConnect(0,'localhost'," + GlobalVars.RobloxPort + ",'Player','" + HatIDOffline1 + "','" + HatIDOffline2 + "','" + HatIDOffline3 + "'," + GlobalVars.HeadColorID + "," + GlobalVars.TorsoColorID + "," + GlobalVars.LeftArmColorID + "," + GlobalVars.RightArmColorID + "," + GlobalVars.LeftLegColorID + "," + GlobalVars.RightLegColorID + ",'" + GlobalVars.Custom_TShirt + "','" + GlobalVars.Custom_Shirt + "','" + GlobalVars.Custom_Pants + "','" + GlobalVars.Custom_Face + "');" + quote;
|
||||
args = "-script " + quote + "dofile('" + GlobalVars.DefaultScript + "'); _G.SetRBXLegacyVersion('" + GlobalVars.SelectedClientVersion + "'); _G.CSConnect(0,'localhost'," + GlobalVars.RobloxPort + ",'Player','" + HatIDOffline1 + "','" + HatIDOffline2 + "','" + HatIDOffline3 + "'," + GlobalVars.HeadColorID + "," + GlobalVars.TorsoColorID + "," + GlobalVars.LeftArmColorID + "," + GlobalVars.RightArmColorID + "," + GlobalVars.LeftLegColorID + "," + GlobalVars.RightLegColorID + ",'" + GlobalVars.Custom_TShirt + "','" + GlobalVars.Custom_Shirt + "','" + GlobalVars.Custom_Pants + "','" + GlobalVars.Custom_Face + "','" + GlobalVars.Custom_IconType + "');" + quote;
|
||||
}
|
||||
try
|
||||
{
|
||||
ConsolePrint("Client Loaded.", 4);
|
||||
if (SecurityFuncs.checkClientMD5(GlobalVars.SelectedClient) == true)
|
||||
{
|
||||
Process.Start(rbxexe, args);
|
||||
Process client = new Process();
|
||||
client.StartInfo.FileName = rbxexe;
|
||||
client.StartInfo.Arguments = args;
|
||||
client.EnableRaisingEvents = true;
|
||||
client.Exited += new EventHandler(ClientExited);
|
||||
client.Start();
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
|
|
@ -675,6 +712,23 @@ namespace RBXLegacyLauncher
|
|||
}
|
||||
}
|
||||
|
||||
void ClientExited(object sender, EventArgs e)
|
||||
{
|
||||
Process[] sudp = Process.GetProcessesByName("sudppipe");
|
||||
if (sudp != null)
|
||||
{
|
||||
foreach (var process in sudp)
|
||||
{
|
||||
process.Kill();
|
||||
}
|
||||
|
||||
if (this.WindowState == FormWindowState.Minimized)
|
||||
{
|
||||
this.WindowState = FormWindowState.Normal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void StartSolo()
|
||||
{
|
||||
string mapfile = GlobalVars.MapsDir + @"\\" + GlobalVars.Map;
|
||||
|
|
@ -686,19 +740,19 @@ namespace RBXLegacyLauncher
|
|||
string HatIDOffline3 = GlobalVars.Custom_Hat3ID_Offline;
|
||||
if (GlobalVars.UsesPlayerName == true && GlobalVars.UsesID == true)
|
||||
{
|
||||
args = quote + mapfile + "\" -script \"dofile('" + GlobalVars.DefaultScript + "'); _G.SetRBXLegacyVersion('" + GlobalVars.SelectedClientVersion + "'); _G.CSSolo(" + GlobalVars.UserID + ",'" + GlobalVars.PlayerName + "','" + HatIDOffline1 + "','" + HatIDOffline2 + "','" + HatIDOffline3 + "'," + GlobalVars.HeadColorID + "," + GlobalVars.TorsoColorID + "," + GlobalVars.LeftArmColorID + "," + GlobalVars.RightArmColorID + "," + GlobalVars.LeftLegColorID + "," + GlobalVars.RightLegColorID + ",'" + GlobalVars.Custom_TShirt + "','" + GlobalVars.Custom_Shirt + "','" + GlobalVars.Custom_Pants + "','" + GlobalVars.Custom_Face + "');" + quote;
|
||||
args = quote + mapfile + "\" -script \"dofile('" + GlobalVars.DefaultScript + "'); _G.SetRBXLegacyVersion('" + GlobalVars.SelectedClientVersion + "'); _G.CSSolo(" + GlobalVars.UserID + ",'" + GlobalVars.PlayerName + "','" + HatIDOffline1 + "','" + HatIDOffline2 + "','" + HatIDOffline3 + "'," + GlobalVars.HeadColorID + "," + GlobalVars.TorsoColorID + "," + GlobalVars.LeftArmColorID + "," + GlobalVars.RightArmColorID + "," + GlobalVars.LeftLegColorID + "," + GlobalVars.RightLegColorID + ",'" + GlobalVars.Custom_TShirt + "','" + GlobalVars.Custom_Shirt + "','" + GlobalVars.Custom_Pants + "','" + GlobalVars.Custom_Face + "','" + GlobalVars.Custom_IconType + "');" + quote;
|
||||
}
|
||||
else if (GlobalVars.UsesPlayerName == false && GlobalVars.UsesID == true)
|
||||
{
|
||||
args = quote + mapfile + "\" -script \"dofile('" + GlobalVars.DefaultScript + "'); _G.SetRBXLegacyVersion('" + GlobalVars.SelectedClientVersion + "'); _G.CSSolo(" + GlobalVars.UserID + ",'Player','" + HatIDOffline1 + "','" + HatIDOffline2 + "','" + HatIDOffline3 + "'," + GlobalVars.HeadColorID + "," + GlobalVars.TorsoColorID + "," + GlobalVars.LeftArmColorID + "," + GlobalVars.RightArmColorID + "," + GlobalVars.LeftLegColorID + "," + GlobalVars.RightLegColorID + ",'" + GlobalVars.Custom_TShirt + "','" + GlobalVars.Custom_Shirt + "','" + GlobalVars.Custom_Pants + "','" + GlobalVars.Custom_Face + "');" + quote;
|
||||
args = quote + mapfile + "\" -script \"dofile('" + GlobalVars.DefaultScript + "'); _G.SetRBXLegacyVersion('" + GlobalVars.SelectedClientVersion + "'); _G.CSSolo(" + GlobalVars.UserID + ",'Player','" + HatIDOffline1 + "','" + HatIDOffline2 + "','" + HatIDOffline3 + "'," + GlobalVars.HeadColorID + "," + GlobalVars.TorsoColorID + "," + GlobalVars.LeftArmColorID + "," + GlobalVars.RightArmColorID + "," + GlobalVars.LeftLegColorID + "," + GlobalVars.RightLegColorID + ",'" + GlobalVars.Custom_TShirt + "','" + GlobalVars.Custom_Shirt + "','" + GlobalVars.Custom_Pants + "','" + GlobalVars.Custom_Face + "','" + GlobalVars.Custom_IconType + "');" + quote;
|
||||
}
|
||||
else if (GlobalVars.UsesPlayerName == true && GlobalVars.UsesID == false)
|
||||
{
|
||||
args = quote + mapfile + "\" -script \"dofile('" + GlobalVars.DefaultScript + "'); _G.SetRBXLegacyVersion('" + GlobalVars.SelectedClientVersion + "'); _G.CSSolo(0,'" + GlobalVars.PlayerName + "','" + HatIDOffline1 + "','" + HatIDOffline2 + "','" + HatIDOffline3 + "'," + GlobalVars.HeadColorID + "," + GlobalVars.TorsoColorID + "," + GlobalVars.LeftArmColorID + "," + GlobalVars.RightArmColorID + "," + GlobalVars.LeftLegColorID + "," + GlobalVars.RightLegColorID + ",'" + GlobalVars.Custom_TShirt + "','" + GlobalVars.Custom_Shirt + "','" + GlobalVars.Custom_Pants + "','" + GlobalVars.Custom_Face + "');" + quote;
|
||||
args = quote + mapfile + "\" -script \"dofile('" + GlobalVars.DefaultScript + "'); _G.SetRBXLegacyVersion('" + GlobalVars.SelectedClientVersion + "'); _G.CSSolo(0,'" + GlobalVars.PlayerName + "','" + HatIDOffline1 + "','" + HatIDOffline2 + "','" + HatIDOffline3 + "'," + GlobalVars.HeadColorID + "," + GlobalVars.TorsoColorID + "," + GlobalVars.LeftArmColorID + "," + GlobalVars.RightArmColorID + "," + GlobalVars.LeftLegColorID + "," + GlobalVars.RightLegColorID + ",'" + GlobalVars.Custom_TShirt + "','" + GlobalVars.Custom_Shirt + "','" + GlobalVars.Custom_Pants + "','" + GlobalVars.Custom_Face + "','" + GlobalVars.Custom_IconType + "');" + quote;
|
||||
}
|
||||
else if (GlobalVars.UsesPlayerName == false && GlobalVars.UsesID == false )
|
||||
{
|
||||
args = quote + mapfile + "\" -script \"dofile('" + GlobalVars.DefaultScript + "'); _G.SetRBXLegacyVersion('" + GlobalVars.SelectedClientVersion + "'); _G.CSSolo(0,'Player','" + HatIDOffline1 + "','" + HatIDOffline2 + "','" + HatIDOffline3 + "'," + GlobalVars.HeadColorID + "," + GlobalVars.TorsoColorID + "," + GlobalVars.LeftArmColorID + "," + GlobalVars.RightArmColorID + "," + GlobalVars.LeftLegColorID + "," + GlobalVars.RightLegColorID + ",'" + GlobalVars.Custom_TShirt + "','" + GlobalVars.Custom_Shirt + "','" + GlobalVars.Custom_Pants + "','" + GlobalVars.Custom_Face + "');" + quote;
|
||||
args = quote + mapfile + "\" -script \"dofile('" + GlobalVars.DefaultScript + "'); _G.SetRBXLegacyVersion('" + GlobalVars.SelectedClientVersion + "'); _G.CSSolo(0,'Player','" + HatIDOffline1 + "','" + HatIDOffline2 + "','" + HatIDOffline3 + "'," + GlobalVars.HeadColorID + "," + GlobalVars.TorsoColorID + "," + GlobalVars.LeftArmColorID + "," + GlobalVars.RightArmColorID + "," + GlobalVars.LeftLegColorID + "," + GlobalVars.RightLegColorID + ",'" + GlobalVars.Custom_TShirt + "','" + GlobalVars.Custom_Shirt + "','" + GlobalVars.Custom_Pants + "','" + GlobalVars.Custom_Face + "','" + GlobalVars.Custom_IconType + "');" + quote;
|
||||
}
|
||||
try
|
||||
{
|
||||
|
|
@ -718,7 +772,7 @@ namespace RBXLegacyLauncher
|
|||
string rbxexe = GlobalVars.ClientDir + @"\\" + GlobalVars.SelectedClient + @"\\RobloxApp.exe";
|
||||
string quote = "\"";
|
||||
string args = "";
|
||||
args = quote + mapfile + "\" -script \"dofile('" + GlobalVars.DefaultScript + "'); _G.SetRBXLegacyVersion('" + GlobalVars.SelectedClientVersion + "'); _G.CSServer(" + GlobalVars.RobloxPort + "," + GlobalVars.PlayerLimit + "); " + quote;
|
||||
args = quote + mapfile + "\" -script \"dofile('" + GlobalVars.DefaultScript + "'); _G.SetRBXLegacyVersion('" + GlobalVars.SelectedClientVersion + "'); _G.CSServer(" + GlobalVars.ServerPort + "," + GlobalVars.PlayerLimit + "); " + quote;
|
||||
try
|
||||
{
|
||||
ConsolePrint("Server Loaded.", 4);
|
||||
|
|
@ -737,7 +791,7 @@ namespace RBXLegacyLauncher
|
|||
string rbxexe = GlobalVars.ClientDir + @"\\" + GlobalVars.SelectedClient + @"\\RobloxApp.exe";
|
||||
string quote = "\"";
|
||||
string args = "";
|
||||
args = quote + mapfile + "\" -script \"dofile('" + GlobalVars.DefaultScript + "'); _G.SetRBXLegacyVersion('" + GlobalVars.SelectedClientVersion + "'); _G.CSServer(" + GlobalVars.RobloxPort + "," + GlobalVars.PlayerLimit + "); " + quote + " -no3d";
|
||||
args = quote + mapfile + "\" -script \"dofile('" + GlobalVars.DefaultScript + "'); _G.SetRBXLegacyVersion('" + GlobalVars.SelectedClientVersion + "'); _G.CSServer(" + GlobalVars.ServerPort + "," + GlobalVars.PlayerLimit + "); " + quote + " -no3d";
|
||||
try
|
||||
{
|
||||
ConsolePrint("Server Loaded in No3d.", 4);
|
||||
|
|
@ -786,7 +840,12 @@ namespace RBXLegacyLauncher
|
|||
}
|
||||
else if (command.Equals("rbxlegacy client"))
|
||||
{
|
||||
Process.Start("sudppipe.exe", "-p " + GlobalVars.IP + " " + GlobalVars.RobloxPort + " " + GlobalVars.RobloxPort);
|
||||
Process sudp = new Process();
|
||||
sudp.StartInfo.FileName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\sudppipe.exe";
|
||||
sudp.StartInfo.Arguments = "-p " + GlobalVars.IP + " " + GlobalVars.RobloxPort + " " + GlobalVars.RobloxPort;
|
||||
sudp.StartInfo.UseShellExecute = false;
|
||||
sudp.StartInfo.CreateNoWindow = true;
|
||||
sudp.Start();
|
||||
StartClient();
|
||||
}
|
||||
else if (command.Equals("rbxlegacy client solo"))
|
||||
|
|
@ -813,6 +872,18 @@ namespace RBXLegacyLauncher
|
|||
{
|
||||
ResetConfigValues();
|
||||
}
|
||||
else if (command.Equals("rbxlegacy sdk"))
|
||||
{
|
||||
SDKForm sdk = new SDKForm();
|
||||
sdk.Show();
|
||||
ConsolePrint("Launched SDK.", 4);
|
||||
}
|
||||
else if (command.Equals("sdk"))
|
||||
{
|
||||
SDKForm sdk = new SDKForm();
|
||||
sdk.Show();
|
||||
ConsolePrint("Launched SDK.", 4);
|
||||
}
|
||||
else if (command.Equals("rbxlegacy help"))
|
||||
{
|
||||
ConsoleRBXLegacyHelp(0);
|
||||
|
|
@ -865,6 +936,7 @@ namespace RBXLegacyLauncher
|
|||
ConsolePrint("= server | Loads server with launcher settings", 3);
|
||||
ConsolePrint("-- no3d | Loads server in NoGraphics mode with launcher settings", 4);
|
||||
ConsolePrint("= studio | Loads Roblox Studio with launcher settings", 3);
|
||||
ConsolePrint("= sdk | Loads the RBXLegacy SDK", 3);
|
||||
ConsolePrint("= config", 3);
|
||||
ConsolePrint("-- save | Saves the config file", 4);
|
||||
ConsolePrint("-- load | Reloads the config file", 4);
|
||||
|
|
|
|||
|
|
@ -203,7 +203,8 @@
|
|||
</value>
|
||||
</data>
|
||||
<data name="label4.Text" xml:space="preserve">
|
||||
<value>NOTE: Make sure the server you join is in the region of the world you live in! (i.e West US, East US, Europe, etc). If you have a problem where you can't see your character, REGENERATE YOUR PLAYER ID THEN REJOIN THE SERVER. If you tried to connect to the server and you get an error, REJOIN THE SERVER. If the server requires a different port than the normal ROBLOX port (53640), change it in the OPTIONS tab.</value>
|
||||
<value>NOTE: Make sure the server you join is in the region of the world you live in! (i.e West US, East US, Europe, etc). If you have a problem where you can't see your character, REGENERATE YOUR PLAYER ID THEN REJOIN THE SERVER. If you tried to connect to the server and you get an error, REJOIN THE SERVER.
|
||||
</value>
|
||||
</data>
|
||||
<data name="label30.Text" xml:space="preserve">
|
||||
<value>WARNING: This client loads assets directly from a server. This means that you may not be able to play it over a LAN or local connection without internet access. This may also mean that some things won't load (i.e the healthbar)</value>
|
||||
|
|
|
|||
|
|
@ -18,6 +18,9 @@
|
|||
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
|
||||
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<SignAssembly>False</SignAssembly>
|
||||
<DelaySign>False</DelaySign>
|
||||
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
|
|
@ -42,6 +45,8 @@
|
|||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<BaseIntermediateOutputPath>obj\</BaseIntermediateOutputPath>
|
||||
<StartAction>Program</StartAction>
|
||||
<StartProgram>..\..\..\RBXLegacy\release\RBXLegacy\RBXLegacyLauncher.exe</StartProgram>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
|
|
@ -59,10 +64,6 @@
|
|||
<Compile Include="CharacterCustomization.Designer.cs">
|
||||
<DependentUpon>CharacterCustomization.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="CharacterCustomization_ClothingMenu.cs" />
|
||||
<Compile Include="CharacterCustomization_ClothingMenu.Designer.cs">
|
||||
<DependentUpon>CharacterCustomization_ClothingMenu.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="CharacterCustomization_HatMenu.cs" />
|
||||
<Compile Include="CharacterCustomization_HatMenu.Designer.cs">
|
||||
<DependentUpon>CharacterCustomization_HatMenu.cs</DependentUpon>
|
||||
|
|
@ -76,6 +77,10 @@
|
|||
<Compile Include="DocForm.Designer.cs">
|
||||
<DependentUpon>DocForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="InfoEditor.cs" />
|
||||
<Compile Include="InfoEditor.Designer.cs">
|
||||
<DependentUpon>InfoEditor.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="LauncherFuncs.cs" />
|
||||
<Compile Include="LoaderForm.cs" />
|
||||
<Compile Include="LoaderForm.Designer.cs">
|
||||
|
|
@ -86,6 +91,10 @@
|
|||
<DependentUpon>QuickConfigure.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="RichTextBoxExtensions.cs" />
|
||||
<Compile Include="SDKForm.cs" />
|
||||
<Compile Include="SDKForm.Designer.cs">
|
||||
<DependentUpon>SDKForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SecurityFuncs.cs" />
|
||||
<Compile Include="ServerInfo.cs" />
|
||||
<Compile Include="ServerInfo.Designer.cs">
|
||||
|
|
@ -107,9 +116,6 @@
|
|||
<EmbeddedResource Include="CharacterCustomization.resx">
|
||||
<DependentUpon>CharacterCustomization.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="CharacterCustomization_ClothingMenu.resx">
|
||||
<DependentUpon>CharacterCustomization_ClothingMenu.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="CharacterCustomization_HatMenu.resx">
|
||||
<DependentUpon>CharacterCustomization_HatMenu.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
|
|
@ -119,6 +125,9 @@
|
|||
<EmbeddedResource Include="DocForm.resx">
|
||||
<DependentUpon>DocForm.Designer.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="InfoEditor.resx">
|
||||
<DependentUpon>InfoEditor.Designer.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="LoaderForm.resx">
|
||||
<DependentUpon>LoaderForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
|
|
@ -128,6 +137,9 @@
|
|||
<EmbeddedResource Include="QuickConfigure.resx">
|
||||
<DependentUpon>QuickConfigure.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="SDKForm.resx">
|
||||
<DependentUpon>SDKForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="ServerInfo.resx">
|
||||
<DependentUpon>ServerInfo.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,80 @@
|
|||
/*
|
||||
* Created by SharpDevelop.
|
||||
* User: BITL
|
||||
* Date: 6/23/2017
|
||||
* Time: 2:33 PM
|
||||
*
|
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers.
|
||||
*/
|
||||
namespace RBXLegacyLauncher
|
||||
{
|
||||
partial class SDKForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Designer variable used to keep track of non-visual components.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Disposes resources used by the form.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing) {
|
||||
if (components != null) {
|
||||
components.Dispose();
|
||||
}
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This method is required for Windows Forms designer support.
|
||||
/// Do not change the method contents inside the source code editor. The Forms designer might
|
||||
/// not be able to load this method if it was changed manually.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SDKForm));
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.button2 = new System.Windows.Forms.Button();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Location = new System.Drawing.Point(12, 12);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(260, 63);
|
||||
this.button1.TabIndex = 0;
|
||||
this.button1.Text = "Clientinfo Editor";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.Button1Click);
|
||||
//
|
||||
// button2
|
||||
//
|
||||
this.button2.Location = new System.Drawing.Point(12, 81);
|
||||
this.button2.Name = "button2";
|
||||
this.button2.Size = new System.Drawing.Size(260, 63);
|
||||
this.button2.TabIndex = 1;
|
||||
this.button2.Text = "Info Editor";
|
||||
this.button2.UseVisualStyleBackColor = true;
|
||||
this.button2.Click += new System.EventHandler(this.Button2Click);
|
||||
//
|
||||
// SDKForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.SystemColors.ControlLightLight;
|
||||
this.ClientSize = new System.Drawing.Size(284, 157);
|
||||
this.Controls.Add(this.button2);
|
||||
this.Controls.Add(this.button1);
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.Name = "SDKForm";
|
||||
this.Text = "RBXLegacy SDK";
|
||||
this.ResumeLayout(false);
|
||||
}
|
||||
private System.Windows.Forms.Button button2;
|
||||
private System.Windows.Forms.Button button1;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
* Created by SharpDevelop.
|
||||
* User: BITL
|
||||
* Date: 6/23/2017
|
||||
* Time: 2:33 PM
|
||||
*
|
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers.
|
||||
*/
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace RBXLegacyLauncher
|
||||
{
|
||||
/// <summary>
|
||||
/// Description of SDKForm.
|
||||
/// </summary>
|
||||
public partial class SDKForm : Form
|
||||
{
|
||||
public SDKForm()
|
||||
{
|
||||
//
|
||||
// The InitializeComponent() call is required for Windows Forms designer support.
|
||||
//
|
||||
InitializeComponent();
|
||||
|
||||
//
|
||||
// TODO: Add constructor code after the InitializeComponent() call.
|
||||
//
|
||||
}
|
||||
|
||||
void Button1Click(object sender, EventArgs e)
|
||||
{
|
||||
ClientinfoEditor cie = new ClientinfoEditor();
|
||||
cie.Show();
|
||||
}
|
||||
|
||||
void Button2Click(object sender, EventArgs e)
|
||||
{
|
||||
InfoEditor ie = new InfoEditor();
|
||||
ie.Show();
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,363 @@
|
|||
/*
|
||||
Copyright 2008,2009 Luigi Auriemma
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
http://www.gnu.org/licenses/gpl-2.0.txt
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <time.h>
|
||||
#include "ip2.h"
|
||||
|
||||
#if defined ACPDUMP_LOCK && WIN32
|
||||
#include <windows.h>
|
||||
#define ACPDUMP_LOCK_VAR static LONG is_writing = 0;
|
||||
#define ACPDUMP_LOCK_START while(InterlockedExchange(&is_writing, 1)) Sleep(0);
|
||||
#define ACPDUMP_LOCK_END InterlockedExchange(&is_writing, 0);
|
||||
#else
|
||||
#define ACPDUMP_LOCK_VAR
|
||||
#define ACPDUMP_LOCK_START
|
||||
#define ACPDUMP_LOCK_END
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#define ACPDUMP_VER "0.2c"
|
||||
|
||||
|
||||
|
||||
#ifdef ACPDUMP_ADDR_STRUCT // define this one if you don't have the following struct
|
||||
|
||||
struct in_addr {
|
||||
union {
|
||||
struct { uint8_t s_b1,s_b2,s_b3,s_b4; } S_un_b;
|
||||
struct { uint16_t s_w1,s_w2; } S_un_w;
|
||||
uint32_t S_addr;
|
||||
} S_un;
|
||||
#define s_addr S_un.S_addr
|
||||
#define s_host S_un.S_un_b.s_b2
|
||||
#define s_net S_un.S_un_b.s_b1
|
||||
#define s_imp S_un.S_un_w.s_w2
|
||||
#define s_impno S_un.S_un_b.s_b4
|
||||
#define s_lh S_un.S_un_b.s_b3
|
||||
};
|
||||
|
||||
struct sockaddr_in {
|
||||
int16_t sin_family;
|
||||
uint16_t sin_port;
|
||||
struct in_addr sin_addr;
|
||||
char sin_zero[8];
|
||||
};
|
||||
|
||||
struct sockaddr {
|
||||
uint16_t sa_family;
|
||||
char sa_data[14];
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
struct timevalx {
|
||||
int32_t tv_sec;
|
||||
int32_t tv_usec;
|
||||
};
|
||||
|
||||
|
||||
|
||||
uint32_t str2ip(uint8_t *data) {
|
||||
unsigned a, b, c, d;
|
||||
|
||||
if(!data[0]) return(0);
|
||||
sscanf((char *)data, "%u.%u.%u.%u", &a, &b, &c, &d);
|
||||
return((a & 0xff) | ((b & 0xff) << 8) | ((c & 0xff) << 16) | ((d & 0xff) << 24));
|
||||
}
|
||||
|
||||
|
||||
|
||||
uint8_t *ip2str(uint32_t ip) {
|
||||
static uint8_t data[16];
|
||||
|
||||
sprintf((char *)data, "%u.%u.%u.%u",
|
||||
(ip & 0xff), ((ip >> 8) & 0xff), ((ip >> 16) & 0xff), ((ip >> 24) & 0xff));
|
||||
return(data);
|
||||
}
|
||||
|
||||
|
||||
uint16_t net16(uint16_t num) {
|
||||
int endian = 1; // big endian
|
||||
|
||||
if(!*(char *)&endian) return(num);
|
||||
return((num << 8) | (num >> 8));
|
||||
}
|
||||
|
||||
|
||||
|
||||
uint32_t net32(uint32_t num) {
|
||||
int endian = 1; // big endian
|
||||
|
||||
if(!*(char *)&endian) return(num);
|
||||
return(((num & 0xff000000) >> 24) |
|
||||
((num & 0x00ff0000) >> 8) |
|
||||
((num & 0x0000ff00) << 8) |
|
||||
((num & 0x000000ff) << 24));
|
||||
}
|
||||
|
||||
|
||||
|
||||
uint16_t in_cksum(void *data, int len, uint32_t *ret_sum) {
|
||||
uint32_t sum = 0;
|
||||
int i = len >> 1,
|
||||
endian = 1; // big endian
|
||||
uint16_t crc,
|
||||
*p = (uint16_t *)data;
|
||||
|
||||
if(*(char *)&endian) endian = 0;
|
||||
if(ret_sum) sum = *ret_sum;
|
||||
while(i--) sum += *p++;
|
||||
if(len & 1) sum += *p & (endian ? 0xff00 : 0xff);
|
||||
if(ret_sum) *ret_sum = sum;
|
||||
crc = sum = (sum >> 16) + (sum & 0xffff);
|
||||
if(sum >>= 16) crc += sum;
|
||||
if(!endian) crc = (crc >> 8) | (crc << 8);
|
||||
return(~crc);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void putxx(FILE *fd, uint32_t num, int bits) {
|
||||
int i,
|
||||
bytes;
|
||||
|
||||
bytes = bits >> 3;
|
||||
for(i = 0; i < bytes; i++) {
|
||||
fputc(num >> (i << 3), fd);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void create_acp(FILE *fd) {
|
||||
if(!fd) return;
|
||||
putxx(fd, 0xa1b2c3d4, 32);
|
||||
putxx(fd, 2, 16);
|
||||
putxx(fd, 4, 16);
|
||||
putxx(fd, 0, 32);
|
||||
putxx(fd, 0, 32);
|
||||
putxx(fd, 65535, 32);
|
||||
putxx(fd, 1, 32);
|
||||
fflush(fd);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void acp_dump(FILE *fd, int type, int protocol, uint32_t src_ip, uint16_t src_port, uint32_t dst_ip, uint16_t dst_port, uint8_t *data, int len, uint32_t *seq1, uint32_t *ack1, uint32_t *seq2, uint32_t *ack2) {
|
||||
ACPDUMP_LOCK_VAR
|
||||
struct {
|
||||
struct timevalx ts;
|
||||
uint32_t caplen;
|
||||
uint32_t len;
|
||||
} acp_pck;
|
||||
static const uint8_t ethdata[14] =
|
||||
"\x00\x00\x00\x00\x00\x00" /* dest */
|
||||
"\x00\x00\x00\x00\x00\x00" /* source */
|
||||
"\x08\x00"; /* type */
|
||||
udph_pseudo udp_ps;
|
||||
uint32_t crc;
|
||||
iph ip;
|
||||
udph udp;
|
||||
tcph tcp;
|
||||
icmph icmp;
|
||||
igmph igmp;
|
||||
int size,
|
||||
tpsize,
|
||||
close_tcp;
|
||||
uint8_t *tp;
|
||||
|
||||
if(!fd) return;
|
||||
if(!type && !protocol) {
|
||||
protocol = 6;
|
||||
} else if((type == 1) && !protocol) {
|
||||
protocol = 6;
|
||||
} else if((type == 2) && !protocol) {
|
||||
protocol = 17;
|
||||
} else if((type == 3) && !protocol) {
|
||||
protocol = 255;
|
||||
}
|
||||
tp = NULL;
|
||||
tpsize = 0;
|
||||
if(type == 3) {
|
||||
// SOCK_RAW
|
||||
} else if(protocol == 6) {
|
||||
tp = (uint8_t *)&tcp;
|
||||
tpsize = sizeof(tcph);
|
||||
} else if(protocol == 17) {
|
||||
tp = (uint8_t *)&udp;
|
||||
tpsize = sizeof(udph);
|
||||
} else if(protocol == 1) {
|
||||
tp = (uint8_t *)&icmp;
|
||||
tpsize = sizeof(icmph);
|
||||
} else if(protocol == 2) {
|
||||
tp = (uint8_t *)&igmp;
|
||||
tpsize = sizeof(igmph);
|
||||
}
|
||||
|
||||
close_tcp = 0;
|
||||
if(len < 0) {
|
||||
close_tcp = 1;
|
||||
len = 0;
|
||||
}
|
||||
|
||||
if((type == 3) && (protocol == 255)) {
|
||||
// SOCK_RAW, IPPROTO_RAW
|
||||
size = len;
|
||||
} else {
|
||||
size = sizeof(iph) + tpsize + len;
|
||||
}
|
||||
|
||||
if((sizeof(acp_pck) + sizeof(ethdata) + size) > 0xffff) { // divides the packet if it's too big
|
||||
size = len; // use size as new "len" so acp_dump can be called with the same arguments
|
||||
if((type == 3) && (protocol == 255)) {
|
||||
len = 0xffff - (sizeof(acp_pck) + sizeof(ethdata));
|
||||
} else {
|
||||
len = 0xffff - (sizeof(acp_pck) + sizeof(ethdata) + sizeof(iph) + tpsize);
|
||||
}
|
||||
while(size > 0) {
|
||||
if(size < len) len = size;
|
||||
acp_dump(fd, type, protocol, src_ip, src_port, dst_ip, dst_port, data, len, seq1, ack1, seq2, ack2);
|
||||
size -= len;
|
||||
data += len;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// use the following if gettimeofday doesn't exist on Windows
|
||||
acp_pck.ts.tv_sec = time(NULL);
|
||||
//acp_pck.ts.tv_usec = GetTickCount();
|
||||
|
||||
acp_pck.caplen = sizeof(ethdata) + size;
|
||||
acp_pck.len = sizeof(ethdata) + size;
|
||||
|
||||
ip.ihl_ver = 0x45;
|
||||
ip.tos = 0;
|
||||
ip.tot_len = net16(size);
|
||||
ip.id = net16(1);
|
||||
ip.frag_off = net16(0);
|
||||
ip.ttl = 128;
|
||||
ip.protocol = protocol;
|
||||
ip.check = net16(0);
|
||||
ip.saddr = src_ip;
|
||||
ip.daddr = dst_ip;
|
||||
ip.check = net16(in_cksum((uint8_t *)&ip, sizeof(iph), NULL));
|
||||
|
||||
if(!tp) {
|
||||
// SOCK_RAW
|
||||
} else if(protocol == 6) {
|
||||
tcp.source = src_port;
|
||||
tcp.dest = dst_port;
|
||||
tcp.seq = net32(*seq1);
|
||||
tcp.ack_seq = net32(*ack1);
|
||||
tcp.doff = sizeof(tcph) << 2;
|
||||
if(close_tcp) {
|
||||
tcp.flags = TH_RST | TH_FIN | TH_ACK;
|
||||
} else if((*seq1 == 1) && (*ack1 == 0)) {
|
||||
tcp.flags = TH_SYN;
|
||||
} else if((*seq1 == 1) && (*ack1 == 2)) {
|
||||
tcp.flags = TH_SYN | TH_ACK;
|
||||
} else if((*seq1 == 2) && (*ack1 == 2) && !data) {
|
||||
tcp.flags = TH_ACK;
|
||||
} else {
|
||||
tcp.flags = TH_PSH | TH_ACK;
|
||||
*ack2 = *seq1;
|
||||
(*seq1) += len;
|
||||
}
|
||||
tcp.window = net16(65535);
|
||||
tcp.check = net16(0);
|
||||
tcp.urg_ptr = net16(0);
|
||||
|
||||
} else if(protocol == 17) {
|
||||
udp.source = src_port;
|
||||
udp.dest = dst_port;
|
||||
udp.check = net16(0);
|
||||
udp.len = net16(sizeof(udph) + len);
|
||||
|
||||
udp_ps.saddr = ip.saddr;
|
||||
udp_ps.daddr = ip.daddr;
|
||||
udp_ps.zero = 0;
|
||||
udp_ps.protocol = 17;
|
||||
udp_ps.length = udp.len;
|
||||
crc = 0; in_cksum(&udp_ps, sizeof(udph_pseudo), &crc);
|
||||
in_cksum(&udp, sizeof(udph), &crc);
|
||||
udp.check = net16(in_cksum(data, len, &crc));
|
||||
|
||||
} else if(protocol == 1) {
|
||||
memset(&icmp, 0, sizeof(icmph));
|
||||
icmp.icmp_type = 8;
|
||||
icmp.icmp_code = 0;
|
||||
crc = 0; in_cksum(&icmp, sizeof(udph_pseudo), &crc);
|
||||
icmp.icmp_cksum = net16(in_cksum(data, len, &crc));
|
||||
|
||||
} else if(protocol == 2) {
|
||||
igmp.igmp_type = 0x11;
|
||||
igmp.igmp_code = 0;
|
||||
igmp.igmp_cksum = net16(0);
|
||||
igmp.igmp_group = net32(0);
|
||||
crc = 0; in_cksum(&igmp, sizeof(udph_pseudo), &crc);
|
||||
igmp.igmp_cksum = net16(in_cksum(data, len, &crc));
|
||||
}
|
||||
|
||||
ACPDUMP_LOCK_START
|
||||
fwrite(&acp_pck, sizeof(acp_pck), 1, fd);
|
||||
fwrite(ethdata, sizeof(ethdata), 1, fd);
|
||||
if(!((type == 3) && (protocol == 255))) {
|
||||
fwrite(&ip, sizeof(iph), 1, fd);
|
||||
}
|
||||
if(tp) fwrite(tp, tpsize, 1, fd);
|
||||
fwrite(data, len, 1, fd);
|
||||
fflush(fd);
|
||||
ACPDUMP_LOCK_END
|
||||
}
|
||||
|
||||
|
||||
|
||||
void acp_dump_handshake(FILE *fd, int type, int protocol, uint32_t src_ip, uint16_t src_port, uint32_t dst_ip, uint16_t dst_port, uint8_t *data, int len, uint32_t *seq1, uint32_t *ack1, uint32_t *seq2, uint32_t *ack2) {
|
||||
if(!fd) return;
|
||||
if(!seq1 || !ack1 || !seq2 || !ack2) return;
|
||||
|
||||
*seq1 = 0; // useless initialization
|
||||
*ack1 = 0;
|
||||
*seq2 = 0;
|
||||
*ack2 = 0;
|
||||
if(!((!type && !protocol) || ((type == 1) && !protocol) || (protocol == 6))) {
|
||||
return; // if it's not tcp don't make handshake
|
||||
}
|
||||
|
||||
*seq1 = 1;
|
||||
*ack1 = 0;
|
||||
acp_dump(fd, type, protocol, src_ip, src_port, dst_ip, dst_port, NULL, 0, seq1, ack1, seq2, ack2);
|
||||
|
||||
*ack2 = *seq1 + 1;
|
||||
*seq2 = 1;
|
||||
acp_dump(fd, type, protocol, dst_ip, dst_port, src_ip, src_port, NULL, 0, seq2, ack2, seq1, ack1);
|
||||
|
||||
*ack1 = *seq2 + 1;
|
||||
(*seq1)++;
|
||||
acp_dump(fd, type, protocol, src_ip, src_port, dst_ip, dst_port, data, len, seq1, ack1, seq2, ack2);
|
||||
|
||||
(*seq2)++;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,138 @@
|
|||
/*
|
||||
Copyright 2008,2009 Luigi Auriemma
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
http://www.gnu.org/licenses/gpl-2.0.txt
|
||||
*/
|
||||
|
||||
#define TH_FIN 0x01
|
||||
#define TH_SYN 0x02
|
||||
#define TH_RST 0x04
|
||||
#define TH_PSH 0x08
|
||||
#define TH_ACK 0x10
|
||||
#define TH_URG 0x20
|
||||
#define TH_ECN 0x40
|
||||
#define TH_CWR 0x80
|
||||
|
||||
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
typedef struct {
|
||||
uint8_t ihl_ver;
|
||||
uint8_t tos;
|
||||
uint16_t tot_len;
|
||||
uint16_t id;
|
||||
uint16_t frag_off;
|
||||
uint8_t ttl;
|
||||
uint8_t protocol;
|
||||
uint16_t check;
|
||||
uint32_t saddr;
|
||||
uint32_t daddr;
|
||||
} iph;
|
||||
|
||||
typedef struct {
|
||||
uint16_t source;
|
||||
uint16_t dest;
|
||||
uint16_t len;
|
||||
uint16_t check;
|
||||
} udph;
|
||||
|
||||
typedef struct {
|
||||
uint32_t saddr;
|
||||
uint32_t daddr;
|
||||
uint8_t zero;
|
||||
uint8_t protocol;
|
||||
uint16_t length;
|
||||
} udph_pseudo;
|
||||
|
||||
typedef struct {
|
||||
uint16_t source;
|
||||
uint16_t dest;
|
||||
uint32_t seq;
|
||||
uint32_t ack_seq;
|
||||
uint8_t doff;
|
||||
uint8_t flags;
|
||||
uint16_t window;
|
||||
uint16_t check;
|
||||
uint16_t urg_ptr;
|
||||
} tcph;
|
||||
|
||||
typedef struct {
|
||||
uint8_t icmp_type;
|
||||
uint8_t icmp_code;
|
||||
uint16_t icmp_cksum;
|
||||
union {
|
||||
uint8_t ih_pptr;
|
||||
uint32_t ih_gwaddr;
|
||||
struct {
|
||||
uint16_t icd_id;
|
||||
uint16_t icd_seq;
|
||||
} ih_idseq;
|
||||
uint32_t ih_void;
|
||||
struct {
|
||||
uint16_t ipm_void;
|
||||
uint16_t ipm_nextmtu;
|
||||
} ih_pmtu;
|
||||
struct {
|
||||
uint8_t irt_num_addrs;
|
||||
uint8_t irt_wpa;
|
||||
uint16_t irt_lifetime;
|
||||
} ih_rtradv;
|
||||
} icmp_hun;
|
||||
#define icmp_pptr icmp_hun.ih_pptr
|
||||
#define icmp_gwaddr icmp_hun.ih_gwaddr
|
||||
#define icmp_id icmp_hun.ih_idseq.icd_id
|
||||
#define icmp_seq icmp_hun.ih_idseq.icd_seq
|
||||
#define icmp_void icmp_hun.ih_void
|
||||
#define icmp_pmvoid icmp_hun.ih_pmtu.ipm_void
|
||||
#define icmp_nextmtu icmp_hun.ih_pmtu.ipm_nextmtu
|
||||
#define icmp_num_addrs icmp_hun.ih_rtradv.irt_num_addrs
|
||||
#define icmp_wpa icmp_hun.ih_rtradv.irt_wpa
|
||||
#define icmp_lifetime icmp_hun.ih_rtradv.irt_lifetime
|
||||
union {
|
||||
struct {
|
||||
uint32_t its_otime;
|
||||
uint32_t its_rtime;
|
||||
uint32_t its_ttime;
|
||||
} id_ts;
|
||||
struct {
|
||||
iph idi_ip;
|
||||
} id_ip;
|
||||
struct {
|
||||
uint32_t ira_addr;
|
||||
uint32_t ira_preference;
|
||||
} id_radv;
|
||||
uint32_t id_mask;
|
||||
uint8_t id_data[1];
|
||||
} icmp_dun;
|
||||
#define icmp_otime icmp_dun.id_ts.its_otime
|
||||
#define icmp_rtime icmp_dun.id_ts.its_rtime
|
||||
#define icmp_ttime icmp_dun.id_ts.its_ttime
|
||||
#define icmp_ip icmp_dun.id_ip.idi_ip
|
||||
#define icmp_radv icmp_dun.id_radv
|
||||
#define icmp_mask icmp_dun.id_mask
|
||||
#define icmp_data icmp_dun.id_data
|
||||
} icmph;
|
||||
|
||||
typedef struct {
|
||||
uint8_t igmp_type;
|
||||
uint8_t igmp_code;
|
||||
uint16_t igmp_cksum;
|
||||
uint32_t igmp_group;
|
||||
} igmph;
|
||||
|
||||
#pragma pack()
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
/*
|
||||
|
||||
Show_dump 0.1.1a
|
||||
|
||||
Copyright 2004,2005,2006 Luigi Auriemma
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
http://www.gnu.org/licenses/gpl.txt
|
||||
|
||||
This function, optimized for performace, shows the hex dump of a buffer and
|
||||
places it in a stream
|
||||
|
||||
Usage:
|
||||
show_dump(buffer, buffer_length, stdout);
|
||||
show_dump(buffer, buffer_length, fd);
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
|
||||
|
||||
void show_dump(unsigned char *data, unsigned int len, FILE *stream) {
|
||||
const static char hex[] = "0123456789abcdef";
|
||||
static unsigned char buff[67]; /* HEX CHAR\n */
|
||||
unsigned char chr,
|
||||
*bytes,
|
||||
*p,
|
||||
*limit,
|
||||
*glimit = data + len;
|
||||
|
||||
memset(buff + 2, ' ', 48);
|
||||
|
||||
while(data < glimit) {
|
||||
limit = data + 16;
|
||||
if(limit > glimit) {
|
||||
limit = glimit;
|
||||
memset(buff, ' ', 48);
|
||||
}
|
||||
|
||||
p = buff;
|
||||
bytes = p + 50;
|
||||
while(data < limit) {
|
||||
chr = *data;
|
||||
*p++ = hex[chr >> 4];
|
||||
*p++ = hex[chr & 15];
|
||||
p++;
|
||||
*bytes++ = ((chr < ' ') || (chr >= 0x7f)) ? '.' : chr;
|
||||
data++;
|
||||
}
|
||||
*bytes++ = '\n';
|
||||
|
||||
fwrite(buff, bytes - buff, 1, stream);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,741 @@
|
|||
/*
|
||||
Copyright 2005,2006,2007,2008,2009 Luigi Auriemma
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
http://www.gnu.org/licenses/gpl-2.0.txt
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
#include <time.h>
|
||||
#include <ctype.h>
|
||||
#include "acpdump2.h"
|
||||
#include "show_dump.h"
|
||||
|
||||
#ifdef WIN32
|
||||
#include <winsock.h>
|
||||
#include "winerr.h"
|
||||
|
||||
#define close closesocket
|
||||
#define in_addr_t uint32_t
|
||||
#define LOADDLL hLib = LoadLibrary(fname); \
|
||||
if(!hLib) winerr();
|
||||
#define GETFUNC(x,y) x = (void *)GetProcAddress(hLib, y); \
|
||||
if(!quiet) printf(" %-10s %p\n", y, x);
|
||||
//if(!x) winerr();
|
||||
#define CLOSEDLL FreeLibrary(hLib);
|
||||
#define set_priority SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS)
|
||||
HINSTANCE hLib = NULL;
|
||||
|
||||
void winerr(void);
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/types.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netdb.h>
|
||||
#include <sys/time.h>
|
||||
#include <dlfcn.h> // -ldl
|
||||
|
||||
#define LOADDLL hLib = dlopen(fname, RTLD_LAZY); \
|
||||
if(!hLib) { \
|
||||
fprintf(stderr, "\nError: %s\n\n", dlerror()); \
|
||||
exit(1); \
|
||||
}
|
||||
#define GETFUNC(x,y) x = (void *)dlsym(hLib, y); \
|
||||
if(!quiet) printf(" %-10s %08x\n", y, (uint32_t)x);
|
||||
//error = dlerror();
|
||||
//if(error || !x) {
|
||||
//fprintf(stderr, "\nError: %s\n\n", error);
|
||||
//exit(1);
|
||||
#define CLOSEDLL dlclose(hLib);
|
||||
#define set_priority nice(-10)
|
||||
void *hLib = NULL;
|
||||
#define SOCKET int
|
||||
#define SOCKET_ERROR (-1)
|
||||
#endif
|
||||
|
||||
typedef uint8_t u8;
|
||||
typedef uint16_t u16;
|
||||
typedef uint32_t u32;
|
||||
|
||||
|
||||
|
||||
#define VER "0.4.1"
|
||||
#define BUFFSZ 0xffff
|
||||
#define RECVFROMF(X) \
|
||||
psz = sizeof(struct sockaddr_in); \
|
||||
len = recvfrom(X, buff, BUFFSZ, 0, (struct sockaddr *)&peerl, &psz); \
|
||||
if(len < 0) continue;
|
||||
#define SENDTOFC(X,Y) \
|
||||
if(sendtof(sdl, buff, len, &c->peer, X) != len) { \
|
||||
c = check_sd(&c->peer, 1); /* it's ever c->peer */ \
|
||||
Y; \
|
||||
if(!c) break; \
|
||||
}
|
||||
|
||||
#ifndef IP_TOS
|
||||
#define IP_TOS 3
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
// default: __cdecl
|
||||
static int (* sudp_init)(u8 *) = NULL; // initialization
|
||||
static int (* sudp_pck)(u8 *, int) = NULL; // modification of the packet
|
||||
static int (* sudp_vis)(u8 *, int) = NULL; // modification for visualization only
|
||||
|
||||
//static SOCKET (*mysocket)(int af, int type, int protocol) = NULL;
|
||||
//static int (*myconnect)(SOCKET s, const struct sockaddr *name, int namelen) = NULL;
|
||||
//static SOCKET (*myaccept)(SOCKET s, const struct sockaddr *name, int *namelen) = NULL;
|
||||
//static int (*mybind)(SOCKET s, const struct sockaddr *name, int namelen) = NULL;
|
||||
//static int (*myclose)(SOCKET s) = NULL;
|
||||
//static int (*myrecv)(SOCKET s, char *buf, int len, int flags) = NULL;
|
||||
static int (*myrecvfrom)(SOCKET s, char *buf, int len, int flags, struct sockaddr *from, int *fromlen) = NULL;
|
||||
//static int (*mysend)(SOCKET s, char **retbuf, int len, int flags) = NULL;
|
||||
static int (*mysendto)(SOCKET s, char **retbuf, int len, int flags, const struct sockaddr *to, int tolen) = NULL;
|
||||
|
||||
|
||||
|
||||
struct clients_struct {
|
||||
int sd; // it's needed to use a different source port for each packet
|
||||
struct sockaddr_in peer;
|
||||
time_t timez;
|
||||
struct clients_struct *next;
|
||||
} *clients = NULL;
|
||||
|
||||
struct sockaddr_in *dhost = NULL;
|
||||
in_addr_t lhost = INADDR_ANY,
|
||||
Lhost = INADDR_ANY;
|
||||
int multisock = 0,
|
||||
samesock = 0,
|
||||
quiet = 0,
|
||||
timeout = 60; // NAT uses a timeout of 5 minutes (300 seconds)
|
||||
|
||||
|
||||
|
||||
int sendtof(int s, char *buf, int len, struct sockaddr_in *to, int do_mysendto);
|
||||
int bind_udp_socket(struct sockaddr_in *peer, in_addr_t iface, u16 port);
|
||||
struct clients_struct *check_sd(struct sockaddr_in *peer, int force_remove);
|
||||
struct sockaddr_in *create_peer_array(u8 *list, u16 default_port);
|
||||
void show_peer_array(u8 *str, struct sockaddr_in *peer);
|
||||
void loaddll(u8 *fname, u8 *par);
|
||||
in_addr_t resolv(char *host);
|
||||
void std_err(void);
|
||||
|
||||
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
struct clients_struct *c = NULL,
|
||||
*tmpc;
|
||||
struct sockaddr_in peerl,
|
||||
peer0,
|
||||
*psrc = NULL,
|
||||
*pdst = NULL;
|
||||
struct timeval tout;
|
||||
FILE *fdcap = NULL;
|
||||
fd_set readset;
|
||||
int sdl = 0,
|
||||
sdi = 0,
|
||||
sd0 = 0,
|
||||
selsock = 0,
|
||||
i,
|
||||
len = 0,
|
||||
psz = 0,
|
||||
hexdump = 0,
|
||||
t,
|
||||
everyone = 0,
|
||||
priority = 0;
|
||||
u16 port,
|
||||
lport,
|
||||
inject = 0;
|
||||
u8 tmp[16],
|
||||
*buff = NULL,
|
||||
*acpfile = NULL,
|
||||
*dllname = NULL,
|
||||
*dllpar = NULL;
|
||||
|
||||
#ifdef WIN32
|
||||
WSADATA wsadata;
|
||||
WSAStartup(MAKEWORD(1,0), &wsadata);
|
||||
#endif
|
||||
|
||||
setbuf(stdout, NULL);
|
||||
setbuf(stderr, NULL);
|
||||
if(argc < 4) {
|
||||
fputs("\n"
|
||||
"Simple UDP proxy/pipe "VER"\n"
|
||||
"by Luigi Auriemma\n"
|
||||
"e-mail: aluigi@autistici.org\n"
|
||||
"web: aluigi.org\n"
|
||||
"\n", stderr);
|
||||
|
||||
|
||||
printf("\n"
|
||||
"Usage: %s [options] <server*> <server_port> <local_port>\n"
|
||||
"\n"
|
||||
"Options:\n"
|
||||
"-x show the hex dump of each packet\n"
|
||||
"-a FILE create a CAP (tcpdump) file in which storing all the packets\n"
|
||||
"-b IP bind only the input interface identified with IP\n"
|
||||
"-B IP as above but works only for the outgoing socket, this means you can\n"
|
||||
" decide to use a secondary interface for connecting to the host (for\n"
|
||||
" example using a wireless connection instead of the main one)\n"
|
||||
"-l LIB load a dll/so file which will be used to process all the incoming\n"
|
||||
" packets. The library must contain the following __cdecl functions:\n"
|
||||
" int sudp_init(char *data); // if you need initialization\n"
|
||||
" int sudp_pck(char *data, int len); // each packet goes here\n"
|
||||
" int sudp_vis(char *data, int len); // for visualization only\n"
|
||||
" int myrecvfrom(...cut...); // proxocket plugin\n"
|
||||
" int mysendto(...cut...); // proxocket plugin\n"
|
||||
"-L PAR parameter for the initialization of the above function,\n"
|
||||
" if the plugin library supports parameters use -L \"\" for help/list\n"
|
||||
"-e forward each packet to anyone (clients and server) except the sender,\n"
|
||||
" it works just like a chat or a broadcaster\n"
|
||||
"-i PORT injection option, listen on the port PORT and each packet received\n"
|
||||
" here is sent to the server from all the connected clients\n"
|
||||
"-X in case of multiple hosts assigns a new socket to each client, this\n"
|
||||
" is useful if the hosts are the same for using multiple source ports\n"
|
||||
"-Y just the opposite of the above one, ANY client has the same port\n"
|
||||
"-t SECS seconds of inactivity after which closing the client socket (%d)\n"
|
||||
"-p increase process priority\n"
|
||||
"-q quiet output\n"
|
||||
"\n"
|
||||
"* <server> can be also a sequence of hostnames and IP addresses separated by\n"
|
||||
" comma to which will be sent and received all the packets at the same time.\n"
|
||||
" <server> can also contain the port using the syntax IP:PORT, such port will\n"
|
||||
" override the default one set by <server_port>.\n"
|
||||
" if <server> is 0 the tool will consider <server_port> as a local port and\n"
|
||||
" will act just like a double binding mode (experimental!)\n"
|
||||
"\n", argv[0], timeout);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
argc -= 3;
|
||||
for(i = 1; i < argc; i++) {
|
||||
if(((argv[i][0] != '-') && (argv[i][0] != '/')) || (strlen(argv[i]) != 2)) {
|
||||
printf("\nError: wrong argument (%s)\n", argv[i]);
|
||||
exit(1);
|
||||
}
|
||||
switch(argv[i][1]) {
|
||||
case 'x': hexdump = 1; break;
|
||||
case 'a': acpfile = argv[++i]; break;
|
||||
case 'b': lhost = resolv(argv[++i]); break;
|
||||
case 'B': Lhost = resolv(argv[++i]); break;
|
||||
case 'l': dllname = argv[++i]; break;
|
||||
case 'L': dllpar = argv[++i]; break;
|
||||
case 'e': everyone = 1; break;
|
||||
case 'i': inject = atoi(argv[++i]); break;
|
||||
case 'p': priority = 1; break;
|
||||
case 'q': quiet = 1; break;
|
||||
case 'X': multisock = 1; break;
|
||||
case 'Y': samesock = 1; break;
|
||||
case 't': timeout = atoi(argv[++i]); break;
|
||||
default: {
|
||||
fprintf(stderr, "\nError: wrong command-line argument (%s)\n\n", argv[i]);
|
||||
exit(1);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
||||
port = atoi(argv[argc + 1]);
|
||||
lport = atoi(argv[argc + 2]);
|
||||
dhost = create_peer_array(argv[argc], port);
|
||||
|
||||
if(lhost == INADDR_NONE) std_err();
|
||||
if(Lhost == INADDR_NONE) std_err();
|
||||
|
||||
sdl = bind_udp_socket(NULL, lhost, lport);
|
||||
|
||||
if(inject) sdi = bind_udp_socket(NULL, lhost, inject);
|
||||
|
||||
if(samesock) {
|
||||
if(!quiet) fprintf(stderr, "- same socket/port mode\n");
|
||||
samesock = bind_udp_socket(NULL, Lhost, 0);
|
||||
}
|
||||
if(multisock) {
|
||||
if(!quiet) fprintf(stderr, "- multi socket/port mode\n");
|
||||
}
|
||||
|
||||
if(!quiet) {
|
||||
if(dhost[0].sin_addr.s_addr) {
|
||||
show_peer_array("- remote hosts: ", dhost);
|
||||
} else {
|
||||
fprintf(stderr, "- double binding\n");
|
||||
fprintf(stderr, "- dest_port %hu\n", port);
|
||||
}
|
||||
}
|
||||
|
||||
if(dllname) loaddll(dllname, dllpar);
|
||||
|
||||
if(acpfile) {
|
||||
if(!quiet) printf("- create ACP file %s\n", acpfile);
|
||||
fdcap = fopen(acpfile, "rb");
|
||||
if(fdcap) {
|
||||
fclose(fdcap);
|
||||
fprintf(stderr, "- do you want to overwrite (Y) or append (A) the file? (y/a/N)\n ");
|
||||
fgets(tmp, sizeof(tmp), stdin);
|
||||
t = tmp[0];
|
||||
if(t == 'a') {
|
||||
} else if(t == 'y') {
|
||||
} else return(0);
|
||||
} else {
|
||||
t = 0;
|
||||
}
|
||||
fdcap = fopen(acpfile, (t == 'a') ? "ab" : "wb");
|
||||
if(!fdcap) std_err();
|
||||
if(t != 'a') create_acp(fdcap);
|
||||
}
|
||||
|
||||
if(priority) set_priority;
|
||||
|
||||
if(!dhost[0].sin_addr.s_addr) {
|
||||
sd0 = bind_udp_socket(&peer0, Lhost, port);
|
||||
printf("- wait first packet from the server (double-binding mode)\n");
|
||||
FD_ZERO(&readset); // wait first client's packet, this is NEEDED!
|
||||
FD_SET(sd0, &readset);
|
||||
if(select(sd0 + 1, &readset, NULL, NULL, NULL)
|
||||
< 0) std_err();
|
||||
}
|
||||
|
||||
printf("- ready\n");
|
||||
FD_ZERO(&readset); // wait first client's packet, this is NEEDED!
|
||||
FD_SET(sdl, &readset);
|
||||
if(select(sdl + 1, &readset, NULL, NULL, NULL)
|
||||
< 0) std_err();
|
||||
|
||||
buff = malloc(BUFFSZ);
|
||||
if(!buff) std_err();
|
||||
clients = NULL;
|
||||
|
||||
for(;;) {
|
||||
FD_ZERO(&readset);
|
||||
FD_SET(sdl, &readset);
|
||||
selsock = sdl;
|
||||
if(sd0) {
|
||||
FD_SET(sd0, &readset);
|
||||
if(sd0 > selsock) selsock = sd0;
|
||||
}
|
||||
if(sdi) {
|
||||
FD_SET(sdi, &readset);
|
||||
if(sdi > selsock) selsock = sdi;
|
||||
}
|
||||
for(c = clients; c; c = c->next) {
|
||||
FD_SET(c->sd, &readset);
|
||||
if(c->sd > selsock) selsock = c->sd;
|
||||
}
|
||||
|
||||
tout.tv_sec = timeout; // this is useful if we want to free memory
|
||||
tout.tv_usec = 0; // ...rarely used but I think it's good here
|
||||
t = select(selsock + 1, &readset, NULL, NULL, &tout);
|
||||
if(t < 0) std_err();
|
||||
if(!t) { // timeout reached, call check_sd for removing the old clients
|
||||
memset(&peerl, 0, sizeof(struct sockaddr_in));
|
||||
check_sd(&peerl, 0);
|
||||
continue;
|
||||
}
|
||||
|
||||
if(sdi && (FD_ISSET(sdi, &readset))) {
|
||||
RECVFROMF(sdi)
|
||||
|
||||
if(!quiet) printf("- packet injection from %s:%hu (%d bytes)\n",
|
||||
inet_ntoa(peerl.sin_addr), ntohs(peerl.sin_port), len);
|
||||
|
||||
psrc = &peerl;
|
||||
pdst = &dhost[0]; // the first one is enough, it's used only for the CAP file
|
||||
|
||||
if(sudp_pck) len = sudp_pck(buff, len); // packets modification
|
||||
|
||||
for(c = clients; c; c = c->next) {
|
||||
if(sd0) sendtof(sd0, buff, len, &peer0, 1);
|
||||
for(i = 0; dhost[i].sin_addr.s_addr; i++) {
|
||||
sendtof(c->sd, buff, len, &dhost[i], 1);
|
||||
}
|
||||
}
|
||||
|
||||
if(everyone) {
|
||||
for(c = clients; c; c = c->next) {
|
||||
SENDTOFC(1,)
|
||||
}
|
||||
}
|
||||
|
||||
} else if(sd0 && FD_ISSET(sd0, &readset)) { // experimental and useless
|
||||
RECVFROMF(sd0)
|
||||
|
||||
psrc = &peerl;
|
||||
pdst = &peer0; // yes it's wrong but it's not necessary
|
||||
|
||||
if(sudp_pck) len = sudp_pck(buff, len); // packets modification
|
||||
|
||||
for(c = clients; c; c = c->next) {
|
||||
SENDTOFC(1,)
|
||||
}
|
||||
|
||||
if(everyone) {
|
||||
// nothing to do here
|
||||
}
|
||||
} else if(FD_ISSET(sdl, &readset)) {
|
||||
RECVFROMF(sdl)
|
||||
|
||||
c = check_sd(&peerl, 0); // check if this is a new or existent client
|
||||
if(!c) continue;
|
||||
|
||||
psrc = &c->peer;
|
||||
pdst = &dhost[0]; // the first one is enough, it's used only for the CAP file
|
||||
|
||||
if(sudp_pck) len = sudp_pck(buff, len); // packets modification
|
||||
|
||||
if(sd0) sendtof(sd0, buff, len, &peer0, 1);
|
||||
if(multisock) {
|
||||
i = 0;
|
||||
for(c = clients; c; c = c->next) {
|
||||
if(!dhost[i].sin_addr.s_addr) break;
|
||||
if(memcmp(&c->peer, &peerl, sizeof(struct sockaddr_in))) continue;
|
||||
sendtof(c->sd, buff, len, &dhost[i], 1);
|
||||
i++;
|
||||
}
|
||||
} else {
|
||||
for(i = 0; dhost[i].sin_addr.s_addr; i++) {
|
||||
sendtof(c->sd, buff, len, &dhost[i], 1);
|
||||
}
|
||||
}
|
||||
|
||||
if(everyone) {
|
||||
tmpc = c;
|
||||
for(c = clients; c; c = c->next) {
|
||||
if(c == tmpc) continue;
|
||||
SENDTOFC(1,)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for(c = clients; c; c = c->next) {
|
||||
if(!FD_ISSET(c->sd, &readset)) continue;
|
||||
RECVFROMF(c->sd)
|
||||
|
||||
psrc = &peerl;
|
||||
pdst = &c->peer;
|
||||
|
||||
if(sudp_pck) len = sudp_pck(buff, len); // packets modification
|
||||
if(myrecvfrom) len = myrecvfrom(c->sd, buff, len, 0, (struct sockaddr *)psrc, &psz);
|
||||
|
||||
SENDTOFC(0, pdst = NULL) // like SENDTOFC but without the handling of mysendto
|
||||
|
||||
if(everyone || samesock) {
|
||||
tmpc = c;
|
||||
for(c = clients; c; c = c->next) {
|
||||
if(c == tmpc) continue;
|
||||
SENDTOFC(1,)
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(!psrc || !pdst) continue; // the following is only for visualization
|
||||
|
||||
if(fdcap) acp_dump(
|
||||
fdcap, SOCK_DGRAM, IPPROTO_UDP,
|
||||
psrc->sin_addr.s_addr, psrc->sin_port, pdst->sin_addr.s_addr, pdst->sin_port,
|
||||
buff, len,
|
||||
NULL, NULL, NULL, NULL);
|
||||
|
||||
if(sudp_vis) len = sudp_vis(buff, len);
|
||||
|
||||
if(hexdump) {
|
||||
if(!quiet) {
|
||||
printf("\n%s:%hu -> ", inet_ntoa(psrc->sin_addr), ntohs(psrc->sin_port));
|
||||
printf("%s:%hu\n", inet_ntoa(pdst->sin_addr), ntohs(pdst->sin_port));
|
||||
}
|
||||
show_dump(buff, len, stdout);
|
||||
}
|
||||
}
|
||||
|
||||
close(sdl);
|
||||
if(sdi) close(sdi);
|
||||
if(sd0) close(sd0);
|
||||
if(fdcap) fclose(fdcap);
|
||||
if(hLib) CLOSEDLL
|
||||
free(buff);
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
int sendtof(int s, char *buf, int len, struct sockaddr_in *to, int do_mysendto) {
|
||||
int oldlen = 0,
|
||||
ret;
|
||||
char *oldbuf = NULL;
|
||||
|
||||
if(!do_mysendto) {
|
||||
return(sendto(s, buf, len, 0, (struct sockaddr *)to, sizeof(struct sockaddr_in)));
|
||||
}
|
||||
|
||||
if(mysendto) {
|
||||
oldbuf = buf;
|
||||
oldlen = len;
|
||||
ret = mysendto(s, &buf, len, 0, (struct sockaddr *)to, sizeof(struct sockaddr_in));
|
||||
if(ret >= 0) {
|
||||
// call real function
|
||||
} else if(ret == SOCKET_ERROR) {
|
||||
goto quit_and_free;
|
||||
} else {
|
||||
ret = oldlen;
|
||||
goto quit_and_free;
|
||||
}
|
||||
len = ret;
|
||||
}
|
||||
ret = sendto(s, buf, len, 0, (struct sockaddr *)to, sizeof(struct sockaddr_in));
|
||||
quit_and_free:
|
||||
if(mysendto) {
|
||||
if(oldbuf != buf) free(buf);
|
||||
if(ret == len) ret = oldlen;
|
||||
}
|
||||
return(ret);
|
||||
}
|
||||
|
||||
|
||||
|
||||
struct clients_struct *check_sd(struct sockaddr_in *peer, int force_remove) {
|
||||
struct clients_struct *c,
|
||||
*tmp,
|
||||
*prev,
|
||||
*ret;
|
||||
time_t curr;
|
||||
int multi = 0;
|
||||
|
||||
curr = time(NULL);
|
||||
prev = NULL;
|
||||
ret = NULL;
|
||||
|
||||
for(c = clients; c; ) {
|
||||
if((c->peer.sin_addr.s_addr == peer->sin_addr.s_addr) && (c->peer.sin_port == peer->sin_port)) {
|
||||
c->timez = curr;
|
||||
ret = c;
|
||||
if(force_remove) {
|
||||
c->timez = (curr - timeout) - 1;
|
||||
ret = prev;
|
||||
}
|
||||
}
|
||||
if((curr - c->timez) >= timeout) {
|
||||
if(!quiet) printf("- remove %s:%hu\n",
|
||||
inet_ntoa(c->peer.sin_addr), ntohs(c->peer.sin_port));
|
||||
|
||||
tmp = c->next;
|
||||
if(samesock) {
|
||||
// do NOT close c->sd!
|
||||
} else {
|
||||
close(c->sd);
|
||||
}
|
||||
free(c);
|
||||
if(prev) { // second, third and so on
|
||||
prev->next = tmp;
|
||||
} else { // the first only
|
||||
clients = tmp;
|
||||
}
|
||||
c = tmp; // already the next
|
||||
} else {
|
||||
prev = c;
|
||||
c = c->next; // get the next
|
||||
}
|
||||
}
|
||||
|
||||
if(force_remove) return(ret);
|
||||
if(ret) return(ret);
|
||||
if((peer->sin_addr.s_addr == INADDR_ANY) || (peer->sin_addr.s_addr == INADDR_NONE) || !peer->sin_port) return(NULL);
|
||||
|
||||
multisock_doit:
|
||||
c = malloc(sizeof(struct clients_struct));
|
||||
if(!c) return(NULL);
|
||||
if(prev) {
|
||||
prev->next = c;
|
||||
} else {
|
||||
clients = c;
|
||||
}
|
||||
|
||||
if(samesock) {
|
||||
c->sd = samesock;
|
||||
} else {
|
||||
c->sd = bind_udp_socket(NULL, Lhost, 0);
|
||||
}
|
||||
memcpy(&c->peer, peer, sizeof(struct sockaddr_in));
|
||||
c->timez = curr;
|
||||
c->next = NULL;
|
||||
|
||||
if(!quiet) printf("- add %s:%hu\n",
|
||||
inet_ntoa(c->peer.sin_addr), ntohs(c->peer.sin_port));
|
||||
|
||||
if(multisock) {
|
||||
prev = c;
|
||||
multi++;
|
||||
if(dhost[multi].sin_addr.s_addr) goto multisock_doit;
|
||||
}
|
||||
|
||||
return(c);
|
||||
}
|
||||
|
||||
|
||||
|
||||
struct sockaddr_in *create_peer_array(u8 *list, u16 default_port) {
|
||||
struct sockaddr_in *ret;
|
||||
int i,
|
||||
size = 1;
|
||||
u16 port;
|
||||
u8 *p1,
|
||||
*p2;
|
||||
|
||||
for(p2 = list; (p1 = strchr(p2, ',')); size++, p2 = p1 + 1);
|
||||
|
||||
ret = calloc(size + 1, sizeof(struct sockaddr_in));
|
||||
if(!ret) std_err();
|
||||
|
||||
for(i = 0;;) {
|
||||
p1 = strchr(list, ',');
|
||||
if(p1) *p1 = 0;
|
||||
|
||||
port = default_port;
|
||||
p2 = strchr(list, ':');
|
||||
if(p2) {
|
||||
*p2 = 0;
|
||||
port = atoi(p2 + 1);
|
||||
}
|
||||
|
||||
while(*list == ' ') list++;
|
||||
ret[i].sin_addr.s_addr = resolv(list);
|
||||
ret[i].sin_port = htons(port);
|
||||
ret[i].sin_family = AF_INET;
|
||||
|
||||
i++;
|
||||
if(!p1) break;
|
||||
list = p1 + 1;
|
||||
}
|
||||
return(ret);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void show_peer_array(u8 *str, struct sockaddr_in *peer) {
|
||||
int i;
|
||||
|
||||
fputs(str, stderr);
|
||||
for(i = 0; peer[i].sin_addr.s_addr; i++) {
|
||||
if(i) fprintf(stderr, ", ");
|
||||
fprintf(stderr, "%s:%hu", inet_ntoa(peer[i].sin_addr), ntohs(peer[i].sin_port));
|
||||
}
|
||||
fputc('\n', stderr);
|
||||
}
|
||||
|
||||
|
||||
|
||||
int bind_udp_socket(struct sockaddr_in *peer, in_addr_t iface, u16 port) {
|
||||
struct sockaddr_in peer_tmp;
|
||||
int sd;
|
||||
static const int
|
||||
on = 1,
|
||||
tos = 0x10;
|
||||
static const struct
|
||||
linger ling = {1,1};
|
||||
|
||||
if(!peer) peer = &peer_tmp;
|
||||
peer->sin_addr.s_addr = iface;
|
||||
peer->sin_port = htons(port);
|
||||
peer->sin_family = AF_INET;
|
||||
|
||||
if((iface != INADDR_ANY) || port) {
|
||||
if(!quiet) printf("- bind UDP port %hu on interface %s\n",
|
||||
ntohs(peer->sin_port), inet_ntoa(peer->sin_addr));
|
||||
}
|
||||
|
||||
sd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
|
||||
if(sd < 0) std_err();
|
||||
setsockopt(sd, SOL_SOCKET, SO_REUSEADDR, (char *)&on, sizeof(on));
|
||||
if(bind(sd, (struct sockaddr *)peer, sizeof(struct sockaddr_in))
|
||||
< 0) std_err();
|
||||
|
||||
setsockopt(sd, SOL_SOCKET, SO_LINGER, (char *)&ling, sizeof(ling));
|
||||
setsockopt(sd, SOL_SOCKET, SO_BROADCAST, (char *)&on, sizeof(on));
|
||||
setsockopt(sd, IPPROTO_IP, IP_TOS, (char *)&tos, sizeof(tos));
|
||||
return(sd);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void loaddll(u8 *fname, u8 *par) {
|
||||
if(!fname) return;
|
||||
|
||||
printf("- load library %s\n", fname);
|
||||
|
||||
LOADDLL;
|
||||
GETFUNC(sudp_init, "sudp_init");
|
||||
GETFUNC(sudp_pck, "sudp_pck");
|
||||
GETFUNC(sudp_vis, "sudp_vis");
|
||||
GETFUNC(myrecvfrom, "myrecvfrom");
|
||||
GETFUNC(mysendto, "mysendto");
|
||||
|
||||
if(sudp_init && sudp_init(par)) {
|
||||
fprintf(stderr, "\nError: plugin initialization failed\n\n");
|
||||
CLOSEDLL
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
in_addr_t resolv(char *host) {
|
||||
struct hostent *hp;
|
||||
in_addr_t host_ip;
|
||||
|
||||
host_ip = inet_addr(host);
|
||||
if(host_ip == INADDR_NONE) {
|
||||
hp = gethostbyname(host);
|
||||
if(!hp) {
|
||||
fprintf(stderr, "\nError: unable to resolv hostname (%s)\n", host);
|
||||
exit(1);
|
||||
} else host_ip = *(in_addr_t *)hp->h_addr;
|
||||
}
|
||||
return(host_ip);
|
||||
}
|
||||
|
||||
|
||||
|
||||
#ifndef WIN32
|
||||
void std_err(void) {
|
||||
perror("\nError");
|
||||
exit(1);
|
||||
}
|
||||
#else
|
||||
void winerr(void) {
|
||||
char *error;
|
||||
|
||||
if(!FormatMessage(
|
||||
FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
|
||||
NULL,
|
||||
GetLastError(),
|
||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
|
||||
(LPTSTR)&error,
|
||||
0,
|
||||
NULL)) {
|
||||
error = strerror(errno);
|
||||
}
|
||||
printf("\nError: %s\n", error);
|
||||
//LocalFree(error);
|
||||
exit(1);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
/*
|
||||
Header file used for manage errors in Windows
|
||||
It support socket and errno too
|
||||
(this header replace the previous sock_errX.h)
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
|
||||
|
||||
void std_err(void) {
|
||||
char *error;
|
||||
|
||||
switch(WSAGetLastError()) {
|
||||
case 10004: error = "Interrupted system call"; break;
|
||||
case 10009: error = "Bad file number"; break;
|
||||
case 10013: error = "Permission denied"; break;
|
||||
case 10014: error = "Bad address"; break;
|
||||
case 10022: error = "Invalid argument (not bind)"; break;
|
||||
case 10024: error = "Too many open files"; break;
|
||||
case 10035: error = "Operation would block"; break;
|
||||
case 10036: error = "Operation now in progress"; break;
|
||||
case 10037: error = "Operation already in progress"; break;
|
||||
case 10038: error = "Socket operation on non-socket"; break;
|
||||
case 10039: error = "Destination address required"; break;
|
||||
case 10040: error = "Message too long"; break;
|
||||
case 10041: error = "Protocol wrong type for socket"; break;
|
||||
case 10042: error = "Bad protocol option"; break;
|
||||
case 10043: error = "Protocol not supported"; break;
|
||||
case 10044: error = "Socket type not supported"; break;
|
||||
case 10045: error = "Operation not supported on socket"; break;
|
||||
case 10046: error = "Protocol family not supported"; break;
|
||||
case 10047: error = "Address family not supported by protocol family"; break;
|
||||
case 10048: error = "Address already in use"; break;
|
||||
case 10049: error = "Can't assign requested address"; break;
|
||||
case 10050: error = "Network is down"; break;
|
||||
case 10051: error = "Network is unreachable"; break;
|
||||
case 10052: error = "Net dropped connection or reset"; break;
|
||||
case 10053: error = "Software caused connection abort"; break;
|
||||
case 10054: error = "Connection reset by peer"; break;
|
||||
case 10055: error = "No buffer space available"; break;
|
||||
case 10056: error = "Socket is already connected"; break;
|
||||
case 10057: error = "Socket is not connected"; break;
|
||||
case 10058: error = "Can't send after socket shutdown"; break;
|
||||
case 10059: error = "Too many references, can't splice"; break;
|
||||
case 10060: error = "Connection timed out"; break;
|
||||
case 10061: error = "Connection refused"; break;
|
||||
case 10062: error = "Too many levels of symbolic links"; break;
|
||||
case 10063: error = "File name too long"; break;
|
||||
case 10064: error = "Host is down"; break;
|
||||
case 10065: error = "No Route to Host"; break;
|
||||
case 10066: error = "Directory not empty"; break;
|
||||
case 10067: error = "Too many processes"; break;
|
||||
case 10068: error = "Too many users"; break;
|
||||
case 10069: error = "Disc Quota Exceeded"; break;
|
||||
case 10070: error = "Stale NFS file handle"; break;
|
||||
case 10091: error = "Network SubSystem is unavailable"; break;
|
||||
case 10092: error = "WINSOCK DLL Version out of range"; break;
|
||||
case 10093: error = "Successful WSASTARTUP not yet performed"; break;
|
||||
case 10071: error = "Too many levels of remote in path"; break;
|
||||
case 11001: error = "Host not found"; break;
|
||||
case 11002: error = "Non-Authoritative Host not found"; break;
|
||||
case 11003: error = "Non-Recoverable errors: FORMERR, REFUSED, NOTIMP"; break;
|
||||
case 11004: error = "Valid name, no data record of requested type"; break;
|
||||
default: error = strerror(errno); break;
|
||||
}
|
||||
fprintf(stderr, "\nError: %s\n", error);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue