Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - QwazyWabbit

Pages: 1 ... 11 12 13 14 15 16 17 18 19 20 [21] 22 23 24 25 26 27 28 29 30 31 ... 75
301
0x1337c0de / Toward a Better MOTD
« on: September 21, 2013, 07:37:41 PM »
LOX has a feature that sends a motto of the day (MOTD) to players when they connect. This code was originally in-line in the ClientBeginDeathmatch function and it was an UGLY part of an otherwise simple ClientBeginDeathmatch function.

Today I decided to clean it up a bit, make it a callable function and publish it for use by other mod developers who might be interested in using a MOTD in their mod. I don't know where the original code came from, it was a part of LOX from a very long time ago and also exists in WODX and presumably WOD from where LOX and WODX derive their pedigree.

ClientBeginDeathmatch isn't called frequently so there is no advantage to writing the code in-line and avoiding a function call. It also goes against discipline to write something in line where a function will be more advantageous and the resulting code much more clear.

The ClientPrintMOTD function prototype belongs at the top of p_client.c or in g_local.h if you intend to access it globally:
void ClientPrintMOTD (edict_t *ent);
The function body belongs in p_client.c:
Code: [Select]
// Store the message of the day in memory.
char *gMOTD = ((char *)-1); // initialized at startup as bad pointer
cvar_t *motdfile;

void ClientPrintMOTD (edict_t *ent)
{
FILE *in;
char motdPath[MAX_QPATH + 1];
int c;
int motdBytes;
char *here;

// If the MOTD hasn't been loaded, do so.
if (gMOTD == ((char *)-1))
{

// Generate the path to the MOTD file.
if (gamedir == NULL || motdfile == NULL
|| !gamedir->string[0] || !motdfile->string[0])
{
gMOTD = NULL; // null pointer means we'll never try again
return;
}

sprintf (motdPath, "./%s/%s", gamedir->string, motdfile->string);

// Open the file.
in = fopen (motdPath, "rt");
if (in == NULL)
{
gi.dprintf("Opening MOTD file failed, error: %i.\n", errno);
gMOTD = NULL;
return;
}

// Count the number of bytes in the file.
motdBytes = 0;
while ((c = fgetc (in)), c != EOF)
motdBytes++;

// Make space for that many bytes.
gMOTD = gi.TagMalloc (motdBytes + 1, TAG_GAME);
gi.dprintf("Allocating %i bytes for MOTD\n", motdBytes +1);

// Now read the MOTD in for real.  Null-terminate the string.
fclose (in);
in = fopen (motdPath, "rt");
here = gMOTD; //extra pointer for writing into gMOTD
while ((c = fgetc (in)), c != EOF)
{
*here = c;
here++;
motdBytes--;
}
*here = '\0';

// If anything went wrong, warn the console.
if (motdBytes != 0)
gi.dprintf ("MOTD error: off by %d bytes", motdBytes);

}
if (gMOTD != NULL) // If a MOTD was successfully loaded, print it.
gi.centerprintf (ent, "%s", gMOTD);
return;
}

Define the necessary CVAR in GameInit:
Code: [Select]
motdfile = gi.cvar ("motdfile", "motd.txt", 0);

Add the CVAR to g_local.h:
Code: [Select]
extern cvar_t *motdfile;

Restore the ClientBeginDeathmatch to it's original beauty.
Code: [Select]
/*=====================
ClientBeginDeathmatch

A client has just connected to the server in deathmatch
mode, so clear everything out before starting them.
=====================*/
void ClientBeginDeathmatch (edict_t *ent)
{
G_InitEdict (ent);
InitClientResp (ent->client);

// locate ent at a spawn point
PutClientInServer (ent);

if (level.intermissiontime)
MoveClientToIntermission (ent);
else
{
// send effect
gi.WriteByte (svc_muzzleflash);
gi.WriteShort (ent-g_edicts);
gi.WriteByte (MZ_LOGIN);
gi.multicast (ent->s.origin, MULTICAST_PVS);
gi.bprintf (PRINT_HIGH, "%s entered the game\n", ent->client->pers.netname);
}

ClientPrintMOTD(ent);

// make sure all view stuff is valid
ClientEndServerFrame (ent);
return;
}

You will notice the ClientPrintMOTD function has a trapdoor in the gMOTD pointer. It's initialized at definition to -1 and the function sets it to NULL if there's a problem initializing the cache it is supposed point to that contains the MOTD text. I'm not sure I would have done it exactly that way but you may see a modified version later, I decided to publish this as-is and may polish it up another time. The trapdoor closes the first time the function is called and the gMOTD pointer either points to a valid MOTD string or it is NULL. The trapdoor prevents the function from taking the time to open/read/close the motd.txt file every time someone connects. The problem with this technique is that if you change the MOTD file you must restart the server to get it to read it again and update the cache.

