From facee564b508129fed1cfbf969f5c55745f0e93c Mon Sep 17 00:00:00 2001 From: Barry Kane Date: Sun, 30 Jul 2023 22:23:25 +0100 Subject: [PATCH] Starting over, see old branch for old codebase --- SilverMUD.org | 91 ------------------------------------ tests/corestat-from-string.c | 11 ----- tests/outputQueue-test.c | 35 -------------- 3 files changed, 137 deletions(-) delete mode 100644 SilverMUD.org delete mode 100644 tests/corestat-from-string.c delete mode 100644 tests/outputQueue-test.c diff --git a/SilverMUD.org b/SilverMUD.org deleted file mode 100644 index 8fc4d46..0000000 --- a/SilverMUD.org +++ /dev/null @@ -1,91 +0,0 @@ -#+LATEX_HEADER: \RequirePackage[left=0.3in,top=0.3in,right=0.3in,bottom=0.3in, a4paper]{geometry} -* SilverMUD: The Hackable Terminal-Top Roleplaying Game. -SilverMUD is a tool for creating engaging and communal stories, all over the -world through the internet. It's designed to give a gamemaster the same power -to improvise that they have at the table, through simple programming and -easy-to-understand structures. - -* Player's Guide -** Running The Client -*** How To Connect To A Server: -To connect to a server, use the command-line option =-i=, and the IP address of -the server. If the server admin is hosting the server on a port other than the -default port of 5000, you can use the =-p= option with the number of the port. If -the connection is successful, you will be placed in the server's login -area. Type =/join =, where player name is a name of your choosing, -and you will be placed in the spawn area, ready to play. - -*** Other Launch Options: - -** The Basic Commands -SilverMUD is played through a set of very simple commands. To use a command, -type a forward-slash (/) followed immediately by the command name. The command -can be upper or lower-case. - -| Command | Arguments | Effect | -|---------+------------------------------------------+---------------------------------------------------------| -| JOIN | Character Name | Logs you into the server with the given character name. | -| MOVE | Path Name/Path Number | Moves you down the given path. | -| LOOK | None | Describes the current area. | -| STAT | None | Displays your current status and character sheet. | -| SPEC | Core Stat Name | Allows you to apply spec points to a given stat. | -| TRY | Core Stat Name/Skill Name, Object Number | Attempt to use the given stat or skill on the object. | - -* Gamemaster's Guide -** Running the Server: - -* Developer's Guide -** Build Prerequisites: -SilverMUD has the following dependencies: -- GnuTLS -- ncurses - -** C Style Guide: -These rules attempt to make the program as visually clear as possible, while -some rules may be made based on my own personal tastes. - -- () :: These are parentheses. -- [] :: These are brackets. -- {} :: These are braces. -*** Formatting: -**** Control Statements: -- A space should be between the keyword and the condition. This is to make - control statements visually distinct from function calls. - -- Opening braces should be on the line after the control statement, and closing - braces on the line after the last statement, on it's own. This is to make the - scope of the control statement easily identifiable. - -- else and else if should always be on a new line, not the same line as an if - statement's closing brace. This is to more easily distinguish the seperate - blocks. - -- Control statements should never omit braces and do single statements. This is - mostly personal preference, but I do think it makes things more clear. - -*** Naming: -**** Rule 0: NEVER USE i AND j! -Never use the variable names i and j. These are easy to confuse, and often make -nested loops awful to read. Name these more descriptively. -For example: -- If you are using a variable to index an array, name the variable index. -- If you are indexing multiple arrays, name it "array name + Index". -- If you are using it to count something, call it count, or "name of the - thing you are counting + count". - -**** Rule 1: No one letter variable names, unless in a mathematical function. -You should never use one letter variable names. They're needlessly obtuse and -you will not remember their meaning upon re-reading of the source code. The -exception to this is when you are writing a function which replicates a -mathematical formula or function with commonly accepted notation. However, you -should consider if it would be better to break mathematical convention for -clarity inside the program, such as when the variable names are the first letter -of a word or the mathematical notation uses many similar looking variables. - -**** Rule 2: Prefer to use full words in variable and function names: -You should always prefer to use full words in variable and function names. It -makes the source code much easier to read, like a sentence. Ideally, if you want -to shorten the name, use synonyms or rephrasing before you resort to removing -letters. - -*** Comments: diff --git a/tests/corestat-from-string.c b/tests/corestat-from-string.c deleted file mode 100644 index ab70d82..0000000 --- a/tests/corestat-from-string.c +++ /dev/null @@ -1,11 +0,0 @@ -// Hopefully optimized corestat to string: -#include -#include -#include -#include -#include "../src/playerdata.h" - -void main(int argc, char ** argv) -{ - getCoreStatFromString(argv[1], strlen(argv[1])); -} diff --git a/tests/outputQueue-test.c b/tests/outputQueue-test.c deleted file mode 100644 index a36fd43..0000000 --- a/tests/outputQueue-test.c +++ /dev/null @@ -1,35 +0,0 @@ -#include "../src/inputoutput.h" -#include -#include -int main() -{ - userMessage A, B, C; - strncpy(A.senderName, "Bob\0", 32 -1); - strncpy(A.messageContent, "joins the fray!\0", MAX-1); - strncpy(B.senderName, "Alice\0", 32 -1); - strncpy(B.messageContent, "challenges the unknown!\0", MAX -1); - strncpy(C.senderName, "Tom\0", 32 -1); - strncpy(C.messageContent, "Attacks them all!\0", MAX -1); - outputMessageQueue * testQueue = createOutputMessageQueue(); - printf("Queue Created.\n"); - printf("%d", queueOutputMessage(testQueue, A)); - printf("Queued A.\n"); - printf("%d", queueOutputMessage(testQueue, B)); - printf("Queued B.\n"); - printf("%d", queueOutputMessage(testQueue, C)); - printf("Queued C.\n"); - printf("%s\n", testQueue->front->content->senderName); - printf("%s\n", testQueue->front->content->messageContent); - printf("%s\n", testQueue->front->next->content->senderName); - printf("%s\n", testQueue->front->next->content->messageContent); - printf("%s\n", testQueue->front->next->next->content->senderName); - printf("%s\n", testQueue->front->next->next->content->messageContent); - printf("%s\n", testQueue->front->content->senderName); - dequeueOutputMessage(testQueue); - printf("%s\n", testQueue->front->content->senderName); - dequeueOutputMessage(testQueue); - printf("%s\n", testQueue->front->content->senderName); -// dequeueOutputMessage(testQueue); -// printf("%s\n", testQueue->front->content->senderName); - return 0; -}