Author Topic: TremSnaps 1.0  (Read 24826 times)

Amanieu

  • Posts: 647
  • Turrets: +135/-83
    • Amanieu
Re: TremSnaps 1.0
« Reply #30 on: November 02, 2008, 01:53:34 am »
Servers will respond to your requests with more than 1 udp packet, you need to make sure you read all packets, no just the first. (This also applies to the master)
Quote
< kevlarman> zakk is getting his patches from shady frenchmen on irc
< kevlarman> this can't be a good sign :P

Syntac

  • Posts: 841
  • Turrets: +118/-104
    • Syntac's Stuff
Re: TremSnaps 1.0
« Reply #31 on: November 02, 2008, 02:00:23 am »
I'll keep that in mind when working on the next implementation.

David

  • Spam Killer
  • *
  • Posts: 3543
  • Turrets: +249/-273
Re: TremSnaps 1.0
« Reply #32 on: November 02, 2008, 12:01:23 pm »
    • Fetches a list from the master server (stripping out corrupted entries).
If you have corrupted entries, then you're reading it wrong.
Also do you wait for all the packets to arrive or just read the first?  There's no way to tell how many will come short of waiting for a second or two.  At the moment there's nearly always two packets sent, although that can change with the number of servers.

EDIT: Didn't see page two, and if a server sends more than one then there's no way to safely reassemble them without guessing :s
Any maps not in the MG repo?  Email me or come to irc.freenode.net/#mg.
--
My words are mine and mine alone.  I can't speak for anyone else, and there is no one who can speak for me.  If I ever make a post that gives the opinions or positions of other users or groups, then they will be clearly labeled as such.
I'm disappointed that people's past actions have forced me to state what should be obvious.
I am not a dev.  Nothing I say counts for anything.

Archangel

  • Guest
Re: TremSnaps 1.0
« Reply #33 on: November 02, 2008, 05:51:11 pm »
ding ding ding We have a winner.

Einstein

  • Posts: 81
  • Turrets: +12/-2
Re: TremSnaps 1.0
« Reply #34 on: November 03, 2008, 09:33:04 pm »
I just saw this thread, and I like what I see. I've been trying to make a Perl and PHP implementation of something like DASPRiD's TremStats, but with a lot more functionality, and most of my features thus far have been geared towards admins rather than the general public. I was wondering if you wouldn't like to join up, and we'll see what a couple of great minds can't come up with. I'm a little handy with PHP, but more so with C/C++ and Perl, so I could use your ideas. If you guys have any comments, I'd love to hear them; an outdated version of my project can be found at http://tremtools.googlecode.com. (I say outdated because there is no public collaboration yet, so the Google Code repository is way behind my local SVN repository that I keep my projects in.) Let me know.

By the way, when I unpack your zip I get absolute garbage; each file is intact but filled with some weird compressed or encoded content, not plaintext. I also realize that TremSnaps is far from finished, and I'd like to see it perfected; once that happens, I'd love to make aggregate statistics logging from it, so that we can see for all the servers in the master list what percent of the time which maps are played, what the balance is for hundreds of servers instead of just individual servers for each mod/gamename, what servers everyone frequents, etc. I could do all of this in Perl, of course, but it would be a royal pain in the ass, and the interface would just plain suck.
« Last Edit: November 03, 2008, 09:38:14 pm by Einstein »

Syntac

  • Posts: 841
  • Turrets: +118/-104
    • Syntac's Stuff
Re: TremSnaps 1.0
« Reply #35 on: November 03, 2008, 10:06:58 pm »
Just so you know, the TremSnaps code is sloppiness in digital form. I intend to do a full redesign. The rewrite I mentioned earlier was sort of fail, due to its crippling inability to list more than twelve servers. Once I solve that problem, awesomeness should result.

By the way, when I unpack your zip I get absolute garbage; each file is intact but filled with some weird compressed or encoded content, not plaintext.
That's due to my somewhat misinfomed use of gzip. Never, ever do this...
Code: [Select]
gzip -r valuable_stuff/
...unless you want to spend a very long time decompressing everything. All I can say is, thank the Lord for Time Machine. The download should be okay now.

