game creation

 
Post new topic   Reply to topic    Aprelium Forum Index -> Networking Issues
View previous topic :: View next topic  
Author Message
xpl0sions
-


Joined: 22 Jul 2005
Posts: 14

PostPosted: Fri Jul 22, 2005 1:22 pm    Post subject: game creation Reply with quote

I have created a online text based game, and ive checked over all the coding and database coding and all, but still when u signup for my game u are sent a password then when u try to login it wont accept the password.
I dont know if this is a error in my coding or somthing wrong with the webserver.
Pls help
Back to top View user's profile Send private message
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Fri Jul 22, 2005 2:24 pm    Post subject: Reply with quote

This could be a problem with the way you coded it. If you coded this text based
game in PHP , have you turned Registered Globals On ? This could be one of a
few things that could be wrong with your game script. Can you link us ?

Note: It would be nice if you could link us to it so we can try it out. Also you can
turn registered globals on by changing your php.ini file located in C:\Windows.

Sincerely , TRUSTpunk
Back to top View user's profile Send private message Visit poster's website
xpl0sions
-


Joined: 22 Jul 2005
Posts: 14

PostPosted: Fri Jul 22, 2005 3:11 pm    Post subject: Reply with quote

ill send u wat it says the url is

220.238.131.52 dont know if it is online

signup, it might take a while for u to receive ur password, when u do try to log in and it will say that it is incorrect,
Back to top View user's profile Send private message
p3
-


Joined: 17 Jun 2005
Posts: 615

PostPosted: Fri Jul 22, 2005 4:05 pm    Post subject: Reply with quote

xpl0sions wrote:
ill send u wat it says the url is

220.238.131.52 dont know if it is online

signup, it might take a while for u to receive ur password, when u do try to log in and it will say that it is incorrect,

No - It isn't online right now...

It timed out.


I guess I"ll try again later I guess...
Back to top View user's profile Send private message Send e-mail
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Fri Jul 22, 2005 4:06 pm    Post subject: Reply with quote

Are you using md5 for the password encryption ?

If you are then maybe your not encrypting the password when it checks to see
if the login is correct. You should encrypt the password being entered and also
compare that password with the one already on file. Hope this helped.

Sincerely , TRUSTpunk
Back to top View user's profile Send private message Visit poster's website
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Fri Jul 22, 2005 4:55 pm    Post subject: Re: game creation Reply with quote

xpl0sions wrote:

I dont know if this is a error in my coding or somthing wrong with the webserver.
Pls help

Can you post here you code so that we can review it? You do not give any information about how you're processing passwords and validating them so we do not have any clue.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
xpl0sions
-


Joined: 22 Jul 2005
Posts: 14

PostPosted: Sat Jul 23, 2005 12:41 am    Post subject: Reply with quote

ok ill post the code.
This is the verify login:
Code:
<% Option Explicit %>
<!-- #include virtual="includes/login.asp" -->
<!-- #include virtual="includes/addtonews.asp" -->
<!-- #include virtual="includes/checkquotes.asp" -->
<!-- #include virtual="includes/errorprinter.asp" -->
<!-- #include virtual="includes/datetime.asp" -->
<!-- #include virtual="includes/subnet.asp" -->

<%

'Declare variables
Dim NumLogins





'Set user as logged in
SQL = "DELETE FROM " & GameAbbreviation & "LoggedIn WHERE lgnPlayer = '" & Username & "'"
Conn.Execute SQL
SQL = "INSERT INTO " & GameAbbreviation & "LoggedIn VALUES('" & Username & "', " & DateTime(DateAdd("n", 30, Now)) & ")"
Conn.Execute SQL


'Give referral credit if necessary
If ReferralMoney > 0 Then
   SQL = "SELECT NumLogins FROM " & GameAbbreviation & "Players WHERE Username = '" & Username & "'"
   Set Returned = Conn.Execute(SQL)
   NumLogins = Returned("NumLogins")
   Returned.Close
   If CLng(NumLogins) = 0 And Request.Cookies("referrer")("username") <> "" Then
      SQL = "SELECT Null FROM " & GameAbbreviation & "ReferralBlocks WHERE rblSubnetMask = '" & Subnet & "'"
      Set Returned = Conn.Execute(SQL)
      If Returned.EOF Then
         SQL = "SELECT Null FROM " & GameAbbreviation & "Players WHERE Username = '" & Request.Cookies("referrer")("username") & "'"
         Set Returned = Conn.Execute(SQL)
         If Not Returned.EOF Then
            SQL = "UPDATE " & GameAbbreviation & "Players SET [Money] = [Money] + " & ReferralMoney & " WHERE Username = '" & Request.Cookies("referrer")("username") & "'"
            Conn.Execute SQL
            SQL = "INSERT INTO " & GameAbbreviation & "ReferralBlocks VALUES('" & Subnet & "', " & DateOnly(DateAdd("d", 30, Now)) & ")"
            Conn.Execute SQL
            AddToNews Request.Cookies("referrer")("username"), "has been referred by you. You''ve been credited " & ReferralMoney & " " & LCase(CurrencyCalled) & ".", Username
            Response.Cookies("referrer")("username") = ""
         End If
      End If
   End If
