X-Git-Url: https://jfr.im/git/irc/gameservirc.git/blobdiff_plain/b6bf42260843f5388afb3a78766e1f9e270b918d..228a25d50e73d2ae94902fb0cb9d25b07b283203:/gameserv/devel.cpp diff --git a/gameserv/devel.cpp b/gameserv/devel.cpp index e852dc7..70e9fc7 100644 --- a/gameserv/devel.cpp +++ b/gameserv/devel.cpp @@ -20,12 +20,13 @@ char *VERSION = "1.2.6 +devel"; long lastrefresh; List clients[U_TABLE_SIZE]; +list items; void save_lastrefresh(); void load_lastrefresh(); void prettyIntro(); void check_idles(); - +void testitems(); int main(int argc, char *argv[]) { @@ -119,38 +120,40 @@ int main(int argc, char *argv[]) } // This loop will retry the connection 3 times + connected = 1; + load_lastrefresh(); - connected = 1; - load_lastrefresh(); - { - string playername; - Player *p; - - cout << "Enter an name: "; - cin >> playername; - p = new Player(playername); - - cout << "You entered: " << p->name << endl; - item *testitem, *tempitem; - weapon *testweapon; - cout << "Enter a weapon name: "; - cin >> playername; - testitem = new weapon(playername); - testweapon = new weapon(playername, 10000); - - cout << "You entered: " << testitem->getName() << endl; - cout << "Adding the item to your inventory" << endl; - p->inventory->addItem(testitem); - - tempitem = p->inventory->Find(playername); - cout << "Name: " << tempitem->getName() << endl; - tempitem = p->inventory->Find(playername); - cout << "Name: " << tempitem->getName() << endl; - cout << "Testitem: " << &testitem << " Tempitem: " << &tempitem << endl; - + testitems(); + item *tester = items.front(); + cout << tester->getName() << endl; + item *tester2 = items.back(); + cout << tester2->getName() << endl; + items.clear(); + } - delete p; + { + // This is where you can test stuff + /* + string itemname; + item *tempitem; + + cout << "Enter an item name: "; + cin >> itemname; + char num[16]; + for (int x = 1; x < 6000001; x++) + { + sprintf(num, "%d", x); + tempitem = new weapon((itemname + num)); + items.push_back(tempitem); + } + + item *tester = items.front(); + cout << tester->getName() << endl; + item *tester2 = items.back(); + cout << tester2->getName() << endl; + items.clear(); + */ } end: @@ -168,6 +171,31 @@ int main(int argc, char *argv[]) unload_config_file(); return 0; } + +void testitems() +{ + // This is where you can test stuff + string itemname; + item *tempitem; + + cout << "Enter an item name: "; + cin >> itemname; + char num[16]; + char *testing; + testing = new char[80]; + strncpy(testing, "1~1~Stick~200~-1~15~0~0~0", 80); + for (int x = 1; x < 6000001; x++) + { + sprintf(num, "%d", x); + tempitem = new weapon("blah"); + if (!tempitem->setData(testing)) + { + cout << "Error in setData()" << endl; + break; + } + items.push_back(tempitem); + } +} aClient *find(char *nick) {