Anyway. What say you to a script that logs everything in a MySQL database?

Einstein

  • Posts: 81
  • Turrets: +12/-2
Re: TremSnaps 1.0
« Reply #36 on: November 03, 2008, 10:24:26 pm »
Anyway. What say you to a script that logs everything in a MySQL database?
That's exactly what I do now; perhaps you can help me with the front-end, at least, but yeah, my suite uses Perl's DBI (DataBase Interface) module to write and read directly to/from any SQL DB.

Oh, and unless you fixed the download in the past five minutes, it's still screwy.

Syntac

  • Posts: 841
  • Turrets: +118/-104
    • Syntac's Stuff
Re: TremSnaps 1.0
« Reply #37 on: November 04, 2008, 12:05:15 am »
Should be fixed now. Re-uploaded it.

I don't know how easy it'll be to combine PHP and Perl into a single suite. Also, I don't know how many web hosts out there offer mod_perl (assuming this is going to be a web app).

Take this to e-mail, perhaps?

Einstein

  • Posts: 81
  • Turrets: +12/-2
Re: TremSnaps 1.0
« Reply #38 on: November 04, 2008, 12:30:14 am »
Much better, it's actually text now, thanks.

Mod Web hosts have to offer Perl for CGI scripting, and besides, if all works out well it'll only have to execute PHP code; the Perl stuff is the backend, which ideally should only have to be run on the game server itself.

Either form of communication is fine. If you want to avoid spamming up Tremulous.net, you can post to the budding Google Group dedicated to my project, or simply e-mail me at one of the addresses that I use for my IM accounts, shown on my profile here. I cannot find your own e-mail address without doing some extensive research; your own site's contact page returns a 404 and you don't post your address as public here on the forums, so I guess you'll have to make first contact, eh?

Syntac

  • Posts: 841
  • Turrets: +118/-104
    • Syntac's Stuff
Re: TremSnaps 1.0
« Reply #39 on: November 04, 2008, 12:40:43 am »
The 404 error is because I'm developing an e-mail script (yet another way of hiding my address).

I guess I'll have to trust you. ;)
« Last Edit: November 04, 2008, 12:42:41 am by Syntac »

Undeference

  • Tremulous Developers
  • *
  • Posts: 1254
  • Turrets: +122/-45
Re: TremSnaps 1.0
« Reply #40 on: November 04, 2008, 01:09:17 am »
I just saw this thread, and I like what I see. I've been trying to make a Perl and PHP implementation of something like DASPRiD's TremStats, but with a lot more functionality, and most of my features thus far have been geared towards admins rather than the general public.
Maybe I don't understand properly, but isn't the purpose of tremsnaps to query servers and store their responses, not to handle local server data (e.g., tremstats parses logs from the local server)? I really don't see much similarity... (Are you trying to do something more like http://betaserv.tk/?)
Quote
I was wondering if you wouldn't like to join up, and we'll see what a couple of great minds can't come up with. I'm a little handy with PHP, but more so with C/C++ and Perl, so I could use your ideas.
Wasn't DASPRiD planning on rewriting the tremstats parser in C?
Quote
If you guys have any comments, I'd love to hear them; an outdated version of my project can be found at http://tremtools.googlecode.com. (I say outdated because there is no public collaboration yet, so the Google Code repository is way behind my local SVN repository that I keep my projects in.) Let me know.
Since you asked for comments, I'll make a few:
Your coding style seems non-existent.
Comments are for explaining what unobvious code is doing or what you are doing with the code, not for burying it.
Your code does many things that will not work properly or at all (though you may have fixed them locally).
Your code does a lot of things suboptimally. That is an understatement.
« Last Edit: April 12, 2013, 08:42:19 pm by Undeference »
Need help? Ask intelligently. Please share solutions you find.

Thats what we need, helpful players, not more powerful admins.

Einstein

  • Posts: 81
  • Turrets: +12/-2
