Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Inquisitor on November 14, 2002, 01:04:34 pm

Title: Poor man's PXO
Post by: Inquisitor on November 14, 2002, 01:04:34 pm
NOTE: This all works EXCEPT making the hash table on start.  Run "/makelistservers" after the script loads to create the hash table.

_____________
Using mIRC.

Open mIRC and connect to the maxgaming irc server. If you don;t have miRC, get a custom version at: http://www.mgonetwork.com/downloads2.php

You want "MGOmIRC Version 2"

Create a file called fs2scraper.mrc in mgogames in your mirc install folder.
Quote

; Open a custom window called @IRC when mIRC starts
;on *:START: hmake FS2Games 50
on *:START: window @FS2ServerLog
;on *:START: clearlistservers

; If the user tries to close @IRC, open it again
; This is a kludge but unfortunately it's hard to come up with a better solution
on *:CLOSE:@FS2ServerLog: .timer 1 0 window @FS2ServerLog

; Since $network doesn't always return value, use $server for the network name if $network fails
alias -l networkname {
if ( $network ) return $network
return $server
}

alias listservers {
var %lcv
; declare the loop control variable as local, this will clean it up
; automatically when the alias is finished executing

%lcv = 1
; set the initial value of the lcv to 1, we start at the first nickname
echo @FS2ServerLog Host Nickname ---- Host IP Address
while (%lcv <= $hget(FS2Games,0).item) {


SET %HostNick $hget(FS2Games,%lcv).item
SET %HostIP $hget(FS2Games,%HostNick)
;echo @FS2ServerLog Host Nickname ---- Host IP Address
echo @FS2ServerLog %HostNick ---- %HostIP
; echo -a Nickname %lcv $+ : $nick(#, %lcv)
; we output the lcv'th nickname

inc %lcv
; we increment the lcv by one since so we can go to the next nickname
; since we have the condition to check the bounds of the lcv, once we have outputted
; the last nickname, the condition will become false and the loop will quit

}
; end the loop
}

alias clearlistservers {
hfree -s FS2games
hmake -s FS2Games 50
}

alias makelistservers {
hmake -s FS2Games 50
}

; Scan Channel messages

on *:TEXT:*FS2 Game started at IP*:#: {
SET %GameIP $6
; hmake FS2Games 50
hadd -s FS2Games $nick %GameIP
echo $color(normal text) -mlti2 @FS2ServerLog < $+ $networkname $+ : $+ $target $+ : $+ $nick $+ > $strip($1-,m)
echo @FS2ServerLog $hget(FS2Games,0).item Servers started since you logged on.
listservers
}


This scans the channels you are in for the text "FS2 Game started at IP"  and takes the 6th word in that string (which will be the IP address right after the word IP, see below). and sets it to %GameIP.

It then writes the players IRC nickname and %GameIP to a local hash table.

It also creates the command "/listservers" that will echo the contents of your hash table, which is simply is a list of all servers your client is aware of since mIRC was started (obviously this isn't scalable).

You want to load this script by entering:
Quote

/reload -rs mgogames/fs2scraper.mrc


Now-

Hit alt-p after you launch mIRC

Go to View-->Nickname List
at the botom of the text field, add the following including the "-" :

Quote

-
Freespace 2 GamePlay
.Start Server List:{/makelistservers }
.Clear Serever List:{/clearlistservers }
.List Servers:{/listservers }
.Join Manually FS2:{/run c:\games\freespace2\fs2_open.exe -connect $$?=Enter IP| /msg $chan 4 $me, Joining a game of Freespace2 }
.Join Selected Nick FS2:{/run c:\games\freespace2\fs2_open.exe -connect $hget(FS2Games, $+ $1) }
.Host FS2 Game:{/run c:\games\freespace2\fs2_open.exe -startgame | /msg $chan FS2 Game started at IP $IP }



What that does:
Adds a menu item called gameplay when you right-click in the channel user list pane. In Gameplay, you have 2 options, join a game in progress or host a game. If you right click on a username who has just launched a game, it will pop a dialog for you to manually enter the IP address of the host.

It also adds a menu item that lets you join a game hosted by the selected user, so highlighting the uername in mIRC, what that does is go to the hash table we created above, lookup the IP associated with that nick, and launches the game with the -connect argument.

Obviously you need to edit the path to wherever fs2 is installed, need to add a reg entry for install directory, then I'll be able to read it.

Next stop, a GUI that lists all the games your mIRC client knows about :) And managing the number of servers your client is aware of by age of the server :)
Title: Poor man's PXO
Post by: mikhael on November 14, 2002, 01:36:23 pm
Quite Groovy. :)
Title: Poor man's PXO
Post by: Sesquipedalian on November 14, 2002, 03:09:55 pm
This needs to be put somewhere permanetly accessible and highly visible.
Title: Poor man's PXO
Post by: BlackDove on November 14, 2002, 03:55:29 pm
Well it works for me so far, we'll see about the game part soon :p
Title: Poor man's PXO
Post by: Inquisitor on November 14, 2002, 04:01:38 pm
Yeah, I am behind on putting the site up, this will go on it :)

