Greetings Sage Scripters:
I am working on a game soon that will incorporate client/server interaction.
Currently I am web-hosted by addr.com, which is pretty flexible with
server-side Perl (although I am limited on hits per month). The game will resemble an
avatar-community, requiring members to be able to see each other in
real-time. Here's my current plan of action:
1) Write a Perl script that runs on the web server to handle
user log-in.
2) When a user creates a log-in, they are added to the server's user list
(text-file). The user list would contain info like username, special_id, IP
address.
3) Each time a player logs on, it retrieves the IP list from the server,
this list is stored locally, and from then on the client manages
everything else. If a user has a dynamic dial-up IP, it's address is
updated in the main file as well.
4) Through P2P, the client connects to each of the IP in its list at
some refresh interval, updating it's database accordingly
Any unresolved pings are tossed from the list and it's assumed that
user has logged off.
Some problems:
1) Is this too much of a load on the server? I've heard something about
pre-compiling your perl scripts as byte-code. Would that be feasible in this
case?
2) I don't want to get a nasty letter from my webhost saying I've received
too much traffic, and will be charged extra. So minimal server
interaction is what I'm striving for. I'm guessing that this won't be a
big problem, unless it really catches on, and then that's a good problem
:)
My apologies if this question isn't totally Perl-centric. What strategies
would you recommend? My current method of invoking the scripts from C++ is
to use an Intelligent Agent class for grabbing URLs
(e.g. http://www.mywebhost.com/jojo/server.pl)
Maybe I shouldn't be using a web-server,Or should I use a special
CPAN module for handling TCP/IP that runs on a server farm or something? If
you know of a cheap server service, I'd be glad to know too.
Question In A NutShell:
Low-budget game designer seeks client/server strategy for multiplayer game,
incorporating Perl and his web-server. Open to suggestions.
Thanks in advance,
End-Of-Ramble Reached
Desert coder
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.