Add a motd.txt file to your server's mod folder and enjoy your center-printed MOTD.

302
Quake / Re: my server no longer shown on q2servers.com
« on: May 25, 2013, 09:33:21 AM »
I'm not the OP. (original poster). i was just sharing information with the OP on the masterservers from my config. i only host 1 server. it is a local one. i have no problem with seeing it in the q2server browser.

 fish is having problems. i just figured he didn't have the right master servers in his config. there seemed to be a little confusion as a result :confused: .. my mistake. disregard that. so now that's out of the way, you can concentrate on his issue.

"setmaster master.q2servers.com" what is wrong with this master server? i posted this on my 1st post.

There is nothing wrong with that server. But you need to view the list of servers on http://q2servers.com/ or with R1ch's Quake2 Server Browser, a Windows application.

If you keep seeing nothing but heartbeat messages then your firewall settings are incorrect. You must open the Quake2 server port (27910 by default) for UDP inbound and outbound.

303
Quake / Re: my server no longer shown on q2servers.com
« on: May 25, 2013, 01:21:36 AM »
Sheesh. :mrdead: I didn't pay close enough attention to the threading. I hate web forums for that reason. One of these days someone is going to invent a way for web forums to display threaded posts.

Fishxz can use the information from my last post to figure it out, I'm sure.

304
Quake / Re: my server no longer shown on q2servers.com
« on: May 25, 2013, 01:06:16 AM »
I see one server, 71.190.92.212:27910, Golgo13's Lithium CTF.

:lolup:

yea, i dunno dude. those are just acknowledges from the masters i thought. you're better at techical jargon. i just put what was showing in my console. :smiley_feet:


I don't know what this means. You didn't answer any of my questions about your servers and IP's. I am telling you I see one server in your name on the q2servers.com active servers list. If you have more, tell us what they are named and what their IP's are. If they are hosted on the same computer you are going to have problems if you don't properly configure them and open your ports on your router for them.

You appear to have only one valid server active and listed.


The server/master handshake looks like this:

server                 master
           ->ping->             server pings master until it receives ack
           <- ack <-
                                     
master prepares to poll server

master polls server periodically once it has listed the server as active:

           <- ping <-         master pings server to see if it's alive
           -> ack ->          server is alive
 
          <- status <-      master asks for game status
           -> print ->       server sends game status and variables (player list, etc.)
           <- ack <-

Between pings and status dialogs, every 5 minutes the server sends a heartbeat frame to the master.

        ->heartbeat ->
           <- ack <-

... repeat

If this handshake fails the master will not list the server. It can take several tries before a master will list a server as active since this all occurs on UDP and delivery is not guaranteed by the protocol.

At server shutdown the server sends a "shutdown" frame to the master and terminates the process and the master deletes the server from the list. The server does not expect an ack to the shutdown frame. The master will delist the server immediately if it receives the shutdown frame but if it doesn't receive the shutdown frame it can take 10 minutes for the master to delist the server. If a server crashes unexpectedly the master will delist the server after it fails to receive acks to its pings.

What you will see in your console if this is all working as expected:

Ping acknowledge from 173.236.101.34:27900
Sending heartbeat to 173.236.101.34:27900
Ping acknowledge from 173.236.101.34:55708
Ping acknowledge from 173.236.101.34:55708
Ping acknowledge from 173.236.101.34:55708
Ping acknowledge from 173.236.101.34:55708
Ping acknowledge from 173.236.101.34:55708
Ping acknowledge from 173.236.101.34:55708
Sending heartbeat to 173.236.101.34:27900
Ping acknowledge from 173.236.101.34:55708
Ping acknowledge from 173.236.101.34:55708
Ping acknowledge from 173.236.101.34:55708
Ping acknowledge from 173.236.101.34:55708
Ping acknowledge from 173.236.101.34:55708
Ping acknowledge from 173.236.101.34:55708
Sending heartbeat to 173.236.101.34:27900
Ping acknowledge from 173.236.101.34:55708
Ping acknowledge from 173.236.101.34:55708


305
Quake / Re: my server no longer shown on q2servers.com
« on: May 24, 2013, 06:13:44 PM »
I see one server, 71.190.92.212:27910, Golgo13's Lithium CTF.

306
Quake / Re: my server no longer shown on q2servers.com
« on: May 24, 2013, 12:20:47 PM »
The listmasters results you show would indicate you are communicating with the master. If you are communicating the number in the lastmsg column will change each time you use the listmasters command.

The setmaster result says otherwise.

All the other servers you have listed no longer exist as happy friar points out.
Netdome.biz doesn't respond as a Q2 master server.

The owner of q2servers.com is R1ch. He may respond if you post you question on his forum.

Check your firewall settings on the servers, if they are hosted sometimes hosting companies will block outbound traffic on the ports Q2 uses.

