|
||
|
|||||||
| Network Modifications This forum is for modifications to the networking code of RunUO |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Newbie
Join Date: Nov 2002
Posts: 22
|
TCP protocol ok....
I have read PacketHandlers.cs & Co, but i don't understand. I want to make a little client (without graphic) in order to make one or two action. I stop on login... How i must send my data ? I have make this (client code): Code:
SendData("0x91");
SendData("?"+log.Substring(0,30)+pass.Substring(0,30)+"]");
Code:
public void SendData(string data)
{
byte[] bufferSend =
System.Text.Encoding.Default.GetBytes(data);
try{
m_socket.Send(
bufferSend,0,
bufferSend.Length,
SocketFlags.None);
}
catch(Exception e){
Console.WriteLine(e.TargetSite.ToString() + ":\n"+e.Message.ToString() );
}
}
Code:
public void GetData()
{
while(true){
try{
byte[] bufferGet =
new Byte[m_socket.Available];
int sortie = m_socket.Receive(bufferGet);
string data =
System.Text.Encoding.ASCII.GetString(
bufferGet, 0, bufferGet.Length);
if(data.Length != 0){
//TEMPO
Console.WriteLine("Data Get: "+data);
}
}
catch(Exception e){
Console.WriteLine(e.TargetSite.ToString() + ":\n"+e.Message.ToString() );
Console.WriteLine("Try disconnect...");
Disconnect();
}
Thread.Sleep(50);
}
}
Ideas ? |
|
|
|
|
|
#2 (permalink) |
|
Forum Newbie
Join Date: Jun 2003
Posts: 12
|
www.ricksprogs.com/UONetwork.rar
this is a console based client on C# with source... |
|
|
|
|
|
#4 (permalink) |
|
Forum Expert
Join Date: Nov 2003
Location: Illinois, USA
Age: 21
Posts: 2,911
|
And you should have posted this in the C# forum since this has nothing to do with Network Modification
![]()
__________________
Useful links (Use them or die in a fire!!!): Ultimate Little Guide, C# Tutorials & Docs, RunUO Basic Scripts, Run UO How to..., Configure server for connections, Scripting for Dummies, Common Problem Solutions, FAQ Forum, RunUO Wiki, Basic Generics, Xml Tutorial |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|