Go Back   RunUO - Ultima Online Emulation > RunUO > Core Modifications > Network Modifications

Network Modifications This forum is for modifications to the networking code of RunUO

Reply
 
Thread Tools Display Modes
Old 03-28-2007, 12:50 PM   #1 (permalink)
Newbie
 
Join Date: Nov 2002
Posts: 22
Default I don't understang how you received data

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]

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 ?
nexam is offline   Reply With Quote
Old 03-28-2007, 04:40 PM   #2 (permalink)
Forum Newbie
 
Join Date: Jun 2003
Posts: 12
Default

www.ricksprogs.com/UONetwork.rar
this is a console based client on C# with source...
Jintaro is offline   Reply With Quote
Old 03-28-2007, 06:53 PM   #3 (permalink)
Newbie
 
Join Date: Nov 2002
Posts: 22
Default

Great ! Thanks !
nexam is offline   Reply With Quote
Old 03-28-2007, 10:56 PM   #4 (permalink)
Forum Expert
 
mordero's Avatar
 
Join Date: Nov 2003
Location: Illinois, USA
Age: 21
Posts: 2,911
Default

And you should have posted this in the C# forum since this has nothing to do with Network Modification
mordero is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5