Make sure you aren't filtering your server list too. R1ch's quake 2 server browser remembers the filter settings and caught me off guard a couple of times.

What are your server names and IP addresses? I will take a look too.

307
Quake / Re: my server no longer shown on q2servers.com
« on: May 23, 2013, 10:11:59 PM »
master.exhale.de has been gone for at least a year. I took it off my configurations that long ago when I noticed it wasn't responding to my server pings. The exhale.de domain is still valid but the subdomains master.exhale.de or masterserver.exhale.de are no longer registered.

fishxz: r1q2dedicated defaults to master.q2servers.com without the need for it to be set with the setmaster command. I don't know if this is true for q2pro but it might be worth looking into. I know q2pro was following r1ch's development and using many of his changes. I still prefer r1q2 as a server, though. Check the server console logs and see if the server is acknowledging your server pings. You can see it in the server console stream if you set con_filterlevel 0, if q2pro supports the con_filterlevel and logfile_filterlevel that exist in r1q2.

You should also check that the domain name is properly resolved on your Q2 server machine.
Use nslookup master.q2servers.com to be sure it resolves.

If your servers are properly reaching master.q2servers.com you will get: "Ping acknowledge from 173.236.101.34:xxxxx" in your log stream. If the server can't resolve the IP address of a master server r1q2 server will print "Bad address: ..." in the console.

Also, commanding "setmaster" in the console of r1q2 will force a ping of the master server, thus:
Quote
setmaster
Sending heartbeat to 173.236.101.34:27900
Ping acknowledge from 173.236.101.34:55708

If sv_global_master is 1, r1q2 will automatically use master.q2servers.com:27900 as its master.

I do not know if there are any other valid q2 master servers in existence.

One of the nice commands in q2pro server is the "listmasters" command which will tell you if the master is communicating with your server. This command doesn't exist in r1q2.

308
Trouble Shooting / Re: CTF maplist file
« on: May 13, 2013, 10:14:09 PM »
What mod are you trying to run in CTF mode?

The original game code allowed for you to set sv_maplist as you indicated. You also want to make sure that dmflags is not setting bit 5 (value 32) or it won't rotate levels.

There were a couple of mods out there that didn't use a maplist file. You had to specify the map rotation on the command line, which was rather limiting.

309
Trouble Shooting / Re: r1q2 issue
« on: January 09, 2013, 07:04:26 PM »
7904 was what I had. That said modified client.

Works fine now, not getting kicked and blocks don't appear when I run cfg.  :beer:


I did some more troubleshooting..

I updated r1q2 again,  is said mine was old (the just installed 7904), it said it was downloading 7904.
when I ran it it was build 8012 again, and did the same block thing.

I removed ALL paks from baseq2 except pak0 and pak1.
ran the game again, was stock text, conchars.pcx.
far as I could tell everything was stock again (shudders)

ran my cfg and the white blocks came back.

I try and find out what in the cfg is triggering it.  But something is screwed on r1q2 if its updating a b7904 to b7904 and actually loading b8012.
Maybe I need to update the updater :)

bbl


Thanks Derv

The 7904 to 7904 update message is a known bug. I am not sure if it's the updater sending the wrong version number or something in the data it fetched from the web server. I suspect it's a copy-paste bug in the text in the database on the web server since the updater wouldn't have any pre-knowlege about the version numbers. At any rate it gets the b8012 version and that binary is stamped with the correct version number.

310
Quake / Re: Quake Roots
« on: December 30, 2012, 10:10:12 PM »
I'm so old school I ported Quake II to PDP8e assembler and used the toggle switches on the panel to play the game while watching an oscilloscope display.  :ubershock:

311
Quake / Re: Q2 15th anniversary FFA event, Friday Dec 7th, 8PM Central
« on: December 11, 2012, 07:49:42 PM »
It was interesting to see that many people on the dm maps.

Interesting? More like INSANE. The one map I won, I was surprised at how I was able to rack up tons of consecutive quick kills in the mg room using nothing but a machinegun and the ammo left by the endless succession of dropped mg's of the scores of people I repeatedly fragged. Couldn't move 5 feet without constantly bumping into someone. "Excuse me, pardon me, excuse me, pardon me, coming through, pardon me, excuse me." :D

Mosh pit mashup with guns.

312
Quake / Re: Official Release Date of Quake 2? Its 15th Birthday?
« on: November 17, 2012, 08:03:14 PM »
releases weren't as big a deal back then.  It could very well of been sent to stores, but it didn't come out until the following Tuesday.  If it were then PQ would of said people were getting it three or four days ahead of time. 

The first patch was released on release day, but since it's '97 I'm betting 95% of the buyers didn't even know as internet wasn't that prevalent and bbs's wouldn't of had it yet.