End If


'Update number of logins
SQL = "UPDATE " & GameAbbreviation & "Players SET NumLogins = NumLogins + 1, DateEdited = " & DateTime(Now) & " WHERE Username = '" & Username & "'"
Conn.Execute SQL


'Send the user to frameset with proper query string
Response.Redirect(GameRootURL & "/members/default.asp?uid=" & Server.URLEncode(Username) & "&pwd=" & Server.URLEncode(Encrypt(Request("pwd"))))

%>

<!-- #include virtual="includes/logout.asp" -->
Back to top View user's profile Send private message
xpl0sions
-


Joined: 22 Jul 2005
Posts: 14

PostPosted: Sat Jul 23, 2005 12:59 am    Post subject: Reply with quote

and this is the login.asp
Code:
<!-- #include virtual="/includes/variables/global.asp" -->
<!-- #include virtual="/includes/variables/in.asp" -->
<!-- #include virtual="/includes/variables/out.asp" -->
<!-- #include virtual="includes/checkquotes.asp" -->
<!-- #include virtual="includes/datetime.asp" -->
<!-- #include virtual="includes/errorprinter.asp" -->
<%

'Declare necessary variables
Dim Conn, Returned, SQL
Dim GetString, PostString
Dim Fs, ReadFile, WriteFile, Reason
Dim CheckPass
Dim Username
Dim UnreadAnnouncements


Set Fs = Server.CreateObject("Scripting.FileSystemObject")


'Check if game is currently on
If Fs.FileExists(Server.MapPath("\admin\gameoff.txt")) Then
   Set ReadFile = Fs.OpenTextFile(Server.MapPath("\admin\gameoff.txt"), 1, False)
   Reason = ReadFile.ReadLine
   Error "Game Disabled", Reason
   Response.End
   ReadFile.Close
   Set ReadFile = Nothing
End If


'Start connection object
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open SQLConnectionParameters


'Check referrer
If Left(Request.ServerVariables("HTTP_REFERER"), Len(GameRootURL)) <> GameRootURL And Left(Request.ServerVariables("HTTP_REFERER"), Len(GameRootURL2)) <> GameRootURL2 Then
   Error "Invalid Referrer", "You may not type in your user url into the browser. Please log in from the login page. If you are using the proper login page this error is likely being caused by a proxy server or firewall removing the headers from your HTTP requests. You will need to contact your network administrator."
End If


'Check for quotes
If Quotes(Request("uid")) Or Quotes(Request("pwd")) Then
      Error "Quotes Present", "You may not submit your fields with quotes."
End If


'Get users password
SQL = "SELECT Password, Username, UnreadAnnouncements FROM " & GameAbbreviation & "Players WHERE Username = '" & Request("uid") & "'"
Set Returned = Conn.Execute(SQL)
If Returned.EOF Then
      Error "Player Not Found", "The player you entered could not be found."
End If
Username = Returned("Username")


'Make sure password is correct
CheckPass = Request("pwd")
If LCase(Request.ServerVariables("PATH_TRANSLATED")) <> LCase(GamePath & "\members\verifylogin.asp") Then
   CheckPass = Decrypt(CheckPass)
End If


If CheckPass <> Returned("Password") Then
      Error "Invalid Password", "The password you entered was incorrect."
End If
CheckPass = Encrypt(Returned("Password"))


'Get unread announcements
UnreadAnnouncements = Returned("UnreadAnnouncements")
Returned.Close


'Delete expired logins
SQL = "DELETE FROM " & GameAbbreviation & "LoggedIn WHERE lgnExpires < " & DateTime(Now) & " AND lgnPlayer <> '" & GameOwnerAccount & "'"
Conn.Execute SQL


'Make sure the user is logged in
If LCase(Request.ServerVariables("PATH_TRANSLATED")) <> LCase(GamePath & "\members\verifylogin.asp") Then
   SQL = "SELECT Null FROM " & GameAbbreviation & "LoggedIn WHERE lgnPlayer = '" & Username & "'"
   Set Returned = Conn.Execute(SQL)
   If Returned.EOF Then
      Error "Login Timed Out", "When your account sits idle for more than 30 minutes you must log in again."
   Else
      SQL = "UPDATE " & GameAbbreviation & "LoggedIn SET lgnExpires = " & DateTime(DateAdd("n", 30, Now)) & " WHERE lgnPlayer = '" & Username & "'"
      Conn.Execute SQL
   End If
