Allegro.cc - Online Community

Allegro.cc Forums » Game Design & Concepts » It's time to learn me stuff

This thread is locked; no one can reply to it. rss feed Print
 1   2   3 
It's time to learn me stuff
Thomas Fjellstrom
Member #476
June 2000
avatar

Quote:

All major protocols are based on TCP/IP.

They are implemented on TCP/IP.

Quote:

Telnet is terminal protocol and AFAIK includes some escape codes to move cursor around and do other stuff which HTTP and FTP won't understand.

AFAIK those escape codes aren't really apart of telnet its self, just the terminal you're running on (vt100, xterm, something). Just look at HTTP, NNTP, POP3 and friends, they are so simplistic, some text headers and maybe some content.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Krzysztof Kluczek
Member #4,191
January 2004
avatar

Quote:

They are implemented on TCP/IP.

That's what I meant.

Quote:

AFAIK those escape codes aren't really apart of telnet its self, just the terminal you're running on (vt100, xterm, something). Just look at HTTP, NNTP, POP3 and friends, they are so simplistic, some text headers and maybe some content.

In this case almost everything is based on telnet. ;)

Thomas Fjellstrom
Member #476
June 2000
avatar

Most of them are :)

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

X-G
Member #856
December 2000
avatar

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

Thomas Fjellstrom
Member #476
June 2000
avatar

Ok.. Lets just say the Telnet as I know it ;) (anything equivelent to raw mode in putty ;D)

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Krzysztof Kluczek
Member #4,191
January 2004
avatar

MS Telnet has control codes too. ;)

Anyway, doesn't it sound strange to say that Quake 3 net code is based on telnet? (If HTTP was based on telnet and supports binary transmission, anything could be said to be based on telnet) ;)

X-G
Member #856
December 2000
avatar

Quote:

anything equivelent to raw mode in putty

Raw mode is exactly that. A raw TCP/IP connection. Not telnet. :P

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

Thomas Fjellstrom
Member #476
June 2000
avatar

Does the quake3 protocol look anything like:

Client:
GET /uri HTTP/1.0
Header1: foo
Header2: bar

Possible data here.

Server:
200 OK HTTP/1.0
Header1: foo
Header2: blah

data here

?

edit:
and in the "binary" sense, its just data. look at a request/response pair for any file:

GET /index.html HTTP/1.0

200 OK HTTP/1.0
Content-Type: text/html
Content-Length: 1024

data here for 1024 bytes.

yay. Theres alot more to http, but thats the basics.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

X-G
Member #856
December 2000
avatar

Uhm, that's HTTP you're describing. Zorro didn't say anything about Q3 being based on HTTP...

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

Thomas Fjellstrom
Member #476
June 2000
avatar

He said it was based on Telnet, Which I argue most of the limited antiquated common protocols are based on. I know HTTP, the others, not so much.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

elver
Member #3,670
July 2003

Tomasu, X-G informs me that you think HTTP is based on Telnet. Please stop believing that as it's not true. Thank you.

Uhh... I need sleep. Exam in two hours! Bloody hell... >:(

Krzysztof Kluczek
Member #4,191
January 2004
avatar

TF: I completely agree that many net protocols are text-based, but telnet isn't one of them despite of looking like one. :)

Matthew said:

Yes, the posts/threads here are all in the same table. The initial post has a parent id of 0 and all other posts have a parent id of the initial post.

Doesn't it require too many database searches when displaying posts? It seems that it requires one query per post. Or are there other fields which accelerate searching?

X-G
Member #856
December 2000
avatar

SELECT * FROM forum_posts WHERE parent='foo';

One query. Returns all posts in a thread.

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

Krzysztof Kluczek
Member #4,191
January 2004
avatar

Heh, I misunderstood it. I though they were linked in a list, which would require much more effort to access them. :)

Thomas Fjellstrom
Member #476
June 2000
avatar

