Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

dg1423

Members
  • Posts

    543
  • Joined

  • Last visited

    Never

Posts posted by dg1423

  1. My new web-based updater I made for ST2\. I gets news from an html file and supports web scripting. Here's a screenie of what I have so far (NOTE: There's going to be a banner at the top behind the buttons and it is 100% working)

    ![](http://duckyp.org/updater.bmp)

    RATE AND COMMENTS PLEASE!!!!!!
  2. hmmm…. I probably should've dumped this into the source section, but this'll show you how to make phase one of the ORS (more to come of course :P)

    **ORS Phase 1:** Creating accounts from websites!!!

    Things you'll need:

    * TE/EE Source
    * VB6 to edit the source (Duh!)
    * A PHP enabled website (with socket capabilities (damn yahoo! hosting =.=''))
    * Be smart enough to use the following code in your site :P

    okay first open your server's source in VB6 and go to modServerTCP, sub IncomingData.

    Dim these:

    ```
    Dim q As Long
    Dim p As Long
    Dim count As Long
    Dim Imail As String
    Dim Name As String
    Dim PASSWORD As String
    ```

    and paste these under the two case"top" 's

    ```
    If LCase(Mid(Buffer, 1, 14)) = "newfaccountied" Then
                If Not IsLoggedIn(index) Then
                  q = 14
                  p = 15
                  count = 0
                  Do While q <= Len(Buffer)
                      Select Case count
                      Case 0
                        If Mid(Buffer, q, 1) = "," Then
                            Name = Mid(Buffer, p, q - p)
                            count = count + 1
                            p = q + 2
                        End If
                      Case 1
                        If Mid(Buffer, q, 1) = "," Then
                            Name = Mid(Buffer, p, q - p)
                            count = count + 1
                            p = q + 2
                            End If
                        Case 2
                            If Mid(Buffer, q, 1) = "," Then
                                PASSWORD = Mid(Buffer, p, q - p)
                                count = count + 1
                                p = q + 2
                            End If
                            Case 0
                        If Mid(Buffer, q, 1) = "," Then
                            Imail = Mid(Buffer, p, q - p)
                            count = count + 1
                            p = q + 2
                        End If
                        End Select
                        q = q + 1
                    Loop

                    If Imail = "" Then
                        Call SendDataTo(index, "You need to fill in your e-mail")
                    End If

                    For i = 1 To Len(Name)
                        n = Asc(Mid(Name, i, 1))

                        If (n >= 65 And n <= 90) Or (n >= 97 And n <= 122) Or (n = 95) Or (n = 32) Or (n >= 48 And n <= 57) Then
                        Else
                            Call SendDataTo(index, "Invalid name, only letters, numbers, spaces, and _ allowed in names.")
                            Exit Sub
                        End If
                    Next i

                    If Not AccountExist(Name) Then
                        Call AddAccount(index, Name, PASSWORD, Imail)
                        Call TextAdd(frmServer.txtText(0), "Account " & Name & " has been created.", True)
                        Call AddLog("Account " & Name & " has been created.", PLAYER_LOG)
                        Call SendDataTo(index, "Your account has been created!")
                    Else
                        Call SendDataTo(index, "Sorry, that account name is already taken!")
                    End If
                End If
                Exit Sub
                End If

                If LCase(Mid(Buffer, 1, 14)) = "newfaccountied" Then
                If Not IsLoggedIn(index) Then
                    q = 14
                  p = 15
                  count = 0
                  Do While q <= Len(Buffer)
                      Select Case count
                      Case 0
                        If Mid(Buffer, q, 1) = "," Then
                            Name = Mid(Buffer, p, q - p)
                            count = count + 1
                            p = q + 2
                        End If
                      Case 1
                        If Mid(Buffer, q, 1) = "," Then
                            Name = Mid(Buffer, p, q - p)
                            count = count + 1
                            p = q + 2
                            End If
                        Case 2
                            If Mid(Buffer, q, 1) = "," Then
                                PASSWORD = Mid(Buffer, p, q - p)
                                count = count + 1
                                p = q + 2
                            End If
                            Case 0
                        If Mid(Buffer, q, 1) = "," Then
                            Imail = Mid(Buffer, p, q - p)
                            count = count + 1
                            p = q + 2
                        End If
                        End Select
                        q = q + 1
                    Loop

                    If Imail = "" Then
                        Call SendDataTo(index, "You need to fill in your e-mail")
                    End If

                    For i = 1 To Len(Name)
                        n = Asc(Mid(Name, i, 1))

                        If (n >= 65 And n <= 90) Or (n >= 97 And n <= 122) Or (n = 95) Or (n = 32) Or (n >= 48 And n <= 57) Then
                        Else
                            Call SendDataTo(index, "Invalid name, only letters, numbers, spaces, and _ allowed in names.")
                            Exit Sub
                        End If
                    Next i

                    If Not AccountExist(Name) Then
                        Call AddAccount(index, Name, PASSWORD, Imail)
                        Call TextAdd(frmServer.txtText(0), "Account " & Name & " has been created.", True)
                        Call AddLog("Account " & Name & " has been created.", PLAYER_LOG)
                        Call SendDataTo(index, "Your account has been created!")
                    Else
                        Call SendDataTo(index, "Sorry, that account name is already taken!")
                    End If
                End If
                Call CloseSocket(index)
                End If
    ```
    okay that's all for the source, now for the php.

    we need two files:

    * blah.php
    * updater.php

    now in blah.php you can paste this in:

    ```
    ";
    echo "username:
    ";
    echo "password:
    ";
    echo "confirm:
    ";
    echo "";
    echo "";
    ?>
    ```
    then put this in updater.php:

    ```
    window.location='http://yourwebsitehere.com'; alert('Your account has been created!');";
    }
    else
    {
    echo "";
    }
    ?>
    ```
    now change iphere, porthere, and yourwebsitehere to your stuff.

    That's all it is for now though, so enjoy it until I upgrade and/or make phase 2!!
  3. This whole time I've been trying to work out all the code for use in sub IncomingData, when I could've just copied over the code from sub HandleData and slightly modified it… man that's a lot of work and time that could've been saved =.=''
  4. I believe that this will completely change the way eclipse has worked over the last..umm..how long has eclipse been here?? o_O I have theoretically completed my ORS(Online Registration System, It's on paper right now, I need to get home and test it out o_O) Any way, if this works, Players will be able to register for your eclipse game online and even view their character sprite, stats and all their info. Anyways, Im going to test this out and post it if it does. *wish me luck* >.<
  5. I've implemented it in my site [HERE](http://duckyp.org/server.php) if anyone wants to see some of the features in use.

    Right now It can report these to any php based web page

    * Online/Offline
    * Server IP
    * Server Port
    * Last time the server was booted up, as "0:00 AM/PM January 1, 2000"
    * Number of players online, as a single number "0"
    * The names of the players online, as a comma seperated list "dg1423, monkey, test"
    * Combo of number and names of players online, as "There are no players online." "There is 1 player online: dg1423" "There are 2 players online: dg1423, test"

    All of which are run by php functions and can be returned printed or as a string to be used in statements.

    Lets get started then:

    Create a new module and call it modStatus.

    Paste this inside:
    ```
    Dim Status As String
    Dim ServerStatus As String
    Dim ServerTime As String

    Dim InternetConnection As Long
    Dim FTPConnection As Long

    Private Declare Function InternetOpen Lib "wininet.dll" Alias "InternetOpenA" (ByVal sAgent As String, ByVal lAccessType As Long, ByVal sProxyName As String, ByVal sProxyBypass As String, ByVal lFlags As Long) As Long
    Private Declare Function InternetConnect Lib "wininet.dll" Alias "InternetConnectA" (ByVal hInternetSession As Long, ByVal sServerName As String, ByVal nServerPort As Integer, ByVal sUsername As String, ByVal sPassword As String, ByVal lService As Long, ByVal lFlags As Long, ByVal lContext As Long) As Long
    Private Declare Function FtpPutFile Lib "wininet.dll" Alias "FtpPutFileA" (ByVal hFtpSession As Long, ByVal lpszLocalFile As String, ByVal lpszRemoteFile As String, ByVal dwFlags As Long, ByVal dwContext As Long) As Boolean
    Private Declare Function InternetCloseHandle Lib "wininet.dll" (ByVal hInet As Long) As Integer

    Sub SaveStatus(Stat As Byte)
    Dim SS As String
    Dim SS0 As String
    Dim SS1 As String
    Dim SS2 As String
    Dim SS3 As String
    Dim SS4 As String
    Dim SS5 As String
    Dim SS6 As String
    Dim SS7 As String
    Dim Time As String
    Dim Color As String
    Dim CurrentTime As Variant
    Dim FileName As String
    Dim SaveFile As Boolean
    Dim CloseFTP As Integer
    Dim s As String
    Dim n As Long, i As Long
    Dim t As String

        s = ""
        n = 0
        For i = 1 To MAX_PLAYERS
            If IsPlaying(i) Then
                s = s & GetPlayerName(i) & ", "
                n = n + 1
            End If
        Next i

        If n = 0 Then
            s = "There are no players online."
        ElseIf n = 1 Then
            s = Mid(s, 1, Len(s) - 2)
            t = s
            s = "There is " & n & " player online: " & s & "."
        Else
            s = Mid(s, 1, Len(s) - 2)
            t = s
            s = "There are " & n & " players online: " & s & "."
        End If

    FileName = App.Path & "\status.php"

    CurrentTime = Now '3:00 PM Jan 16, 2005
    Time = Format(CurrentTime, "h:mm AMPM MMM d, yyyy")

    If Stat = 0 Then
        SS = "Offline"
        Color = "FF0000"
    ElseIf Stat = 1 Then
        SS = "Online"
        Color = "00FF00"
    End If

    SS0 = ""

    SS1 = SS
    SS2 = Time
    SS3 = s
    SS4 = n
    SS5 = t
    SS6 = STR(GameServer.LocalPort)
    SS7 = frmServer.Socket(0).LocalIP

    Open FileName For Output As #1
        Print #1, ""
    Close #1

    If Stat >= 2 Then Exit Sub

    If FileExist("DontUpdateStatus") = True Then Exit Sub

        InternetConnection = InternetOpen("FTPControl", 1, vbNullString, vbNullString, 0)
        If InternetConnection = 0 Then
            MsgBox ("Error opening internet connection!")
        Else
            FTPConnection = InternetConnect(InternetConnection, "", 0, "", "", 1, 0, 0)
            If FTPConnection = 0 Then MsgBox ("Error connecting to FTP server!")
        End If
        If FTPConnection <> 0 Then
            SaveFile = FtpPutFile(FTPConnection, FileName, "status.php", 1, 0)
            If SaveFile = False Then MsgBox ("Error sending Status.php file to FTP server!")

            CloseFTP = InternetCloseHandle(FTPConnection)
            If CloseFTP = False Then MsgBox ("Error closing FTP connection!")
            CloseFTP = InternetCloseHandle(InternetConnection)
            If CloseFTP = False Then MsgBox ("Error closing internet connection!")
        End If
    End Sub

    ```
    Now lets open modGeneral.

    Now at the bottom of sub InitServer, before the End Sub add this:
    ```
    Call SaveStatus(1)
    ```
    Now, still in modGeneral, go to sub DestroyServer find this:
    ```
    DoEvents
    ```
    and add this under it:
    ```
    Call SaveStatus(0)
    ```
    Done there. Open modGameLogic and head to sub JoinGame.
    Find this:
    ```
    Call DisabledTimeTo(index)
    ```
    and under that add this:
    ```
    Call SaveStatus(1)
    ```
    head on over to sub LeftGame and find this:
    ```
    Call RemovePMember(index)
    ```
    just below that add this:
    ```
    Call SaveStatus(1)
    ```
    And we're done!!!

    Make sure to change , , and to your info in modStatus.

    What this does is it uploads the file status.php (can be changed) to the root (can be changed) of your ftp server where it can then be called by other php files.

    here is a small tutorial on how to use to  the current functions if you aren't familiar with php.

    let's take this:

    ```
    server_status()
    ```
    That will print either "Online" or "Offline"

    but, as with all my functions, you can change it to

    ```
    server_status($output_method = 'string')
    ```
    to have it return a string instead of just printing it. This is useful if you want it to display a picture instead of just printing "Online" and can be used like this (I haven't tried this yet so if someone could confirm…)

    ```
    if (server_status($output_method = 'string') == "Online")
    echo "![](online.jpg)"
    else
    echo "![](offline.jpg)"
    ```
    EDIT: Tested right now and it works like a charm!

    Those are the basics on how to use the functions here's the list of them:

    ```
    server_status()
    ```
    returns/prints whether the server is online or offline

    ```
    server_ip()
    ```
    returns/prints the server ip address

    ```
    server_port()
    ```
    returns/prints the servers port

    ```
    last_mod()
    ```
    returns/prints the last time the server was started

    ```
    number_online()
    ```
    returns/prints the number of players online

    ```
    whois_online()
    ```
    returns/prints the names of the players online

    ```
    full_online()
    ```
    returns/prints a combination of the number and names of players online

    NOTE: Remember to use an Include in order to use the commands

    Well That's all, I hope everyone enjoys this!
  6. 1) I can't seem to find bltplayerHPbars anywhere x.x I'm trying to make it so the name and HP bar of a certain player will disappear when the variable "invis" is set to one in their account file. I think I already located the name in modText but I just can't find the HP bar.

    Also,

    2) Just wondering (I'm kinda new to vb) but If I were to change the gamefont=makefont… line (not on my computer right now I forgot what the whole line was) to something like gamefont=Tahoma.ttf would it work, or are there other variables needed to change the font?
  7. Well, all I saw were EE Outlines, and I wasn't completely sure if there were similar enough to use together. I highly doubt anyone will want/need/use these, but they're here if anyone wants them anyway.

    Here's the link:

    http://duckyp.org/files/TEOutlines.zip

    Well, never mind, these have transparent backgrounds but I hadn't seen spikes outlines (they have a black background) there before. =_=''
  8. After I log in for a couple minutes, the client crashes and reports "An uexpected error has occurred in the game loop. Character has been saved, client shutting down. Error num: -2005532086, Desc: Automation Error"
    Anyone know what it might be?
×
×
  • Create New...