Hey people.
This is an implementation of sending a .pak file to clients, which uses a 'cfg' in the pak whiich is run by the server to confirm the pak was received. Your comments, suggestions, etc appreciated
OBJECTIVE
For the qw server (FTEQWSV) to:
1. send a pak file to clients (only if they haven't already downloaded it)
2. confirm that it was downloaded successfully
3. be able to send them an updated version if required in future.
IMPLEMENTATION
1. Make the .pak (I used taniwha's pak program which (unlike pak explorer) allows filenames bigger than 8 letters).
2. In the pak, make a folder called 'test', containing a txt file (which I've) called 'konfirm.cfg', and contains one line:
Code: Select all
cmd bob123 //can be anything really
Code: Select all
precache_model("test/konfirm.cfg");
4. In ClientConnect() (client.qc) we add the line:
Code: Select all
stuffcmd (self, "exec test/konfirm.cfg\n");
5. In SV_ParseClientCommand (in fteqw.qc) do this:
Code: Select all
// this runs whenever the client types anything
void(string in) SV_ParseClientCommand =
{
float argcount; // this will store how many words the client typed
string s1,s2,s3,s4,s5,s6,s7;
argcount = ftebi_tokenize(in);
/* put each word into the array[EDIT: It's not actually an 'array', it's just a bunch of strings, each one holding a 'word']. This puts the first word they typed into the string s1 */
s1 = ftebi_argv(0);
// etc
s2 = ftebi_argv(1);
.
.
//This checks if the client cmd was 'bob123'
if (s1 == "bob123")
{
// if we are here, it means the client downloaded the pak!
dprint("Pak received!\n");
// we return so that the hidden 'message' doesn't get seen by clients
return;
}
There is is. This works with fte and ezquake clients [ EDIT (Dec 2013): No, it doesn't work w EZQuake clients, but it might with the upcoming EZQuake3.0] . It means you can make a bunch of 'stuff', send it to clients in one go, check whether they received it, AND if in future you update the skins/mdls/sounds/whatever, you can send an updated pak. This updated pak will have to be renamed, and needs the konfirm text to be updated to 'bob1234' or something, but you get the idea. [EDIT: Is this correct?]
Seems 'fiddly', but ..
1. Is there something I've missed?
2. Is there a better way of doing this?
thanks,
OneManClan
ps I couldn't figure out a more descriptive subject line .. suggestions welcome