To start a new discussion, join us on Discord. The DontCamp.com read-only forum archives are below.

DontCamp.com
No, but really, you should join us on Discord.

DontCamp Code
Goto page Previous  1, 2, 3  Next
 
   DontCamp.com Forum Index -> Community Discussion and News
View previous topic :: View next topic  
Author Message
DogShxtTaco
CH Administrator


Joined: 19 Apr 2004
Posts: 8201
Location: Cary, NC

PostPosted: Mon Aug 08, 2005 5:32 pm    Post subject:

http://pear.php.net/package/Text_Highlighter
Valt
Forum Veteran


Joined: 25 May 2004
Posts: 1986
Location: Attleboro, MA

PostPosted: Fri Aug 12, 2005 10:26 pm    Post subject:

Would anyone be up for some code puzzlers?
_________________
Meh.
DogShxtTaco
CH Administrator


Joined: 19 Apr 2004
Posts: 8201
Location: Cary, NC

PostPosted: Sun Aug 14, 2005 2:27 am    Post subject:

'course.

Make a new thread. Smile
GForce®
Helpful Forum User


Joined: 08 Aug 2005
Posts: 21

PostPosted: Thu Dec 08, 2005 4:21 pm    Post subject:

What happened to the dc_ass.py script?
_________________
GForce®
Butter
CH Administrator


Joined: 18 Apr 2004
Posts: 7520
Location: New York, NY

PostPosted: Thu Dec 08, 2005 5:37 pm    Post subject:

Since you posted this question twice, I deleted the other post. We removed all our bf2 python code from our server to try to track down a bug. We've also moved to using PB directly to admin the server. However, probably later tonight, I'll be adding some of the old python code back in and the dc_ass.py file will show itself once again in on the code page.
_________________
EDT sucks.
GForce®
Helpful Forum User


Joined: 08 Aug 2005
Posts: 21

PostPosted: Thu Dec 08, 2005 7:54 pm    Post subject:

Thanks Butter,

That script is far too good for the scap heap!!! Very Happy Any reason why it should not be working after the new patch?
_________________
GForce®
Butter
CH Administrator


Joined: 18 Apr 2004
Posts: 7520
Location: New York, NY

PostPosted: Fri Dec 09, 2005 2:03 pm    Post subject:

I didn't add out python code back into to BF2 yet, but I did add a release section to the code page. Right now, the only things in the release section are the dc_ass.py file and its dependencies.
_________________
EDT sucks.
Butter
CH Administrator


Joined: 18 Apr 2004
Posts: 7520
Location: New York, NY

PostPosted: Thu Jan 26, 2006 3:07 pm    Post subject:

For those interested, the latest GSQuery_class.php on our code page is now in a mostly beta state. It's one of the more flexible and powerful pieces of code I've made to date. I need to add some documentation, but the idea behind this class is to provide the basic tools needed to easily communicate with GameSpy query based multiplayer games. Since there seems to be some games that don't follow the GameSpy standard very well, I've setup this class to easily be extended to support more games.

As the class stands now, it will support BF1942, BF2, and although mostly untested, it seems to work well with UT2K4.

This class is now used to drive our TSAT application and the game server info on the frontpage.
_________________
EDT sucks.
Maddy
Forum Veteran


Joined: 11 Jun 2005
Posts: 551
Location: Washington D.C.

PostPosted: Thu Jan 26, 2006 5:38 pm    Post subject:

thats some great code butter, im just kind of confused where im supposed to define the server's ip and port that wer are extracting the info from
Butter
CH Administrator


Joined: 18 Apr 2004
Posts: 7520
Location: New York, NY

PostPosted: Thu Jan 26, 2006 7:21 pm    Post subject:

Check out the example at the top of the source code. You get a GSQuery object using the static method: factory() which takes two arguments: the IP of the game server, and the number for the game. ATM, 1 = bf1942, 2 = bf2, and 3 = ut2k4. You can get a list of supported games with the static method: listGames(). This class already knows the default GameSpy ports for the supported games. So unless you're running on a non-standard port you don't need to use the setPort() method. But if you did, and your IP was 1.2.3.4:

Code:
$gs = GSQuery::factory('1.2.3.4', 2);
$gs->setPort(29901); // 29900 is the default port for bf2

$players = $gs->getPlayers();

_________________
EDT sucks.
Maddy
Forum Veteran


Joined: 11 Jun 2005
Posts: 551
Location: Washington D.C.

PostPosted: Thu Jan 26, 2006 7:56 pm    Post subject:

ohhh, durrrr
Thanks
Maddy
Forum Veteran


Joined: 11 Jun 2005
Posts: 551
Location: Washington D.C.

PostPosted: Thu Jan 26, 2006 8:10 pm    Post subject:

well, i think i understand, if i would want to query your server, i would want to put

Code:
<?php
include('GSQuery_class.php');

    print_r(GSQuery::listGames()); // shows a list of supported games

       $gs = GSQuery::factory('72.21.55.106', 2); // 2 = use game format BF2
    print_r($gs->getPlayers());



   ?>
Butter
CH Administrator


Joined: 18 Apr 2004
Posts: 7520
Location: New York, NY

PostPosted: Thu Jan 26, 2006 11:55 pm    Post subject:

That looks like it'll work to me.
_________________
EDT sucks.
Cereal Killer
Helpful Forum User


Joined: 09 Jul 2004
Posts: 13
Location: Manassas, VA

PostPosted: Sat Jan 28, 2006 1:10 am    Post subject:

How 'bout that dcf_live.php code? Where can I get it?

Thanks!

- CK
Butter
CH Administrator


Joined: 18 Apr 2004
Posts: 7520
Location: New York, NY

PostPosted: Sat Jan 28, 2006 1:28 am    Post subject:

I saw the first post you made.
_________________
EDT sucks.
DogShxtTaco
CH Administrator


Joined: 19 Apr 2004
Posts: 8201
Location: Cary, NC

PostPosted: Sat Jan 28, 2006 12:00 pm    Post subject:

As did I.
Butter
CH Administrator


Joined: 18 Apr 2004
Posts: 7520
Location: New York, NY

PostPosted: Mon Jan 30, 2006 12:33 pm    Post subject:

For those curious about how the BF2 extension to our GSQuery class works, check out the BF2 GameSpy Query article I submitted to kquery.com
_________________
EDT sucks.
Butter
CH Administrator


Joined: 18 Apr 2004
Posts: 7520
Location: New York, NY

PostPosted: Wed Feb 01, 2006 11:48 am    Post subject:

While ts2_autoteam.php wasn't really designed for public use, I figured I'd go ahead and post it on the code page for those that want to give it a try on their own sites.
_________________
EDT sucks.
Butter
CH Administrator


Joined: 18 Apr 2004
Posts: 7520
Location: New York, NY

PostPosted: Fri Feb 10, 2006 12:52 pm    Post subject:

The DontCamp LoneWolf Kicker is now available on the code page.
_________________
EDT sucks.
Gramps



Joined: 27 Apr 2006
Posts: 3

PostPosted: Fri Apr 28, 2006 3:24 am    Post subject:

Guys(or gals)!

Please save my day.

I need a python script that is somewhat similar to the dc_irs.py
But i really s*x at programming in python. All i can do is some some very basic VB..
What the script needs to do:

Trigger on a certain word in chat
eg. !admin or ?report or similar.

clean up the string from some crap like [dead] and [teamhudchat] or whatever...
Save the chatline and who said it in a txt-file.
Optional:
inform in chat or serveranouncements that info is recieved

start an external application


Can you plz help me with that. For someone who knows python and BF2 i guess it's easy Wink