End If


'Set string variables
GetString = "uid=" & Server.URLEncode(Username) & "&pwd=" & Server.URLEncode(CheckPass)
PostString = "<INPUT type=""hidden"" name=""uid"" value=""" &  Username & """><INPUT type=""hidden"" name=""pwd"" value=""" & CheckPass & """>"

'
'End script, functions and procedures follow
'



Function Encrypt(EncryptString)
Dim CountUp, DoneStr, FirstChar, CurChar
FirstChar = Left(EncryptString, 1)
Rnd(-1)
Randomize Convert(FirstChar)
DoneStr = FirstChar
For CountUp = 2 To Len(EncryptString)
   CurChar = Convert(Mid(EncryptString, CountUp, 1))
   CurChar = CurChar + Int(Rnd * 62)
   If CurChar > 62 Then CurChar = CurChar - 62
   CurChar = Revert(CurChar)
   DoneStr = DoneStr & CurChar
Next
Encrypt = DoneStr
End Function

Function Decrypt(DecryptString)
Dim CountUp, DoneStr, FirstChar, CurChar
FirstChar = Left(DecryptString, 1)
Rnd(-1)
Randomize Convert(FirstChar)
DoneStr = FirstChar
For CountUp = 2 To Len(DecryptString)
   CurChar = Convert(Mid(DecryptString, CountUp, 1))
   CurChar = CurChar - Int(Rnd * 62)
   If CurChar <= 0 Then CurChar = CurChar + 62
   CurChar = Revert(CurChar)
   DoneStr = DoneStr & CurChar
Next
Decrypt = DoneStr
End Function

Function Convert(Char)
If Asc(Char) >= 48 And Asc(Char) <= 57 Then
   Convert = Asc(Char) - 47
ElseIf Asc(Char) >= 65 And Asc(Char) <= 90 Then
   Convert = Asc(Char) - 54
ElseIf Asc(Char) >= 97 And Asc(Char) <= 122 Then
   Convert = Asc(Char) - 60
End If
End Function


Function Revert(Num)
If Num >= 1 And Num <= 10 Then
   Revert = Chr(Num + 47)
ElseIf Num >= 11 And Num <= 36 Then
   Revert = Chr(Num + 54)
ElseIf Num >= 37 And Num <= 62 Then
   Revert = Chr(Num + 60)
End If
End Function



%>
Back to top View user's profile Send private message
cmxflash
-


Joined: 11 Dec 2004
Posts: 872

PostPosted: Sat Jul 23, 2005 4:44 am    Post subject: Reply with quote

Dude, pay a visit to www.php.net and stop using that ASP-crap.
Back to top View user's profile Send private message
k1ll3rdr4g0n
-


Joined: 04 Jul 2004
Posts: 609

PostPosted: Sat Jul 23, 2005 6:09 am    Post subject: Reply with quote

cmxflash wrote:
Dude, pay a visit to www.php.net and stop using that ASP-crap.


Umm....ok?
Talk about rude comments :\.

Maybe he doesn't want to use PHP for his game, did you ever think about that?
If he uses PHP then he has to learn a whole other language.

Sorry to get offtopic....
_________________
Back to top View user's profile Send private message AIM Address
xpl0sions
-


Joined: 22 Jul 2005
Posts: 14

PostPosted: Sun Jul 24, 2005 12:39 pm    Post subject: Reply with quote

I spose nobody can figure this out?
ill leave the web address..u need the port thats why it isnt working i think.
220.238.131.52
And yes i am using md5.
Back to top View user's profile Send private message
MonkeyNation
-


Joined: 05 Feb 2005
Posts: 921
Location: Cardiff

PostPosted: Sun Jul 24, 2005 4:26 pm    Post subject: Reply with quote

xpl0sions wrote:
I spose nobody can figure this out?
ill leave the web address..u need the port thats why it isnt working i think.
220.238.131.52
And yes i am using md5.


Whats the asp mail function?
I dont know much of it so cant help that much.

Id assume the smtp server your contacting is not available or something.

I have a game also, based on promisance.
It was being developed on my server until it got fried.
A copy of the scripts is on someone elses server too so all is not lost but he cant get the turns to work on his god forsaken OS.
This is in PHP though, so I cant help much.
_________________
Back to top View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger ICQ Number
xpl0sions
-


Joined: 22 Jul 2005
Posts: 14

PostPosted: Sun Jul 31, 2005 11:06 am    Post subject: Reply with quote

can yall try this link and tell me if my game comes up.oh yea and tell me if A or B works.
A- http://220.238.131.52
if that doesn work try putting in my port number
B- http://220.238.131.52:80
Back to top View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> Networking Issues All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group