Re: TremSnaps 1.0
« Reply #41 on: November 04, 2008, 01:31:02 am »
I just saw this thread, and I like what I see. I've been trying to make a Perl and PHP implementation of something like DASPRiD's TremStats, but with a lot more functionality, and most of my features thus far have been geared towards admins rather than the general public.
Maybe I don't understand properly, but isn't the purpose of tremsnaps to query servers and store their responses, not to handle local server data (e.g., tremstats parses logs from the local server)? I really don't see much similarity... (Are you trying to do something more like http://betaserv.tk/?)
Most of my stuff right now parses the logs, yes, and much of my focus has been on statistics of the server; imagine if I could add statistics from the entire Tremulous community by using the master list's (limited) information? And yes, to some extent, the betaserv's pages do a few of the same things that mine do, although I am not sure of their implementation methods.

Quote
I was wondering if you wouldn't like to join up, and we'll see what a couple of great minds can't come up with. I'm a little handy with PHP, but more so with C/C++ and Perl, so I could use your ideas.
Wasn't DASPRiD planning on rewriting the tremstats parser in C?
I have no idea, actually. Last time I checked his project was entirely dormant, and his site was all but totally inactive.

Quote
If you guys have any comments, I'd love to hear them; an outdated version of my project can be found at http://tremtools.googlecode.com. (I say outdated because there is no public collaboration yet, so the Google Code repository is way behind my local SVN repository that I keep my projects in.) Let me know.
Since you asked for comments, I'll make a few:
Your coding style seems non-existent.
Comments are for explaining what unobvious code is doing or what you are doing with the code, not for burying it.
Your code does many things that will not work properly or at all (though you may have fixed them locally).
Your code does a lot of things suboptimally. That is an understatement.
Explain what you'd like to be done better in terms of my "coding style," whether you mean method, syntax, lack of whitespace, etc.

I know that my comments are annoying as hell, at least for that one file. My original version wasn't commented at all, but I think that was before I created the Google Code repository. It actually took me longer to comment that mini-program than it did to code it, I think, but I did so for an express purpose, because I originally wrote it to be tested on the X server and an interested party there was not a coder and so I commented it so as to be understandable by a non-programmer. Because at that point it was not intended to be truly public, I did not take that into consideration; I have yet to clean it up, as you can see, even on my local revisions. The only reason I can read it is because of gedit's syntax highlighting that makes it neither helpful or harmful, but rather all but invisible if I so choose. In my programming environment, it's easy enough to ignore. When there's a ton of people that actually want to start looking at the code, I'll start writing it for them instead of for a couple of friends from X.

I honestly cannot remember where I was at when I last committed the Google Code copy of my code, but I can tell you right now that in some spots it's still like that, and my comments say as much. I intentionally partially code some things but then tell them to do nothing or nothing of great importance, leaving them until I can finish other related parts of the project that depend on them. This is very intentional and is merely an example of setting up functionality that doesn't yet exist. It does exactly what I want it to, however; otherwise, I fix it immediately, be assured of that.

I'm not sure if I mentioned this anywhere other than the X server forums, but I should say that I learned Perl for the sole purpose of writing the original logfile parser. I had never touched Perl before in my life, and am still learning, of course. It is a very versatile but sometimes very obscure language that I find both gratifying and frustrating at the same time. It also happens to be quite fast; not nearly as fast as C, of course, but rather well-performing nonetheless. So if by "optimally" you refer to "optimization" then I suppose that's why. If you'd care to be more specific, I'm sure there's something you can teach me that I'd be very grateful for!

The 404 error is because I'm developing an e-mail script (yet another way of hiding my address).
There's a thousand and one ways to do this, whether it's CGI, JavaScript, or simple encoding like URL escaping using the HTML hex symbols for each character. It should take all of ten seconds to do, if you want me to show you...
« Last Edit: May 13, 2014, 06:07:09 am by Undeference »

Syntac

  • Posts: 841
  • Turrets: +118/-104
    • Syntac's Stuff
Re: TremSnaps 1.0
« Reply #42 on: November 04, 2008, 01:40:35 am »
Personally, I think this could be better implemented with PHP. Development might eventually start, when I have the time.

