|
You last visited: Today at 08:48
Advertisement
C# Get Username and password from the Client using sockets ?
Discussion on C# Get Username and password from the Client using sockets ? within the CO2 Programming forum part of the Conquer Online 2 category.
04/17/2014, 17:28
|
#16
|
elite*gold: 0
Join Date: Mar 2010
Posts: 475
Received Thanks: 14
|
Quote:
Originally Posted by abdoumatrix
check this better
SuperAids 's chat project
|
okay i`ll check it , but can you check this [ client side ] codes , i know its dumb but that what i can do for now ..
Code:
private void SERVER_CONNECT_BUTTON_Click(object sender, EventArgs e)
{
ConnectAuth();
}
Socket S_O_C_K_E_T;
public void ConnectAuth()
{
S_O_C_K_E_T = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
Thread rec = new Thread(recMsg);
byte tries = 0;
while (tries < 3 && !S_O_C_K_E_T.Connected)
{
try
{
S_O_C_K_E_T.Connect("127.0.0.1", 9999);
break;
}
catch { }
tries++;
System.Threading.Thread.Sleep(2000);
}
if (!S_O_C_K_E_T.Connected)
{
MessageBox.Show("Connecting failed due to server maintenance or internet congestion. Please re-login later.");
}
else
{
LOGIN_BUTTON.Enabled = true;
rec.Start();
}
}
ushort ClientSocketPort;
string ChatSocketIP;
uint ClientID;
Jeel_Chat_Client.Network.Forward.ForwardType FT;
void recMsg()
{
while (S_O_C_K_E_T.Connected)
{
Thread.Sleep(500);
byte[] Buffer = new byte[1000];
S_O_C_K_E_T.Receive(Buffer, 0, Buffer.Length, 0);
ushort Length = BitConverter.ToUInt16(Buffer, 0);
ushort ID = BitConverter.ToUInt16(Buffer, 2);
if (ID == 1055)
{
Network.Forward Fw = new Network.Forward(Buffer);
Fw.Buffer = Buffer;
ClientID = Fw.Identifier;
ChatSocketIP = Fw.IP.Replace("\0", "").Split('\0')[0];
ClientSocketPort = Fw.Port;
FT = Fw.Type;
switch (FT)
{
case Network.Forward.ForwardType.Banned:
{
MessageBox.Show("The account is banned.");
break;
}
case Network.Forward.ForwardType.InvalidInfo:
{
MessageBox.Show("invalid account id or password!");
break;
}
case Network.Forward.ForwardType.Ready:
{
ConnectToChatSocket();
break;
}
default:
{
MessageBox.Show("Please try to log on later!");
break;
}
}
}
}
}
void ChatrecMsg()
{
while (S_O_C_K_E_T.Connected)
{
Thread.Sleep(500);
byte[] Buffer = new byte[1000];
S_O_C_K_E_T.Receive(Buffer, 0, Buffer.Length, 0);
ushort Length = BitConverter.ToUInt16(Buffer, 0);
ushort ID = BitConverter.ToUInt16(Buffer, 2);
if (ID == 1055)
{
Network.Forward Fw = new Network.Forward(Buffer);
Fw.Buffer = Buffer;
ClientID = Fw.Identifier;
ChatSocketIP = Fw.IP.Replace("\0", "").Split('\0')[0];
ClientSocketPort = Fw.Port;
FT = Fw.Type;
switch (FT)
{
case Network.Forward.ForwardType.Banned:
{
MessageBox.Show("The account is banned.");
break;
}
case Network.Forward.ForwardType.InvalidInfo:
{
MessageBox.Show("invalid account id or password!");
break;
}
case Network.Forward.ForwardType.Ready:
{
ConnectToChatSocket();
break;
}
default:
{
MessageBox.Show("Please try to log on later!");
break;
}
}
}
}
}
private void ConnectToChatSocket()
{
S_O_C_K_E_T = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
Thread RecDem = new Thread(ChatrecMsg);
byte tries = 0;
while (tries < 3 && !S_O_C_K_E_T.Connected)
{
try
{
S_O_C_K_E_T.Connect(ChatSocketIP, ClientSocketPort);
break;
}
catch { }
tries++;
System.Threading.Thread.Sleep(2000);
}
if (!S_O_C_K_E_T.Connected)
{
MessageBox.Show("Connecting failed due to server maintenance or internet congestion. Please re-login later.");
}
else
{
LOGIN_BUTTON.Enabled = true;
RecDem.Start();
}
}
private void LOGIN_BUTTON_Click(object sender, EventArgs e)
{
Network.LoginPacket login = new Network.LoginPacket(true, USERNAME_BOX.Text, PASSWORD_BOX.Text);
Send(login.ToArray());
}
private void Send(Byte[] Buffer)
{
if (Buffer != null)
{
S_O_C_K_E_T.Send(Buffer);
}
}
|
|
|
04/19/2014, 20:24
|
#17
|
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
|
It's just another ****** andeen thread demonstrating he hasn't listened to any of the hundreds of other answers we've given him. You're wasting your time matrix.
|
|
|
04/21/2014, 20:16
|
#18
|
elite*gold: 0
Join Date: Feb 2014
Posts: 397
Received Thanks: 205
|
But those naming conventions though.
|
|
|
04/21/2014, 20:24
|
#19
|
elite*gold: 0
Join Date: Sep 2013
Posts: 197
Received Thanks: 140
|
Quote:
Originally Posted by InsomniacPro
But those naming conventions though.
|
What the ****.
|
|
|
04/22/2014, 00:42
|
#20
|
elite*gold: 0
Join Date: Feb 2014
Posts: 397
Received Thanks: 205
|
Quote:
Originally Posted by SteveRambo
What the ****.
|
Quote:
That.
|
|
|
04/22/2014, 02:26
|
#21
|
elite*gold: 0
Join Date: Sep 2013
Posts: 197
Received Thanks: 140
|
Quote:
Originally Posted by InsomniacPro
That.
|
Oh, I meant "What the ****" as in: "What the ****, that's some ugly-*** ****".
|
|
|
|
|
Similar Threads
|
SBot Password and Username
09/09/2014 - Silkroad Online - 2 Replies
How to find Password for SBot Account after I just purchased it
|
Invalid Username or Password
10/27/2013 - Minecraft - 2 Replies
Hallo Leute,
Unzwar wenn ich mich im Launcher oder in FTB Launcher einloggen will kommt immer Invalid Username or Password. Ich hab mit Email und ohne Email probiert.
AUF DER HOMPAGE KANN ICH MICH EINLOGGEN. Nur im Launcher halt nciht und ich benutze die selben Daten hab auch schon deinstalliert und passwort geändert ._.
Hilfe!!
|
Giving away username/password
08/26/2013 - League of Legends Trading - 11 Replies
Yo guys, one question if someone could help me please. I am trying to sell my account - http://www.elitepvpers.com/forum/league-legends-tr ading/2802907-euw-account-all-champions-skins.html
Some guy added me and made a proposal to me. First i have to give him my username/password, then he will pay me the money and then i will give him the email.
So my question is, can he steal my account if i give him the username/password only? I mean, i know he can, but can i recover it back? Thank you.
|
CO Opener with my username and password
09/29/2012 - CO2 Programming - 11 Replies
Can Some one told me how to Open Conquer At With my Own Username and password
Like >>>
enter my username and my password at application {not at conquer} and just click run and its could run
sorry for my bad english
|
All times are GMT +2. The time now is 08:48.
|
|