From 15fcc190319a3deaaeaa544833ea07475e790585 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Sun, 29 May 2016 20:52:17 -0400 Subject: re-synching --- bugreporter.c | 0 cgi-bin/bugcomment.cgi | Bin 8584 -> 0 bytes cgi-bin/bugsdata.cgi | Bin 6492 -> 0 bytes cgi-bin/gencaptcha.cgi | Bin 7440 -> 0 bytes cgi-bin/newbug.cgi | Bin 9424 -> 0 bytes cgi-bin/showbug.cgi | Bin 6600 -> 0 bytes cgi-bin/test.cgi | Bin 8172 -> 0 bytes cgi-bin/test.txt | Bin 3307 -> 0 bytes chatlog.c | 0 common.c | 16 - example.png | Bin 2739 -> 0 bytes gms/index.html | 71 +++ gms/jumbotron-narrow.css | 79 +++ main.c | 37 -- test.png | Bin 2909 -> 0 bytes test.txt | 1 - testimage.png | Bin 3577 -> 0 bytes testimg.png | Bin 3383 -> 0 bytes ws2a/a.exe | Bin 69591 -> 0 bytes ws2a/adj.txt | 201 ------ ws2a/bugcomment.c | 186 ------ ws2a/bugs.html | 81 --- ws2a/bugs.js | 57 -- ws2a/bugs/1 | 22 - ws2a/bugs/2 | 12 - ws2a/bugs/3 | 26 - ws2a/bugs/4 | 19 - ws2a/bugs/5 | 18 - ws2a/bugs/6 | 10 - ws2a/bugs/7 | 6 - ws2a/bugs/8 | 6 - ws2a/bugs/lastbug | 1 - ws2a/bugsdata.c | 78 --- ws2a/bugview.html | 94 --- ws2a/bugview.js | 89 --- ws2a/gencaptcha.c | 91 --- ws2a/help.css | 54 ++ ws2a/help.html | 98 +++ ws2a/index.html | 2 +- ws2a/newbug.c | 183 ------ ws2a/nouns.txt | 1525 ---------------------------------------------- ws2a/showbug.c | 51 -- ws2a/test.txt | 0 ws2a/testcaptcha.png | Bin 10151 -> 0 bytes ws2a/testhtmlreplace.c | 108 ---- ws2a/writetest.c | 10 - 46 files changed, 303 insertions(+), 2929 deletions(-) delete mode 100644 bugreporter.c delete mode 100755 cgi-bin/bugcomment.cgi delete mode 100755 cgi-bin/bugsdata.cgi delete mode 100755 cgi-bin/gencaptcha.cgi delete mode 100755 cgi-bin/newbug.cgi delete mode 100755 cgi-bin/showbug.cgi delete mode 100755 cgi-bin/test.cgi delete mode 100755 cgi-bin/test.txt delete mode 100644 chatlog.c delete mode 100644 common.c delete mode 100755 example.png create mode 100644 gms/index.html create mode 100644 gms/jumbotron-narrow.css delete mode 100644 main.c delete mode 100755 test.png delete mode 100644 test.txt delete mode 100755 testimage.png delete mode 100755 testimg.png delete mode 100644 ws2a/a.exe delete mode 100644 ws2a/adj.txt delete mode 100644 ws2a/bugcomment.c delete mode 100644 ws2a/bugs.html delete mode 100644 ws2a/bugs.js delete mode 100644 ws2a/bugs/1 delete mode 100644 ws2a/bugs/2 delete mode 100644 ws2a/bugs/3 delete mode 100644 ws2a/bugs/4 delete mode 100644 ws2a/bugs/5 delete mode 100644 ws2a/bugs/6 delete mode 100644 ws2a/bugs/7 delete mode 100644 ws2a/bugs/8 delete mode 100644 ws2a/bugs/lastbug delete mode 100644 ws2a/bugsdata.c delete mode 100644 ws2a/bugview.html delete mode 100644 ws2a/bugview.js delete mode 100644 ws2a/gencaptcha.c create mode 100644 ws2a/help.css create mode 100644 ws2a/help.html delete mode 100644 ws2a/newbug.c delete mode 100644 ws2a/nouns.txt delete mode 100644 ws2a/showbug.c delete mode 100755 ws2a/test.txt delete mode 100644 ws2a/testcaptcha.png delete mode 100644 ws2a/testhtmlreplace.c delete mode 100644 ws2a/writetest.c diff --git a/bugreporter.c b/bugreporter.c deleted file mode 100644 index e69de29..0000000 diff --git a/cgi-bin/bugcomment.cgi b/cgi-bin/bugcomment.cgi deleted file mode 100755 index 9eaa7f7..0000000 Binary files a/cgi-bin/bugcomment.cgi and /dev/null differ diff --git a/cgi-bin/bugsdata.cgi b/cgi-bin/bugsdata.cgi deleted file mode 100755 index 1781dc0..0000000 Binary files a/cgi-bin/bugsdata.cgi and /dev/null differ diff --git a/cgi-bin/gencaptcha.cgi b/cgi-bin/gencaptcha.cgi deleted file mode 100755 index 7211805..0000000 Binary files a/cgi-bin/gencaptcha.cgi and /dev/null differ diff --git a/cgi-bin/newbug.cgi b/cgi-bin/newbug.cgi deleted file mode 100755 index 1aad098..0000000 Binary files a/cgi-bin/newbug.cgi and /dev/null differ diff --git a/cgi-bin/showbug.cgi b/cgi-bin/showbug.cgi deleted file mode 100755 index 23eb010..0000000 Binary files a/cgi-bin/showbug.cgi and /dev/null differ diff --git a/cgi-bin/test.cgi b/cgi-bin/test.cgi deleted file mode 100755 index 85e01b2..0000000 Binary files a/cgi-bin/test.cgi and /dev/null differ diff --git a/cgi-bin/test.txt b/cgi-bin/test.txt deleted file mode 100755 index b0e0a4e..0000000 Binary files a/cgi-bin/test.txt and /dev/null differ diff --git a/chatlog.c b/chatlog.c deleted file mode 100644 index e69de29..0000000 diff --git a/common.c b/common.c deleted file mode 100644 index a8571b7..0000000 --- a/common.c +++ /dev/null @@ -1,16 +0,0 @@ - -//Size of shared memory -#define SHMSZ_CHAT 1024 -#define SHMSZ_BUGS 1024 -#define SHMSZ_DATA 1024 -#define SHMSZ_PLAY 1024 - -//Keys for the shared memory -#define KEY_CHAT_TO 5679 -#define KEY_CHAT_FROM 5680 -#define KEY_BUGS_TO 5681 -#define KEY_BUGS_FROM 5682 -#define KEY_DATA_TO 5683 -#define KEY_DATA_FROM 5684 -#define KEY_PLAY_TO 5685 -#define KEY_PLAY_FROM 5686 diff --git a/example.png b/example.png deleted file mode 100755 index c7fa85d..0000000 Binary files a/example.png and /dev/null differ diff --git a/gms/index.html b/gms/index.html new file mode 100644 index 0000000..aeee489 --- /dev/null +++ b/gms/index.html @@ -0,0 +1,71 @@ + + + + + + + + + + + GMS + + + + + + + + + + + + + +
+
+ +

Garry's Mod Stranded

+
+ +
+

GMS

+

A varient of Garry's Mod Stranded
hosted by the The Community

+

Join server!

+
+ +
+
+

What is it?

+

This version of Garry's Mod Stranded is a clean-up of the codebase, with a few additions made by various people.

+ +

It's so fucking broken!

+

Consider fileing a bug in the bugs tab, then wait patiently until it gets fixed!

+
+ +
+

I want to help!

+

Check out the dev agreements here , and if you're satisfied, join the teamspeak here and ask to help out!

+ +

History

+

Garry's Mod Stranded was originally created by jA_cOp, prop_dynamic, Chewgum, Wokkel, and robotboy655. This version has additions by Djarex, Scott, and Apickx. See configure_me.lua for more information.