Only if you want to show an entire thread, if its threaded, instead of just listed like it is here.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

X-G
Member #856
December 2000
avatar

Perhaps one could have a system where every post stores not only its immediate parent, but every parent in its thread; so that a few levels down, for instance, a post could have a "parents" field like "1;15;24;27" or similar. It would take up a bit of space, but probably be faster than doing several queries to show an entire thread.

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

Matthew Leverton
Supreme Loser
January 1999
avatar

I store three ids:

post_id, parent_id, root_id

(In my case parent_id and root_id are always identical. )

Such a structure allows you to get all the threads in one query in the proper order if you grab associatively by [SORT BY parent_id, post_id] and can make the assumption that higher post id = later time.

What you would do then is:

0 Grab Data from DB into $parents[0] = first post, $parents[$thread_id] = array of base posts, $parents[$post_id_X] = array of sub threads
A Show first post
B For Each $parents[$thread_id]
C-- If $parents[$post_id] exists (sub thread), go to B
D End For Each

This only works though if you grab from the base of the thread. Ie, if you want to grab a specific sub thread, you are out of luck.

If you wanted to do it with any thread, I'd probably create a lookup table like:

1
+-2
| +-3
|
+-4

post_id | parent_id | direct_flag
---------------------------------
 1      | 0         | 1
 2      | 1         | 1
 3      | 1         | 0
 3      | 2         | 1
 4      | 1         | 1
---------------------------------

You could do things like

SELECT FROM post WHERE post_id IN (SELECT post_id FROM parent_link WHERE parent_id = $X AND direct_flag=1)

That would give you all direct replies. Eliminate the direct_flag, if you want to get the entire list of children, and you could use the above mentioned method for looping through them without having to do a db query for each sub thread (ouch).

23yrold3yrold
Member #1,134
March 2001
avatar

Any advice on how to set up my system as an Apache server so I can test PHP/MySQL here? I found this, but it looks excessively painful. :( Or is that the standard procedure? No download-this-file-and-double-click-it method? :)

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

Kanzure
Member #3,669
July 2003
avatar

Quote:

download-this-file-and-double-click-it method?

Sourceforge - search for "PHP Triad for Windows".

ReyBrujo
Moderator
January 2001
avatar

You using Windows? Download the latest Apache executable (I tried with the 1.3x something, the 2.x had something broken) and install it. Then install and configure MySQL. Finally, download PHP, put the module in the Apache directory, and edit httpd.conf to process PHP pages with PHP before showing them. That is basically what I did a year ago and worked quite fine :)

--
RB
光子「あたしただ…奪う側に回ろうと思っただけよ」
Mitsuko's last words, Battle Royale

Oscar Giner
Member #2,207
April 2002
avatar

Quote:

download-this-file-and-double-click-it method?

EasyPHP

23yrold3yrold
Member #1,134
March 2001
avatar

Why is it in French? >:(

I'm going to try Kanzure's suggestion. If that doesn't work, I'm going to try ReyBrujo's suggestion. If that doesn't work, I'm going to say "screw comoputers" and go move to Tibet and be a monk.

Quote:

Sourceforge - search for "PHP Triad for Windows".

Google turned up the SourceForge page easier than SourceForge did. ^_^ Not much info on this thing, is there ...

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

Mars
Member #971
February 2001
avatar

Check out some WAMP solution. WAMP is LAMP with Windows instead of Linux. :)

--
This posting is a natural product. The slight variations in spelling and grammar enhance its individual character and beauty and in no way are to be considered flaws or defects.

23yrold3yrold
Member #1,134
March 2001
avatar

PHP Triad seems to be working. I haven't figured out how to make it load my pages yet ... it really seems to like c:\apache\htdocs. ;D ::)

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

Kanzure
Member #3,669
July 2003
avatar

Quote:

I haven't figured out how to make it load my pages yet

What?? That addy you gave is right for your files.. what's teh problem?

 1   2   3 


Go to: