Sign in to follow this  
Followers 0
Drew

Login TCP

2 posts in this topic

Alright , I've had a bit of experience in setting up TCP connection and what not , but through that experience I didn't realize a way I could add a "login" system to it.

You see , I'm in the "thinking and planning" stage of my next program and heres the basics on what I'm making:

-Allow users who have zero access to the server, have the ability to restart certain services the server provides.

-Allow the Administration to keep track of who did what , and take care of any problems.

-Do not allow automatic Account creation , I want this done manually so that I can obtain various information from the user to tag to the account, incase there are problems later on.

That's all about the program that seems relevant to the login system. I've searched a bit on the forum for any example scripts however I couldn't find anything. If anyone knows of something, let me know.

*Dreu

Share this post


Link to post
Share on other sites



Hi!

Just made a quickie on how I would imagine a log in system in tcp:

Server:

; Server (Start first)
TCPStartup()
$listen = TCPListen("127.0.0.1", 2111)
Global $username = "admin", $password = "password"
Global $loggedin = False
Do
    Sleep(10)
    $socket = TCPAccept($listen)
    If $socket <> -1 Then
        Do
            Sleep(100)
            $temp = TCPRecv($socket, 256)
        Until $temp <> ""
        $array = StringSplit($temp, "|")
        If $array[1] == $username And $array[2] == $password Then
            TCPSend($socket, "Connected")
            $loggedin = True
        Else
            TCPSend($socket, "Connection failed")
            TCPCloseSocket($socket)
            $socket = -1
        EndIf
    EndIf
    
Until $socket <> -1
MsgBox(0,"Success","Someone connected :)")oÝ÷ Ø  ݶ'§µ«­¢+Øì
±¥¹Ð)Q
AMÑÉÑÕÀ ¤(ÀÌØíÕÍɹµõ%¹ÁÕÑ   ½à ÅÕ½ÐíUÍɹµèÅÕ½Ðì°ÅÕ½ÐíA±Í¥¹ÁÕÐå½ÕÈÕÍɹµÅÕ½Ðì¤(ÀÌØíÁÍÍݽÉõ%¹ÁÕÑ   ½à ÅÕ½ÐíAÍÍݽÉÅÕ½Ðì°ÅÕ½ÐíA±Í¥¹ÁÕÐå½ÕÈÁÍÍݽÉÅÕ½Ðì°ÅÕ½ÐìÅÕ½Ðì°ÅÕ½Ðì¨ÅÕ½Ðì¤((ÀÌØíͽ­ÐõQ
A
½¹¹Ð ÅÕ½ÐìÄÈܸÀ¸À¸ÄÅÕ½Ðì°ÈÄÄĤ)%ÉɽÈQ¡¸(%5Í ½à ÄØ°ÅÕ½ÐíÉɽÈÅÕ½Ðì°ÅÕ½Ðí
½Õ±¸Ìäíн¹¹ÐѼÍÉÙÈÅÕ½Ðì¤(%á¥Ð)¹%)Q
AM¹ ÀÌØíͽ­Ð°ÀÌØíÕÍɹµµÀìÅÕ½ÐíðÅÕ½ÐìµÀìÀÌØíÁÍÍݽɤ()¼(%ͱÀ ÄÀ¤($ÀÌØíѵÀõQ
AIØ ÀÌØíͽ­Ð°ÈÔؤ)U¹Ñ¥°ÀÌØíѵÀ±ÐìÐìÅÕ½ÐìÅÕ½Ðì()%ÀÌØíѵÀôÅÕ½Ðí
½¹¹ÑÅÕ½ÐìQ¡¸(%5Í    ½à À°ÅÕ½ÐíMÕÍÌÅÕ½Ðì°ÅÕ½Ðíe½Ô½¹¹ÑÝ¥Ñ Ñ¡É¥¡ÐÕÍɹµ¹ÁÍÌè¤ÅÕ½Ðì¤)±Í(%5Í    ½à ÄØ°ÅÕ½ÐíMÕÍÌÅÕ½Ðì°ÅÕ½Ðí]ɽ¹ÕÍɹµ¼ÁÍÍݽÉè ÅÕ½Ðì¤)¹%

Hope it helps you :)


Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0