+
+
+ + + +
+ + + diff --git a/gms/jumbotron-narrow.css b/gms/jumbotron-narrow.css new file mode 100644 index 0000000..952adc5 --- /dev/null +++ b/gms/jumbotron-narrow.css @@ -0,0 +1,79 @@ +/* Space out content a bit */ +body { + padding-top: 20px; + padding-bottom: 20px; +} + +/* Everything but the jumbotron gets side spacing for mobile first views */ +.header, +.marketing, +.footer { + padding-right: 15px; + padding-left: 15px; +} + +/* Custom page header */ +.header { + padding-bottom: 20px; + border-bottom: 1px solid #e5e5e5; +} +/* Make the masthead heading the same height as the navigation */ +.header h3 { + margin-top: 0; + margin-bottom: 0; + line-height: 40px; +} + +/* Custom page footer */ +.footer { + padding-top: 19px; + color: #777; + border-top: 1px solid #e5e5e5; +} + +/* Customize container */ +@media (min-width: 768px) { + .container { + max-width: 730px; + } +} +.container-narrow > hr { + margin: 30px 0; +} + +/* Main marketing message and sign up button */ +.jumbotron { + text-align: center; + border-bottom: 1px solid #e5e5e5; +} +.jumbotron .btn { + padding: 14px 24px; + font-size: 21px; +} + +/* Supporting marketing content */ +.marketing { + margin: 40px 0; +} +.marketing p + h4 { + margin-top: 28px; +} + +/* Responsive: Portrait tablets and up */ +@media screen and (min-width: 768px) { + /* Remove the padding we set earlier */ + .header, + .marketing, + .footer { + padding-right: 0; + padding-left: 0; + } + /* Space out the masthead */ + .header { + margin-bottom: 30px; + } + /* Remove the bottom border on the jumbotron for visual effect */ + .jumbotron { + border-bottom: 0; + } +} diff --git a/main.c b/main.c deleted file mode 100644 index b1b68cf..0000000 --- a/main.c +++ /dev/null @@ -1,37 +0,0 @@ -#include -#include -#include -#include -#include "common.c" - -int main(){ - char* data = getenv("QUERY_STRING"); - char* hardip = getenv("REMOTE_ADDR"); - printf("%s%c%c\n", - "Content-Type:text/html;charset=iso-8859-1",13,10); - printf("Data:%s",data); -} - -void addConnected(int32_t ipaddr){ - char* shm; - int shmid; - /* - //Create the segment. - if ((shmid = shmget(key, SHMSZ, IPC_CREAT | 0666)) < 0) { - perror("shmget"); - exit(1); - } - - //Now we attach the segment to our data space. - if ((shm = shmat(shmid, NULL, 0)) == (char *) -1) { - perror("shmat"); - exit(1); - } - - /* - * If there's another process that got there first - * Wait for it to finish loading data before we start - */ - while (*shm != '*') - sleep(1); -} diff --git a/test.png b/test.png deleted file mode 100755 index 8eb3c76..0000000 Binary files a/test.png and /dev/null differ diff --git a/test.txt b/test.txt deleted file mode 100644 index 832426c..0000000 --- a/test.txt +++ /dev/null @@ -1 +0,0 @@ -This is some text \ No newline at end of file diff --git a/testimage.png b/testimage.png deleted file mode 100755 index ca59f8e..0000000 Binary files a/testimage.png and /dev/null differ diff --git a/testimg.png b/testimg.png deleted file mode 100755 index 5010244..0000000 Binary files a/testimg.png and /dev/null differ diff --git a/ws2a/a.exe b/ws2a/a.exe deleted file mode 100644 index 2b28d5e..0000000 Binary files a/ws2a/a.exe and /dev/null differ diff --git a/ws2a/adj.txt b/ws2a/adj.txt deleted file mode 100644 index e83f470..0000000 --- a/ws2a/adj.txt +++ /dev/null @@ -1,201 +0,0 @@ -adorable -beautiful -clean -drab -elegant -fancy -glamorous -handsome -long -magnificent -old-fashioned -plain -quaint -sparkling -ugliest -unsightly -wide-eyed -alive -better -careful -clever -dead -easy -famous -gifted -helpful -important -inexpensive -mushy -odd -powerful -rich -shy -tender -uninterested -vast -wrong -angry -bewildered -clumsy -defeated -embarrassed -fierce -grumpy -helpless -itchy -jealous -lazy -mysterious -nervous -obnoxious -panicky -repulsive -scary -thoughtless -uptight -worried -agreeable -brave -calm -delightful -eager -faithful -gentle -happy -jolly -kind -lively -nice -obedient -proud -relieved -silly -thankful -victorious -witty -zealous -broad -chubby -crooked -curved -deep -flat -high -hollow -low -narrow -round -shallow -skinny -square -steep -straight -wide -big -colossal -fat -gigantic -great -huge -immense -large -little -mammoth -massive -miniature -petite -puny -scrawny -short -small -tall -teeny -teeny-tiny -tiny -cooing -deafening -faint -hissing -loud -melodic -noisy -purring -quiet -raspy -screeching -thundering -voiceless -whispering -ancient -brief -early -fast -late -long -modern -old -old-fashioned -quick -rapid -short -slow -swift -young -bitter -delicious -fresh -greasy -juicy -hot -icy -loose -melted -nutritious -prickly -rainy -rotten -salty -sticky -strong -sweet -tart -tasteless -uneven -weak -wet -wooden -yummy -boiling -breeze -broken -bumpy -chilly -cold -cool -creepy -crooked -cuddly -curly -damaged -damp -dirty -dry -dusty -filthy -flaky -fluffy -freezing -hot -warm -wet -abundant -empty -few -full -heavy -light -many -numerous -sparse -substantial diff --git a/ws2a/bugcomment.c b/ws2a/bugcomment.c deleted file mode 100644 index 38dd97d..0000000 --- a/ws2a/bugcomment.c +++ /dev/null @@ -1,186 +0,0 @@ -#include -#include -#include -#include - -char* replaceHTML(char* str){ - printf("Replaceing:%s\n",str); - char* nstr = malloc((sizeof(char)*strlen(str)) + 1); - if(nstr == NULL){ - printf("%s%c%c\n","Content-Type:text/html;charset=iso-8859-1",13,10); - printf("Failed to allocate memory!\n"); - } - - int strp = 0; - int nstrp = 0; - while(str[strp] != '\0'){ - //printf("Strp=%d nstrp=%d\n",strp,nstrp); - if(str[strp] == '+'){ - nstr[nstrp] = ' '; - strp++; - nstrp++; - }else if(str[strp] == '%'){ - //printf("Hit encodeing!\n"); - int hex = 0; - sscanf(str+strp,"%%%2x",&hex); - //printf("Was:%c(%d)\n",(char)hex,hex); - if(hex == 0x0D){ - strp+=3; - continue; - } - if(hex == 0x0A){ - nstr[nstrp] = '\\'; - nstr[nstrp+1] = 'n'; - nstrp+=2; - strp+=3; - continue; - } - nstr[nstrp] = (char)hex; - nstrp++; - strp+=3; - }else if(str[strp] == '\n'){ - nstr[nstrp] = '\\'; - nstr[nstrp+1] = 'n'; - nstrp+=2; - strp++; - }else{ - nstr[nstrp] = str[strp]; - nstrp++; - strp++; - } - } - nstr[nstrp] = '\0'; - printf("Done, str is now:%s\n",nstr); - return nstr; -} - -unsigned long hash(unsigned char *str){ - unsigned long hash = 5381; - int c; - - while (c = *str++) - hash = ((hash << 5) + hash) + c; /* hash * 33 + c */ - - return hash; -} - -char* useridhash(char* str){ - printf("useridhash\n"); - char* hash = calloc(sizeof(char)*20,sizeof(char)); - int i = (int)str[0]; - int len = strlen(str); - int tloop = i*20; - unsigned int hashp = 0; - unsigned int strp = 0; - i = 0; - while(i < tloop){ - //printf("i:%d hashp:%u strp:%u tloop:%d\n",i,hashp,strp,tloop); - char tchar = str[strp%len]; - hash[hashp%20] += str[strp%len]; - str[strp%len]+=1; - hashp+=(int)tchar; - strp+=(int)(hashp*hashp); - i++; - } - i = 0; - //printf("Before characterizeing the hash, it was: %s\n",hash); - while(i < 20){ - //printf("Normalizeing %c(%u) as %c(%u)\n",hash[i],(unsigned int)hash[i],(hash[i] % 92) + 32,(hash[i] % 92) + 32); - unsigned int hashnum = hash[i]; - unsigned int modedhashnum = hashnum % 92; - //printf("hashnum was %u, after mod it is:%u\n",hashnum,modedhashnum); - hash[i] = modedhashnum + 32; - i++; - } - printf("Resulting hash was:%s\n",hash); - return hash; -} - -int main(){ - char* data = getenv("QUERY_STRING"); - //char data[20] = "?id=1"; - char* hardip = getenv("REMOTE_ADDR"); - //char data[] = "name=Apickx&id=test&comment=Can+I+comment+on+other+bugs%3F&captcha=clean+night&bugid=7"; - - char name[15]; - char userid[20]; - char comment[2048]; - char captcha[30]; - char bugid[5]; - - char* iname = strtok(data,"&"); - char* iuserid = strtok(NULL,"&"); - char* icomment = strtok(NULL,"&"); - char* icaptcha = strtok(NULL,"&"); - char* ibugid = strtok(NULL,"&"); - - sscanf(iname,"name=%s",name); - sscanf(iuserid,"id=%s",userid); - sscanf(icomment,"comment=%s",comment); - sscanf(icaptcha,"captcha=%s",captcha); - sscanf(ibugid,"bugid=%s",bugid); - - /* - char* name = "Apickx"; - char* userid = "ThestID"; - char* comment = "This+Is+My+Comment"; - char* captcha = "teeny-tiny+currency"; - char* bugid = "1"; - */ - - //printf("

name:%s

userid:%s

comment:%s

captcha:%s

bugid:%s",name,userid,comment,captcha,bugid); - - //Check captcha - char captchapath[100]; - char* captchadecoded = replaceHTML(captcha); - sprintf(captchapath,"../ws2a/captchas/%s.txt",captchadecoded); - //printf("Generated path...\n"); - FILE* captchafile = fopen(captchapath,"r"); - if(captchafile == NULL){ - printf("%s%c%c\n","Content-Type:text/html;charset=iso-8859-1",13,10); - printf("Captcha incorrect"); - return; - } - //Hash of "teeny-tiny currency" is 2053680550 - unsigned long inputhash = hash(captchadecoded); - free(captchadecoded); - unsigned long filehash = 0; - fscanf(captchafile,"%lu",&filehash); - if(filehash != inputhash){ - printf("%s%c%c\n","Content-Type:text/html;charset=iso-8859-1",13,10); - printf("Captcha incorrect"); - return; - } - fclose(captchafile); - char command[100]; - sprintf(command,"rm \"%s\"",captchapath); - system(command); - //printf("After first command\n"); - sprintf(command,"rm \"../ws2a/captchas/%lu.png\"",inputhash); - system(command); - //printf("After second command\n"); - - //Add comment to bug file - char filepath[100]; - sprintf(filepath,"../ws2a/bugs/%s",bugid); - FILE* bugfile = fopen(filepath,"a"); - if(bugfile == NULL){ - printf("%s%c%c\n","Content-Type:text/html;charset=iso-8859-1",13,10); - printf("

