Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Tools

Development::Tools 3rd Party Tools for EQEMu (DB management tools, front ends, etc...)

Reply
 
Thread Tools Display Modes
  #1  
Old 07-09-2008, 08:49 AM
nosfentora
Discordant
 
Join Date: Oct 2004
Location: In a house
Posts: 377
Default Telnet and broadcasting

I'm writing some code to broadcast to the server through a tool i'm working on.

Using the following code it works
Code:
   Dim lReturn As Object
   lReturn = IIf(My.Settings.ShowTelnet, Shell("Telnet " & My.Settings.BroadcastServerIP & " " & My.Settings.BroadcastServerPort, AppWinStyle.NormalFocus, False), Shell("Telnet " & My.Settings.BroadcastServerIP & " " & My.Settings.BroadcastServerPort, AppWinStyle.Hide, False))
   Sleep(5)
   AppActivate(lReturn)
   Sleep(2)
   ''login
   System.Windows.Forms.SendKeys.SendWait(My.Settings.BroadcastUsername & "{ENTER}")
   Sleep(2)
   '' pass
   System.Windows.Forms.SendKeys.SendWait(My.Settings.BroadcastPassword & "{ENTER}")
   Sleep(2)
   ''broadcast message
   System.Windows.Forms.SendKeys.SendWait("broadcast " & msg & "{ENTER}")
   Sleep(1)
   ''LOGOFF
   System.Windows.Forms.SendKeys.SendWait("exit{ENTER}")
   Sleep(2)
   ''CLOSE TELNET
   System.Windows.Forms.SendKeys.SendWait("{ENTER}")
   System.Windows.Forms.SendKeys.SendWait("%{F4}")
*BUT* it does not work if the computer is locked (the telnet window stays open and times out - preventing any future broadcasts)

So I tried this:

Code:
            Dim sock As System.Net.Sockets.Socket
            sock = New System.Net.Sockets.Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)
            sock.Connect(My.Settings.BroadcastServerIP, Val(My.Settings.BroadcastServerPort))
            If sock.Connected Then
                sock.Send(System.Text.Encoding.ASCII.GetBytes(My.Settings.BroadcastUsername & vbCrLf))
                sock.Send(System.Text.Encoding.ASCII.GetBytes(My.Settings.BroadcastPassword & vbCrLf))
                sock.Send(System.Text.Encoding.ASCII.GetBytes("broadcast " & msg & vbCrLf))
                sock.Send(System.Text.Encoding.ASCII.GetBytes("exit" & vbCrLf & vbCrLf))
                sock.Shutdown(SocketShutdown.Both)
                sock.Disconnect(False)
                sock.Close()
                Log.WriteLine("Message Broadcasted!")
            Else
                Log.WriteLine("Failed to connect!")
            End If
            sock = Nothing
This worked once, and then continues to output the following in the World.exe window:
[DEBUG] [WORLD__ZONE] New TCP Connection from 0.0.0.0:0
[DEBUG] [WORLD__CONSOLE] removing concole (!tcp -> connected) from 0.0.0.0:

I then tried this:
Code:
            Dim ip As New System.Net.IPEndPoint(System.Net.Dns.GetHostAddresses(My.Settings.BroadcastServerIP)(0), My.Settings.BroadcastServerPort)
            Dim client As New System.Net.Sockets.TcpClient()
            client.Connect(ip)
            If client.Connected Then
                Dim myWrite As System.IO.StreamWriter = New System.IO.StreamWriter(client.GetStream())
                myWrite.WriteLine(My.Settings.BroadcastUsername)
                myWrite.WriteLine(My.Settings.BroadcastPassword)
                myWrite.WriteLine("broadcast " & msg)
                myWrite.WriteLine("exit")
                myWrite.Close()
                client.Close()
            End If
which never worked and constantly output
[DEBUG] [WORLD__ZONE] New TCP Connection from 0.0.0.0:0
[DEBUG] [WORLD__CONSOLE} removing concole (!tcp -> connected) from 0.0.0.0:

in the World.exe window

Any thoughts from the developers on a possible solution? The easiest would be to turn off the auto-lock on the computer, but I'd prefer not to.

(if this is the wrong area to post - please feel free to move it)
Reply With Quote
  #2  
Old 07-09-2008, 12:05 PM
LordRathgil
Banned
 
Join Date: Jun 2008
Location: planet earth
Posts: 137
Default

Ive got a gui that ive been working on for a bit that handles all that it does the same in world but it works fine its in c#.net though not vb.net
Reply With Quote
  #3  
Old 07-09-2008, 01:05 PM
nosfentora
Discordant
 
Join Date: Oct 2004
Location: In a house
Posts: 377
Default

i was watching in game to see if it broadcasted or not and it never did (when the ip 0.0.0.0:0 came up).

.net is pretty much the same all the way round - just minor syntax changes

if you wouldn't mind sharing the broadcasting portion of your code i'd appreciate it.
Reply With Quote
  #4  
Old 07-09-2008, 02:17 PM
LordRathgil
Banned
 
Join Date: Jun 2008
Location: planet earth
Posts: 137
Default

yeah ill just give you my whole gui provided you dont release the source ( dont want someone using it to cheat on servers taht aint their own and im sure someone will figure out how lol) Let me upload it and ill pm you the link
Reply With Quote
  #5  
Old 07-09-2008, 03:17 PM
nosfentora
Discordant
 
Join Date: Oct 2004
Location: In a house
Posts: 377
Default

Thanks - i greatly appreciate it! And I won't release the source.
Reply With Quote
Reply


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

Forum Jump

   

All times are GMT -4. The time now is 12:41 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3