Einstein

  • Posts: 81
  • Turrets: +12/-2
Re: TremSnaps 1.0
« Reply #43 on: November 04, 2008, 01:57:55 am »
Personally, I think this could be better implemented with PHP. Development might eventually start, when I have the time.
Er... How's that going to work? PHP is strictly server-side, and so as long as it eventually spits out your e-mail as a string, a spambot will see it. On the contrary, very few spambots execute JavaScript or other client-sided implementations. Anyways...

Syntac

  • Posts: 841
  • Turrets: +118/-104
    • Syntac's Stuff
What?
« Reply #44 on: November 04, 2008, 02:07:24 am »
Er... How's that going to work? PHP is strictly server-side, and so as long as it eventually spits out your e-mail as a string, a spambot will see it. On the contrary, very few spambots execute JavaScript or other client-sided implementations. Anyways...
I get the feeling we're talking about two completely different things. ::)

Quote
PHP is strictly server-side
Wrong. It's also a command-line scripting language.

I was talking about TremSnaps or TremTools or whatever you want to call it. You seem to be talking about something I mentioned in passing (that also happens to be completely unrelated).

-- While we're still on the topic of e-mail: You don't seem to be very well-informed about PHP. My system allows me to present users with a form. When they submit it, their message is sent to my address via PHP's mail() function. Nothing is revealed to anyone.
« Last Edit: November 04, 2008, 02:12:39 am by Syntac »

kevlarman

  • Posts: 2737
  • Turrets: +291/-295
Re: TremSnaps 1.0
« Reply #45 on: November 04, 2008, 02:35:34 am »
I'm a little handy with PHP, but more so with C/C++ and Perl, so I could use your ideas.
you know you wanna do it in visual basic  ;D
Quote from: Asvarox link=topic=8622.msg169333#msg169333
Ok let's plan it out. Asva, you are nub, go sit on rets, I will build, you two go feed like hell, you go pwn their asses, and everyone else camp in the hallway, roger?
the dretch bites.
-----
|..d| #
|.@.-##
-----

Einstein

  • Posts: 81
  • Turrets: +12/-2
Re: TremSnaps 1.0
« Reply #46 on: November 04, 2008, 03:16:44 am »
My apologies, I thought you were talking about your site, and I didn't realize you were trying for more of a comment box, which is also pretty easy to do. I am well aware of PHP's capabilities, as I have been coding in it for many years, but mostly as a web dev rather than for local applications like this. I considered doing TremTools in either PHP (esp. for its database handling) or C++ (for its speed and object-oriented capabilities) and decided Perl was a nice compromise. Honestly, a big factor in that decision was not practicality; at the time, I was excessively bored, and needed to learn something new. Perl as the medium for TremTools seemed to fit the bill, long before it was TremTools.

Kevlarman, it's nice to see you again, after I've been MIA for a year. Your humor never fails to amuse me.

Syntac

  • Posts: 841
  • Turrets: +118/-104
    • Syntac's Stuff
Re: TremSnaps 1.0
« Reply #47 on: November 04, 2008, 03:21:33 am »
My apologies, I thought you were talking about your site, and I didn't realize you were trying for more of a comment box, which is also pretty easy to do.
Seriously man, what in the name of all things holy are you talking about?

I will attempt to explain what I said in very simple terms.
    • It's a script that contains a form.
    • There's a text box.
    • Someone types something in the box.
    • And submits the form.
    • I receive an e-mail with the submitted text.
    • Not a comment box.

This is a comment box.

-- All that nonsense aside, I'll eventually get around to e-mailing you with some stuff (wow Syntac, that was descriptive).
« Last Edit: November 04, 2008, 03:23:56 am by Syntac »

Einstein

  • Posts: 81
  • Turrets: +12/-2
Re: TremSnaps 1.0
« Reply #48 on: November 04, 2008, 03:52:16 am »
In the name of all things unholy, I've always thought of a comment box as something like Benmachine's, except it also e-mails you every post. I'm confused as to why this is difficult, you and I are talking about the same thing now... sorry for the confusion; apparently it's making me sound like an imbecile here. :P Anyways, wouldn't something like Matt Wright's FormMail or its equivalent fulfill your needs nicely? It has the necessary validation and security checks built into the Perl script...