Unable to find bug!"); - return; - } - char* dname = replaceHTML(name); - char* duid = useridhash(userid); - char* dcomment = replaceHTML(comment); - //printf("%s%c%c\n","Content-Type:text/html;charset=iso-8859-1",13,10); - printf("Location: ../ws2a/bugview.html?id=%s\n\n",bugid); - //printf("

data:%s",data); - //printf("

comment:%s

dcomment:%s",comment,dcomment); - //printf("Everything ok, inserting comment!"); - fprintf(bugfile,"\n%s\n%s\n%s\n",dname,duid,dcomment); - fclose(bugfile); - free(dname); - free(duid); - free(dcomment); - return 0; -} diff --git a/ws2a/bugs.html b/ws2a/bugs.html deleted file mode 100644 index 248759b..0000000 --- a/ws2a/bugs.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - WS2A - - - - - - - - - - - - - - - -

-
- -

Winter Survival 2 - Anarchy

-
- -

Recently submitted bugs

-
- - - - - - - - - - - - - -
SubmitterDate SubmittedDescriptionStatus
-
- - - - - -
- - - diff --git a/ws2a/bugs.js b/ws2a/bugs.js deleted file mode 100644 index 209b936..0000000 --- a/ws2a/bugs.js +++ /dev/null @@ -1,57 +0,0 @@ -function htmlEscape(str) { - return String(str) - .replace(/&/g, '&') - .replace(/"/g, '"') - .replace(/'/g, ''') - .replace(//g, '>') - .replace(/\//g, '/'); -} - -function loadLastBugs() { - var xhttp = new XMLHttpRequest(); - xhttp.onreadystatechange = function() { - if (xhttp.readyState == 4 && xhttp.status == 200) { - var parts = xhttp.response.split("\n"); - console.log(parts); - var i = 0 - var table = document.getElementById("bugstable"); - while(i < (parts.length-2)){ - var newrow = document.createElement("tr"); - var submitter = htmlEscape(parts[i]); - var submitterid = htmlEscape(parts[i+1]); - var date = htmlEscape(parts[i+2]); - var desc = htmlEscape(parts[i+3]); - var status = htmlEscape(parts[i+4]); - var comments = htmlEscape(parts[i+5]); - var bugid = htmlEscape(parts[i+6]); - if(bugid == null){ - return; - } - var statusicon = "" - if(status == "0:"){ - statusicon = "Unassigned"; - }else if(status.substring(0,2) == "1:"){ - statusicon = "" + status.substring(2) + ""; - }else if(status == "2:"){ - statusicon = "Closed"; - } - newrow.innerHTML = "View" + comments + "" + submitter + "" + submitterid + "" + "" + date + "" + desc + "" + statusicon + ""; - table.appendChild(newrow); - i = i + 7; - } - } - }; - xhttp.open("GET", "/cgi-bin/bugsdata.cgi", true); - xhttp.send(); - var captcha = new XMLHttpRequest(); - captcha.onreadystatechange = function() { - if (captcha.readyState == 4 && captcha.status == 200) { - var id = captcha.response; - document.getElementById("captcha").innerHTML = ""; - } - } - captcha.open("GET", "/cgi-bin/gencaptcha.cgi",true); - captcha.send(); -} -window.onload = loadLastBugs diff --git a/ws2a/bugs/1 b/ws2a/bugs/1 deleted file mode 100644 index c3a3f0e..0000000 --- a/ws2a/bugs/1 +++ /dev/null @@ -1,22 +0,0 @@ -Submitter 8 -lasdfjla1231 -Date_submitted -Short Description -0: -Long description - -User person -sdlfkj13221lkjl -Comment - -Another User -4234lkjsdf3234 -Their comment - -Apickx -eD=$U&C]s&Ofyr6y^"{*cmd.Z�̺ -This Is My Comment - -Apickx -YHOujV7o98Gqa%#o*w!ai - diff --git a/ws2a/bugs/2 b/ws2a/bugs/2 deleted file mode 100644 index 98718cb..0000000 --- a/ws2a/bugs/2 +++ /dev/null @@ -1,12 +0,0 @@ -Submitter 7 -a;ljkasdf8213 -Date_submitted -Short Description -0: -Long description - -Apickx -` .%7,132),@83?)6 i -This is a comment -That in includes -Newlines diff --git a/ws2a/bugs/3 b/ws2a/bugs/3 deleted file mode 100644 index c0137e9..0000000 --- a/ws2a/bugs/3 +++ /dev/null @@ -1,26 +0,0 @@ -Submitter 6 -alsdfkj19283 -Date_submitted -Short Description -1:Test User -Long description - -Apickx -` 47-:-@'6-%8->) i -Comment - -Apickx -` -6@0-%+9- ` i -this\nIsªA\nMulti\nLine¬Comment - -Apickx -` 0=@&)7)&)00 ` i -this\nIsªA\nMulti\nLine¬Comment - -Apickx -` <@7-/2%8=6) ` i -This\nIsªAnother\nMulti\nLine¬Comment - -Apickx -` 30-2/@%7;-78` i -I\nThink\nI\nFinally\nFixed\nNew\nLine\nComments\nA\nB\nC diff --git a/ws2a/bugs/4 b/ws2a/bugs/4 deleted file mode 100644 index 1c128f0..0000000 --- a/ws2a/bugs/4 +++ /dev/null @@ -1,19 +0,0 @@ -Submitter 5 -alsdkfj89218379 -Date_submitted -Short Description -2: -Long description - -Apicxk -` A@467(9'< ` i -This is ªA comment -With a þFew Newlines - -Test comment -` ` ` ` ` ‰ -How does this thing -send new lines -to the server? ªAre they ®Encoded with -Some sort of -html? diff --git a/ws2a/bugs/5 b/ws2a/bugs/5 deleted file mode 100644 index 7a0dc06..0000000 --- a/ws2a/bugs/5 +++ /dev/null @@ -1,18 +0,0 @@ -Submitter 4 -asldfj1283791287 -Date_submitted -Short Description -0: -Long description - -Apickx -` 78,@87='0303/= i -This -Is ªAnother -Test -To -See -If -New -Lines ªAre -Working diff --git a/ws2a/bugs/6 b/ws2a/bugs/6 deleted file mode 100644 index dc9666a..0000000 --- a/ws2a/bugs/6 +++ /dev/null @@ -1,10 +0,0 @@ -Submitter 3 -alsdkfj1928379 -Date_submitted -Short Description -1:Another test user -Long description - -Apickx -U!Qw::&oa0EUB@sp+]N&i -Createing a comment on this bug! diff --git a/ws2a/bugs/7 b/ws2a/bugs/7 deleted file mode 100644 index 3df129f..0000000 --- a/ws2a/bugs/7 +++ /dev/null @@ -1,6 +0,0 @@ -Submitter 2 -lasdkfj18923 -Date_submitted -Short Description -2: -Long description diff --git a/ws2a/bugs/8 b/ws2a/bugs/8 deleted file mode 100644 index cb01572..0000000 --- a/ws2a/bugs/8 +++ /dev/null @@ -1,6 +0,0 @@ -Submitter 1 -lasdfjk12938 -Date_submitted -Short Description -2: -Long description diff --git a/ws2a/bugs/lastbug b/ws2a/bugs/lastbug deleted file mode 100644 index 45a4fb7..0000000 --- a/ws2a/bugs/lastbug +++ /dev/null @@ -1 +0,0 @@ -8 diff --git a/ws2a/bugsdata.c b/ws2a/bugsdata.c deleted file mode 100644 index 0370147..0000000 --- a/ws2a/bugsdata.c +++ /dev/null @@ -1,78 +0,0 @@ -#include -#include -#include -#include - -int main(){ - printf("%s%c%c\n", - "Content-Type:text/html;charset=iso-8859-1",13,10); - FILE* lastfilenum; - lastfilenum = fopen("../ws2a/bugs/lastbug","r"); - if(lastfilenum == NULL){ - printf("Error reteriveing bugs, contact the admin!"); - return 1; - } - long long last = 0; - fscanf(lastfilenum,"%lld",&last); - fclose(lastfilenum); - long long end = last-20; - - while(last > end && last > 0){ - char filestring[64] = "../ws2a/bugs/"; - char filename[10]; - sprintf(filename,"%lld",last); - strcat(filestring,filename); - FILE* thisbug; - thisbug = fopen(filestring,"r"); - if(thisbug == NULL){ - printf("Error opening bug:%s\n",filestring); - printf("
"); - last--; - continue; - } - printbug(thisbug); - printf("%lld\n",last); - fclose(thisbug); - last--; - } - - return 0; -} -/*Prints bugs, format: - Submitter\n - SubmitterID - Date_submitted\n - Short Description\n - Status\n - numcomments\n - bugid -*/ -void printbug(FILE* f){ - - int line = 0; - char tchar = ' '; - while((tchar = fgetc(f)) && tchar != EOF){ - if(tchar == '\n') - line++; - if(line > 4) - break; - putchar(tchar); - } - - unsigned int comments = 0; - while (EOF != (fscanf(f,"%*[^\n]"), fscanf(f,"%*c"))) - ++comments; - printf("\n%u\n",(comments-1)/4); -} - -/* -function htmlEscape(str) { - return String(str) - .replace(/&/g, '&') - .replace(/"/g, '"') - .replace(/'/g, ''') - .replace(//g, '>') - .replace(/\//g, '/'); -} -*/ diff --git a/ws2a/bugview.html b/ws2a/bugview.html deleted file mode 100644 index c0cf3fa..0000000 --- a/ws2a/bugview.html +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - - - - WS2A - - - - - - - - - - - - - - - -
-
- -

Winter Survival 2 - Anarchy

-
- -

Bugid

- - -
-
-
-
- Submitter:

Loading...

Loading...
-
-
- Date submited:

Loading...

-
-
- Status:

Loading...

-
-
-
- -
-

Loading...

-
- Loading... -
-
-
- -
- -
- -
- -
- - - -
- - - diff --git a/ws2a/bugview.js b/ws2a/bugview.js deleted file mode 100644 index bad27f6..0000000 --- a/ws2a/bugview.js +++ /dev/null @@ -1,89 +0,0 @@ -function getQueryStrings() { - var assoc = {}; - var decode = function (s) { return decodeURIComponent(s.replace(/\+/g, " ")); }; - var queryString = location.search.substring(1); - var keyValues = queryString.split('&'); - - for(var i in keyValues) { - var key = keyValues[i].split('='); - if (key.length > 1) { - assoc[decode(key[0])] = decode(key[1]); - } - } - - return assoc; -} - -function htmlEscape(str) { - return String(str) - .replace(/&/g, '&') - .replace(/"/g, '"') - .replace(/'/g, ''') - .replace(//g, '>') - .replace(/\//g, '/') - .replace(/\\n/g, '
'); -} - -function loadLastBugs() { - var xhttp = new XMLHttpRequest(); - xhttp.onreadystatechange = function() { - if (xhttp.readyState == 4 && xhttp.status == 200) { - var parts = xhttp.response.split("\n"); - var query = getQueryStrings(); - var bugnum = query["id"]; - document.getElementById("submitter").innerHTML = htmlEscape(parts[0]); - document.getElementById("subid").innerHTML = htmlEscape(parts[1]); - document.getElementById("date").innerHTML = htmlEscape(parts[2]); - document.getElementById("bugid").innerHTML = "Bug #" + bugnum; - document.getElementById("shortdesc").innerHTML = htmlEscape(parts[3]); - var statustext = parts[4]; - var statusicon = "" - if(statustext == "0:"){ - statusicon = "Unassigned"; - }else if(statustext.substring(0,2) == "1:"){ - statusicon = "" + status.substring(2) + ""; - }else if(statustext == "2:"){ - statusicon = "Closed"; - } - - document.getElementById("status").innerHTML = statusicon; - document.getElementById("longdesc").innerHTML = htmlEscape(parts[5]); - console.log(parts); - var i = 6; - var commentsec = document.getElementById("comments"); - while(i < (parts.length-2)){ - var commentnode = document.createElement("div"); - commentnode.setAttribute("class","panel panel-info"); - var commenter = htmlEscape(parts[i+1]); - var commentid = htmlEscape(parts[i+2]); - var commenttext = htmlEscape(parts[i+3]); - if(commenttext == null){ - return; - } - commentnode.innerHTML = "
" + commenter + "" + commentid + "
" + commenttext + "
"; - commentsec.appendChild(commentnode); - i = i + 4; - } - //document.getElementById("longdesc").innerHTML = xhttp.responseText; - } - }; - var query = getQueryStrings(); - var bugnum = query["id"]; - xhttp.open("GET", "/cgi-bin/showbug.cgi?id="+bugnum, true); - xhttp.send(); - var captcha = new XMLHttpRequest(); - captcha.onreadystatechange = function() { - if (captcha.readyState == 4 && captcha.status == 200) { - var id = captcha.response; - document.getElementById("captcha").innerHTML = ""; - var query = getQueryStrings(); - var bugnum = query["id"]; - document.getElementById("bgid").setAttribute("value",bugnum); - console.log("Added hidden field to form:" + bugnum); - } - } - captcha.open("GET", "/cgi-bin/gencaptcha.cgi",true); - captcha.send(); -} -window.onload = loadLastBugs diff --git a/ws2a/gencaptcha.c b/ws2a/gencaptcha.c deleted file mode 100644 index cc57651..0000000 --- a/ws2a/gencaptcha.c +++ /dev/null @@ -1,91 +0,0 @@ -#include -#include -#include -#include -//convert label.png -virtual-pixel White -distort Arc 60 arctest.png - -//convert -background gray -fill cyan -pointsize 72 label:Alex label.png - -//convert label.png -virtual-pixel white -distort Barrel "0.2 0.0 0.0 1.0" barrel.png -#define ADJNUM 200 -#define NOUNUM 1524 -#define AVGADJ 7 -#define AVGNOU 7 -#define LONGADJ 14 -#define LONGNOU 15 - -void createRandomWords(char* buf){ - long adjnum = rand() % ADJNUM; - long nounum = rand() % NOUNUM; - FILE* adjfile; - FILE* noufile; - adjfile = fopen("../ws2a/adj.txt","r"); - noufile = fopen("../ws2a/nouns.txt","r"); - //Instead of getting a particular line, seek an average length, and find the next word. - if(adjfile == NULL || noufile == NULL){ - printf("Something has gone serirously wrong!"); - } - fseek(adjfile,adjnum*AVGADJ,0); - fseek(noufile,nounum*AVGNOU,0); - - while(fgetc(adjfile) != '\n'){} - while(fgetc(noufile) != '\n'){} - int pos = 0; - char tchar = fgetc(adjfile); - do{ - buf[pos] = tchar; - pos++; - tchar = fgetc(adjfile); - }while(tchar != '\n'); - buf[pos] = ' '; - pos++; - tchar = fgetc(noufile); - do{ - buf[pos] = tchar; - pos++; - tchar = fgetc(noufile); - }while(tchar != '\n'); - buf[pos] = '\0'; -} - - -unsigned long hash(unsigned char *str){ - unsigned long hash = 5381; - int c; - - while (c = *str++) - hash = ((hash << 5) + hash) + c; /* hash * 33 + c */ - - return hash; -} - -int main(){ - - srand(time(NULL)); - char randwords[LONGADJ+LONGNOU+1]; - createRandomWords(randwords); - - int barraldis1 = rand()%10; - int barraldis2 = rand()%10; - int arcdis = (rand()%45)+45; - char command[1024]; - unsigned long rhash = hash(randwords); - sprintf(command,"convert -background white -fill black -pointsize 48 label:\"%s\" \"../ws2a/captchas/%lu.png\"",randwords,rhash); - system(command); - sprintf(command,"convert \"../ws2a/captchas/%lu.png\" -distort Barrel \"0.0%d 0.0 0.0%d\" \"../ws2a/captchas/%lu.png\"",rhash,barraldis1,barraldis2,rhash); - system(command); - sprintf(command,"convert \"\"../ws2a/captchas/%lu.png\" -virtual-pixel White -distort Arc %d \"../ws2a/captchas/%lu.png\"",rhash,arcdis,rhash); - system(command); - - printf("%s%c%c\n","Content-Type:text/html;charset=iso-8859-1",13,10); - printf("%lu",rhash); - - FILE* tfile; - char filepath[100]; - sprintf(filepath,"../ws2a/captchas/%s.txt",randwords); - tfile = fopen(filepath,"w"); - fprintf(tfile,"%lu",rhash); - fclose(tfile); - - return 0; -} diff --git a/ws2a/help.css b/ws2a/help.css new file mode 100644 index 0000000..3645ed7 --- /dev/null +++ b/ws2a/help.css @@ -0,0 +1,54 @@ +/* F.A.Q */ + +div { position: relative; } +input[type=checkbox] { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + opacity: 0; +} +h2 { + font-size: 30px; + font-weight: 400; + margin: 60px 0 10px 0; +} +label { + cursor: pointer; +} +label { + position: relative; + display: block; + padding-left: 30px; +} +label:before { + content: ""; + position: absolute; + width: 0; + height: 0; + top: 50%; + left: 10px; + border-left: 8px solid black; + border-top: 8px solid transparent; + border-bottom: 8px solid transparent; + margin-top: -8px; +} +input[type=checkbox]:checked ~ h2 label:before { + border-left: 8px solid transparent; + border-top: 8px solid black; + border-right: 8px solid transparent; + margin-left: -4px; + margin-top: -4px +} + +p { + max-height: 100; + overflow: hidden; + padding-left: 30px; + transition: max-height 0.4s ease; + font-family: 'Habibi', serif; +} +input[type=checkbox]:checked ~ h2 ~ p { + max-height: 80px; +} diff --git a/ws2a/help.html b/ws2a/help.html new file mode 100644 index 0000000..e6dc6b5 --- /dev/null +++ b/ws2a/help.html @@ -0,0 +1,98 @@ + + + + + + + + + + + WS2A + + + + + + + + + + + + + + +
+
+ +

Winter Survival 2 - Anarchy

+
+ + + +
+

For Server Owners

+

To intall, simply drop the wintersurvival2 folder into the /gamemodes/ folder of your server, located at /garrysmod/gamemodes/. Then, add the folowing line to /garrysmod/cfg/server.cfg +


gamemode wintersurvival2
+

The gamemode should be able to use admin mods like ULX, but they haven't been tested. In addition, Winter Survival 2 - Anarchy comes with it's own admin system, see "For Server Admins" below +

Admins must be added by adding the name/steamid to the garrysmod/settings/users.txt file like so +

+        "admin"
+        {
+          "Apickx"                                "STEAM_0:0:13641699"
+        }
+        
+
+ +
+

For Server Admins

+ This is a breif list of admin commands that can be used. +
mas_goto string_playername
+ Teleports you to another player +
mas_sethp string_playername number_health
+ Sets a player health +
mas_bring string_playername
+ Teleports another player to you +
mas_god string_playername
+ Enables godmode for a player, they will not take dammage, and cannot die. +
mas_ungod string_playername
+ Disables godmode for a player +
mas_bansteamid string_steamid number_time string_reason
+ Bans a player for an ammount of time. If the time is 0, this will ban the player permenently. When the player tries to join, they will get a popup with "You are banned:string_reason" on their screen. +
mas_unbansteamid string_steamid
+ Unbans the given steamid. +
mas_printbannedplayers
+ Prints all banned players to console +
mas_banplayer string_playername
+ Bans a player with the given playername. Translates the player's name to their steamid. If a player has a name changer, use mas_bansteamid instead. You can find a player's steamid with status +
+
+ + + + + +
+ + + diff --git a/ws2a/index.html b/ws2a/index.html index adf04cc..bdf0a62 100644 --- a/ws2a/index.html +++ b/ws2a/index.html @@ -57,7 +57,7 @@

I want to help!

-

Feel free to get a copy of the source code and start hacking away here

+

Feel free to get a copy of the source code and start hacking away here

Where's the liscense?

Although I like useing and publishing under copyleft liscenses, other people involved in development didn't give me much to work with! I can't bind their code under a liscense of my choice, but my code is free to use under the BSD 2-clause, and assets under Creative Commons Attribution

diff --git a/ws2a/newbug.c b/ws2a/newbug.c deleted file mode 100644 index cda4e38..0000000 --- a/ws2a/newbug.c +++ /dev/null @@ -1,183 +0,0 @@ -#include -#include -#include -#include - -char* replaceHTML(char* str){ - //printf("Replaceing:%s\n",str); - char* nstr = malloc((sizeof(char)*strlen(str)) + 1); - if(nstr == NULL){ - printf("%s%c%c\n","Content-Type:text/html;charset=iso-8859-1",13,10); - printf("Failed to allocate memory!\n"); - } - - int strp = 0; - int nstrp = 0; - while(str[strp] != '\0'){ - //printf("Strp=%d nstrp=%d\n",strp,nstrp); - if(str[strp] == '+'){ - nstr[nstrp] = ' '; - strp++; - nstrp++; - }else if(str[strp] == '%'){ - //printf("Hit encodeing!\n"); - int hex = 0; - sscanf(str+strp,"%%%2x",&hex); - //printf("Was:%c(%d)\n",(char)hex,hex); - if(hex == 0x0D){ - strp+=3; - continue; - } - if(hex == 0x0A){ - nstr[nstrp] = '\\'; - nstr[nstrp+1] = 'n'; - nstrp+=2; - strp+=3; - continue; - } - nstr[nstrp] = (char)hex; - nstrp++; - strp+=3; - }else if(str[strp] == '\n'){ - nstr[nstrp] = '\\'; - nstr[nstrp+1] = 'n'; - nstrp+=2; - strp++; - }else{ - nstr[nstrp] = str[strp]; - nstrp++; - strp++; - } - } - nstr[nstrp] = '\0'; - //printf("Done, str is now:%s\n",nstr); - return nstr; -} - -unsigned long hash(unsigned char *str){ - unsigned long hash = 5381; - int c; - - while (c = *str++) - hash = ((hash << 5) + hash) + c; /* hash * 33 + c */ - - return hash; -} - -char* useridhash(char* str){ - char* hash = calloc(sizeof(char)*20,sizeof(char)); - int i = (int)str[0]; - int len = strlen(str); - int tloop = i*20; - unsigned int hashp = 0; - unsigned int strp = 0; - i = 0; - while(i < tloop){ - //printf("i:%d hashp:%u strp:%u tloop:%d\n",i,hashp,strp,tloop); - char tchar = str[strp%len]; - hash[hashp%20] += str[strp%len]; - str[strp%len]+=1; - hashp+=(int)tchar; - strp+=(int)(hashp*hashp); - i++; - } - i = 0; - //printf("Before characterizeing the hash, it was: %s\n",hash); - while(i < 20){ - //printf("Normalizeing %c(%u) as %c(%u)\n",hash[i],(unsigned int)hash[i],(hash[i] % 92) + 32,(hash[i] % 92) + 32); - unsigned int hashnum = hash[i]; - unsigned int modedhashnum = hashnum % 92; - //printf("hashnum was %u, after mod it is:%u\n",hashnum,modedhashnum); - hash[i] = modedhashnum + 32; - i++; - } - //printf("Resulting hash was:%s\n",hash); - return hash; -} - -int main(){ - char* data = getenv("QUERY_STRING"); - //char data[20] = "?id=1"; - char* hardip = getenv("REMOTE_ADDR"); - //char data[] = "name=Apickx&id=test&shortdesc=This&longdesc=This+is+the+first+ever+test+bug+to+be+created!&captcha=proud+pain"; - - char name[20]; - char userid[20]; - char shortdesc[128]; - char longdesc[4096]; - char captcha[30]; - - char* iname = strtok(data,"&"); - char* iuserid = strtok(NULL,"&"); - char* ishortdesc = strtok(NULL,"&"); - char* ilongdesc = strtok(NULL,"&"); - char* icaptcha = strtok(NULL,"&"); - - sscanf(iname,"name=%s",name); - sscanf(iuserid,"id=%s",userid); - sscanf(ishortdesc,"shortdesc=%s",shortdesc); - sscanf(ilongdesc,"longdesc=%s",longdesc); - sscanf(icaptcha,"captcha=%s",captcha); - - //printf("name:%s\nid:%s\nshort:%s\nlong:%s\ncaptcha:%s\n",name,userid,shortdesc,longdesc,captcha); - - //Check captcha - char captchapath[100]; - char* captchadecoded = replaceHTML(captcha); - sprintf(captchapath,"../ws2a/captchas/%s.txt",captchadecoded); - - FILE* captchafile = fopen(captchapath,"r"); - if(captchafile == NULL){ - printf("%s%c%c\n","Content-Type:text/html;charset=iso-8859-1",13,10); - printf("Captcha incorrect:No file found"); - return; - } - unsigned long inputhash = hash(captchadecoded); - free(captchadecoded); - unsigned long filehash = 0; - fscanf(captchafile,"%lu",&filehash); - if(filehash != inputhash){ - printf("%s%c%c\n","Content-Type:text/html;charset=iso-8859-1",13,10); - printf("Captcha incorrect:Bad hash"); - return; - } - - //If we had the correct captcha, remove it. - char command[100]; - sprintf(command,"rm \"%s\"",captchapath); - system(command); - - //Create new bug - FILE* lastbugfile = fopen("../ws2a/bugs/lastbug","r+"); - if(lastbugfile == NULL){ - printf("Unable to open LastBugFile!"); - } - unsigned long long lastbug = 0; - fscanf(lastbugfile,"%llu",&lastbug); - fseek(lastbugfile,0,SEEK_SET); - lastbug++; - fprintf(lastbugfile,"%llu",lastbug); - fclose(lastbugfile); - - char* dname = replaceHTML(name); - char* duid = useridhash(userid); - time_t rawtime; - struct tm * timeinfo; - time(&rawtime); - timeinfo = localtime(&rawtime); - char* dshortd = replaceHTML(shortdesc); - char* dlongd = replaceHTML(longdesc); - printf("Location: ../ws2a/bugview.html?id=%s\n\n",lastbug); - //printf("Right before printing to file\n"); - char newfilepath[100]; - sprintf(newfilepath,"../ws2a/bugs/%llu",lastbug); - FILE* newfile = fopen(newfilepath,"w"); - fprintf(newfile,"%s\n%s\n%s%s\n0:\n%s\n",dname,duid,asctime(timeinfo),dshortd,dlongd); - fclose(newfile); - free(dname); - free(duid); - free(dshortd); - free(dlongd); - - return 0; -} diff --git a/ws2a/nouns.txt b/ws2a/nouns.txt deleted file mode 100644 index 672484c..0000000 --- a/ws2a/nouns.txt +++ /dev/null @@ -1,1525 +0,0 @@ -people -history -way -art -world -information -map -two -family -government -health -system -computer -meat -year -thanks -music -person -reading -method -data -food -understanding -theory -law -bird -literature -problem -software -control -knowledge -power -ability -economics -love -internet -television -science -library -nature -fact -product -idea -temperature -investment -area -society -activity -story -industry -media -thing -oven -community -definition -safety -quality -development -language -management -player -variety -video -week -security -country -exam -movie -organization -equipment -physics -analysis -policy -series -thought -basis -boyfriend -direction -strategy -technology -army -camera -freedom -paper -environment -child -instance -month -truth -marketing -university -writing -article -department -difference -goal -news -audience -fishing -growth -income -marriage -user -combination -failure -meaning -medicine -philosophy -teacher -communication -night -chemistry -disease -disk -energy -nation -road -role -soup -advertising -location -success -addition -apartment -education -math -moment -painting -politics -attention -decision -event -property -shopping -student -wood -competition -distribution -entertainment -office -population -president -unit -category -cigarette -context -introduction -opportunity -performance -driver -flight -length -magazine -newspaper -relationship -teaching -cell -dealer -finding -lake -member -message -phone -scene -appearance -association -concept -customer -death -discussion -housing -inflation -insurance -mood -woman -advice -blood -effort -expression -importance -opinion -payment -reality -responsibility -situation -skill -statement -wealth -application -city -county -depth -estate -foundation -grandmother -heart -perspective -photo -recipe -studio -topic -collection -depression -imagination -passion -percentage -resource -setting -ad -agency -college -connection -criticism -debt -description -memory -patience -secretary -solution -administration -aspect -attitude -director -personality -psychology -recommendation -response -selection -storage -version -alcohol -argument -complaint -contract -emphasis -highway -loss -membership -possession -preparation -steak -union -agreement -cancer -currency -employment -engineering -entry -interaction -mixture -preference -region -republic -tradition -virus -actor -classroom -delivery -device -difficulty -drama -election -engine -football -guidance -hotel -owner -priority -protection -suggestion -tension -variation -anxiety -atmosphere -awareness -bath -bread -candidate -climate -comparison -confusion -construction -elevator -emotion -employee -employer -guest -height -leadership -mall -manager -operation -recording -sample -transportation -charity -cousin -disaster -editor -efficiency -excitement -extent -feedback -guitar -homework -leader -mom -outcome -permission -presentation -promotion -reflection -refrigerator -resolution -revenue -session -singer -tennis -basket -bonus -cabinet -childhood -church -clothes -coffee -dinner -drawing -hair -hearing -initiative -judgment -lab -measurement -mode -mud -orange -poetry -police -possibility -procedure -queen -ratio -relation -restaurant -satisfaction -sector -signature -significance -song -tooth -town -vehicle -volume -wife -accident -airport -appointment -arrival -assumption -baseball -chapter -committee -conversation -database -enthusiasm -error -explanation -farmer -gate -girl -hall -historian -hospital -injury -instruction -maintenance -manufacturer -meal -perception -pie -poem -presence -proposal -reception -replacement -revolution -river -son -speech -tea -village -warning -winner -worker -writer -assistance -breath -buyer -chest -chocolate -conclusion -contribution -cookie -courage -dad -desk -drawer -establishment -examination -garbage -grocery -honey -impression -improvement -independence -insect -inspection -inspector -king -ladder -menu -penalty -piano -potato -profession -professor -quantity -reaction -requirement -salad -sister -supermarket -tongue -weakness -wedding -affair -ambition -analyst -apple -assignment -assistant -bathroom -bedroom -beer -birthday -celebration -championship -cheek -client -consequence -departure -diamond -dirt -ear -fortune -friendship -funeral -gene -girlfriend -hat -indication -intention -lady -midnight -negotiation -obligation -passenger -pizza -platform -poet -pollution -recognition -reputation -shirt -sir -speaker -stranger -surgery -sympathy -tale -throat -trainer -uncle -youth -time -work -film -water -money -example -while -business -study -game -life -form -air -day -place -number -part -field -fish -back -process -heat -hand -experience -job -book -end -point -type -home -economy -value -body -market -guide -interest -state -radio -course -company -price -size -card -list -mind -trade -line -care -group -risk -word -fat -force -key -light -training -name -school -top -amount -level -order -practice -research -sense -service -piece -web -boss -sport -fun -house -page -term -test -answer -sound -focus -matter -kind -soil -board -oil -picture -access -garden -range -rate -reason -future -site -demand -exercise -image -case -cause -coast -action -age -bad -boat -record -result -section -building -mouse -cash -class -nothing -period -plan -store -tax -side -subject -space -rule -stock -weather -chance -figure -man -model -source -beginning -earth -program -chicken -design -feature -head -material -purpose -question -rock -salt -act -birth -car -dog -object -scale -sun -note -profit -rent -speed -style -war -bank -craft -half -inside -outside -standard -bus -exchange -eye -fire -position -pressure -stress -advantage -benefit -box -frame -issue -step -cycle -face -item -metal -paint -review -room -screen -structure -view -account -ball -discipline -medium -share -balance -bit -black -bottom -choice -gift -impact -machine -shape -tool -wind -address -average -career -culture -morning -pot -sign -table -task -condition -contact -credit -egg -hope -ice -network -north -square -attempt -date -effect -link -post -star -voice -capital -challenge -friend -self -shot -brush -couple -debate -exit -front -function -lack -living -plant -plastic -spot -summer -taste -theme -track -wing -brain -button -click -desire -foot -gas -influence -notice -rain -wall -base -damage -distance -feeling -pair -savings -staff -sugar -target -text -animal -author -budget -discount -file -ground -lesson -minute -officer -phase -reference -register -sky -stage -stick -title -trouble -bowl -bridge -campaign -character -club -edge -evidence -fan -letter -lock -maximum -novel -option -pack -park -plenty -quarter -skin -sort -weight -baby -background -carry -dish -factor -fruit -glass -joint -master -muscle -red -strength -traffic -trip -vegetable -appeal -chart -gear -ideal -kitchen -land -log -mother -net -party -principle -relative -sale -season -signal -spirit -street -tree -wave -belt -bench -commission -copy -drop -minimum -path -progress -project -sea -south -status -stuff -ticket -tour -angle -blue -breakfast -confidence -daughter -degree -doctor -dot -dream -duty -essay -father -fee -finance -hour -juice -limit -luck -milk -mouth -peace -pipe -seat -stable -storm -substance -team -trick -afternoon -bat -beach -blank -catch -chain -consideration -cream -crew -detail -gold -interview -kid -mark -match -mission -pain -pleasure -score -screw -sex -shop -shower -suit -tone -window -agent -band -block -bone -calendar -cap -coat -contest -corner -court -cup -district -door -east -finger -garage -guarantee -hole -hook -implement -layer -lecture -lie -manner -meeting -nose -parking -partner -profile -respect -rice -routine -schedule -swimming -telephone -tip -winter -airline -bag -battle -bed -bill -bother -cake -code -curve -designer -dimension -dress -ease -emergency -evening -extension -farm -fight -gap -grade -holiday -horror -horse -host -husband -loan -mistake -mountain -nail -noise -occasion -package -patient -pause -phrase -proof -race -relief -sand -sentence -shoulder -smoke -stomach -string -tourist -towel -vacation -west -wheel -wine -arm -aside -associate -bet -blow -border -branch -breast -brother -buddy -bunch -chip -coach -cross -document -draft -dust -expert -floor -god -golf -habit -iron -judge -knife -landscape -league -mail -mess -native -opening -parent -pattern -pin -pool -pound -request -salary -shame -shelter -shoe -silver -tackle -tank -trust -assist -bake -bar -bell -bike -blame -boy -brick -chair -closet -clue -collar -comment -conference -devil -diet -fear -fuel -glove -jacket -lunch -monitor -mortgage -nurse -pace -panic -peak -plane -reward -row -sandwich -shock -spite -spray -surprise -till -transition -weekend -welcome -yard -alarm -bend -bicycle -bite -blind -bottle -cable -candle -clerk -cloud -concert -counter -flower -grandfather -harm -knee -lawyer -leather -load -mirror -neck -pension -plate -purple -ruin -ship -skirt -slice -snow -specialist -stroke -switch -trash -tune -zone -anger -award -bid -bitter -boot -bug -camp -candy -carpet -cat -champion -channel -clock -comfort -cow -crack -engineer -entrance -fault -grass -guy -hell -highlight -incident -island -joke -jury -leg -lip -mate -motor -nerve -passage -pen -pride -priest -prize -promise -resident -resort -ring -roof -rope -sail -scheme -script -sock -station -toe -tower -truck -witness -a -you -it -can -will -if -one -many -most -other -use -make -good -look -help -go -great -being -few -might -still -public -read -keep -start -give -human -local -general -she -specific -long -play -feel -high -tonight -put -common -set -change -simple -past -big -possible -particular -today -major -personal -current -national -cut -natural -physical -show -try -check -second -call -move -pay -let -increase -single -individual -turn -ask -buy -guard -hold -main -offer -potential -professional -international -travel -cook -alternative -following -special -working -whole -dance -excuse -cold -commercial -low -purchase -deal -primary -worth -fall -necessary -positive -produce -search -present -spend -talk -creative -tell -cost -drive -green -support -glad -remove -return -run -complex -due -effective -middle -regular -reserve -independent -leave -original -reach -rest -serve -watch -beautiful -charge -active -break -negative -safe -stay -visit -visual -affect -cover -report -rise -walk -white -beyond -junior -pick -unique -anything -classic -final -lift -mix -private -stop -teach -western -concern -familiar -fly -official -broad -comfortable -gain -maybe -rich -save -stand -young -fail -heavy -hello -lead -listen -valuable -worry -handle -leading -meet -release -sell -finish -normal -press -ride -secret -spread -spring -tough -wait -brown -deep -display -flow -hit -objective -shoot -touch -cancel -chemical -cry -dump -extreme -push -conflict -eat -fill -formal -jump -kick -opposite -pass -pitch -remote -total -treat -vast -abuse -beat -burn -deposit -print -raise -sleep -somewhere -advance -anywhere -consist -dark -double -draw -equal -fix -hire -internal -join -kill -sensitive -tap -win -attack -claim -constant -drag -drink -guess -minor -pull -raw -soft -solid -wear -weird -wonder -annual -count -dead -doubt -feed -forever -impress -nobody -repeat -round -sing -slide -strip -whereas -wish -combine -command -dig -divide -equivalent -hang -hunt -initial -march -mention -smell -spiritual -survey -tie -adult -brief -crazy -escape -gather -hate -prior -repair -rough -sad -scratch -sick -strike -employ -external -hurt -illegal -laugh -lay -mobile -nasty -ordinary -respond -royal -senior -split -strain -struggle -swim -train -upper -wash -yellow -convert -crash -dependent -fold -funny -grab -hide -miss -permit -quote -recover -resolve -roll -sink -slip -spare -suspect -sweet -swing -twist -upstairs -usual -abroad -brave -calm -concentrate -estimate -grand -male -mine -prompt -quiet -refuse -regret -reveal -rush -shake -shift -shine -steal -suck -surround -anybody -bear -brilliant -dare -dear -delay -drunk -female -hurry -inevitable -invite -kiss -neat -pop -punch -quit -reply -representative -resist -rip -rub -silly -smile -spell -stretch -stupid -tear -temporary -tomorrow -wake -wrap -yesterday diff --git a/ws2a/showbug.c b/ws2a/showbug.c deleted file mode 100644 index 27a01e6..0000000 --- a/ws2a/showbug.c +++ /dev/null @@ -1,51 +0,0 @@ -#include -#include -#include -#include - -int main(){ - char* data = getenv("QUERY_STRING"); - //char data[20] = "?id=1"; - char* hardip = getenv("REMOTE_ADDR"); - printf("%s%c%c\n", - "Content-Type:text/html;charset=iso-8859-1",13,10); - FILE* lastfilenum; - lastfilenum = fopen("../ws2a/bugs/lastbug","r"); - if(lastfilenum == NULL){ - printf("Error reteriveing bugs, contact the admin!"); - return 1; - } - long long last = 0; - if(fscanf(lastfilenum,"%lld",&last) < 1){ - printf("Error finding file id"); - return 1; - } - fclose(lastfilenum); - long long thisid = 0; - sscanf(data,"id=%lld",&thisid); - if(thisid > last){ - printf("Invalid!"); - return 1; - } - - char filestring[64] = "../ws2a/bugs/"; - char filename[10]; - sprintf(filename,"%lld",thisid); - strcat(filestring,filename); - FILE* bugfile; - bugfile = fopen(filestring,"r"); - if(bugfile == NULL){ - printf("Unable to open bug file!"); - return 1; - } - while(!feof(bugfile)){ - char c = fgetc(bugfile); - if(feof(bugfile)){ - break; - }else{ - putchar(c); - } - } - fclose(bugfile); - return 0; -} diff --git a/ws2a/test.txt b/ws2a/test.txt deleted file mode 100755 index e69de29..0000000 diff --git a/ws2a/testcaptcha.png b/ws2a/testcaptcha.png deleted file mode 100644 index 7e08ff3..0000000 Binary files a/ws2a/testcaptcha.png and /dev/null differ diff --git a/ws2a/testhtmlreplace.c b/ws2a/testhtmlreplace.c deleted file mode 100644 index 2106185..0000000 --- a/ws2a/testhtmlreplace.c +++ /dev/null @@ -1,108 +0,0 @@ -#include -#include -#include -#include - -char* replaceHTML(char* str){ - //printf("Replaceing:%s\n",str); - char* nstr = malloc((sizeof(char)*strlen(str)) + 1); - if(nstr == NULL){ - printf("%s%c%c\n","Content-Type:text/html;charset=iso-8859-1",13,10); - printf("Failed to allocate memory!\n"); - } - - int strp = 0; - int nstrp = 0; - while(str[strp] != '\0'){ - //printf("Strp=%d nstrp=%d\n",strp,nstrp); - if(str[strp] == '+'){ - nstr[nstrp] = ' '; - strp++; - nstrp++; - }else if(str[strp] == '%'){ - //printf("Hit encodeing!\n"); - int hex = 0; - sscanf(str+strp,"%%%2x",&hex); - //printf("Was:%c(%d)\n",(char)hex,hex); - if(hex == 0x0D){ - strp+=3; - continue; - } - if(hex == 0x0A){ - nstr[nstrp] = '\\'; - nstr[nstrp+1] = 'n'; - nstrp+=2; - strp+=3; - continue; - } - nstr[nstrp] = (char)hex; - nstrp++; - strp+=3; - }else if(str[strp] == '\n'){ - nstr[nstrp] = '\\'; - nstr[nstrp+1] = 'n'; - nstrp+=2; - strp++; - }else{ - nstr[nstrp] = str[strp]; - nstrp++; - strp++; - } - } - nstr[nstrp] = '\0'; - //printf("Done, str is now:%s\n",nstr); - return nstr; -} - -char* useridhash(char* str){ - char* hash = calloc(sizeof(char)*20,sizeof(char)); - int i = (int)str[0]; - int len = strlen(str); - int tloop = i*20; - unsigned int hashp = 0; - unsigned int strp = 0; - i = 0; - while(i < tloop){ - printf("i:%d hashp:%u strp:%u tloop:%d\n",i,hashp,strp,tloop); - char tchar = str[strp%len]; - hash[hashp%20] += str[strp%len]; - str[strp%len]+=1; - hashp+=(int)tchar; - strp+=(int)(hashp*hashp); - i++; - } - i = 0; - printf("Before characterizeing the hash, it was: %s\n",hash); - while(i < 20){ - //printf("Normalizeing %c(%u) as %c(%u)\n",hash[i],(unsigned int)hash[i],(hash[i] % 92) + 32,(hash[i] % 92) + 32); - unsigned int hashnum = hash[i]; - unsigned int modedhashnum = hashnum % 92; - //printf("hashnum was %u, after mod it is:%u\n",hashnum,modedhashnum); - hash[i] = modedhashnum + 32; - i++; - } - printf("Resulting hash was:%s\n",hash); - return hash; -} - -int main(){ - char teststring[] = "Test"; - printf("Original:%s\n",teststring); - char* parsed = useridhash(teststring); - printf("%s\n",parsed); -/* - char teststring2[] = "Tost"; - printf("Original:%s\n",teststring2); - char* parsed2 = useridhash(teststring2); - printf("%s\n",parsed2); - - char teststring3[] = "This%0D%0AIs%0D%0AAnother%0D%0AMulti%0D%0ALine%0D%0AComment"; - printf("Original:%s\n",teststring3); - char* parsed3 = useridhash(teststring3); - printf("%s\n",parsed3); - free(parsed); - free(parsed2); - free(parsed3); - return 0; -*/ -} diff --git a/ws2a/writetest.c b/ws2a/writetest.c deleted file mode 100644 index ccb5a61..0000000 --- a/ws2a/writetest.c +++ /dev/null @@ -1,10 +0,0 @@ -#include - -int main(){ - FILE* tofile; - tofile = fopen("../test.txt","w"); - fprintf(tofile,"This is some text"); - fclose(tofile); - printf("%s%c%c\n","Content-Type:text/html;charset=iso-8859-1",13,10); - printf("Completed without error!"); -} -- cgit v1.2.3-70-g09d2