Code center > Darwinbots3
P2P Internet Mode
Numsgil:
Ooh, neat, I think this will work. Why does the data need to be coded in base 64, though?
goffrie:
--- Quote from: Numsgil ---Ooh, neat, I think this will work. Why does the data need to be coded in base 64, though?
--- End quote ---
Gah, you're supposed to use urlencode (with the %hexnumber goodness). The code I "post"ed (haha) doesn't handle this automatically, though, so you'll have to do it manually. I found this VB function at http://www.csie.nctu.edu.tw/~cdsheen/codin...b-urlencode.php :
--- Code: --- <pre><font><font face="Georgia">Function UrlEncode(ByVal urlText As String) As String
Dim I As Long
Dim ansi() As Byte
Dim ascii As Integer
Dim encText As String
ansi = StrConv(urlText, vbFromUnicode)
encText = ""
For I = 0 To UBound(ansi)
ascii = ansi(I)
Select Case ascii
Case 48 To 57, 65 To 90, 97 To 122
encText = encText & chr(ascii)
Case 32
encText = encText & "+"
Case Else
If ascii < 16 Then
encText = encText & "%0" & Hex(ascii)
Else
encText = encText & "%" & Hex(ascii)
End If
End Select
Next I
UrlEncode = encText
End Function
--- End code ---
Using this function, you don't need base64 anymore (d'oh), so remove the "base64_decode" line.
EricL:
--- Quote from: goffrie ---Security issues perhaps are a problem, but they are only moderately severe as long as code is kept well-managed.
--- End quote ---
As a guy who has spent a bunch of years working in software security, I respectfully disagree with you. The moment you have applicaiton level code listening on a port on client machines, particularly code whose source is freely available as with DB, attacking you becomes relatively easy for someone with the right skills. I am not going to spend my time code-reviewing and penetration testing a local DB server for every possible stack or buffer overflow and I would suggest other developer's time might be equally better spent elsewhere.
--- Quote from: goffrie ---Issues with NATs can be overcome by relaying through the central server.
--- End quote ---
If you're communicating through a server, by definition it's not P2P.
--- Quote from: goffrie ---"moving the server communication code out of proc" - I'm not too sure what you meant by this.
--- End quote ---
It means pulling the client-side of the client-server communicaiton "out-of-process" and putting it in it's own process so that when it waits for the server to respond, it does so on a separate thread of execution (a separate process in this case) and thus does not block the simulator.
--- Quote from: goffrie ---Which is a real server.
--- End quote ---
Forgive my shorthand. By "real" server, I meant an applicaiton level server, specifically one which impliments our specific semantics. Yes, FTP is a real server in the sense that it is code which listens on ports but the semanitcs it impliments are limited and not specific to our needs. It is not an applicaiton server.
--- Quote from: goffrie ---... Why the lecture? I don't see what point you're trying to make.
--- End quote ---
That it is a hell of a lot easier, expediant and secure to build a real (excuse me. I mean applciation level) server than to do P2P.
Vodalian:
I think the current concept of Internet mode is pretty flawed right now for one reason. Bots are being teleported back and forth into constantly changing sims with different costs and physics, this really plays havoc on evolution. I think it would be nice if we could have a way of sharing settings, like individual 'ponds' that you can create or join. Having shared settings would probably yield much more interesting results than the chaos they currently go through.
Numsgil:
Welcome!
Settings don't necessarily need to be exactly the same. A little variation might help to create nooks and crannies. And a bot that can successfully sweep through the sim is all the more impressive. That said, yes, it would be a good idea to help users share settings for IM. If they're all totally different, the sims might as well not even be connected.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version