Changeset - 109689bb5e10
[Not reviewed]
default
0 1 0
ethanzonca - 16 years ago 2009-07-02 23:24:26

Quick comment- we need struct rather than array for frameset so we can track who each frame went out to...
1 file changed with 1 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/server/distrend.c
Show inline comments
 
/*
 
  Copyright 2008 Nathan Phillip Brink, Ethan Zonca
 
 
  This file is a part of DistRen.
 
 
  DistRen is free software: you can redistribute it and/or modify
 
  it under the terms of the GNU Affero General Public License as published by
 
  the Free Software Foundation, either version 3 of the License, or
 
  (at your option) any later version.
 
 
  DistRen is distributed in the hope that it will be useful,
 
  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
  GNU Affero General Public License for more details.
 
 
  You should have received a copy of the GNU Affero General Public License
 
  along with DistRen.  If not, see <http://www.gnu.org/licenses/>.
 
 
*/
 
 
/* This file contains the code which both processes (renders) jobs as a slave, and the code which distributes frames to slaves after receiving them from the client portion of the codebase. */
 
 
 /* Just some notes -- Ethan Zonca
 
 * ++ Make data availible for other apps to parse
 
 * Server<==>Client Communication
 
 * Upload while rendering
 
 */
 
 
#include <stdio.h>
 
#include "execio.h"
 
 
// needs to be implemented
 
#include "options.h"
 
 
#include <confuse.h>
 
 
#define max 100
 
// maximum number of stored jobs in memory, per job type (lux/blend). Eventually we can dump this data to disk, or atleast the remainder not in memory...
 
 
int jobnum = 0;
 
 
// Structures for storing job information
 
// OOOOOOkay so we really need a struct for frameset rather than just an array, because we should track who each frame was sent out to. Please do this, someone! :D
 
struct {
 
  char *name;
 
  char *submitter;
 
  char *email;
 
  int priority;
 
  struct frameset **frameset; // What exactly is this now? hehe
 
} blendjob[max];
 
 
struct {
 
  char *name;
 
  char *submitter;
 
  char *email;
 
  int priority;
 
  int mode; // 0 = Static Render, stop at Spp, or infinity if spp is null. Framerange is ignored || 1 = animation, stop at Spp and stay in framerange.
 
  int spp;
 
  struct frameset ** frameset;
 
} luxjob[max];
 
 
 
 
 
int main(int argc, char *argv[])
 
{
 
 
/* !!!!!!! Important notes !!!!!!!!!!!!
 
 
So, we need a common key. Maybe. Or we need to generate a key in registeruser() and get it to the client somehow.
 
If we use a common key, then we'll need different passphrases for each user, which would be kinda crazy. How can
 
we get a key generated on the server, and transferred to the client's distrend?
 
 
*/
 
 
 
// We need the conf parser code from options.c here!!!
 
char *username = "unregistered"; // get this from conf
 
 
 
 
// Checks if the conf is left at the default username
 
int registered;
 
if(username == "unregistered") {
 
  fprintf(stderr,"\nYou have not set your username in distrend.conf!\nIf you need to register a username, run distrend -c username email@example.com\n\n");
 
  registered = 0;
 
}
 
else{
 
  fprintf(stderr,"Logging into the DistRen server...\n");
 
}
 
0 comments (0 inline, 0 general)