I don't know where you get this Tuesday thing, that may be the case today but I don't even remember it being the practice 15 years ago. Please present your evidence for that being in effect in 1997. I see none. Absent any positive evidence of a true release date, I will personally observe it on Dec. 1 since that's the only sure date from the horses mouth about when the code went Gold. It's also universal since it doesn't matter what country you live in.

As far as the prevalence of the internet, I was doing internet stuff on 300 baud modems back in 1980. In 1997 I was reading John Carmack's .plan files directly on a Unix box and on a Windows box in Netscape on 96kbps modems, perhaps even a 128k ISDN line, I can't remember the specifics off hand, I'd have to look for the ISDN bills and I'm too lazy right now. I seldom used BBSs and I know the plan file wasn't distributed that way.

I also know I was downloading the 3.06 code directly off the idSoftware server that day after I had purchased the retail CD in a store so I know that had to be between the 1st and the 6th.

I don't know any store that would have let a popular product like the much-anticipated Q2 sit in their stock rooms for three days waiting for a Tuesday when they could have all weekend to sell it off the shelf. I don't know anyone who would sign a contract to embargo it for that long either.


I just checked my Quicken reports. I was doing 128k ISDN in December of 1997. Prior to that it was 96k dialup.

313
Quake / Re: Official Release Date of Quake 2? Its 15th Birthday?
« on: November 16, 2012, 09:38:29 PM »
Yeah, 97 not 07.  Oopes.

Where do you get US release on the 6th?  December 6th, 1997 was a Saturday, games are normally released in Tuesdays, movies Thursdays in North America.

The party was the evening of the 5th. Presumbably it was delivered to stores by that date for display Saturday. Preorders were commenced on the 4th. He wrote nothing in his plan file about Q2 between stating it was gold on the 1st and stating the 3.06 point release was available on the 9th. The stated goal was that the CD would be released and the first point release "within a few days". I assume he was a busy guy between the 2nd and the 9th.


http://www.scribd.com/doc/14191/John-Carmack-Archive-plan-1997

314
Quake / Re: Official Release Date of Quake 2? Its 15th Birthday?
« on: November 16, 2012, 08:15:48 PM »
I went looking @ PQ's news archives at the time:
*Q2's EU release day was 12/12/07
*Q2's US/Canada was 12/09/07 (I was at EB games that day, btw.  :D )
*Denmark was selling it in 12/7/07
*Q2 copies available at the release party on 12/05/07

link: http://planetquake.gamespy.com/show_archives.php?month=12&day=7&year=1997

So, 12/9/07 was official, Google is wrong, Wikipedia is wrong, IGN is wrong.

PQ was right.   :bravo:

I think you mean 97, not 07. But I contend that 12/6/97 is the day.

Gold on 12/1/97.
Preorders accepted on id's site: 12/4/97
Release party on 12/5/97
US release 12/6/97.

315
Quake / Re: Official Release Date of Quake 2? Its 15th Birthday?
« on: November 15, 2012, 09:36:54 PM »
From John Carmack's .plan file, 1997:

Quote
Quake2 has mastered. (Dec01,1997)

Where we go from here:
Point release.
We should have a Quake 2 point release out shortly after the game gets in your hands. We intend to fix any bugs that turn up, improve the speed some what, and optimize for internet play in various ways. We will also be making several deathmatch only maps.
Deathmatch in Q2 has gotten a lot of lan testing (Thresh, Redwood, and Vik Long helped quite a bit the last week with tuning), but not much in-ternet testing. There are probably gaping holes in it, but we will address them soon.
The deathmatch code in the shipping Q2 is also not designed to hold up against malicious users - there is no protection against clients being ob-noxious and constantly changing skins, chat flooding, client-side cheat-ing, or whatever.

...

BIG BUG IN Q2 NETWORKING! (Dec09,1997)
 
If you run multiplayer servers, download:
ftp://ftp.idsoftware.com/idstuff/quake2/q2_306.zip

...

The Quake 2 public code release is up at (Dec11,1997)
 
ftp://ftp.idsoftware.com/idstuff/quake2/source/q2source_12_11.zip
 
This source code distribution is only for hard-core people that are going to spend a lot of time pouring over it. This is NOT a how-to-make-levels-for-q2 type dsitribution!This should keep a bunch of you busy for a while. :)

You can say Q2 was shipped for mastering on Dec. 1, 1997, so that was the code that shipped on the retail CD. The 3.06 point release on December 9 was the one I remember as being the "official" multiplayer version. All my historical memory of the game stems from that 3.06 release. Happy Friar's LAN test on October 19 was a test of incomplete Q2 and there were many changes before the release. It looks like that December 6, 1997 date from Google is correct but there is no post from John Carmack on that date. No doubt he was busy coding the point release. :)

Pages: 1 ... 11 12 13 14 15 16 17 18 19 20 [21] 22 23 24 25 26 27 28 29 30 31 ... 75