Anyone want to be a part time webmaster?
Title: Poor man's PXO
Post by: Taristin on November 19, 2002, 03:37:30 pm
Now if only you could make it so the game did all this for you...
Title: Poor man's PXO
Post by: Stealth on November 19, 2002, 05:01:34 pm
Quote
Originally posted by Inquisitor
Yeah, I am behind on putting the site up, this will go on it :)

Anyone want to be a part time webmaster?


i can be a part time webmaster...
Title: Poor man's PXO
Post by: Inquisitor on November 19, 2002, 06:06:28 pm
You have to respond to the email I sent ;) I  understand you volunteered to help caretake the tester list.

Email me, we'll talk :)
Title: Poor man's PXO
Post by: IceFire on November 19, 2002, 06:48:43 pm
You just have to deal with the PHP elements that we use.  No worries, if you've got HTML under your belt, this won't be too hard at all.

If I can do it...
Title: Poor man's PXO
Post by: Bobboau on November 19, 2002, 07:47:02 pm
why can't the game do all this, I thought it had some sort of IRC code in it
Title: Poor man's PXO
Post by: Inquisitor on November 19, 2002, 09:26:13 pm
It can, I was just doing something quick and simple that we could model from ; )
Title: Poor man's PXO
Post by: EdrickV on November 20, 2002, 03:00:54 am
Quote
Originally posted by Bobboau
why can't the game do all this, I thought it had some sort of IRC code in it


"Had" being the key word. The PXO stuff (or at least the main part of the PXO stuff) was removed before the source was released because it's Parallax's stuff not Volitions.
Title: Poor man's PXO
Post by: Inquisitor on November 20, 2002, 06:23:02 am
The goal os to put it back in game, I just wanted something quick and dirty ;)

This is my way of prototyping thru the issues. It was also a convenient way for me to relearn mIRC scripting ;)
Title: Poor man's PXO
Post by: Bobboau on November 20, 2002, 09:15:41 am
I thought the IRC code was still in there, only the internal logging in-out stuff was cut, but I havn't looked at the multiplayer code at all so I have no real idea
Title: Poor man's PXO
Post by: EdrickV on November 21, 2002, 12:10:51 am
As far as I can tell, the entire PXO chat interface/game list user interface code was removed. I'm not sure about the code that actually handled the messages for the chat system. I'm pretty sure the briefing chat stuff is still there though, but have no idea where and am not entirely sure it's the same as the PXO chat lobby code. There is also PXO related code scattered throughout the multiplayer files that might be useful if we ever make a PXO like server. (One that keeps track of stats and stuff.)
Title: Poor man's PXO
Post by: Stealth on November 22, 2002, 12:56:16 pm
Quote
Originally posted by Inquisitor
You have to respond to the email I sent ;) I  understand you volunteered to help caretake the tester list.

Email me, we'll talk :)


i have?

i will email you :)

Quote

You just have to deal with the PHP elements that we use. No worries, if you've got HTML under your belt, this won't be too hard at all.

If I can do it...


i can get around in PHP, i'm just not very good at it.

if you can do it go ahead... but i thought what with the source code programming, VW, etc. you might be a little too busy ;)
Title: Poor man's PXO
Post by: Stealth on November 22, 2002, 12:57:03 pm
Quote
Originally posted by EdrickV


"Had" being the key word. The PXO stuff (or at least the main part of the PXO stuff) was removed before the source was released because it's Parallax's stuff not Volitions.


isn't Parallax a part of Volition, Inc.?
Title: Poor man's PXO
Post by: Galemp on November 22, 2002, 06:04:29 pm
Parallax broke into Volition and Outrage, (haven't heard from them since D3, actually...) so PXO is probably jointly owned by them.
Title: Poor man's PXO
Post by: EdrickV on November 22, 2002, 07:08:58 pm
Quote
Originally posted by GalacticEmperor
Parallax broke into Volition and Outrage, (haven't heard from them since D3, actually...) so PXO is probably jointly owned by them.


THQ bought (or otherwise acquired) Outrage. And apparently Outrage is still doing stuff, but for console systems.
Title: Poor man's PXO
Post by: Bobboau on December 04, 2002, 05:56:04 am
so what progress has been made on this front?
Title: Poor man's PXO
Post by: Inquisitor on December 04, 2002, 07:33:32 am
I tested this, the above seems to work, need to do something integrated into fs2 next.

Also have the possibility of a real master server coming soon.

Basically, plodding along, slow but sure.

You committ that decal code?
Title: Poor man's PXO
Post by: WMCoolmon on January 03, 2003, 11:40:40 pm
Quote
I tested this, the above seems to work, need to do something integrated into fs2 next.

I agree, it should be possible to play FS2 multiplayer "out of the box", so to speak. ie as soon as Freespace 2 is installed and configured, the player should be able to download a list of gammes, join a game, and play it without doing anything other than setting up a pilot/account. fs2_open needs to be user friendly to attract new players (and multiplayer is a feature in pretty much every game released these days).
Title: Poor man's PXO
Post by: Andur on January 16, 2003, 12:06:18 pm
Maybe I'm just plain wrong, but couldn't we use Kali and/or Kahn to do precisely that?


 BTW, I've been a lurker here for a couple months, but didn't want to register till I could contribute with a post that sounded constructive :thepimp: