#include <fstream>
#include <iostream>
-int sock = 2;
+int sock = 1;
using namespace std;
long lastrefresh;
List<aClient> clients[U_TABLE_SIZE];
+list <item*> items;
void save_lastrefresh();
void load_lastrefresh();
void prettyIntro();
void check_idles();
-
+void testitems();
int main(int argc, char *argv[])
{
}
// This loop will retry the connection 3 times
+ connected = 1;
+ load_lastrefresh();
- connected = 1;
- load_lastrefresh();
+ {
+ testitems();
+ item *tester = items.front();
+ cout << tester->getName() << endl;
+ item *tester2 = items.back();
+ cout << tester2->getName() << endl;
+ items.clear();
+ }
- {
- string itemname;
- item *testitem;
-
- cout << "Enter an weapon name: ";
- cin >> itemname;
- testitem = new weapon(itemname, 10000);
-
- cout << "You entered: " << testitem->getName();
-
- delete testitem;
+ {
+ // 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:
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)
{