Edit: I just checked DASPRiD's site. While he's apparently back to work on the site and has a Web presence elsewhere again, it's equally evident that TremStats has not been touched in a year. Oh, well.
« Last Edit: November 04, 2008, 03:58:26 am by Einstein »

Syntac

  • Posts: 841
  • Turrets: +118/-104
    • Syntac's Stuff
Re: TremSnaps 1.0
« Reply #49 on: November 04, 2008, 07:54:00 pm »
AAAAAAAAAHHHHH OFFTOPIC!!!!!!!!!!!!!!!!!

Anyways, wouldn't something like Matt Wright's FormMail or its equivalent fulfill your needs nicely? It has the necessary validation and security checks built into the Perl script...
No. Mainly because it's not written in PHP. Also because I only use my own projects, since it's easier for me to troubleshoot them.

professor

  • Posts: 232
  • Turrets: +1/-33
Re: TremSnaps 1.0
« Reply #50 on: November 09, 2008, 06:22:26 am »
hmm well i just read this right now, and i cant really figure what to do with it once i download it.. do i just put it in a folder or sumthin cuz i dont get it.. :granger:
http://static.flickr.com/24/141310872_e39ad59705_b.jpg
omg! someone cut the arm off my tyrant!!

Syntac

  • Posts: 841
  • Turrets: +118/-104
    • Syntac's Stuff
Re: TremSnaps 1.0
« Reply #51 on: November 09, 2008, 06:26:14 am »
It's rather simple. You put the

in the

and you

it all together.

*sigh*

First, get your computer's built-in Apache web server working (with the PHP module enabled).

professor

  • Posts: 232
  • Turrets: +1/-33
Re: TremSnaps 1.0
« Reply #52 on: November 09, 2008, 06:42:27 am »
o god i hate to do this to you, but i have no idea how to do that ??? so ummm :o how do u do that?
http://static.flickr.com/24/141310872_e39ad59705_b.jpg
omg! someone cut the arm off my tyrant!!

Syntac

  • Posts: 841
  • Turrets: +118/-104
    • Syntac's Stuff
Re: TremSnaps 1.0
« Reply #53 on: November 09, 2008, 06:58:37 am »
Google is your friend.

The PHP website has instructions (you'll want to read the comments at the bottom).
« Last Edit: November 09, 2008, 07:00:32 am by Syntac »

professor

  • Posts: 232
  • Turrets: +1/-33
Re: TremSnaps 1.0
« Reply #54 on: November 09, 2008, 06:22:03 pm »
hmm that wasnt very helpful, so can u please just help
http://static.flickr.com/24/141310872_e39ad59705_b.jpg
omg! someone cut the arm off my tyrant!!

Syntac

  • Posts: 841
  • Turrets: +118/-104
    • Syntac's Stuff
Re: TremSnaps 1.0
« Reply #55 on: November 09, 2008, 07:51:05 pm »
No, I can't "just help". Stop being a lazy ass and use a search engine.

professor

  • Posts: 232
  • Turrets: +1/-33
http://static.flickr.com/24/141310872_e39ad59705_b.jpg
omg! someone cut the arm off my tyrant!!

Syntac

  • Posts: 841
  • Turrets: +118/-104
    • Syntac's Stuff
Re: TremSnaps 1.0
« Reply #57 on: November 09, 2008, 11:12:21 pm »
Obviously, you aren't very good at searching. Buy a brain and stop wasting my time.

Bissig

  • Posts: 1309
  • Turrets: +103/-131
Re: TremSnaps 1.0
« Reply #58 on: November 09, 2008, 11:33:48 pm »

professor

  • Posts: 232
  • Turrets: +1/-33
Re: TremSnaps 1.0
« Reply #59 on: November 09, 2008, 11:57:16 pm »
o thanks that was helpful i think that works..
http://static.flickr.com/24/141310872_e39ad59705_b.jpg
omg! someone cut the arm off my tyrant!!