PreCU - Experimental SVN Changes

From SWGANH Wiki
Jump to: navigation, search
Revision: 342
Author: maach_ine
Date: 10:12:01 AM, Friday, August 24, 2007
Message:
Committing progress on the SUIManager object.  This object still is not used.  However, the design intention is this:

The Server will have a list of SUIObjects that are linked with a particular character.  When the client sends back anything to do with the SUIData, the ZoneClient object passes the relevant data on to the ZoneServer's SUI object, which will then figure out what action was actually taken, and return relevant data to the ZoneClient to be acted on.
----
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/SUIManager.cpp
Modified : /src/ZoneServer/SUIManager.h
Modified : /src/ZoneServer/ZoneServer.cpp
Modified : /src/ZoneServer/ZoneServer.h
Modified : /src/shared/Common.h


Revision: 341
Author: maach_ine
Date: 5:08:20 PM, Thursday, August 23, 2007
Message:
Modification to the client version verification:  If you attempt to log in with an invalid client, the error message that pops up on screen will now tell you your client version string that is sent in the LoginClientID packet.  
----
Modified : /src/LoginServer/HandleLogin.cpp


Revision: 340
Author: maach_ine
Date: 10:06:33 AM, Saturday, August 18, 2007
Message:
Gah -- Tortoise SVN updated the zoneserver project and zoneserver.cpp files to point to files which do not exist, thus breaking the server.  Committing those files to unbreak things.
----
Added : /src/ZoneServer/SUIManager.cpp
Added : /src/ZoneServer/SUIManager.h


Revision: 339
Author: maach_ine
Date: 10:04:54 AM, Saturday, August 18, 2007
Message:
Uploading some packet documentation necessary for the upcoming SUIManager class.
----
Added : /Documents/Packets/SUI
Added : /Documents/Packets/SUI/Client-Server
Added : /Documents/Packets/SUI/Client-Server/SUIEventNotification.txt
Added : /Documents/Packets/SUI/Server-Client
Added : /Documents/Packets/SUI/Server-Client/SuiCreatePageMessage.txt
Modified : /ProjectFiles/ZoneServer/ZoneServer.vcproj
Modified : /src/ZoneServer/ZoneServer.cpp


Revision: 338
Author: lordcorm
Date: 12:23:33 AM, Saturday, August 18, 2007
Message:
Basic Combat has been put in finally!, this will be the main thing i will be working on. One i need done to make combat work is i need to know the weapon type from the database. As of right now unharmed attacks work, but it will not be an accual combat session where you lose health or kill the creature untill i get all default attacks working, all skills working, and multi-combat working done before i will ad it so you lose health and kill monsters.
----
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/PacketFactory.h
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/shared/Database.cpp
Modified : /src/shared/opcodes.h


Revision: 337
Author: lordcorm
Date: 8:11:24 PM, Friday, August 17, 2007
Message:
NPC Conversations WORK!!!! YAY!, but they need to be loaded from a script file now... and it needs to see if the object is an npc, because when i click a swoop the dialog comes up and also on the house management
----
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/PacketFactory.h
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/shared/opcodes.h


Revision: 336
Author: maach_ine
Date: 4:10:21 PM, Friday, August 17, 2007
Message:
Fix for issue parsing multipackets.
----
Modified : /src/ZoneServer/ZoneClient.cpp


Revision: 335
Author: lordcorm
Date: 4:07:12 PM, Friday, August 17, 2007
Message:
Stances such as sit, neel, prone, and stand now work.
----
Modified : /Release/PingServer/BuildLog.htm
Modified : /Release/PingServer/PingServer.exe
Modified : /Release/SWGPreCU_Ping.cod
Modified : /Release/SWGPreCU_Ping.obj
Modified : /Release/mt.dep
Modified : /Release/vc80.idb
Modified : /src/PingServer/SWGPreCU_Ping.cpp
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/shared/Database.cpp
Modified : /src/shared/opcodes.h


Revision: 334
Author: plasmaflow
Date: 9:17:22 PM, Thursday, August 16, 2007
Message:
Several crash fix changes minor but fixes none the less sorry for the little doc on the changes.
----
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/OverTime.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 333
Author: plasmaflow
Date: 4:12:42 PM, Thursday, August 16, 2007
Message:
email Router was broken on previous commits.
It has been corrected
----
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/OverTime.cpp
Modified : /src/ZoneServer/ZoneServer.cpp
Modified : /src/ZoneServer/ZoneServer.h
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 332
Author: plasmaflow
Date: 2:49:50 PM, Thursday, August 16, 2007
Message:
Correcter HANDLE_ObjController_CommandQueueEnqueue_purchaseticket
to deduct ticket cost from bank and inv when amount to be debited 
is less than total sum of both cash counts.
----
Modified : /src/ZoneServer/ObjControllers.cpp


Revision: 331
Author: plasmaflow
Date: 2:16:49 PM, Thursday, August 16, 2007
Message:
removed BuildingDeeds.4.sql
----
Deleted : /dbScript/BuildingDeeds.4.sql


Revision: 330
Author: plasmaflow
Date: 2:15:59 PM, Thursday, August 16, 2007
Message:
Deed Tables were wrong
Updating them.
----
Modified : /dbScript/BuildingDeeds.4.sql
Modified : /dbScript/Deeds.4.sql


Revision: 329
Author: plasmaflow
Date: 2:06:22 PM, Thursday, August 16, 2007
Message:
Deleted item_template TO BE MERGED INTO CURRENT.sql
No longer needed has been merged
----
Deleted : /dbScript/item_template TO BE MERGED INTO CURRENT.sql


Revision: 328
Author: plasmaflow
Date: 1:58:14 PM, Thursday, August 16, 2007
Message:
Revision Notes PlasmaFlow

WARNING!!! FULL NEW DATABASE WILL BEW REQUIRED ON THIS LOAD
FLUSH AND RINSE YOUR DATABASE BEFORE RUNNING THIS REV LOTS OF 
DB CHANGES HERE!!!!!

OVERVIEW
=============================================

All ticket droids have been placed in all Starports and Shuttle Ports.
They also know if you hold a ticket for travel from its location or not.

All Travel terminals have been placed in all Starports and Shuttle Ports.
The ticket terminal will populate all locations on a planet. Sell you a ticket
if you have cash, if no cash in your inventory is available then youre SOL.

To give yourself cash use the command "&credits bank <amount>" 
or "&credits inventory <amount>" This will update your inventory info.


All travel tickets are now pupulated in the Database too.
When you purchase a ticket it will spawn in your inventory.
Ticket Purchase will also deduct from your bank account.
If you're near a ticket droid you can double click it to travel.

Travel arrival coords are randomized around the coords to the location 
and you are spawned there.

The &travel command now gives you a list of tickets with destinations.
To see the list type "&travel" with no arguments, the list will give you the
ticket ID for each port. Then to Travel just type "&travel <ticketID>" and 
Voila! youre traveling. Annoying spam of "So and So joined the server when traveling has 
been eliminated, a new function for travel that mimics HandleSelectCharacter has been 
added to HandleCharacterTravel, this function also avoids the clearing and re setting 
of startup variables  for toons logging in.

Friends List now work and inform you of Friend on line and off line.
Friends list also now drive the /FindFriend command.
If you are on a friends list you can find your friend.
/addfriend and /removefriend work and do as told. Adding a friend and removing
from the community >> friends page works as well. Adding comments or groups to a 
friend in the list also works, this is client side driven.

/Findfriend command will spawn a waypoint to your friend provided youre on their list.

waypoints work properly internally but have some bugs. see todo and bugs section.

Code changes to identify a player as a gm and allow login even if server is locked.

Code changes to not use NEW to create a new list but use a local variable to avoid memory leaks.

Swoop Bike now spawns from the Database and item table.

Swoop bike is mounted and dismounted by clicking on it.

Every toon will get a sorosuub deed and a sorosuub in their datapad.

Stf names for intangibles are being read and passed properly from the db to the spawner function.

CmdStarScene packet updated to have JTL values in it and be Var Driven.

Packet Queue will now correct incorrect packet sizes when paket size is 0

New FriendListID item is spawned for each player this is the friends list id.

All items in the players inventory now spawn to the proper inventory, bank, inventory, datapad from the items table.


Added the script handler thread to the ZServer

Added Tells and Friend update Functions to allow players to know a friend logged in.

friend Updates run every 30 seconds and dont occur unless a friend has changed status. this runs off the overtime.cpp

Master OPCode List updated

Placing a house will now email and create a waypoint to the structure.

Structure terminals now give the proper radial options.

Bank terminals give proper options.

Travel terminals will not crash client.

Travel tickets will tell you if you are too far from the droid to use it.



All code has been run through debugger and tested not to crash with all i have in it.

Please if there is something i did and missed im so sorry. But there was a lot fo work here that was intertwined 
and had to be done so one function didnt stop another form working properly.

there are several bugs and will be worked out.


CHANGES IN DB swgprecu.sql.changelog.txt
=============================================
-- --------------------------------------------------------------------------------------------------------------------------------------------------
-- 08-16-07 PlasmaFlow	TABLE Character Changes : new column added friend_waypoint_id. this keeps track of what our findfriend waypoint is. same wp number 
--			gets re used until we rename it. then a new number is assigned. Auto Increment for Player IDS begins at 20000000 yes you read right 
--			20 Million 20,000,000. this is beasue world objects have a reserved range from item 1 to item 19,999,999, THERE CANT BE AN OBJECT
--			IN THE WORLD GENERATED BY US WITH AN ID LOWER THAN 19,999,999 OR THE WORLD OBJECT DISSAPPEARS.
--			OBJECT RANGES ARE IN THE SYSTEM CODE AND ARE IDENTIFIED BASED ON ID. READ C++ CHANGES!!!!!
--			TABLE item CHANGES: item table was storing oI,oJ,oK,oW as ints, these have been changed to Floats.
--			The following fields have been added to the item table to accomodate for travel tickets.
--			`travelticket` TINYINT(1) NOT NULL DEFAULT 0,  `arrivalplanet` TINYINT(3) NOT NULL DEFAULT 0,  `departureplanet` TINYINT(3) NOT NULL DEFAULT 0,
--			`departurecity` varchar(100),  `arrivalcity` varchar(100),  `roundtrip` TINYINT(1) DEFAULT 0,
--			TABLE tickets CHANGES: This table is NOW DATA FILLED. New fields have been added to the table to allow cross referencing the ticket 
--			pricing table based on departure and destination. New cols as follows: 
--			`cost` int NOT NULL,  `shuttleport` bool default 0,  `starport` bool default 0,  `playercityshuttle` bool default 0,
--			NEW TABLE ADDED ticket_prices: This table contains the cost for a travel ticket from location a to location b for reference when purchasing a ticket.
--			This table is data filled and will have to be auto filled when a player city shuttle is placed.
--			NEW TABLE friendlist :: This table holds the data for friends information. data in this table will be auto flagged for deletion upon char deletion.
--			This table comes empty up to players to fill up.
--			NEW TABLE ADDED worldobjects: This table contains all objects upto patch 14 that are spawned by the client. This table is crucial for identifying 
--			objects spawned in the world. This table allows us to know what type of object is being cliecked and to spawn the proper radials or
--			make the object react to commands and such.
--			NEW TABLE ADDED radialoptions: This table stores text strings for popping up radial menus and make them db driven and changeble without recoding the menu.
--			C++ Code and explanation on the C++ Project. Currently this table contains the Radial options for banks.
--			TABLE item_template CHANGES: This table has been updated with several pieces of information throughout.
--			Mostly are content changes no table changes. This table now contains fixed item numbers in the file. These are not fixed ids since we are also fixing them in the 
--			C++ Code.
--			TABLE terminals CHANGES: new columns added for identifying the terminal as a travel terminal and identifying the ticket that that terminal
--			uses or dispenses. This is required so ticket droids know if you have a ticket for him or not.
--			Also its required so we know what terminal we are purchasing a ticket from so that terminal is set as the local terminal being clicked and we dont
--			display a destination for it in the travel map as an available option, this is also required by the client since the client wants to know 
--			where we are purchasing a ticket from in order to populate the list properly.
--			This table is now datafilled with all travel terminals on all starports and shuttles.
--			TABLE terminals CHANGES: this table now has 2 new columns to identify an npc as a ticket droid and the ticket he can use for travel. this allows the droid
--			to tell you if you have a ticket for him or not. This table is now data filled with all ticket droids in all starports and shuttleports.
--			
-- --------------------------------------------------------------------------------------------------------------------------------------------------------------

KNOWN BUGS
=============================================
Travel terminals might not populate all destinations in the client window. I believe this is a client bug.
find Friend will bug waypoints and might stop enabling and disabling the waypoints until logout and login.
Rename waypoint and other waypoint related functions will bug waypoints


TO DO
=============================================

Correct Travel terminal destinations not showing up properly or all destinations not showing up.
Fix waypoint issues.
Add terminal responses to requests
add handling of temrinal requests for terminals not done.





CHANGES IN CODE
=============================================

Index: C:/Software/SWG Pre-CU/Closed2/src/LoginServer/HandleLogin.cpp
===================================================================
This allows us to identify a player as a gm and allow him to login even if the server is in locked state.
--- C:/Software/SWG Pre-CU/Closed2/src/LoginServer/HandleLogin.cpp	(revision 327)
+++ C:/Software/SWG Pre-CU/Closed2/src/LoginServer/HandleLogin.cpp	(working copy)
@@ -62,8 +62,8 @@
 	if (ID > 0) {
 		this->iStationID = ID;
 		this->Characters = db->lLoadClientCharactersFromDatabase(this->iStationID);
-		for (std::list<LClientCharacterInfo>::iterator it = Characters->begin(); 
-			it != Characters->end(); ++it) {
+		for (std::list<LClientCharacterInfo>::iterator it = Characters.begin(); 
+			it != Characters.end(); ++it) {
 				it->iAppearanceCRC = PlayerRace[it->iAppearanceCRC];
 		}
 		gm = db->GetGmStatus(this->iStationID);

Index: C:/Software/SWG Pre-CU/Closed2/src/LoginServer/LoginClient.cpp
===================================================================
Changed lists to not be a NEW list but be a local to avoid memory leaks.
--- C:/Software/SWG Pre-CU/Closed2/src/LoginServer/LoginClient.cpp	(revision 327)
+++ C:/Software/SWG Pre-CU/Closed2/src/LoginServer/LoginClient.cpp	(working copy)
@@ -55,7 +55,7 @@
  fragCounter			=   0;
  fragSize				=   0;
  Handled				=	false;
- Characters = new list<LClientCharacterInfo>;
+// Characters = new list<LClientCharacterInfo>;
 }
 
 LClient::~LClient(){ 
@@ -156,8 +156,8 @@
 			Log->pkf(pData,nLength,true);
 			validClient = false;
 			server_sequence = 0; 
-			Characters->clear();
-			delete Characters;
+			Characters.clear();
+//			delete Characters;
 			delete this;
 			break; }
 		case SOE_PING: { 

Index: C:/Software/SWG Pre-CU/Closed2/src/LoginServer/LoginClient.h
===================================================================
Changed lists to not be a NEW list but be a local to avoid memory leaks.
--- C:/Software/SWG Pre-CU/Closed2/src/LoginServer/LoginClient.h	(revision 327)
+++ C:/Software/SWG Pre-CU/Closed2/src/LoginServer/LoginClient.h	(working copy)
@@ -73,7 +73,7 @@
 			bool	Handled;
 			int     galaxy_id;//By Alaguerrano 06-01-07
 			int     character_id;//By Alaguerrano 06-01-07
-			std::list<LClientCharacterInfo> *Characters;
+			std::list<LClientCharacterInfo> Characters;
 			string sErrorMessage1;
 			string sErrorMessage2;
 	public:

Index: C:/Software/SWG Pre-CU/Closed2/src/LoginServer/PacketFactory.cpp
===================================================================
Changed lists to not be a NEW list but be a local to avoid memory leaks.
--- C:/Software/SWG Pre-CU/Closed2/src/LoginServer/PacketFactory.cpp	(revision 327)
+++ C:/Software/SWG Pre-CU/Closed2/src/LoginServer/PacketFactory.cpp	(working copy)
@@ -80,9 +80,9 @@
 	ByteBuffer *LEC = new ByteBuffer();
 	LEC->uType(3);
 	LEC->opcode2(LoginEnumCluster);
-	LEC->writeINT(db->Servers->size());
+	LEC->writeINT(db->Servers.size());
 	int iMaxCharsPerAccount = -1;
-	for (std::list<Galaxy>::iterator it = db->Servers->begin(); it != db->Servers->end(); ++it) {
+	for (std::list<Galaxy>::iterator it = db->Servers.begin(); it != db->Servers.end(); ++it) {
 		LEC->writeINT(it->iGalaxyID);
 		LEC->writeASTRING(it->sGalaxyName.c_str());
 		LEC->writeINT(it->iServerDistance);
@@ -100,8 +100,8 @@
 	LCS->uType(2);
 	LCS->opcode2(LoginClusterStatus);
 	
-	LCS->writeINT(db->Servers->size()); //List Size
-	for (std::list<Galaxy>::iterator it = db->Servers->begin(); it != db->Servers->end(); ++it) {
+	LCS->writeINT(db->Servers.size()); //List Size
+	for (std::list<Galaxy>::iterator it = db->Servers.begin(); it != db->Servers.end(); ++it) {
 		LCS->writeINT(it->iGalaxyID);
 		LCS->writeASTRING(it->sGalaxyIPWAN.c_str());//changed for db compatablty removed address added wan
 		LCS->writeSHORT(it->iGalaxyServerPort);
@@ -128,9 +128,9 @@
 	ByteBuffer *ECI = new ByteBuffer();
 	ECI->uType(2);
 	ECI->opcode2(EnumerateCharacterId);
-	ECI->writeINT(this->Characters->size());
-	for (std::list<LClientCharacterInfo>::iterator it = this->Characters->begin(); 
-		it != this->Characters->end(); ++it) {
+	ECI->writeINT(this->Characters.size());
+	for (std::list<LClientCharacterInfo>::iterator it = this->Characters.begin(); 
+		it != this->Characters.end(); ++it) {
 			stringstream fullname;
 			if ((it->sLastName.size() == 0) || (it->sLastName.find(" ") != string::npos) ) {
 				fullname << it->sFirstName;

Index: C:/Software/SWG Pre-CU/Closed2/src/shared/Common.h
===================================================================
updated some of the static constants to add smoe for email and more for other things.

--- C:/Software/SWG Pre-CU/Closed2/src/shared/Common.h	(revision 327)
+++ C:/Software/SWG Pre-CU/Closed2/src/shared/Common.h	(working copy)
@@ -80,23 +80,30 @@
 #define XGLOBAL				7
 
 //#define PLAYER_OFFSET 25
-#define INVENTORY_OFFSET	1
-#define MISSIONBAG_OFFSET	2
-#define BANK_OFFSET			4
-#define HAIR_OFFSET			5
-#define DATAPAD_OFFSET		6
-#define PLAY_OFFSET			7
+#define INVENTORY_OFFSET		1
+#define MISSIONBAG_OFFSET		2
+#define BANK_OFFSET				4
+#define HAIR_OFFSET				5
+#define DATAPAD_OFFSET			6
+#define PLAY_OFFSET				7
+#define FRIEND_WAYPOINT_OFFSET	8
+#define FRIEND_LIST_OFFSET		11
 
-#define NPC_OFFSET 100000000
-#define BUILDINGS_OFFSET 200000000
-#define CELL_OFFSET 70
-#define CELL_ITEM_OFFSET 300000000
-#define WORLD_OBJECT_OFFSET 400000000
-#define ITEM_OFFSET 500000000
-#define DATAPAD_WAYPOINT_OFFSET 600000000 //temporary for testing may not be needed PF.
-#define	TERMINAL_OFFSET 700000000
-#define INSTANCE_OFFSET 800000000
-#define RESOURCE_OFFSET 900000000
+#define EVERYONE_EMAIL_LIST		24
+#define DEV_EMAIL_LIST			23
+#define CSR_EMAIL_LIST			22
+#define	GUILD_EMAIL_LIST		21
+
+#define NPC_OFFSET					100000000
+#define BUILDINGS_OFFSET			200000000
+#define CELL_OFFSET					70
+#define CELL_ITEM_OFFSET			300000000
+#define WORLD_OBJECT_OFFSET			400000000
+#define ITEM_OFFSET					500000000
+#define DATAPAD_WAYPOINT_OFFSET		600000000 
+#define	TERMINAL_OFFSET				700000000
+#define INSTANCE_OFFSET				800000000
+#define RESOURCE_OFFSET				900000000
 //640543FE
 	
 	
Index: C:/Software/SWG Pre-CU/Closed2/src/shared/Database.cpp
===================================================================
Several Changes as explained Please Read ON

--- C:/Software/SWG Pre-CU/Closed2/src/shared/Database.cpp	(revision 327)
+++ C:/Software/SWG Pre-CU/Closed2/src/shared/Database.cpp	(working copy)
@@ -235,7 +235,7 @@
 	CharacterID					= 25; // Present in database -- Character table.
 	CharacterGalaxyID			= 3; // Present in database Character table.
 	CharacterStatus				= 1;
===================================================================
change due to change ion lists not being new and clearing the list.
-	Servers						= 0;
+	Servers.clear(); //						= 0;
 	
  }
 //this function initializes the database
@@ -300,7 +300,7 @@
 
 DBConnect::~DBConnect() {
 	Log->cbe("In ~DBConnect\n");
===================================================================
change due to lists not being used as new delete function no longer needed
-	delete Servers;
+//	delete Servers;
 }
 
 int DBConnect::CanLogin(string username,string password,string version) 
@@ -478,14 +478,14 @@
 
===================================================================
list change to not use new

-list<LClientCharacterInfo> * DBConnect::lLoadClientCharactersFromDatabase(int iClientID) {
+list<LClientCharacterInfo> DBConnect::lLoadClientCharactersFromDatabase(int iClientID) {
 	/*
 		Thi function loads all characters for a player so we can present them to the client ui in the character list.
 	*/
 	//Log->cbe("In DBConnect::lLoadClientCharactersFromDatabase\n");
 	stringstream query;
 	query << "SELECT * from `character` where account_id = " << iClientID << " AND `destroy` = 0";
-	list<LClientCharacterInfo> * newList = new list<LClientCharacterInfo>; 
+	list<LClientCharacterInfo>  newList;
 	printf("******Getting Character List********\n");
 	LClientCharacterInfo Character;
 	if (!mysql_query(conn, query.str().c_str()))
@@ -500,13 +500,13 @@
 			Character.iAppearanceCRC = (int)atoi(Row[8]);
 			Character.sFirstName = Row[4];
 			Character.sLastName = Row[5];
-			newList->push_back(Character);
+			newList.push_back(Character);
 		}
 	}
 	mysql_free_result(Result);
 	return newList;
 }
===================================================================
list change to not use new

-list<Item> * DBConnect::GetInventory(uint64 character, uint64 containerid2)
+list<Item>  DBConnect::GetInventory(uint64 character)
 {
 	/*
 		This function returns a list of items for the player specifies so when the player loads it can be spawned for him
@@ -517,7 +517,7 @@
 	stringstream _query;
 
 	Item tempinv;
===================================================================
list change to not use new

-	list<Item> * tempInventory = new list<Item>;
+	list<Item>  tempInventory ;
 
 	_query << "SELECT * FROM `item` WHERE `character_id` =" << character << " AND `inv` = '1' AND `spawn` = 1 ORDER BY `slot` DESC";
 	//printf("INV Query \n\n%s\n\n",_query.str().c_str());
@@ -537,7 +537,7 @@
===================================================================
list change to not use new

 				tempinv.equiped = true;
 				tempinv.serial = atoi(_Row[0]);
 				tempinv.itemtemplate = atoi(_Row[3]);
-				tempinv.containerid = containerid2;
+				tempinv.containerid = atol(_Row[8]); //containerid2;
 				tempinv.slot_id = atoi(_Row[17]);
 				tempinv.deed_id = atoi(_Row[18]);
 				if(_Row[27] != NULL)
@@ -552,7 +552,7 @@
 				tempinv.equiped = false;
 				tempinv.serial = atoi(_Row[0]);
 				tempinv.itemtemplate = atoi(_Row[3]);
-				tempinv.containerid = containerid2;
+				tempinv.containerid = atol(_Row[8]); //containerid2;
 				tempinv.slot_id = atoi(_Row[17]);
 				tempinv.deed_id = atoi(_Row[18]);
 				if(_Row[27] != NULL)
@@ -562,7 +562,7 @@
 				}
 			}
 			tempinv.stack_size = (int)atoi(_Row[34]);
-			tempInventory->push_back(tempinv);
+			tempInventory.push_back(tempinv);
 		}
 	}
 
@@ -611,7 +611,7 @@
 
 
===================================================================
list change to not use new
 
-list<Galaxy> * DBConnect::GrabGalaxyInfo()
+list<Galaxy>  DBConnect::GrabGalaxyInfo()
 {
 	/*
 		This function is called every time a new client needs to know how many galaxy servers we have up.
@@ -623,10 +623,10 @@
 	MYSQL_RES * _Result;
 	MYSQL_ROW _Row;
 
-	printf("Grabbing Galaxy Info\n");
+	//printf("Grabbing Galaxy Info\n");
 	int retval = mysql_query(conn,"SELECT * FROM galaxy");  // Send a query to the database.
 	Galaxy tempGalaxy;
===================================================================
list change to not use new

-	list<Galaxy> * tempServers = new list<Galaxy>;
+	list<Galaxy>  tempServers ;
 
 	_Result = mysql_use_result(conn);	// Recieve the result and store it in res_set
 	
@@ -648,7 +648,7 @@
 			tempGalaxy.iServerDistance = (int)atoi(_Row[10]);
 			tempGalaxy.iMaxCharactersPerAccount = (int)atoi(_Row[11]);
===================================================================
list change to not use new
 			
-			tempServers->push_back(tempGalaxy);
+			tempServers.push_back(tempGalaxy);
 		}	
 		mysql_free_result(_Result);
 	}
@@ -811,6 +811,14 @@
===================================================================
friends list deletion code in delete char function

 							retval = mysql_query(conn,_query.str().c_str());
 							if (!retval)
 							{
+								_query.str("");
+								_query << "UPDATE `friendlist` SET `destroy` = 1, `destroy_date` = now() WHERE `character_id` = " << character_id ;
+								retval = mysql_query(conn,_query.str().c_str());
+								if (!retval)
+								{
+									return true;	
+								}
+
 								return true;	
 							}
 							return true;	
@@ -935,15 +943,21 @@
 			{ tBiography << "\\" << sBiography[i]; }
 		}
 	}
-//	if (1) 
-//	{
===================================================================
changes for object ids all toons now beign at 20millon offset

+
+		//4,294,967,295 int max val, 
+		//Toon ids have to begin at 20 million to avoid conflicts with world objects, they end at 10 mil, this gives us another 10mil for mods,
+		int _ObjID = 0;
+		_ObjID = GetIntFromQuery("Select MAX(`character_id`) FROM `character` AS `id`"); // get the highest row in the db and add 25 to it.
+		if(_ObjID <= 19999999)
+		{
+			_ObjID = 20000000;
+		}
+		_ObjID = _ObjID + 25;
 		
-		int ObjID = (GetIntFromQuery("Select MAX(`character_id`) FROM `character` AS `id`") + 25); // get the highest row in the db and add 25 to it.
-		if (ObjID == 24) ObjID = 25; 
 		stringstream createCharacterQuery;
-		createCharacterQuery << "INSERT INTO `character` (character_id, account_id, galaxy_id, appearance_crc, firstname, lastname, scale, biography, species_id, guild, x, z, y, planet_id, instance_id, appearance, appearancelen, h_hea, h_str, h_con, h_d_hea, h_d_str, h_d_con, h_w_hea, h_w_str, h_w_con, a_act, a_qui, a_sta, a_d_act, a_d_qui, a_d_sta, a_w_act, a_w_qui, a_w_sta, m_mind, m_foc, m_wil, m_d_mind, m_d_foc, m_d_wil, m_w_mind, m_w_foc, m_w_wil , hairobject,hairlen,custom_data,custom_data_len, starting_profession, invcredits, bankcredits, cell_id ) VALUE ( ";
+		createCharacterQuery << "INSERT INTO `character` (character_id, account_id, galaxy_id, appearance_crc, firstname, lastname, scale, biography, species_id, guild, x, z, y, planet_id, instance_id, appearance, appearancelen, h_hea, h_str, h_con, h_d_hea, h_d_str, h_d_con, h_w_hea, h_w_str, h_w_con, a_act, a_qui, a_sta, a_d_act, a_d_qui, a_d_sta, a_w_act, a_w_qui, a_w_sta, m_mind, m_foc, m_wil, m_d_mind, m_d_foc, m_d_wil, m_w_mind, m_w_foc, m_w_wil , hairobject,hairlen,custom_data,custom_data_len, starting_profession, invcredits, bankcredits, cell_id ,friend_waypoint_id) VALUES ( ";
 		
-		createCharacterQuery << ObjID << "," << iStationID << ", ";// CHANGE STATION ID TO  ACCOUNT ID   THAY ARE THE SAME  AND STATION ID IS TO BE DROPED
+		createCharacterQuery << _ObjID << "," << iStationID << ", ";// CHANGE STATION ID TO  ACCOUNT ID   THAY ARE THE SAME  AND STATION ID IS TO BE DROPED
 		createCharacterQuery << iGalaxyID << ", " << iAppearanceCRC << ", '" << tFirstName.str().c_str();
 		createCharacterQuery << "', '" << tLastName.str().c_str() << "', " << fScale << ", '" << tBiography.str().c_str();
 		createCharacterQuery << "', '" << iSpecies << "', " << iGuildID << ", " << x << ", ";
@@ -958,16 +972,22 @@
 		createCharacterQuery << 0 << ", " << iHAM[6] << ", " << iHAM[7] << ", " << iHAM[8] << ", " << iHAM[6];
 		createCharacterQuery << ", " << iHAM[7] << ", " << iHAM[8] << ", " << 0 << ", " << 0 << ", ";
 		createCharacterQuery << 0 << ",'" << hairObject.c_str() << "'," << hairlen << ",'" << encodedhairCustomData ;
-		createCharacterQuery << "'," << encodedhairCustomDataLen << ",'" << newCharacterProfession.c_str() << "', " << 100 <<", "<< 100 << "," << _cellID << ")";
+		createCharacterQuery << "'," << encodedhairCustomDataLen << ",'" << newCharacterProfession.c_str() << "', " << 100 <<", "<< 100 << "," << _cellID << ", 0 )";
 		//delete the ham array		
 		delete [] iHAM;
 		printf("Query:  %s\n",createCharacterQuery.str().c_str() );
 		//this is the actual char insertion point if its successful we will get a row id for the toon which is same as the ObjID
 		if (!mysql_query(conn, createCharacterQuery.str().c_str())) 
 		{
-			ObjID = mysql_insert_id(conn); // Here is where we get the new toons id
-			printf("Character created successfully for Station ID %i.Char ObjID: %i\n", StationID,ObjID);// CHANGE STATION ID TO  ACCOUNT ID   THAY ARE THE SAME  AND STATION ID IS TO BE DROPED		
-			return ObjID;
+			_ObjID = mysql_insert_id(conn); // Here is where we get the new toons id
+			stringstream _autoincrupdate;
+			int incr = _ObjID;
+			incr = incr + 25;
+			_autoincrupdate << "ALTER TABLE `character` AUTO_INCREMENT = " << incr ;
+			//printf("\n%s\n",_autoincrupdate.str().c_str());
+			mysql_query(conn,_autoincrupdate.str().c_str());
+			printf("Character created successfully for Station ID %i.Char ObjID: %i\n", StationID,_ObjID);// CHANGE STATION ID TO  ACCOUNT ID   THAY ARE THE SAME  AND STATION ID IS TO BE DROPED		
+			return _ObjID;
 		} 
 		else 
 		{
@@ -975,11 +995,7 @@
 			printf("Character NOT created successfully for Station ID %i.\n", StationID);// CHANGE STATION ID TO  ACCOUNT ID   THAY ARE THE SAME  AND STATION ID IS TO BE DROPED
 			return -1;
 		}
-//	} 
-//	else 
-//	{
-//		return -1;
-//	}
+
 	return -1;
 }
 
@@ -1370,6 +1386,7 @@
 		}
 	}
 	mysql_free_result(Result);
+	db->SetCRCValuesToTemplates();
 	return featuresloaded;	
 }
 
@@ -1668,6 +1685,7 @@
 			  tempData.invcredits = atoi(Row[68]);
 			  tempData.bankcredits = atoi(Row[69]);
 			  tempData.cell_id = (long)atof(Row[70]);
+			  tempData.friend_waypoint_id = atoi(Row[73]);
 		}
 	}
 
@@ -1764,7 +1782,7 @@
 }
 
===================================================================
list change to not use new

 
-list<Building> * DBConnect::SpawnBuildings( int _planetID)
+list<Building>  DBConnect::SpawnBuildings( int _planetID)
 {
 	/*
 		// This function loads a list of all buildings on a given planet for spawning.
@@ -1775,7 +1793,7 @@
 
 	stringstream _query;
 	Building tempbuilding;
-	list<Building> * tempBuildings = new list<Building>;
+	list<Building>  tempBuildings;
 
 	if (_planetID != NULL)
 	{
@@ -1805,7 +1823,7 @@
 			tempbuilding.bY = atof(_Row[9]);
 			tempbuilding.planetid = atoi(_Row[10]);
 			
-			tempBuildings->push_back(tempbuilding);
+			tempBuildings.push_back(tempbuilding);
 		}
 	}
 	if (_Result)
@@ -2104,13 +2122,19 @@
 	//printf("Inserting Items\n");
 	for ( std::list<StarterItem>::iterator it = starteritems->begin(); it != starteritems->end(); ++it) 
 	{
-		InsertItem(it->serial, it->equiped, it->armorstat_id, it->weaponstat_id, it->slot_id, character, it->template_id, it->deed_id, it->itemName, 0);
+		InsertItem(it->serial, it->equiped, it->armorstat_id, it->weaponstat_id, it->slot_id, character, it->template_id, it->deed_id, it->itemName, 0 , character + INVENTORY_OFFSET );
 	}
+	//insert the data swoop
+	InsertItem(0, 0, 0, 0,0, character,  3534,  0,          "Speederbike Swoop", 0 , character + DATAPAD_OFFSET );
+	InsertItem(0, 0, 0, 0,0, character, 15426,  0,      "Sorosuub Luxury Yatch", 0 , character + DATAPAD_OFFSET );
+	InsertItem(0, 0, 0, 0,0, character, 14029,138, "Sorosuub Luxury Yatch Deed", 0 , character + INVENTORY_OFFSET );
+	
 	return;
+
 }
 
===================================================================
Insert item now needs the container id to put the object into so
that its spawned in the right place, i/e datapad, inventory, bank

 
-void DBConnect::InsertItem(	uint64 serial,bool equiped, int armorstat_id, int weaponstat_id, int slot_id, int character, int template_num, int deed_id, string _itemName, int stackSize)
+void DBConnect::InsertItem(	uint64 serial,bool equiped, int armorstat_id, int weaponstat_id, int slot_id, int character, int template_num, int deed_id, string _itemName, int stackSize, int containerID)
 {
 	/*
 		//This function does the actual insertion of template items it is a helper routine to the insertstarteritems functions above^
@@ -2118,7 +2142,7 @@
 	stringstream _query;
 	//mysqlquery << "INSERT INTO item  VALUES ( " << serial << ", 0," << slot << ", "<< template_num << ", " << character << ", 1, 0, 0, 0, 0," << equiped << ", 0, 1000, 1000, 0, 1, " << armorstat_id << ", " << weaponstat_id << ", " << weapon << " ) "; 
 	slot=0;
-	_query << "INSERT INTO item  VALUES( `serial` , 0, " << slot << ", " << template_num << ", " << character << ", 1, 0, 0, 0, 0, " << equiped << ", 1000, 1000, 0, 1, " << armorstat_id << ", " << weaponstat_id << ", " << slot_id << ", " << deed_id << ",0, 0,0,0,1,0,0,0,'" << _itemName.c_str() << "',0,0,1,DEFAULT,0,";
+	_query << "INSERT INTO item  VALUES( `serial` , 0, " << slot << ", " << template_num << ", " << character << ", 1, 0, 0," << containerID << ", 0, " << equiped << ", 1000, 1000, 0, 1, " << armorstat_id << ", " << weaponstat_id << ", " << slot_id << ", " << deed_id << ",0, 0,0,0,1,0,0,0,'" << _itemName.c_str() << "',0,0,1,DEFAULT,0,";
 	
 	if (template_num == 14037) {
 		_query << "3,";
@@ -2135,7 +2159,9 @@
 	} else {
 		_query << "0,";
 	}
-	_query << stackSize << ");";
+	_query << stackSize ;
+	_query << ",0,0,0,'','',0);";
+	
 	int retval = mysql_query(conn,_query.str().c_str());
 	if(!retval)
 	{}
@@ -2265,12 +2291,12 @@
 }
 
===================================================================
list change to not use new

-list<DeedObject> * DBConnect::InventoryDeed(uint64 serialid)
+list<DeedObject>  DBConnect::InventoryDeed(uint64 serialid)
 {
 	MYSQL_ROW _Row;
 	MYSQL_RES * _Result;
 	stringstream _query;
-	list<DeedObject> * tempDeed = new list<DeedObject>;
+	list<DeedObject> tempDeed;
 	int id;
 
 	_query << "SELECT * FROM `item` WHERE `serial` = " << serialid;
@@ -2301,7 +2327,7 @@
 
 
 ===================================================================
list change to not use new

-list<StaticNPC> * DBConnect::SpawnStaticNPCs(int _planetID)
+list<StaticNPC> DBConnect::SpawnStaticNPCs(int _planetID)
 {
 	/*
 		This function returns a list of static npcs to spawn for a player on a planet
@@ -2309,7 +2335,7 @@
 	MYSQL_RES * _Result;
 	MYSQL_ROW _Row;
 	stringstream _query;
-	list<StaticNPC> * tempnpcs = new list<StaticNPC>;
+	list<StaticNPC> tempnpcs ;
 	StaticNPC tempnpc;
 
 	if(_planetID != NULL)
@@ -2318,9 +2344,9 @@
 	}
 	else
 	{
-		_query << "SELECT * FROM `static_npcs`";
+		_query << "SELECT * FROM `static_npcs` WHERE `planet_id` = " << 0;
 	}
-	
+	//printf("\n%s\n\n",_query.str().c_str());
 	int retval = mysql_query(conn, _query.str().c_str());
 	if (!retval)
 	{
@@ -2341,20 +2367,31 @@
 			tempnpc.health = atoi(_Row[11]);
 			tempnpc.mind = atoi(_Row[12]);
 			tempnpc.action = atoi(_Row[13]);
+			if(_Row[14] != NULL)
+			{
+				tempnpc.script = _Row[14];
+			}
+			else
+			{
+				tempnpc.script = "None";
+			}
 			tempnpc.planet_id = atoi(_Row[15]);
 			tempnpc.CellID = atoi(_Row[16]);
 			tempnpc.dancestring = _Row[17];
 			tempnpc.posture = atoi(_Row[18]);
-
-			tempnpcs->push_back(tempnpc);
+			
+			tempnpc.ticketdroid = (bool)atoi(_Row[19]);
+			tempnpc.ticketid = atoi(_Row[20]);
+			
+			tempnpcs.push_back(tempnpc);
 		}
+		if(_Result){mysql_free_result(_Result);}
 	}
-	if(_Result)
-	{mysql_free_result(_Result);}
+	
 	return tempnpcs;
 }

===================================================================
list change to not use new

 
-list<CellObject> * DBConnect::GetCellObjects(int cell_id)
+list<CellObject> DBConnect::GetCellObjects(int cell_id)
 {
 	/*
 		thif function returns a list of cell objects to spawn in a planet forr a player
@@ -2363,7 +2400,7 @@
 	MYSQL_ROW GCORow;
 	stringstream query;
 
-	list<CellObject> * tempobj = new list<CellObject>;
+	list<CellObject>  tempobj;
 
 //	query << "SELECT * FROM `item` WHERE `cell_id` =" << cell_id << " AND `building` = 1";
 	query << "SELECT * FROM `item` WHERE `cell_id` = " << cell_id << " AND `building` = 1 AND `spawn` = 1";
@@ -2386,15 +2423,15 @@
 		tempcellobj.z = atof(GCORow[25]);
 		tempcellobj.y = atof(GCORow[26]);
 
-		tempobj->push_back(tempcellobj);
-}
+		tempobj.push_back(tempcellobj);
+	}
 	mysql_free_result(GCOResult);
 
 	return tempobj;
 }
 
===================================================================
list change to not use new

 
-list<DeedObject> * DBConnect::GetDeedObject(int id)
+list<DeedObject> DBConnect::GetDeedObject(int id)
 {
 	/*
 		//This function gose and gets the object that will be spawned from the deed from the Database
@@ -2404,7 +2441,7 @@
 	stringstream _query;
 	DeedObject deed;
 
-	list<DeedObject> * tempDeed = new list<DeedObject>;
+	list<DeedObject> tempDeed ;
 	_query << "SELECT * FROM `deeds` WHERE `id` = " << id;
 
 	int retval = mysql_query(conn,_query.str().c_str());
@@ -2475,7 +2512,7 @@
 			deed.sign_ssoK = atof(_Row[46]);
 			deed.sign_ssoW = atof(_Row[47]);
 
-			tempDeed->push_back(deed);
+			tempDeed.push_back(deed);
 		}
 
 		mysql_free_result(_Result);
@@ -2502,7 +2539,7 @@
 
 	return Toreturn;
 }

===================================================================
list change to not use new

-list<Terminal> * DBConnect::GetTerminal(int _planetID)
+list<Terminal>  DBConnect::GetTerminal(int _planetID)
 {
 	/*
 		This function returns a list of terminals to spawn on a planet
@@ -2510,7 +2547,7 @@
 	MYSQL_RES * _Result;
 	MYSQL_ROW _Row;
 	stringstream _query; 
-	list<Terminal> * temp = new list<Terminal>;
+	list<Terminal>  temp ;
 
 	if (_planetID != NULL)
 	{
@@ -2542,43 +2579,65 @@
 			tempnpc.CellID = atoi(_Row[13]);
 			tempnpc.posture = atoi(_Row[14]);
 			tempnpc.type = atoi(_Row[15]);
+			tempnpc.travelterminal = atoi(_Row[20]);
+			tempnpc.ticketid = atoi(_Row[21]);
 
-			temp->push_back(tempnpc);
+			temp.push_back(tempnpc);
 		}
 	}
 	if (_Result)
 	{mysql_free_result(_Result);}
 	return temp;
 }

===================================================================
list change to not use new

-list<Ticket> * DBConnect::GetTickets(int planet_id)
+list<Ticket>  DBConnect::GetTickets(int planet_id,bool shuttles)
 {
 	/*
 		this function returns the list of ticket for travel for a planet id.
 	*/
-	stringstream query;
-	MYSQL_RES * GTResult;
-	MYSQL_ROW	Row;
+	//printf("Getting Tickets\n");
+	stringstream _query;
+	MYSQL_RES * _Result;
+	MYSQL_ROW	_Row;
+	int retval;
+	if(shuttles)
+	{
+		_query << "SELECT * FROM `tickets` WHERE `planet_id` = " << planet_id << " AND `shuttleport` = 0 AND `starport` = 1 OR `planet_id` = " << planet_id << " AND `shuttleport` = 1 AND `starport` = 0 ORDER BY `Destination`";
+	}
+	else
+	{
+		_query << "SELECT * FROM `tickets` WHERE `planet_id` = " << planet_id << " AND `starport` = 1 ORDER BY `Destination`";
+	}
 
-	query << "SELECT * FROM `tickets` WHERE	`planet_id` = " << planet_id;
-	mysql_query(conn, query.str().c_str());
-	GTResult = mysql_use_result(conn);
-	
-	list<Ticket> * TempTickets = new list<Ticket>;
+	retval = mysql_query(conn, _query.str().c_str());
+	_Result = mysql_use_result(conn);
+	//printf("\n\n%s\n\n",_query.str().c_str());
+	list<Ticket>  TempTickets;
+	Ticket tempticket;
 
-	while ((Row = mysql_fetch_row(GTResult)) != NULL)
+	if(_Result)
 	{
-
-		Ticket tempticket;
-		tempticket.planet_id = atoi(Row[1]); 
-		tempticket.destination = Row[2];
-		tempticket.x = atoi(Row[3]);
-		tempticket.z = atoi(Row[4]);
-		tempticket.y = atoi(Row[5]);
-		tempticket.cost = atoi(Row[6]);
-		TempTickets->push_back(tempticket);
-
+		while ((_Row = mysql_fetch_row(_Result)) != NULL)
+		{
+			tempticket.ticketID = atoi(_Row[0]); 
+			tempticket.planet_id = atoi(_Row[1]); 
+			tempticket.destination = _Row[2];
+			tempticket.x = atoi(_Row[3]);
+			tempticket.z = atoi(_Row[4]);
+			tempticket.y = atoi(_Row[5]);
+			tempticket.cost = atoi(_Row[6]);
+			tempticket.shuttle = atoi(_Row[7]);
+			tempticket.starport = atoi(_Row[8]);
+			tempticket.playercityshuttle = atoi(_Row[9]);
+			TempTickets.push_back(tempticket);
+		}
+		mysql_free_result(_Result);
 	}
-	mysql_free_result(GTResult);
+	else
+	{
+		stringstream toLog;
+		toLog << "GetTickets:MySQL:Error:" << retval << "\n";
+		Log->cb((char*)toLog.str().c_str());
+	}
 
 	return TempTickets;
 }
@@ -2629,7 +2688,7 @@
 	{mysql_free_result(_Result);}
 
===================================================================
changes to identify droid or npc as ticket droid

 	_query << "INSERT INTO `static_npcs` (`npc_id`,`npc_crc`, `npc_name`, `npc_bitmask`, `oI`, `oJ`, `oK`,";
-	_query << " `oW`, `x`, `z`, `y`, `planet_id`, `cellID`) VALUES (";
+	_query << " `oW`, `x`, `z`, `y`, `planet_id`, `cellID`,`ticketdroid`,`ticketid`) VALUES (";
 	_query << MaxRow << ",";
 	_query << _npcData.crc << ",'";
 	_query << tempName.str().c_str() << "',";
@@ -2642,7 +2701,9 @@
 	_query << _npcData.z << ",";
 	_query << _npcData.y << ",";
 	_query << _npcData.planet_id << ",";
-	_query << _npcData.CellID << " ";
+	_query << _npcData.CellID << ", ";
+	_query << _npcData.ticketdroid << ", ";
+	_query << _npcData.ticketid << " ";
 	_query << ")";
 	printf("New NPC Query:\n%s\n",_query.str().c_str());
 	
@@ -2749,7 +2810,7 @@
 	{mysql_free_result(_Result);}
===================================================================
change to identify a temrinal as a travel terminal or not

 
 	_query << "INSERT INTO `terminals` (`terminals_id`,`terminals_crc`, `terminals_name`, `terminals_bitmask`, `oI`, `oJ`, `oK`,";
-	_query << " `oW`, `x`, `z`, `y`, `planet_id`, `cellID`,`type`,`destroy`,`packed`,`spawn`,`destroy_date`) VALUES (";
+	_query << " `oW`, `x`, `z`, `y`, `planet_id`, `cellID`,`type`,`destroy`,`packed`,`spawn`,`destroy_date`,`travelterminal`,`ticketid`) VALUES (";
 	_query << MaxRow << ",";
 	_query << _terminalData.crc << ",'";
 	_query << tempName.str().c_str() << "',";
@@ -2764,7 +2825,8 @@
 	_query << _terminalData.planet_id << ",";
 	_query << _terminalData.CellID << ", ";
 	_query << _terminalData.type << " ";
-	_query << ",0,0,1,DEFAULT)";
+	_query << ",0,0,1,DEFAULT,";
+	_query << _terminalData.travelterminal << "," << _terminalData.ticketid << ")";
 	printf("New Terminal Query:\n%s\n",_query.str().c_str());
 	
 	qreslt = mysql_query(conn,_query.str().c_str());
@@ -2835,6 +2897,7 @@

===================================================================
function updated for incorporating safety and avoid crashes also 
returns now the stf name from the db item_template table

 	_query << "SELECT * FROM `item_template` WHERE `template_id` = " << templateID;
 	int retval = mysql_query(conn,_query.str().c_str());
 	//printf("1retval:%i\n",retval);
+	
 	if (!retval)
 	{
 	//	printf("2retval:%i\n",retval);
@@ -2842,15 +2905,18 @@
 		while((_Row = mysql_fetch_row(_Result)) != NULL )
 		{
 	//		printf("3retval:%i\n",retval);
-			if (_Row[3] != NULL)
-			{
-				//printf("3.1retval:%i\n",retval);
-				toReturn.itemName = ("%s",_Row[3]);
-			}
-	//		printf("3.2retval:%i\n",retval);
+			if(_Row[3] != NULL)
+			{toReturn.itemName = ("%s",_Row[3]);}
+			else
+			{toReturn.itemName = "";}
+			if(_Row[10] != NULL)
+			{toReturn.STFName = ("%s",_Row[10]);}
+			else
+			{toReturn.STFName = "";}
+			//		printf("3.2retval:%i\n",retval);
 			toReturn.itemCRC = SWGCRC(_Row[2]);   //(uint32)atof(_Row[8]);
-			
 		}
+
 	}
 	//printf("4retval:%i\n",retval);
 	if (_Result)
@@ -2861,20 +2927,38 @@
 
===================================================================
updated for safety in the function and check for errors.

 
 int DBConnect::GetTemplateID(int itemID) {
-
+/*
+	This function returns the template id for an item in the players item table
+*/
 	stringstream query;
-	query << "Select template_id from item where serial = '" << itemID << "';";
+	MYSQL_RES * _Result;
+	MYSQL_ROW _Row;
+	int retval;
 	int toReturn = -1; 
-	if (!mysql_query(conn, query.str().c_str())) {
-		Result = mysql_store_result(conn);
-		if (Result) {
-			Row=mysql_fetch_row(Result);
-			if (Row) {
-				toReturn = (int)atoi(Row[0]);
+
+	query << "Select `template_id` From `item` WHERE `serial` = " << itemID << ";";
+	//printf("%s\n",query.str().c_str());
+	retval = mysql_query(conn, query.str().c_str());
+	_Result = mysql_store_result(conn);
+	if(_Result)
+	{
+		while((_Row = mysql_fetch_row(_Result)) != NULL)
+		{
+			if(_Row[0] != NULL)
+			{
+				toReturn = atoi(_Row[0]);
+				//printf("TemplateID Returning: %i\n",atoi(_Row[0]));
+				//printf("TemplateID Returning: %i\n",toReturn);
 			}
-			mysql_free_result(Result);
 		}
+		mysql_free_result(_Result);
 	}
+	else
+	{
+		stringstream toLog;
+		toLog << "GetTemplateID:MySQL:Error:" << retval << "\n";
+		Log->cb((char*)toLog.str().c_str());
+	}
 	return toReturn;
 }
 
@@ -3447,8 +3531,8 @@
 	tempEmail.Error = retval;
 	return tempEmail;
 }
===================================================================
list change to not use new

-list <Email> * DBConnect::GetEmailHeaders(int _recipient){
-	list <Email> * tempEmailHeaders = new list<Email>;
+list <Email>  DBConnect::GetEmailHeaders(int _recipient){
+	list <Email>  tempEmailHeaders;
 	Email tempEmail;
 	MYSQL_RES * _Result;
 	MYSQL_ROW _Row;
@@ -3478,7 +3562,7 @@
 			tempEmail.Read = atoi(_Row[8]);
 			tempEmail.TimeStamp = atoi(_Row[3]);
 			tempEmail.Error = 0;
-			tempEmailHeaders->push_back(tempEmail);
+			tempEmailHeaders.push_back(tempEmail);
 			
 		}
 		mysql_free_result(_Result);
@@ -3489,7 +3573,7 @@
 		toLog << "GetEmailHeaders:MySQL:1:Error:" << retval;
 		Log->cb((char*)toLog.str().c_str());
 		tempEmail.Error = -1;
-		tempEmailHeaders->push_back(tempEmail);
+		tempEmailHeaders.push_back(tempEmail);
 		return tempEmailHeaders;
 	}
 }
@@ -3581,6 +3665,7 @@
 	}
 	return -1;
 }
+
===================================================================
list change to not use new

 bool DBConnect::PingDatabase(){ 
 	MYSQL_RES * _Result;
 	stringstream _query; 
@@ -3705,13 +3790,13 @@
 	return false;
 }
===================================================================
list change to not use new

 
-list<_EmailAttachment> * DBConnect::GetEmailAttachments(int _EmailID) {
+list<_EmailAttachment>  DBConnect::GetEmailAttachments(int _EmailID) {
 
 	/*
 		Added Function: list<_EmailAttachment> * DBConnect::GetEmailAttachments(int _EmailID) { to return a list of email attachments for a particular email message
 	*/
 
-	list<_EmailAttachment> * tempAttachmentList = new list<_EmailAttachment>;
+	list<_EmailAttachment>  tempAttachmentList;
 	_EmailAttachment tempAttachment;
 	stringstream _query;
 	MYSQL_RES * _Result;
@@ -3734,7 +3819,7 @@
 			tempAttachment.x = atof(_Row[6]);
 			tempAttachment.z = atof(_Row[7]);
 			tempAttachment.y = atof(_Row[8]);
-			tempAttachmentList->push_back(tempAttachment);
+			tempAttachmentList.push_back(tempAttachment);
 			printf("Attachment:id:%i\nname:%s\n",tempAttachment.id,tempAttachment.name.c_str());
 		}
 		mysql_free_result(_Result);
@@ -3877,24 +3962,185 @@
 	query << "UPDATE `waypoint` SET `x` = '" << x << "', `y` = '" << y << "', `z` = '" << z << "' where `id` = '" << waypointID << "' and `character_id` = '" << ObjID << "' and `galaxy_id` = '" << galaxyID << "';";
 	mysql_query(conn, query.str().c_str());
 }
===================================================================
new function added for friend waypoints

+void DBConnect::UpdateCharacterFriendWaypointID(int _ObjID,int _wpID) {
+	stringstream _query;
+	stringstream t_name;
 
+	
+	_query << "UPDATE `character` SET `friend_waypoint_id` = " << _wpID << " WHERE `character_id` = " << _ObjID;
+
+	
+	int retval = mysql_query(conn,_query.str().c_str());
+	if(!retval)
+	{
+	}
+	else
+	{
+		stringstream toLog;
+		toLog << "UpdateCharacterFriendWaypointID:MySQL:Error:" << retval;
+		Log->cb((char*)toLog.str().c_str());
+	}
+
+	return;
+}
===================================================================
new function to insert travel tickets to inventory

+int DBConnect::InsertTravelTicketToInventory(Ticket _ticket,string _destinationCity,string _departureCity, int _departurePlanet,int _arrivalPlanet,bool _roundtrip,int _ObjID) {
+	stringstream _query;
+	stringstream t_name;
+	stringstream t_dcity;
+	stringstream t_acity;
+
+	MYSQL_RES * _Result;
+	MYSQL_ROW _Row;
+	int retval;
+	int retrecord;
+	
+	for(int i=0;i<_departureCity.length();i++)
+	{
+		string t;
+		t = _departureCity[i];
+		if(!strcmp(t.c_str(),"'"))
+		{
+			t_dcity << "\\" << _departureCity[i];
+		}
+		else
+		{
+			t_dcity << _departureCity[i];
+		}
+	}
+	for(int i=0;i<_destinationCity.length();i++)
+	{
+		string t;
+		t = _destinationCity[i];
+		if(!strcmp(t.c_str(),"'"))
+		{
+			t_acity << "\\" << _destinationCity[i];
+		}
+		else
+		{
+			t_acity << _destinationCity[i];
+		}
+	}
+	_query << "INSERT INTO `item` VALUES (`serial`,0,0,14132,"<< _ObjID <<",'1', '0', '0', " << _ObjID + INVENTORY_OFFSET << ", 0, '0', 1000, 1000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1," << _ticket.x << ", " << _ticket.z << ", " << _ticket.y << ", 'Travel Ticket', 0, 0, 1, default, 0, 0, 0,1, " << _arrivalPlanet << "," << _departurePlanet << ", '" << t_dcity.str().c_str() << "', '" << t_acity.str().c_str() << "', " << _roundtrip << ")";
+	printf("ITQ:\n%s\n",_query.str().c_str());
+	retval = mysql_query(conn,_query.str().c_str());
+	//travel ticket template id is: 14132
+	if(!retval)
+	{
+		retrecord = mysql_insert_id(conn);
+		return retrecord;
+	}
+	else
+	{
+		stringstream toLog;
+		toLog << "InsertTravelTicketToInventory:MySQL:Error:" << retval;
+		Log->cb((char*)toLog.str().c_str());
+		return 0;
+	}
+}
===================================================================
new function for inserting credits to player credits 

+PlayerData DBConnect::UpdateCharacterCredits(PlayerData _pd){
+	stringstream _query;
+	int retval;
+	PlayerData _retPlayerData;
+	_retPlayerData = _pd;
+	_query << "UPDATE `character` SET `invcredits` = " << _pd.invcredits << ", `bankcredits` = " << _pd.bankcredits << " WHERE `character_id` = " << _pd.character_id ;
+	retval = mysql_query(conn,_query.str().c_str());
+	if(!retval)
+	{
+		_retPlayerData = db->GetPlayerData(_pd.character_id);
+		return _retPlayerData;
+	}
+	else
+	{
+		stringstream toLog;
+		toLog << "UpdateCharacterCredits:MySQL:ERROR:" << retval;
+		Log->cb((char*)toLog.str().c_str());
+		return _retPlayerData;
+	}
+}
+
===================================================================
Function for travel tickets to obtain data from the ticket

+Ticket DBConnect::GetTicketDataFromPlayerItem(int _itemID){
+	Ticket retTicket;
+	retTicket.itemID = 0;
+	stringstream _query;
+	MYSQL_RES * _Result;
+	MYSQL_ROW _Row;
+	int retval;
+	
+	_query << "SELECT * FROM `item` WHERE `serial` = " << _itemID << " AND `destroy` = 0 ";
+	printf("Qry Ticket Item\n%s\n",_query.str().c_str());
+	retval = mysql_query(conn,_query.str().c_str());
+	_Result = mysql_use_result(conn);
+	if(_Result)
+	{
+		while((_Row = mysql_fetch_row(_Result)) != NULL)
+		{
+			retTicket.itemID = atoi(_Row[0]);
+			retTicket.departure = _Row[38];
+			retTicket.destination = _Row[39];
+			retTicket.departureplanet = atoi(_Row[37]);
+			retTicket.planet_id = atoi(_Row[36]);
+			retTicket.x = atof(_Row[24]);
+			retTicket.z = atof(_Row[25]);
+			retTicket.y = atof(_Row[26]);
+		}
+		mysql_free_result(_Result);
+		
+		_query.str("");
+		_query << "Select `id` From `tickets` Where `Destination` LIKE '%" << retTicket.destination.c_str() << "%' AND `planet_id` = " << retTicket.planet_id;
+		retval = mysql_query(conn,_query.str().c_str());
+		_Result = mysql_use_result(conn);
+		if(_Result)
+		{
+			while((_Row = mysql_fetch_row(_Result)) != NULL)
+			{
+				retTicket.ticketID = atoi(_Row[0]);
+			}
+			mysql_free_result(_Result);
+		}
+		else
+		{
+			stringstream toLog;
+			toLog << "GetTicketDataFromPlayerItem:MySQL:2:Error:" << retval;
+			Log->cb((char*)toLog.str().c_str());
+		}
+
+
+	}
+	else
+	{
+		stringstream toLog;
+		toLog << "GetTicketDataFromPlayerItem:MySQL:1:Error:" << retval;
+		Log->cb((char*)toLog.str().c_str());
+	}
+	
+
+	return retTicket;
+}
===================================================================
function update to use local variables.

 int DBConnect::GetFirstAvailableItemID() {
-	string query = "Select `serial` from `item`;";
+
+	string _query = "Select `serial` from `item`;";
+	MYSQL_RES * _Result;
+	MYSQL_ROW _Row;
 	int lastItemID = 0;
 	int currentItemID;
 	bool bFound = false;
-	if (!mysql_query(conn, query.c_str())) {
-		Result = mysql_store_result(conn);
-		if (Result) {
-			while (((Row = mysql_fetch_row(Result)) != NULL) && !bFound) {
-				currentItemID = (int)atoi(Row[0]);
-				if (currentItemID > (lastItemID + 1)) {
+	if (!mysql_query(conn, _query.c_str())) 
+	{
+		_Result = mysql_store_result(conn);
+		if (_Result) 
+		{
+			while (((_Row = mysql_fetch_row(_Result)) != NULL) && !bFound) 
+			{
+				currentItemID = (int)atoi(_Row[0]);
+				if (currentItemID > (lastItemID + 1)) 
+				{
 					bFound = true;
-				} else {
+				} else 
+				{
 					lastItemID = currentItemID;
 				}
 			}
-			mysql_free_result(Result);
+			mysql_free_result(_Result);
 		}
 	}
 	return lastItemID + 1;
@@ -3994,4 +4240,516 @@
 		}
 	}
 	return aDespawnedResource;
+}
+
===================================================================
new function to get item data for several other functions. returns one item

+ItemData DBConnect::GetItemData(int _itemID){
+	ItemData tempItem;
+	tempItem.serial = 0;
+	stringstream _query;
+	MYSQL_RES * _Result;
+	MYSQL_ROW _Row;
+	int retval;
+
+	_query << "SELECT * FROM `item` WHERE `serial` = " << _itemID;
+	retval = mysql_query(conn,_query.str().c_str());
+	_Result = mysql_use_result(conn);
+	if(_Result)
+	{
+		while((_Row = mysql_fetch_row(_Result)) != NULL)
+		{
+			tempItem.serial = atoi(_Row[0]);
+			tempItem.salt = atoi(_Row[1]);
+			tempItem.slot = atoi(_Row[2]);
+			tempItem.template_id = atoi(_Row[3]);
+			tempItem.character_id = atoi(_Row[4]);
+			tempItem.inv = atoi(_Row[5]);
+			tempItem.bank = atoi(_Row[6]);
+			tempItem.building = atoi(_Row[7]);
+			tempItem.container_id = atoi(_Row[8]);
+			tempItem.appearance = atoi(_Row[9]);
+			tempItem.equipped = atoi(_Row[10]);
+			tempItem.cur_condition = atoi(_Row[11]);
+			tempItem.max_condition = atoi(_Row[12]);
+			tempItem.min_condition = atoi(_Row[13]);
+			tempItem.dec_condition = atoi(_Row[14]);
+			tempItem.wep_id = atoi(_Row[15]);
+			tempItem.armor_id = atoi(_Row[16]);
+			tempItem.slot_id = atoi(_Row[17]);
+			tempItem.deed_id = atoi(_Row[18]);
+			tempItem.cell_id = atol(_Row[19]);
+			tempItem.oI = atof(_Row[20]);
+			tempItem.oJ = atof(_Row[21]);
+			tempItem.oK = atof(_Row[22]);
+			tempItem.oW = atof(_Row[23]);
+			tempItem.x = atof(_Row[24]);
+			tempItem.z = atof(_Row[25]);
+			tempItem.y = atof(_Row[26]);
+			if(_Row[27] != NULL)
+			{tempItem.item_name = (_Row[27]);}
+			else {tempItem.item_name = "";}
+			tempItem.destroy = atoi(_Row[28]);
+			tempItem.packed = atoi(_Row[29]);
+			tempItem.spawn = atoi(_Row[30]);
+			if(_Row[31] != NULL)
+			{tempItem.destroy_date = (_Row[31]);}
+			else{tempItem.destroy_date = "";}
+			tempItem.resourceToolRangeOption = atoi(_Row[32]);
+			tempItem.resourceToolType = atoi(_Row[33]);
+			tempItem.stack_size = atoi(_Row[34]);
+			tempItem.travelticket = atoi(_Row[35]);
+			tempItem.arrivalplanet = atoi(_Row[36]);
+			tempItem.departureplanet = atoi(_Row[37]);
+			if(_Row[38] != NULL)
+			{tempItem.departurecity = (_Row[38]);}
+			else {tempItem.departurecity = "";}
+			if(_Row[39] != NULL)
+			{tempItem.arrivalcity = (_Row[39]);}
+			else {tempItem.arrivalcity = "";}
+			tempItem.roundtrip = atoi(_Row[40]);
+
+		}
+		mysql_free_result(_Result);
+	}
+	else
+	{
+		stringstream toLog;
+		toLog << "GetItemData:MySQL:Error:" << retval;
+		Log->cb((char*)toLog.str().c_str());
+	}
+	
+	
+	return tempItem;
+}
===================================================================
new function to return a list of items

+list<ItemData> DBConnect::GetItemDataList(int _ObjID){
+	ItemData tempItem;
+	tempItem.serial = 0;
+	list<ItemData> tempList;
+	stringstream _query;
+	MYSQL_RES * _Result;
+	MYSQL_ROW _Row;
+	int retval;
+
+	_query << "SELECT * FROM `item` WHERE `character_id` = " << _ObjID << " AND `destroy` = 0";
+	retval = mysql_query(conn,_query.str().c_str());
+	_Result = mysql_use_result(conn);
+	if(_Result)
+	{
+		while((_Row = mysql_fetch_row(_Result)) != NULL)
+		{
+			tempItem.serial = atoi(_Row[0]);
+			tempItem.salt = atoi(_Row[1]);
+			tempItem.slot = atoi(_Row[2]);
+			tempItem.template_id = atoi(_Row[3]);
+			tempItem.character_id = atoi(_Row[4]);
+			tempItem.inv = atoi(_Row[5]);
+			tempItem.bank = atoi(_Row[6]);
+			tempItem.building = atoi(_Row[7]);
+			tempItem.container_id = atoi(_Row[8]);
+			tempItem.appearance = atoi(_Row[9]);
+			tempItem.equipped = atoi(_Row[10]);
+			tempItem.cur_condition = atoi(_Row[11]);
+			tempItem.max_condition = atoi(_Row[12]);
+			tempItem.min_condition = atoi(_Row[13]);
+			tempItem.dec_condition = atoi(_Row[14]);
+			tempItem.wep_id = atoi(_Row[15]);
+			tempItem.armor_id = atoi(_Row[16]);
+			tempItem.slot_id = atoi(_Row[17]);
+			tempItem.deed_id = atoi(_Row[18]);
+			tempItem.cell_id = atol(_Row[19]);
+			tempItem.oI = atof(_Row[20]);
+			tempItem.oJ = atof(_Row[21]);
+			tempItem.oK = atof(_Row[22]);
+			tempItem.oW = atof(_Row[23]);
+			tempItem.x = atof(_Row[24]);
+			tempItem.z = atof(_Row[25]);
+			tempItem.y = atof(_Row[26]);
+			if(_Row[27] != NULL)
+			{tempItem.item_name = (_Row[27]);}
+			else {tempItem.item_name = "";}
+			tempItem.destroy = atoi(_Row[28]);
+			tempItem.packed = atoi(_Row[29]);
+			tempItem.spawn = atoi(_Row[30]);
+			if(_Row[31] != NULL)
+			{tempItem.destroy_date = (_Row[31]);}
+			else{tempItem.destroy_date = "";}
+			tempItem.resourceToolRangeOption = atoi(_Row[32]);
+			tempItem.resourceToolType = atoi(_Row[33]);
+			tempItem.stack_size = atoi(_Row[34]);
+			tempItem.travelticket = atoi(_Row[35]);
+			tempItem.arrivalplanet = atoi(_Row[36]);
+			tempItem.departureplanet = atoi(_Row[37]);
+			tempItem.departurecity = (_Row[38]);
+			tempItem.arrivalcity = (_Row[39]);
+			tempItem.roundtrip = atoi(_Row[40]);
+			tempList.push_back(tempItem);
+
+		}
+		mysql_free_result(_Result);
+	}
+	else
+	{
+		stringstream toLog;
+		toLog << "GetItemData:MySQL:Error:" << retval;
+		Log->cb((char*)toLog.str().c_str());
+	}
+	
+	
+	return tempList;
+}
===================================================================
new function for getting ticket prices

+int DBConnect::GetTicketPrice(int _FromPlanet,int _ToPlanet){
+	stringstream _query;
+	MYSQL_RES * _Result;
+	MYSQL_ROW _Row;
+	int retval;
+	int TicketPrice = 0;
+
+	_query << "Select * From `ticket_prices` WHERE `fromplanetid` = " << _FromPlanet;
+	retval = mysql_query(conn,_query.str().c_str());
+	_Result = mysql_use_result(conn);
+	if(_Result)
+	{
+		while((_Row = mysql_fetch_row(_Result)) != NULL)
+		{
+			TicketPrice = atoi(_Row[(_ToPlanet+1)]);
+		}
+		mysql_free_result(_Result);
+	}
+	else
+	{
+		stringstream toLog;
+		toLog << "GetTicketPrice:MySQL:Error:" << retval;
+		Log->cb((char*)toLog.str().c_str());
+	}
+
+	return TicketPrice;
+}
+
===================================================================
new function to add friends

+bool DBConnect::AddFriend(int _ObjID,string _FriendName,string _GalaxyName){
+	bool ret = false;
+	stringstream tempFriendName;
+	stringstream temp_GalaxyName;
+	stringstream _query;
+	MYSQL_RES * _Result;
+	MYSQL_ROW _Row;
+	int _GalaxyID = db->GalaxyID;
+	int retval;
+	int FriendID = 0;
+	int exists = false;
+
+	for(int i=0;i<_GalaxyName.length();i++)
+	{
+		string t;
+		t = _GalaxyName[i];
+		if(!strcmp(t.c_str(),"'"))
+		{
+			temp_GalaxyName << "\\" << _GalaxyName[i];
+		}
+		else
+		{
+			temp_GalaxyName << _GalaxyName[i];
+		}
+	}
+
+	for(int i=0;i<_FriendName.length();i++)
+	{
+		string t;
+		t = _FriendName[i];
+		if(!strcmp(t.c_str(),"'"))
+		{
+			tempFriendName << "\\" << _FriendName[i];
+		}
+		else
+		{
+			tempFriendName << _FriendName[i];
+		}
+	}
+	_query << "Select `id` From `galaxy` Where `name` = '" << temp_GalaxyName.str().c_str() << "'";
+	printf("\n%s\n",_query.str().c_str());
+	retval = mysql_query(conn,_query.str().c_str());
+	_Result = mysql_use_result(conn);
+	if(_Result)
+	{
+		while((_Row = mysql_fetch_row(_Result)) != NULL)
+		{
+			_GalaxyID = atoi(_Row[0]);
+		}
+		mysql_free_result(_Result);
+	}
+
+	_query.str("");
+	_query << "Select `character_id` From `character` Where `firstname` = '" << tempFriendName.str().c_str() << "' AND `galaxy_id` = " << _GalaxyID;
+	printf("\n%s\n",_query.str().c_str());
+	retval = mysql_query(conn,_query.str().c_str());
+	_Result = mysql_use_result(conn);
+	if(_Result)
+	{
+		while((_Row = mysql_fetch_row(_Result)) != NULL)
+		{
+			if(_Row[0] != NULL)
+			{
+				FriendID = atoi(_Row[0]);
+			}
+			mysql_free_result(_Result);
+			_query.str("");
+			_query << "Select * From `friendlist` Where `character_id` = " << _ObjID << " AND `friend_id` = " << FriendID;
+			printf("\n%s\n",_query.str().c_str());
+			retval = mysql_query(conn,_query.str().c_str());
+			_Result = mysql_use_result(conn);
+			if(_Result)
+			{
+				while((_Row = mysql_fetch_row(_Result)) != NULL)
+				{
+					if(atoi(_Row[2]) == FriendID)
+					{
+						exists = true;
+					}
+				}
+				mysql_free_result(_Result);
+				if(exists)
+				{
+					_query.str("");
+					_query << "Update `friendlist` SET `destroy` = 0";
+					printf("\n%s\n",_query.str().c_str());
+					retval = mysql_query(conn,_query.str().c_str());
+					if(!retval)
+					{
+						return true;
+					}
+				}
+				else
+				{
+					_query.str("");
+					_query << "Insert Into `friendlist` VALUES (default,"<< _ObjID << "," << FriendID << ", 0, default,"<< _GalaxyID << ");";
+					printf("\n%s\n",_query.str().c_str());
+					retval = mysql_query(conn,_query.str().c_str());
+					if(!retval)
+					{
+						return true;
+					}
+				}
+			}
+			else
+			{
+				_query.str("");
+				_query << "Insert Into `friendlist` VALUES (default,"<< _ObjID << "," << FriendID << ", 0, default,"<< _GalaxyID << ");";
+				printf("\n%s\n",_query.str().c_str());
+				retval = mysql_query(conn,_query.str().c_str());
+				if(!retval)
+				{
+					return true;
+				}
+			}
+		}
+	}
+	else
+	{
+		stringstream toLog;
+		toLog << "AddFriend:Mysql:1:Error:" << retval;
+		Log->cb((char*)toLog.str().c_str());
+	}
+
+	return ret;
+}
===================================================================
new function to remove a friend

+bool DBConnect::RemoveFriend(int _ID){
+	
+	int retval;
+	stringstream _query;
+	_query << "Update `friendlist` SET `destroy` = 1, `destroy_date` = now() WHERE `id` = " << _ID;
+	retval = mysql_query(conn,_query.str().c_str());
+	if(!retval)
+	{
+		return true;
+	}
+	else
+	{
+		return false;
+	}
+}
===================================================================
new function to return a friends data

+list<FriendData> DBConnect::GetFriendsList(int _ObjID){
+	list<FriendData> returnList;
+	FriendData tempFriend;
+	stringstream _query;
+	int retval;
+	MYSQL_RES * _Result;
+	MYSQL_ROW _Row;
+
+	_query << "Select * From `friendlist` Where `character_id` = " << _ObjID << " AND `destroy` = 0";
+	retval = mysql_query(conn,_query.str().c_str());
+	_Result = mysql_use_result(conn);
+	if(_Result)
+	{
+		while((_Row = mysql_fetch_row(_Result)) != NULL)
+		{
+				tempFriend._FriendID = atoi(_Row[2]);
+				tempFriend._ObjID = atoi(_Row[1]);
+				tempFriend.id = atoi(_Row[0]);
+				tempFriend.friendGalaxyID = atoi(_Row[5]);
+				tempFriend.onlineStatus = 0x00;
+				returnList.push_back(tempFriend);
+		}
+		mysql_free_result(_Result);
+	}
+	else
+	{
+		stringstream toLog;
+		toLog << "GetFriendsList:Mysql:1:Error:" << retval;
+		Log->cb((char*)toLog.str().c_str());
+	}
+	for(std::list<FriendData>::iterator fl = returnList.begin(); fl != returnList.end();fl++)
+	{
+		PlayerData tempPD;
+		tempPD = db->GetPlayerData(fl->_FriendID);
+		fl->_FriendName = tempPD.firstname.c_str();
+	}
+	return returnList;
+}
+
===================================================================
new function to get template data from the world objects table

+int DBConnect::GetClientWorldObjectTemplateID(int _ItemID){
+
+	stringstream _query;
+	int retval;
+	MYSQL_RES * _Result;
+	MYSQL_ROW _Row;
+	int _retTemplate = 0;
+
+	_query << "SELECT `template_id` From `worldobjects` WHERE `id` = " << _ItemID;
+
+	retval = mysql_query(conn,_query.str().c_str());
+	_Result = mysql_use_result(conn);
+	if(_Result)
+	{
+		while((_Row = mysql_fetch_row(_Result)) != NULL)
+		{
+			_retTemplate = atoi(_Row[0]);
+		}
+		mysql_free_result(_Result);
+	}
+	else
+	{
+		stringstream toLog;
+		toLog << "GetClientWorldObjectTemplateID:MySQL:Error:" << retval << " itemID: " << _ItemID;
+		Log->cb((char*)toLog.str().c_str());
+	}
+
+	return _retTemplate;
+}
===================================================================
new function to return radial options for any item, this table has to be populated in order to be used

+string DBConnect::GetRadialOptionsList(uint32 _crc, long _itemID, long _templateID) {
+	stringstream _query;
+	string RadialTextData;
+	int retval;
+	MYSQL_RES * _Result;
+	MYSQL_ROW _Row;	
+
+	
+	_query << "Select * From `radialoptions` WHERE `crc` = " << _crc << " AND `itemid` = " << _itemID << " AND `templateid` = " << _templateID;
+	printf("Q:%s\n",_query.str().c_str());
+	retval = mysql_query(conn,_query.str().c_str());
+	_Result = mysql_use_result(conn);
+	if(_Result)
+	{
+		while((_Row = mysql_fetch_row(_Result)) != NULL)
+		{
+			RadialTextData = _Row[4];
+		}
+		mysql_free_result(_Result);
+	}
+	else
+	{
+		stringstream toLog;
+		toLog << "GetRadialOptionsList:MySQL:Error:" << retval << "\n";
+		Log->cb((char*)toLog.str().c_str());
+	}
+	
+	return RadialTextData.c_str();
+}
===================================================================
This function runs on startup and corrects any new items in the 
item template table  that dont have a proper crc value.
if the crc value is 0 or null it will calculate the proper crc and
save it to the db.


+void DBConnect::SetCRCValuesToTemplates(){
+
+	MYSQL_RES * _Result;
+	MYSQL_ROW _Row;
+	stringstream _query;
+	stringstream toLog;
+	int retval;
+	templateData tempTemplate;
+	list<templateData> temTemplateList;
+
+	_query << "Select * From `item_template` WHERE `crc` = 0";
+	retval = mysql_query(conn,_query.str().c_str());
+	_Result = mysql_use_result(conn);
+	if(_Result)
+	{
+		while((_Row = mysql_fetch_row(_Result)) != NULL)
+		{
+			tempTemplate.id = atoi(_Row[0]);
+			tempTemplate.hasSerial = (bool)atoi(_Row[1]);
+			if(_Row[2] != NULL)
+			{tempTemplate.item_model = ("%s",_Row[2]);}
+			else
+			{tempTemplate.item_model="";}
+			if(_Row[3] != NULL)
+			{tempTemplate.itemName = atoi(_Row[3]);}
+			else
+			{tempTemplate.itemName = "";}
+			if(_Row[4] != NULL)
+			{tempTemplate.requiredskill = atoi(_Row[4]);}
+			else
+			{tempTemplate.requiredskill = 0;}
+			if(_Row[5] != NULL)
+			{tempTemplate.requiredspecies = atoi(_Row[5]);}
+			else
+			{tempTemplate.requiredspecies = 0;}
+			if(_Row[6] != NULL)
+			{tempTemplate.appearance = atoi(_Row[6]);}
+			else
+			{tempTemplate.appearance = 0;}
+			if(_Row[6] != NULL)
+			{tempTemplate.stat_id = atoi(_Row[6]);}
+			else
+			{tempTemplate.stat_id = 0;}
+			if(_Row[7] != NULL)
+			{tempTemplate.itemCRC = atol(_Row[7]);}
+			else
+			{tempTemplate.itemCRC = 0;}
+			tempTemplate.cell_count = atoi(_Row[8]);
+			if(_Row[9] != NULL)
+			{tempTemplate.STFName = atoi(_Row[9]);}
+			else
+			{tempTemplate.STFName = "";}
+			temTemplateList.push_back(tempTemplate);
+		}
+		mysql_free_result(_Result);
+	}
+	else
+	{
+		toLog.str("");
+		toLog << "SetCRCValuesToTemplates:MySQL:Error:" << retval << "\n";
+		Log->cb((char*)toLog.str().c_str());
+	}
+	if(temTemplateList.size() >= 1)
+	{
+		for(std::list<templateData>::iterator td = temTemplateList.begin(); td != temTemplateList.end(); td++)
+		{
+			_query.str("");
+			_query << "Update `item_template` SET `crc` = " << SWGCRC(td->item_model.c_str()) << " WHERE `template_id` = " << td->id;
+			retval = mysql_query(conn,_query.str().c_str());
+			if(!retval)
+			{
+				toLog.str("");
+				toLog << "SetCRCValuesToTemplates: Correction Made: TemplateID:" << td->id << " Model:" << td->item_model.c_str() << "\n";
+				Log->cb((char*)toLog.str().c_str());
+				_query << "\n";
+				Log->cb((char*)_query.str().c_str());
+			}
+			else
+			{
+				toLog.str("");
+				toLog << "SetCRCValuesToTemplates:MySQL:Error:" << retval << " While correcting CRC for Template ID:" << td->id << "\n";
+				Log->cb((char*)toLog.str().c_str());
+			}
+		}
+	}
+	
+	toLog.str("");
+	toLog << "SetCRCValuesToTemplates:CRC Corrections Made:" << temTemplateList.size() << "\n";
+	Log->cb((char*)toLog.str().c_str());
+	return;
 }
\ No newline at end of file

Index: C:/Software/SWG Pre-CU/Closed2/src/shared/Database.h
===================================================================

changes to add several functions and update structures for data
This allows additions of friends lists waypoints frined waypoints and many other changes

--- C:/Software/SWG Pre-CU/Closed2/src/shared/Database.h	(revision 327)
+++ C:/Software/SWG Pre-CU/Closed2/src/shared/Database.h	(working copy)
@@ -86,6 +86,7 @@
 
 #include "ByteBuffer.h"
 #include <mysql.h>
+
 //
 
 
@@ -440,8 +441,6 @@
 		int base_id;
 		int terminal_id;
 		int sign_id;
-
-
 };
 
 struct Terminal
@@ -462,6 +461,8 @@
 	string dancestring;
 	int posture;
 	int type;
+	bool travelterminal;
+	int ticketid;
 };
 
 struct Galaxy {
@@ -544,10 +545,20 @@
   int invcredits;
   int bankcredits;
   long cell_id;
-  //int lvlgm;
+  int lvlgm;
   bool gm;
+  bool afk;
+  int friend_waypoint_id;
 };
 
+struct RadialOptions {
+			uint16 OptionNum;
+			uint16 ParentMenuID;
+			uint16 OptionID;
+			uint16 unk2;
+			string unkStr;
+};
+
 struct Email {
 	int ID;
 	string Subject;
@@ -606,6 +617,9 @@
 	long CellID;
 	string dancestring;
 	int posture;
+	string script;
+	bool ticketdroid;
+	int ticketid;
 };
 struct CellObject
 {
@@ -625,6 +639,7 @@
 {
 	string name;
 	string object_iff;
+	
 	int number_cells;
 	int deed_type;
 	string object_base;
@@ -672,8 +687,6 @@
 	float sign_ssoJ;
 	float sign_ssoK;
 	float sign_ssoW;
-
-
 	int maintenance_rate;
 };
 
@@ -681,11 +694,23 @@
 {
 	int planet_id;
 	string destination;
+	string departure;
+	int departureplanet;
 	float x;
 	float z;
 	float y;
 	int cost;
+	int ticketID;
+	int itemID;
+	bool shuttle;
+	bool starport;
+	bool playercityshuttle;
 };
+struct _Attribute
+{
+	string sAttributeName;
+	string sAttributeValue;
+};
 struct _EmailRouterFlags {
 			bool EmailsPendingRouting;
 			int UserID;
@@ -702,10 +727,62 @@
 
 };
 struct templateData{
+	int id;
+	bool hasSerial;
 	string itemName;
 	uint32 itemCRC;
+	string STFName;
+	string item_model;
+	int requiredskill;
+	int requiredspecies;
+	int appearance;
+	int stat_id;
+	int cell_count;
 };
+struct ItemData {
+	int serial;
+	int salt;
+	int slot;
+	int template_id;
+	int character_id;
+	bool inv;
+	bool bank;
+	bool building;
+	int container_id;
+	int appearance;
+	bool equipped;
+	unsigned int cur_condition;
+	unsigned int max_condition;
+	unsigned int min_condition;
+	unsigned int dec_condition;
+	unsigned int wep_id;
+	unsigned int armor_id;
+	int slot_id;
+	int deed_id;
+	int cell_id;
+	float oI;
+	float oJ;
+	float oK;
+	float oW;
+	float x;
+	float z;
+	float y;
+	string item_name;
+	bool destroy;
+	bool packed;
+	bool spawn;
+	string destroy_date;
+	int resourceToolRangeOption;
+	int resourceToolType;
+	int stack_size;
+	bool travelticket;
+	int arrivalplanet;
+	int departureplanet;
+	string departurecity;
+	string arrivalcity;
+	bool roundtrip;
 
+};
 struct Waypoints {
 	 int waypointID;
 	 int characterID;
@@ -718,6 +795,14 @@
 	 bool bActive;
 	 int iGalaxyID;
 };
+struct FriendData {
+	int id;
+	int _ObjID;
+	int _FriendID;
+	string _FriendName;
+	int friendGalaxyID;
+	byte onlineStatus;
+};
 
 class DBConnect
 {
@@ -784,7 +869,8 @@
 			int container;
 			long int appearance;
 			int equipped;
-			list<Item>* GetInventory(uint64 characterid, uint64 containerid);
+			list<Item> GetInventory(uint64 characterid);
+			
 
 			//Game Features Values
 			bool flatten_name;// = false;
@@ -806,33 +892,33 @@
 			string lang_value;// = "en";
 		//Galaxy Map
 		
-		list<LClientCharacterInfo> *lLoadClientCharactersFromDatabase(int iClientID);
-		list<CellObject> * GetCellObjects(int cell_id);
+		list<LClientCharacterInfo> lLoadClientCharactersFromDatabase(int iClientID);
+		list<CellObject>  GetCellObjects(int cell_id);
 		int CanLogin(string username,string password,string version);
 		void CreateNewUser(string username, string password, string version);
 		int CreateNewCharacter(string sFirstName, string sLastName, unsigned int iStationID, unsigned int iGalaxyID, uint32 iAppearanceCRC, float fScale, string sBiography, int iSpecies, unsigned int iGuildID, int x, int z, int y, unsigned int iPlanetID, unsigned int iInstanceID, uint8 * appearanceData, int appLen, string hairObject, int hairlen,uint8 * hairCustomData, int hairCustomDataLen, string newCharacterProfession, long _cellID);
         int CheckNewCharacterName(string sFirstName, string sLastName, int _iRaceIndex);
 		bool DeleteCharacter(int character_id, int galaxy_id);
 		bool DeleteItem(uint64 serial_item);
-		list<Galaxy> * GrabGalaxyInfo();
-		list<Building> * SpawnBuildings(int _planetID);
+		list<Galaxy>  GrabGalaxyInfo();
+		list<Building> SpawnBuildings(int _planetID);
 		//bool bDoesQueryExist(string query);
 		//bool bDidQueryExecute(string query);
 		int AddNewBuilding(uint32 building_crc, int cellnumber, float oI, float oJ, float oK, float oW, float x, float z, float y, int planet_id,uint32 _ObjID, int _baseID,int _terminal_id,int _sign_id,int _maintenance_pool , int _maintenance_rate );
 		bool isTerminal(int uItemID);
-		list<Terminal> * GetTerminal(int _planetID);
+		list<Terminal>  GetTerminal(int _planetID);
 		void InsertStarterItems(string profession, int _iRaceIndex, int character);
-		void InsertItem( uint64 serial, bool equiped, int armorstat_id, int weaponstat_id, int slot_id, int character, int template_num, int deed_id, string _itemName, int stackSize);
+		void InsertItem( uint64 serial, bool equiped, int armorstat_id, int weaponstat_id, int slot_id, int character, int template_num, int deed_id, string _itemName, int stackSize, int containerID);
 		int GetGalaxyID();
 		int GetMinRow(string table , string idcol);
 		int GetMaxRow(string table , string idcol);
 		//uint32 GetSpeciesFromAppearance(string appearance); removed no longer needed PF 06-22-07
-		list<DeedObject> * InventoryDeed(uint64 serialid);
-		list<StaticNPC> * SpawnStaticNPCs(int _planetID);
-		list<DeedObject> * GetDeedObject(int id);
-		list<Galaxy> * Servers;
-	    list<Item> * Inventory;
-		list<Building> * Buildings;
+		list<DeedObject>  InventoryDeed(uint64 serialid);
+		list<StaticNPC> SpawnStaticNPCs(int _planetID);
+		list<DeedObject> GetDeedObject(int id);
+		list<Galaxy>  Servers;
+	    list<Item>  Inventory;
+		list<Building>  Buildings;
 		PlayerData GetPlayerData(int char_id);
 		int GetIntFromQuery(string _query);
 		// Removed not used uint32 GetCRCFromAppearance(int itemID);
@@ -853,7 +939,7 @@
 		size_t DecodeSQL (const char *iSqlStr, void *oData, size_t oDataSize);
 		void UpdatePlayerPos(PlayerData _pdToUpdate, bool _FlagCell, long cell_id);
 		//void DBUpdateItemContainment(int item_id, bool equipped);
-		list<Ticket> * GetTickets(int planet_id);
+		list<Ticket> GetTickets(int planet_id,bool shuttles);
 		StaticNPC AddStaticNPC(StaticNPC _npcData);
 		Terminal AddTerminal(Terminal _terminalData);
 		templateData GetTemplateData(int templateID);
@@ -877,7 +963,7 @@
 		bool UpdateItemEquippedStatus(uint64 _ItemID, bool _status);
 		bool DeleteCharacterBuildings(int _character_id, int _galaxy_id);
 		Email GetEmailContent(int _EmailID);
-		list <Email> * GetEmailHeaders(int _recipient);
+		list <Email>  GetEmailHeaders(int _recipient);
 		
 		bool DeleteEmail(int _EmailID);
 		int SaveWaypoint(int _character_id,string _name,int _planet_id,float _x,float _z,float _y,bool _active,int _mission_id,bool _default,int _galaxy_id);
@@ -887,7 +973,7 @@
 		void ToggleWaypointStatus(int _dbID,bool _status);
 		void RenameWaypoint(int _dbID,string _wpName);
 		bool DeleteWaypoint(int _wpID);
-		list<_EmailAttachment> * GetEmailAttachments(int _EmailID);
+		list<_EmailAttachment>  GetEmailAttachments(int _EmailID);
 		bool GetGmStatus(int _AccountID);
 		void UpdateResourceToolRangeOption(unsigned int iRangeOption, unsigned int itemID);
 		unsigned int GetResourceToolRangeOption(unsigned int itemID);
@@ -895,8 +981,24 @@
 		unsigned int GetResourceSpawnIDByResourceName(string resourceName);
 		int GetFirstAvailableWaypointID();
 		void UpdateWaypointCoordinates(uint64 ObjID, int waypointID, float x, float z, float y, int galaxyID);
+		void UpdateCharacterFriendWaypointID(int _ObjID,int _wpID);
+		int InsertTravelTicketToInventory(Ticket _ticket,string _destinationCity,string _departureCity, int _departurePlanet,int _arrivalPlanet,bool _roundtrip,int _ObjID);
 		int GetFirstAvailableItemID();
 
+		PlayerData UpdateCharacterCredits(PlayerData _pd);
+		Ticket GetTicketDataFromPlayerItem(int _itemID);
+		ItemData GetItemData(int _itemID);
+		list<ItemData> GetItemDataList(int _ObjID);
+		int GetTicketPrice(int _FromPlanet,int _ToPlanet);
+		bool AddFriend(int _ObjID,string _FriendName,string _GalaxyName);
+		bool RemoveFriend(int _ID);
+		list<FriendData> GetFriendsList(int _ObjID);
+		int GetClientWorldObjectTemplateID(int _ItemID);
+		string GetRadialOptionsList(uint32 _crc ,long _itemID ,long _templateID);
+		
+		void SetCRCValuesToTemplates();
+
+		
 };
 
 #define db DBConnect::getdbObject()

Index: C:/Software/SWG Pre-CU/Closed2/src/shared/opcodes.h
===================================================================
new op codes added for new packets

--- C:/Software/SWG Pre-CU/Closed2/src/shared/opcodes.h	(revision 327)
+++ C:/Software/SWG Pre-CU/Closed2/src/shared/opcodes.h	(working copy)
@@ -167,8 +167,13 @@
 	ResourceListForSurveyMessage			= 0x8A64B1D5,
 	PlayClientEffectLocMessage				= 0x02949E74,
 	SurveyMessage							= 0x877F79AC,
+	AttributesList							= 0XF3F12F2A,
+	FriendListRequestResponse				= 0xE97AB594,
+	ChatFriendOnlineUpdate					= 0x6CD2FCD8,
+	ChatFriendOfflineUpdate					= 0x54336726,
 
 
+
 //BOTH
 	CmdSceneReady							= 0x43FD1C22,
 	ObjControllerMessage					= 0x80CE5E46,
@@ -183,6 +188,7 @@
 	CommandQueueEnqueue				= 0x00000116,
 	ObjectMenuRequest				= 0x00000146,
 	UseItem							= 0x00000126,
+	RefreshMissionList				= 0x000000F5,
 //Server->Client
 	ObjectMenuResponse				= 0x00000147,
 	PlayerEmote						= 0x0000012E,
@@ -205,13 +211,19 @@
 	requestcraftingsession          = 0x094AC516,
     commandstartmusic               = 0xDDD1E8F1,
 	commandstartdance               = 0x7B1DCBE0,
-	commanditemradialop1			= 0x164550EF,
+	getattributesbatch				= 0x164550EF,
 	emailrelatedenqueurequest   	= 0xEF21F9CE,
 	ClientRequestSlashWay			= 0x640543FE,
 	ToggleWaypointStatus			= 0xC3EDA6B6,
 	ClientRenameWaypoint			= 0x398F891A,
 	RequestSurveySession			= 0xC00CFA18,
 	RequestCoreSample				= 0x9223C634,
+	toggleawayfromkeyboard			= 0x9B9FE4A8,
+	findfriend						= 0x30BE6EE9,
+	addfriend						= 0x2A2357ED,
+	removefriend					= 0x8E9091D7,
+	burstrun						= 0xFC3D1CB2,
+	SetGodMode						= 0x6CAFFD66,
 };
 
 
Index: C:/Software/SWG Pre-CU/Closed2/src/ZoneServer/Constants.h
===================================================================

New handler added
+	{RefreshMissionList,		"	---RefreshMissionList \n",	    &ZClient::HANDLE_ObjController_RefreshMissionList       },
+
REMOVED -	{commanditemradialop1,		"    ----use item radial option 1 \n",  &ZClient::HANDLE_ObjController_CommandQueueEnqueue_itemradialop1		    },
CHANGED TO+	{getattributesbatch,		"    ----getattributesbatch \n",		&ZClient::HANDLE_ObjController_CommandQueueEnqueue_getattributesbatch	    },
UPDATED +	{toggleawayfromkeyboard,	"    ----toggleawayfromkeyboard \n",	&ZClient::HANDLE_ObjController_CommandQueueEnqueue_toggleawayfromkeyboard	},
ADDED +	{findfriend,				"    ----findfriend \n",				&ZClient::HANDLE_ObjController_CommandQueueEnqueue_findfriend				},
ADDED +	{addfriend,					"    ----addfriend \n",					&ZClient::HANDLE_ObjController_CommandQueueEnqueue_addfriend				},
ADDED +	{removefriend,				"    ----removefriend \n",				&ZClient::HANDLE_ObjController_CommandQueueEnqueue_removefriend				},
ADDED +	{burstrun,					"	 ----burstrun \n",					&ZClient::HANDLE_ObjController_CommandQueueEnqueue_burstrun 				},
ADDED +	{SetGodMode,				"    ----SetGodMode \n",				&ZClient::HANDLE_ObjController_CommandQueueEnqueue_SetGodMode				},
 };
 
+#define	QUEUE_ToggleAFKDelta								(&ZClient::BUILD_ToggleAFKDelta)
+#define	QUEUE_UpdateNPCTransformMessage						(&ZClient::BUILD_UpdateNPCTransformMessage)
+#define QUEUE_UpdateNPCTransformParentMessage				(&ZClient::BUILD_UpdateNPCTransformParentMessage)
+#define QUEUE_SUI_TicketPurchaseComplete					(&ZClient::BUILD_SUI_TicketPurchaseComplete)
+#define QUEUE_BankCreditsUpdateDelta						(&ZClient::BUILD_BankCreditsUpdateDelta)
+#define QUEUE_InventoryCreditsUpdateDelta					(&ZClient::BUILD_InventoryCreditsUpdateDelta)
+#define QUEUE_TicketPurchaseFlyText							(&ZClient::BUILD_TicketPurchaseFlyText)
+#define QUEUE_SendAttributesBatch							(&ZClient::BUILD_SendAttributesBatch)
+#define QUEUE_SUI_MessageBox								(&ZClient::BUILD_SUI_MessageBox)
+#define QUEUE_NoTravelTicket								(&ZClient::BUILD_NoTravelTicket)
+#define QUEUE_FriendListRequestResponse						(&ZClient::BUILD_FriendListRequestResponse)
+#define QUEUE_FriendListDeltasMessage						(&ZClient::BUILD_FriendListDeltasMessage)
+#define QUEUE_DeltasMessage_FriendListUpdate				(&ZClient::BUILD_DeltasMessage_FriendListUpdate)
+#define QUEUE_ObjControllerMessage_FriendListUpdate			(&ZClient::BUILD_ObjControllerMessage_FriendListUpdate)
+#define QUEUE_FriendOnlineStatusUpdate						(&ZClient::BUILD_FriendOnlineStatusUpdate)
+#define QUEUE_FriendOfflineStatusUpdate						(&ZClient::BUILD_FriendOfflineStatusUpdate)
+#define QUEUE_ChatAccountUpdate								(&ZClient::BUILD_ChatAccountUpdate)
+#define QUEUE_FriendAddedFlyText							(&ZClient::BUILD_FriendAddedFlyText)
+#define QUEUE_FriendRemovedFlyText							(&ZClient::BUILD_FriendRemovedFlyText)
+


=============================================================== 
Added Offset list for testing and identifying an object

 const static long OffsetList[] = {
-	NPC_OFFSET,
-	BUILDINGS_OFFSET,
-	CELL_ITEM_OFFSET,
-	WORLD_OBJECT_OFFSET,
-	ITEM_OFFSET,
-	DATAPAD_WAYPOINT_OFFSET,
-	TERMINAL_OFFSET,
-	INSTANCE_OFFSET,
+	NPC_OFFSET,//0
+	BUILDINGS_OFFSET,//1
+	CELL_ITEM_OFFSET,//2
+	WORLD_OBJECT_OFFSET,//3
+	ITEM_OFFSET,//4
+	DATAPAD_WAYPOINT_OFFSET,//5
+	TERMINAL_OFFSET,//6
+	INSTANCE_OFFSET,//7
 };
==================================================================
Added Offset names list so we can printouts or use as needed
 const static char* OffsetNames[] = {
-	"NPC",
-	"BUILDING",
-	"CELL_ITEM",
-	"WORLD_OBJECT",
-	"ITEM",
-	"DATAPAD_WAYPOINT",
-	"TERMINAL",
-	"INSTANCE",
+	"NPC",//0
+	"BUILDING",//1
+	"CELL_ITEM",//2
+	"WORLD_OBJECT",//3
+	"ITEM",//4
+	"DATAPAD_WAYPOINT",//5
+	"TERMINAL",//6
+	"INSTANCE",//7
+	"PLAYER",//8
+	"CLIENT_OBJECT",//9
+};
=========================================================
added a const for travel ticket will prolly remove later
+const static unsigned long TRAVEL_TICKET = 3667975811;
+
==========================================================
this staic is used to generate serial numbers for items based on the item id
+const static char* serialNumbers[] = {
+"k",
+"9",
+"1",
+"g",
+"3",
+"5",
+"d",
+"e",
+"7",
+"a",
+
 };
\ No newline at end of file

Index: C:/Software/SWG Pre-CU/Closed2/src/ZoneServer/HandleZone.cpp
===================================================================

New code added to identify objects to handle menus item use requests and many more things properly

--- C:/Software/SWG Pre-CU/Closed2/src/ZoneServer/HandleZone.cpp	(revision 327)
+++ C:/Software/SWG Pre-CU/Closed2/src/ZoneServer/HandleZone.cpp	(working copy)
@@ -269,10 +269,10 @@
 			//		db->SaveWaypoint(character_id, "Starting location", newbiePlanetID, newbieX,
 			//			newbieZ, newbieY, true, 0, true, db->GalaxyID); 
 			//	} else {
-					db->SaveWaypoint(character_id, "Starting location", 5, -5152,
+					db->SaveWaypoint(character_id, "Starting Location", 5, -5152,
 						0, 4293, false, 0, true, db->GalaxyID);
 			//	}
-				vClientWaypoints = db->LoadWaypoints(character_id, db->GalaxyID);	
+				ZClient::vClientWaypoints = db->LoadWaypoints(character_id, db->GalaxyID);	
 				SEND_QueuedPackets(PLAYER,false);
 
 				Email eml;
@@ -282,6 +282,28 @@
 				welcomeMessage << "\n\nSWG Pre-CU Dev Team\n";
 				
 				eml = db->RouteNewEmailFromUser(0,tempFirstName.c_str(),time(0),"Welcome to SWG Pre-CU!",welcomeMessage.str().c_str(),false);
+			/*	Removed for the time being.	Message Causes Client Crash. */
+			/*	welcomeMessage.str("");
+				welcomeMessage << "You have taken your first steps into the immense universe of Star Wars.";
+				welcomeMessage << "This game mail is meant to give you a quick welcome and overview. ";
+				welcomeMessage << "If you need additional details on any system, don't be afraid to bring up the Holocron (default CTRL H). ";
+				welcomeMessage << "It offers easy to navigate chapters that not only teach you the game, but also give you starting missions.";
+				welcomeMessage << "Unlike many other games, there is no linear direction to Star Wars Galaxies. The 'point' of the game is to live in and interact with the Star Wars universe in a way you never have been able to before.";
+				welcomeMessage << "If you are looking for a little direction to get you started, we recommend finding a local mission terminal to take some missions. ";
+				welcomeMessage << "After making some credits doing simple delivery or destroy missions, you may want to start upgrading your equipment. ";
+				welcomeMessage << "Eventually, you'll want to converse with non-player character to find more interesting and lucrative missions or you may want to head to the adventure Theme Parks like Jabba's Palace on Tatooine. ";
+				welcomeMessage << "After that, your goals are largely determined by what you are interested in. For example, you may want to join the Rebellion or Empire and work your way up through the military ranks. ";
+				welcomeMessage << "You may wish to master multiple professions and become renown throughout the planet for your skills. ";
+				welcomeMessage << "You may want to acquire, make or sell the best equipment in the galaxy. You might want to explore the ten worlds and find a perfect spot to build your home. ";
+				welcomeMessage << "You may even want to try to unlock the secret to opening a second character slot that is Force Sensitive (warning this is extremely difficult, mysterious and dangerous). ";
+				welcomeMessage << "The choice is really up to you. Your best source for in-depth information on the game will come from other players. ";
+				welcomeMessage << "You can find players who are ready and willing to answer your questions right now by typing '/who newbiehelper'. ";
+				welcomeMessage << "Simply pick one of the list and send your question by typing '/tell [player name] I'm new, could you please help me?' As a final note, the game is designed around the recommended default SWG controls. ";
+				welcomeMessage << "However if you are more comfortable with a different control set up (EQ style, FPS style or Isometric style) you can quickly remap the entire keyboard layout in the Option menus (default CTRL O - Controls tab - Keymap button - use the dropdown menu). ";
+				welcomeMessage << "On behalf of the entire SWG Pre-CU development team, thank you and enjoy your time in Star Wars Galaxies. ";
+
+				eml = db->RouteNewEmailFromUser(0,tempFirstName.c_str(),time(0),"Welcome to Star Wars Galaxies",welcomeMessage.str().c_str(),false);
+				*/
 				if(Tutorial)
 				{
 					welcomeMessage.str("");
@@ -307,7 +329,7 @@
 				//error code goes here
 				if(nameResponseCode != 0)
 				{
-					
+					SendPlayerErrorMessage(NameResponseCodes[nameResponseCode],NameResponseCodes[nameResponseCode]);
 				}
 				QueuePacket(QUEUE_ClientCreateCharacterFailed);
 				SEND_QueuedPackets(PLAYER,false);
@@ -329,12 +351,22 @@
 	//printf("\nHere\n");
 	ObjID = Packet.readLONG();
 	debug = false;
-	
-	PlayerSpawnedObjects = new list <_PlayerSpawnedObjects>;
-	EmailAttachmentList = new list<_EmailAttachment>;
-	vClientWaypoints = db->LoadWaypoints(ObjID, db->GalaxyID);
+	welcomeSent = false;
+	PlayerSpawnedObjects.clear();
+	EmailAttachmentList.clear();
+	lAttributes.clear();
+	friendListUpdateCounter = 0;
+	friendLastListUpdate = time(0);
+	spaceLaunch = false;
+	spaceCmdStartScene = 1;
+	jtlW = 1.0;
+	ZClient::vClientWaypoints = db->LoadWaypoints(ObjID, db->GalaxyID);
+	ZClient::FriendList = db->GetFriendsList(ObjID);
+
+
 	PlayerData LoadedPlayerInfo = db->GetPlayerData(ObjID);
-	
+	CharacterData = db->GetPlayerData(ObjID);
+
 		//--
 	iRaceID = LoadedPlayerInfo.appearance_crc;
 	planetID = LoadedPlayerInfo.planet_id;
@@ -359,10 +391,10 @@
 	
 	
 	//SpawnBuildings Here
-	list<Building> * Buildings = db->SpawnBuildings(planetID);
-	if(Buildings->size() != 0)
+	list<Building>  Buildings = db->SpawnBuildings(planetID);
+	if(Buildings.size() != 0)
 	{
-		for (std::list<Building>::iterator it = Buildings->begin(); it != Buildings->end(); ++it) 
+		for (std::list<Building>::iterator it = Buildings.begin(); it != Buildings.end(); ++it) 
 		{
 			//stringstream query;
 			//query << "SELECT planet_id FROM character WHERE character_id =" << ObjID;
@@ -378,8 +410,9 @@
 		
 	//Spawn the player character, has tto spawn after buildings or we have a problem and stay stuck when we unload in a cell.
 	SpawnPlayer(LoadedPlayerInfo);
+
+
 	
-	
 	//This is where you should spawn the creatures, and items within 128m of the player 
 	//Load Players within chatrange
 	for (ZServer::ZClientList::iterator i = zServer->Clients.begin(); i != zServer->Clients.end(); ++i) {
@@ -411,24 +444,24 @@
 
 
 	//	TERMINAL
-	list<Terminal> * Terminals;
+	list<Terminal> Terminals;
 	Terminals = db->GetTerminal(planetID);
-	if (Terminals->size() !=0)
+	if (Terminals.size() !=0)
 	{
-		for (std::list<Terminal>::iterator it = Terminals->begin(); it != Terminals->end(); ++it) {
+		for (std::list<Terminal>::iterator it = Terminals.begin(); it != Terminals.end(); ++it) {
 			if(it->planet_id == planetID)
 			{
-				SpawnCreature((it->npc_id+TERMINAL_OFFSET),it->crc,it->name,128,it->oI,it->oJ,it->oK,it->oW,it->x,it->z,it->y,0,0,0,it->CellID,"",0);
+				SpawnCreature((it->npc_id+TERMINAL_OFFSET),it->crc,it->name,it->bitmask,it->oI,it->oJ,it->oK,it->oW,it->x,it->z,it->y,0,0,0,it->CellID,"",0);
 			}
 		}
 	}
 
 	//Spawning StaticNPC's
-	list<StaticNPC> * NPCs;
+	list<StaticNPC> NPCs;
 	NPCs = db->SpawnStaticNPCs(planetID);
-	if (NPCs->size() !=0)
+	if (NPCs.size() !=0)
 	{
-		for (std::list<StaticNPC>::iterator it = NPCs->begin(); it != NPCs->end(); ++it) 
+		for (std::list<StaticNPC>::iterator it = NPCs.begin(); it != NPCs.end(); ++it) 
 			{
 				//if(it->planet_id == planetID)
 				//{
@@ -456,13 +489,52 @@
 		}
 	}
 	//End Player Insert
-	QueuePacket(QUEUE_CmdSceneReady);			
+	QueuePacket(QUEUE_CmdSceneReady);
+
+	//send friends list
+	//OnlineStatusUpdateFriend
+	QueuePacket(QUEUE_FriendListRequestResponse);
+	QueuePacket(QUEUE_FriendListDeltasMessage);
 	SEND_QueuedPackets(PLAYER,false);
+	ZClient::UpdateFriendStatus(1,true);
+	friendLastListUpdate = time(0);
+
+	sX = LoadedPlayerInfo.x;
+	sZ = LoadedPlayerInfo.z;
+	sY = LoadedPlayerInfo.y;
+	sN = LoadedPlayerInfo.n;
+	sS = LoadedPlayerInfo.s;
+	sE = LoadedPlayerInfo.e;
+	sW = LoadedPlayerInfo.w;
+
+	if(!CellID)
+	{
+		QueuePacket(QUEUE_UpdateTransformMessage);
+	}
+	else
+	{
+		QueuePacket(QUEUE_UpdateCellContainmentMessage); 
+		QueuePacket(QUEUE_UpdateTransformParentMessage);
+	}
+	SEND_QueuedPackets(PLAYER,false);
 return; }
 
 void ZClient::HANDLE_ClientInactivityMessage(ByteBuffer &Packet) {
 	//Sets the player either AFK or not.. if
 	bool isAFK = Packet.readBYTE();
+	
+	if(debug){	printf("Afk Status Change:%i\n",isAFK);}
+		CharacterData.x = posX;
+		CharacterData.z = posZ;
+		CharacterData.y = posY;
+		CharacterData.n = oI;
+		CharacterData.s = oJ;
+		CharacterData.e = oK;
+		CharacterData.w = oW;
+		CharacterData.planet_id = planetID;
+		CharacterData.afk = isAFK;
+	
+		
 	if(isAFK)
 	{
 		PlayerData updPlayer;
@@ -476,6 +548,8 @@
 		updPlayer.planet_id = planetID;
 		updPlayer.character_id = ObjID;
 		db->UpdatePlayerPos(updPlayer,FlagCell,CellID);
+	//	QueuePacket(QUEUE_ToggleAFKDelta);
+	//	SEND_QueuedPackets(PLAYER,false);
 	}
 return; }
 
@@ -486,15 +560,22 @@
 void ZClient::HANDLE_CmdSceneReady(ByteBuffer &Packet) {
  //Add Message of the Day and anything else you want to do
  //when the player has finished zoning.
-	sMessage = (char*)db->motd.c_str(); //"Welcome to the SWG Pre-CU ALPHA Test Center!";
-	QueuePacket(QUEUE_ChatSystemMessage);
-	SEND_QueuedPackets(PLAYER,false);	
+	if(!welcomeSent)
+	{
+		SendMessageToPlayer((char*)db->motd.c_str()); //"Welcome to the SWG Pre-CU ALPHA Test Center!";
+		welcomeSent = true;
+	}
+	//QueuePacket(QUEUE_ChatSystemMessage);
+	//SEND_QueuedPackets(PLAYER,false);	
 	char meanBuf[100];
-	PlayerData pd = db->GetPlayerData(ObjID);
+	PlayerData pd = CharacterData;  //db->GetPlayerData(ObjID);
 	sprintf(meanBuf, "%s has joined the server.",pd.fullName.c_str());
 	sMessage = meanBuf;	
 	QueuePacket(QUEUE_ChatSystemMessage);
 	SEND_QueuedPackets(XGLOBAL,false);
+
+	
+
 return; }
 
 void ZClient::HANDLE_NewbieTutorialResponse(ByteBuffer &Packet) {
@@ -506,290 +587,597 @@
 void ZClient::HANDLE_ObjectMenuSelectMessage(ByteBuffer &Packet) {
  //when an option is slected via a radial button this packet will be sent. Use this function
  //in junction with the button IDs nelk extracted from the client to handle radial buttons
-  uint64 itemID = Packet.readLONG();
+  long itemID = Packet.readLONG();
   uint8 button = Packet.readBYTE();
-  switch(button) {  
-	case 20: {
-		int templateID = db->GetTemplateID(itemID - ITEM_OFFSET);
-		if (((templateID >= 14036) && (templateID <= 14045)) || 
-			(templateID == 14044)) { // If the item is a survey tool:
-				int surveyRange = db->GetResourceToolRangeOption((unsigned int)(itemID - ITEM_OFFSET));
-				ResourceToolType = db->GetSurveyToolType(itemID - ITEM_OFFSET);
-				if (surveyRange > 0) {
-					QueuePacket(QUEUE_ResourceListForSurveyMessage);
-					ResourceToolID = itemID - ITEM_OFFSET;
-					SEND_QueuedPackets(PLAYER, false);
-					
-				} else {
-					QueuePacket(QUEUE_SuiSetSurveyToolRange);
-					SEND_QueuedPackets(PLAYER, false);
-					ResourceToolID = itemID - ITEM_OFFSET;
+  int objType = -1;
+  objType = GetObjectTypeFromID(itemID);
 
-				}
-		} else {
-				//Checking to see if the object is a deed here
-				list<DeedObject> * Deed = new list<DeedObject>; //get the deed object
-				Deed = db->InventoryDeed((itemID - ITEM_OFFSET) ); // set when we get the " use item " and after we check its a deed
-				for (std::list<DeedObject>::iterator it = Deed->begin(); it != Deed->end(); ++it) 
-				{
-				
-					//Building Deed
-					if(it->deed_type == 0)
-					{
-						if (FlagCell)
-						{	
-							//Cannot Place a building indoors
-							sMessage = "You cannot place a structure while indoors.";
-							QueuePacket(QUEUE_ChatSystemMessage);
-							SEND_QueuedPackets(PLAYER,false);
-							sMessage = "";
-							break;
+  int templateID = db->GetTemplateID(itemID - OffsetList[objType]);
+	/*
+		NPC_OFFSET,//0 	BUILDINGS_OFFSET,//1 	CELL_ITEM_OFFSET,//2 	WORLD_OBJECT_OFFSET,//3
+	ITEM_OFFSET,//4 	DATAPAD_WAYPOINT_OFFSET,//5 	TERMINAL_OFFSET,//6 	INSTANCE_OFFSET,//7 ,Player //8, clientobject //9
+	*/
+  switch(objType)
+  {
+  case 0: // npc
+	  {
+		  break;
+	  }
+  case 1: // building
+	  {
+		  break;
+	  }
+  case 2: // cellitem
+	  {
+		  break;
+	  }
+  case 3: // worldobject
+	  {
+		  SendMessageToPlayer("World Object Clicked ObjMenuSelectMsg");
+		  break;
+	  }
+  case 4: // Item
+	  {
+		  switch(button) 
+		  {
+		  case 20: 
+			  {
+				  if (((templateID >= 14036) && (templateID <= 14045)) ||	(templateID == 14044)) 
+				  { // If the item is a survey tool:
+						int surveyRange = db->GetResourceToolRangeOption((unsigned int)(itemID - ITEM_OFFSET));
+						ResourceToolType = db->GetSurveyToolType(itemID - ITEM_OFFSET);
+						if (surveyRange > 0) 
+						{
+							QueuePacket(QUEUE_ResourceListForSurveyMessage);
+							ResourceToolID = itemID - ITEM_OFFSET;
+							SEND_QueuedPackets(PLAYER, false);
+							
+						} 
+						else 
+						{
+							QueuePacket(QUEUE_SuiSetSurveyToolRange);
+							SEND_QueuedPackets(PLAYER, false);
+							ResourceToolID = itemID - ITEM_OFFSET;
+
 						}
-						BuildingIff = it->object_iff;
-						cell_num = it->number_cells;
-						BuildingBase =  it->object_base;
-						BaseRequired = it->base_required;
-						BuildingTerminalIFF = it->object_admin_terminal;
-						BuildingTerminalRequired = it->terminal_required;
-						BuildingSignIFF = it->object_sign;
-						BuildingSignRequired = it->sign_required;
-						Building_terminal_x = it->terminal_x;
-						Building_terminal_z = it->terminal_z;
-						Building_terminal_y = it->terminal_y;
-						Building_terminal_oI = it->terminal_oI;
-						Building_terminal_oJ = it->terminal_oJ;
-						Building_terminal_oK = it->terminal_oK;
-						Building_terminal_oW = it->terminal_oW;
-						Building_terminal_cellID = it->terminal_cellID;
+				  }
+				  else if(templateID == 14132) // travel ticket
+				  {
+					  Ticket tempTicket;
+					  tempTicket = db->GetTicketDataFromPlayerItem(itemID - OffsetList[objType]);
+					  printf("Ticket ID: %i Destination: %s\n",tempTicket.ticketID,tempTicket.destination.c_str());
 					
-						Building_swx = it->sign_swx;
-						Building_swy = it->sign_swy;
-						Building_swz = it->sign_swz;
-						Building_swoI = it->sign_swoI;
-						Building_swoJ = it->sign_swoJ;
-						Building_swoK = it->sign_swoK;
-						Building_swoW = it->sign_swoW;
-					
-						Building_sex = it->sign_sex;
-						Building_sey = it->sign_sey;
-						Building_sez = it->sign_sez;
-						Building_seoI = it->sign_seoI;
-						Building_seoJ = it->sign_seoJ;
-						Building_seoK = it->sign_seoK;
-						Building_seoW = it->sign_seoW;
-
-						Building_snx = it->sign_snx;
-						Building_sny = it->sign_sny;
-						Building_snz = it->sign_snz;
-						Building_snoI = it->sign_snoI;
-						Building_snoJ = it->sign_snoJ;
-						Building_snoK = it->sign_snoK;
-						Building_snoW = it->sign_snoW;
-
-						Building_ssx = it->sign_ssx;
-						Building_ssy = it->sign_ssy;
-						Building_ssz = it->sign_ssz;
-						Building_ssoI = it->sign_ssoI;
-						Building_ssoJ = it->sign_ssoJ;
-						Building_ssoK = it->sign_ssoK;
-						Building_ssoW = it->sign_ssoW;
-
-						Building_maintenance_rate = it->maintenance_rate;
-
-						QueuePacket(QUEUE_EnterStructurePlacementMode);			
-						SEND_QueuedPackets(PLAYER,false);
+						int departureID = 0;
+						list<Ticket> AvailableTickets;
+						AvailableTickets = db->GetTickets(tempTicket.departureplanet,true);
+						for(std::list<Ticket>::iterator at = AvailableTickets.begin(); at != AvailableTickets.end(); at++)
+						{
+							printf("Iterating: %s\n",at->destination.c_str());
+							if(!strcmp(at->destination.c_str(),tempTicket.departure.c_str()))
+							{
+								printf("Found Departure Point\n");
+								departureID = at->ticketID;
+							}
+						}
+						printf("Departure Location ID: %i\n",departureID);
+						list<StaticNPC> closestTicketDroid;
+						closestTicketDroid = db->SpawnStaticNPCs(tempTicket.departureplanet);
+						for(std::list<StaticNPC>::iterator td = closestTicketDroid.begin(); td != closestTicketDroid.end(); td++ )
+						{
+							if(td->ticketdroid)
+							{
+								//printf("Npc is a Ticket Droid\n");
+								//printf("TID:%i\n",td->ticketid);
+								//printf("DID:%i\n",departureID);
+								if(td->ticketid == departureID)
+								{
+									//printf("Found The Droid %i\n",td->npc_id);
+									int diffX;
+									int diffY;
+									diffX = (int)((td->x - CharacterData.x)*2);
+									diffY = (int)((td->y - CharacterData.y)*2);
+								
+									//printf("x%i , z%i \n",diffX,diffY);
+									if(diffX <= 7 && diffX >= -7  || diffY <= 7 && diffY >= -7)
+									{
+										CharacterData.x = tempTicket.x + ((float)(((float) rand() / (float) RAND_MAX) * 3 + 1));
+										CharacterData.y = tempTicket.y + ((float)(((float) rand() / (float) RAND_MAX) * 3 + 1));
+										CharacterData.z = tempTicket.z;
+										CharacterData.planet_id = tempTicket.planet_id;
+										CharacterData.cell_id = 0;
+										if(db->DeleteItem(tempTicket.itemID))
+										{
+											db->UpdatePlayerPos(CharacterData,false,0);
+											ByteBuffer SC; SC.writeLONG(ObjID);
+											db->UpdatePopulation(-1);
+											HANDLE_CharacterTravel(SC);
+											return;
+										}
+									}
+									else
+									{
+										if(FlagCell)
+										{
+											QueuePacket(QUEUE_UpdateTransformParentMessage);
+										}
+										else
+										{
+											QueuePacket(QUEUE_UpdateTransformMessage);
+										}
+										SEND_QueuedPackets(PLAYER,false);
+										SendMessageToPlayer("You are too far away");
+										return;
+									}
+								}
+							}
+						}
 					}
-			
-				}
-		// End checking if the object is a deed
-			 }
-			 }
-	break;
-	case 60: {
-		//temp: if they have a spawn already delete it and spawn another
-		if(FlagCell){
-			sMessage = "You cannot call a mount indoors, please move outside.";
-			QueuePacket(QUEUE_ChatSystemMessage);
-			SEND_QueuedPackets(PLAYER,false);
-			sMessage = "";
-		}
-			
-		if(hasSpawn) { //TODO: Fix this to be a triggered by the proper radial button
-			printf("Spawning Bike\n");
-			for(std::list<_PlayerSpawnedObjects>::iterator m = PlayerSpawnedObjects->begin(); m != PlayerSpawnedObjects->end(); m++ )
-				{
-					if(m->isMounted) 
-					{ 
-						printf("Was Mounted\n");
-						isEquipped = false;
-						isMounted = false;			
-						spawnID=ObjID;
-						ContainerID=0;
-						delID = mountID;
-						QueuePacket(QUEUE_StopClientEffectObjectByLabelMessage);
-						QueuePacket(QUEUE_UpdateContainmentMessage);				
-						QueuePacket(QUEUE_SceneDestroyObject);
-						SEND_QueuedPackets(CHATRANGE,false);
-						hasSpawn = false;	
-						m->isSpawned = false;
-						m->isMounted = false;
-						m->isEquipped = false;
-
-						sposX = 0; sposZ = 0; sposY = 0;
-						mountID = 0;
+					else if(templateID == 3534) // Swoop Bike
+					{
+						//printf("Speeder Bike Swoop Menu 20\n");
 					}
 					else 
 					{
-						printf("Was Not Mounted\n");
-						isMounted = false;
-						delID = m->spawnID; //mountID;
-						if(m->isSpawned)
+							//Checking to see if the object is a deed here
+							list<DeedObject>  Deed ; //get the deed object
+							Deed = db->InventoryDeed((itemID - ITEM_OFFSET) ); // set when we get the " use item " and after we check its a deed
+							for (std::list<DeedObject>::iterator it = Deed.begin(); it != Deed.end(); ++it) 
+							{
+							
+								//Building Deed
+								if(it->deed_type == 0)
+								{
+									if (FlagCell)
+									{	
+										//Cannot Place a building indoors
+										SendMessageToPlayer("You cannot place a structure while indoors.");
+										break;
+									}
+									BuildingDeedIff = it->name;
+									BuildingIff = it->object_iff;
+									cell_num = it->number_cells;
+									BuildingBase =  it->object_base;
+									BaseRequired = it->base_required;
+									BuildingTerminalIFF = it->object_admin_terminal;
+									BuildingTerminalRequired = it->terminal_required;
+									BuildingSignIFF = it->object_sign;
+									BuildingSignRequired = it->sign_required;
+									Building_terminal_x = it->terminal_x;
+									Building_terminal_z = it->terminal_z;
+									Building_terminal_y = it->terminal_y;
+									Building_terminal_oI = it->terminal_oI;
+									Building_terminal_oJ = it->terminal_oJ;
+									Building_terminal_oK = it->terminal_oK;
+									Building_terminal_oW = it->terminal_oW;
+									Building_terminal_cellID = it->terminal_cellID;
+								
+									Building_swx = it->sign_swx;
+									Building_swy = it->sign_swy;
+									Building_swz = it->sign_swz;
+									Building_swoI = it->sign_swoI;
+									Building_swoJ = it->sign_swoJ;
+									Building_swoK = it->sign_swoK;
+									Building_swoW = it->sign_swoW;
+							
+									Building_sex = it->sign_sex;
+									Building_sey = it->sign_sey;
+									Building_sez = it->sign_sez;
+									Building_seoI = it->sign_seoI;
+									Building_seoJ = it->sign_seoJ;
+									Building_seoK = it->sign_seoK;
+									Building_seoW = it->sign_seoW;
+	
+									Building_snx = it->sign_snx;
+									Building_sny = it->sign_sny;
+									Building_snz = it->sign_snz;
+									Building_snoI = it->sign_snoI;
+									Building_snoJ = it->sign_snoJ;
+									Building_snoK = it->sign_snoK;
+									Building_snoW = it->sign_snoW;
+	
+									Building_ssx = it->sign_ssx;
+									Building_ssy = it->sign_ssy;
+									Building_ssz = it->sign_ssz;
+									Building_ssoI = it->sign_ssoI;
+									Building_ssoJ = it->sign_ssoJ;
+									Building_ssoK = it->sign_ssoK;
+									Building_ssoW = it->sign_ssoW;
+	
+									Building_maintenance_rate = it->maintenance_rate;
+	
+									QueuePacket(QUEUE_EnterStructurePlacementMode);			
+									SEND_QueuedPackets(PLAYER,false);
+								}
+					
+							}
+					// End checking if the object is a deed
+						 }
+					break;
+					}
+				case 60: case 0x0E:
+					{
+						if(templateID == 3534) // Swoop Bike
 						{
-							QueuePacket(QUEUE_SceneDestroyObject);
-							SEND_QueuedPackets(CHATRANGE,false);
-						}
-						hasSpawn = false;				
-						m->isSpawned = false;
-						m->isMounted = false;
-						m->isEquipped = false;
-						sposX = 0; sposZ = 0; sposY = 0;
-						mountID = 0;
-					}
-			}
-		}//end if has spawn
-		//DB stuffs if(itemID == db->isSwoop());
-			hasSpawn = true;
-			mountID = itemID+12;
-			sposX = posX+0.3; sposZ = posZ; sposY = posY+0.3;
-			for (ZServer::ZClientList::iterator i = zServer->Clients.begin(); i != zServer->Clients.end(); ++i) {
-				ZClient* Client = i->second;
-				if (Client) {
-					if (Client->isValid()) {	
-						Client->ownerID = ObjID;
+							//temp: if they have a spawn already delete it and spawn another
+							if(FlagCell)
+							{
+								SendMessageToPlayer("You cannot call a mount indoors, please move outside.");
+							}
 						
-						bool mountinlist = false;
-						_PlayerSpawnedObjects tempPlayerObject;
-						for(std::list<_PlayerSpawnedObjects>::iterator m = PlayerSpawnedObjects->begin(); m != PlayerSpawnedObjects->end(); m++ )
+						if(hasSpawn) 
 						{
-							if(m->spawnID == mountID)
+							//TODO: Fix this to be a triggered by the proper radial button
+							//printf("Spawning Bike\n");
+							for(std::list<_PlayerSpawnedObjects>::iterator m = PlayerSpawnedObjects.begin(); m != PlayerSpawnedObjects.end(); m++ )
 							{
-								printf("Was in list\n");
-								m->isEquipped = false;
-								m->isMounted = false;
-								if(!m->isSpawned)
-								{m->isSpawned = true;}
-								mountinlist = true;
-								tempPlayerObject.spawnID = m->spawnID;
-								tempPlayerObject.isEquipped = m->isEquipped;
-								tempPlayerObject.isMounted = m->isMounted;
-								tempPlayerObject.isSwoop = m->isSwoop;
-								tempPlayerObject.bitmask = m->bitmask;
-								tempPlayerObject.isSpawned = m->isSpawned;
-								mountID= tempPlayerObject.spawnID;
-								tempPlayerObject.crc = m->crc; //0xAF6D9F4F;
-								tempPlayerObject.cName = m->cName.c_str();//"Speederbike Swoop";
-								tempPlayerObject.n = oI;
-								tempPlayerObject.s = oJ;
-								tempPlayerObject.e = oK;
-								tempPlayerObject.w = oW;
-								tempPlayerObject.x = posX+0.3;  
-								tempPlayerObject.z = posZ+0.3;
-								tempPlayerObject.y = posY+0.3;
-								tempPlayerObject.health = 0;
-								tempPlayerObject.mind = 0;
-								tempPlayerObject.action = 0;
-								tempPlayerObject.cellID = 0;
-								tempPlayerObject.perfid = "";
-								tempPlayerObject.stanceID = 0;
+								if(m->isMounted) 
+								{ 
+									printf("Was Mounted\n");
+									isEquipped = false;
+									isMounted = false;			
+									spawnID=ObjID;
+									ContainerID=0;
+									delID = mountID;
+									QueuePacket(QUEUE_StopClientEffectObjectByLabelMessage);
+									QueuePacket(QUEUE_UpdateContainmentMessage);				
+									QueuePacket(QUEUE_SceneDestroyObject);
+									SEND_QueuedPackets(CHATRANGE,false);
+									hasSpawn = false;	
+									m->isSpawned = false;
+									m->isMounted = false;
+									m->isEquipped = false;
+			
+									sposX = 0; sposZ = 0; sposY = 0;
+									mountID = 0;
+								}
+								else 
+								{
+									printf("Was Not Mounted\n");
+									isMounted = false;
+									delID = m->spawnID; //mountID;
+									if(m->isSpawned)
+									{
+										QueuePacket(QUEUE_SceneDestroyObject);
+										SEND_QueuedPackets(CHATRANGE,false);
+									}
+									hasSpawn = false;				
+									m->isSpawned = false;
+									m->isMounted = false;
+									m->isEquipped = false;
+									sposX = 0; sposZ = 0; sposY = 0;
+									mountID = 0;
+								}
 							}
-							
-						}
-						if(!mountinlist)
+						}//end if has spawn
+					//DB stuffs if(itemID == db->isSwoop());
+						hasSpawn = true;
+						
+						ItemData Swoop;
+						Swoop = db->GetItemData(itemID - OffsetList[objType]);
+						mountID = Swoop.serial + WORLD_OBJECT_OFFSET; //    //itemID;
+						sposX = posX+0.3; sposZ = posZ; sposY = posY+0.3;
+						for (ZServer::ZClientList::iterator i = zServer->Clients.begin(); i != zServer->Clients.end(); ++i) 
 						{
-							printf("Was not in list\n");
-							//mountID,0xAF6D9F4F,"Speederbike Swoop",256,0,0,0,1,sposX,sposZ,posY, 0, 0, 0,0,"",0
-							tempPlayerObject.spawnID = mountID;
-							tempPlayerObject.isEquipped = false;
-							tempPlayerObject.isMounted = false;
-							tempPlayerObject.isSwoop = true;
-							tempPlayerObject.crc = 0xAF6D9F4F;
-							tempPlayerObject.cName = "Speederbike Swoop";
-							tempPlayerObject.bitmask = 256;
-							tempPlayerObject.n = oI;
-							tempPlayerObject.s = oJ;
-							tempPlayerObject.e = oK;
-							tempPlayerObject.w = oW;
-							tempPlayerObject.x = posX+0.3;  
-							tempPlayerObject.z = posZ+0.3;
-							tempPlayerObject.y = posY+0.3;
-							tempPlayerObject.health = 0;
-							tempPlayerObject.mind = 0;
-							tempPlayerObject.action = 0;
-							tempPlayerObject.cellID = 0;
-							tempPlayerObject.perfid = "";
-							tempPlayerObject.stanceID = 0;
-							tempPlayerObject.isSpawned = true;
-							PlayerSpawnedObjects->push_back(tempPlayerObject);
+							ZClient* Client = i->second;
+							if (Client) 
+							{
+								if (Client->isValid()) 
+								{	
+									Client->ownerID = ObjID;
+									
+									bool mountinlist = false;
+									_PlayerSpawnedObjects tempPlayerObject;
+									for(std::list<_PlayerSpawnedObjects>::iterator m = PlayerSpawnedObjects.begin(); m != PlayerSpawnedObjects.end(); m++ )
+									{
+										if(m->spawnID == mountID)
+										{
+											printf("Was in list\n");
+											m->isEquipped = false;
+											m->isMounted = false;
+											if(!m->isSpawned)
+											{m->isSpawned = true;}
+											mountinlist = true;
+											tempPlayerObject.spawnID = m->spawnID;
+											tempPlayerObject.isEquipped = m->isEquipped;
+											tempPlayerObject.isMounted = m->isMounted;
+											tempPlayerObject.isSwoop = m->isSwoop;
+											tempPlayerObject.bitmask = m->bitmask;
+											tempPlayerObject.isSpawned = m->isSpawned;
+											mountID= tempPlayerObject.spawnID;
+											tempPlayerObject.crc = m->crc; //0xAF6D9F4F;
+											tempPlayerObject.cName = m->cName.c_str();//"Speederbike Swoop";
+											tempPlayerObject.n = oI;
+											tempPlayerObject.s = oJ;
+											tempPlayerObject.e = oK;
+											tempPlayerObject.w = oW;
+											tempPlayerObject.x = posX+0.3;  
+											tempPlayerObject.z = posZ+0.3;
+											tempPlayerObject.y = posY+0.3;
+											tempPlayerObject.health = 0;
+											tempPlayerObject.mind = 0;
+											tempPlayerObject.action = 0;
+											tempPlayerObject.cellID = 0;
+											tempPlayerObject.perfid = "";
+											tempPlayerObject.stanceID = 0;
+										}
+										
+									}
+									if(!mountinlist)
+									{
+										printf("Was not in list\n");
+										//mountID,0xAF6D9F4F,"Speederbike Swoop",256,0,0,0,1,sposX,sposZ,posY, 0, 0, 0,0,"",0
+										tempPlayerObject.spawnID = mountID;
+										tempPlayerObject.isEquipped = false;
+										tempPlayerObject.isMounted = false;
+										tempPlayerObject.isSwoop = true;
+										tempPlayerObject.crc = 0xAF6D9F4F;
+										tempPlayerObject.cName = "Speederbike Swoop";
+										tempPlayerObject.bitmask = 256;
+										tempPlayerObject.n = oI;
+										tempPlayerObject.s = oJ;
+										tempPlayerObject.e = oK;
+										tempPlayerObject.w = oW;
+										tempPlayerObject.x = posX+0.3;  
+										tempPlayerObject.z = posZ+0.3;
+										tempPlayerObject.y = posY+0.3;
+										tempPlayerObject.health = 0;
+										tempPlayerObject.mind = 0;
+										tempPlayerObject.action = 0;
+										tempPlayerObject.cellID = 0;
+										tempPlayerObject.perfid = "";
+										tempPlayerObject.stanceID = 0;
+										tempPlayerObject.isSpawned = true;
+										PlayerSpawnedObjects.push_back(tempPlayerObject);
+									}
+			
+									//-----
+									Client->isSwoop = true;
+									//Client->SpawnCreature(mountID,0xAF6D9F4F,"Speederbike Swoop",256,0,0,0,1,sposX,sposZ,posY, 0, 0, 0,0,"",0);
+									Client->SpawnCreature(	tempPlayerObject.spawnID,
+															tempPlayerObject.crc,
+															tempPlayerObject.cName.c_str(),
+															tempPlayerObject.bitmask,
+															tempPlayerObject.n,
+															tempPlayerObject.s,
+															tempPlayerObject.e,
+															tempPlayerObject.w,
+															tempPlayerObject.x,
+															tempPlayerObject.z,
+															tempPlayerObject.y, 
+															tempPlayerObject.health,
+															tempPlayerObject.action,
+															tempPlayerObject.mind,
+															tempPlayerObject.cellID,
+															tempPlayerObject.perfid.c_str(),
+															tempPlayerObject.stanceID);
+															Client->isSwoop = false;
+								}
+							}
 						}
-
-						//-----
-						Client->isSwoop = true;
-						//Client->SpawnCreature(mountID,0xAF6D9F4F,"Speederbike Swoop",256,0,0,0,1,sposX,sposZ,posY, 0, 0, 0,0,"",0);
-						Client->SpawnCreature(	tempPlayerObject.spawnID,
-												tempPlayerObject.crc,
-												tempPlayerObject.cName.c_str(),
-												tempPlayerObject.bitmask,
-												tempPlayerObject.n,
-												tempPlayerObject.s,
-												tempPlayerObject.e,
-												tempPlayerObject.w,
-												tempPlayerObject.x,
-												tempPlayerObject.z,
-												tempPlayerObject.y, 
-												tempPlayerObject.health,
-												tempPlayerObject.action,
-												tempPlayerObject.mind,
-												tempPlayerObject.cellID,
-												tempPlayerObject.perfid.c_str(),
-												tempPlayerObject.stanceID);
-						Client->isSwoop = false;
-					} 
+						
+					}
+				break; 
 				}
+			case 0x0B:
+				{
+					spawnID = itemID;
+					ContainerID = ObjID;
+					isEquipped = true;
+					QueuePacket(QUEUE_UpdateContainmentMessage);
+					SEND_QueuedPackets(PLAYER,false);
+					db->UpdateItemEquippedStatus(itemID,true);
+					break;	   
+				}
+			case 0x0C: 
+				{
+					spawnID = itemID;
+					ContainerID = InventoryID;
+					isEquipped = false;
+					//QueuePacket(QUEUE_UpdateContainmentMessage);
+					//SEND_QueuedPackets(PLAYER,false);
+					
+					db->UpdateItemEquippedStatus(itemID,false);
+					break; 
+				}
+			case 0x86: case 0x87: 
+				{
+					QueuePacket(QUEUE_SuiSetSurveyToolRange);
+					SEND_QueuedPackets(PLAYER, false);
+					ResourceToolID = itemID - ITEM_OFFSET;
+					break;
+				}
+			default:
+				{
+					printf("Unhandled button num: 0x%.2X on item: 0x%.16X \n",button,itemID);
+					break;			
+				}
+		  }
+		  break;
+	  }
+  case 5: // waypoint
+	  {
+		  break;
+	  }
+  case 6: //terminal
+	  {
+		  stringstream toPlayer;
+		  Terminal tempTerminal;
+		  list<Terminal> tempTermList;
+		  tempTermList = db->GetTerminal(planetID);
+		  int termID = itemID - OffsetList[objType];
+		  for(std::list<Terminal>::iterator it = tempTermList.begin(); it != tempTermList.end(); it++)
+		  {
+			if(termID == it->npc_id)
+			{
+				tempTerminal.bitmask = it->bitmask;
+				tempTerminal.CellID = it->CellID;
+				tempTerminal.crc = it->crc;
+				tempTerminal.dancestring = it->dancestring;
+				tempTerminal.name = it->name.c_str();
+				tempTerminal.npc_id = it->npc_id;
+				tempTerminal.oI = it->oI;
+				tempTerminal.oJ = it->oJ;
+				tempTerminal.oK = it->oK;
+				tempTerminal.oW = it->oW;
+				tempTerminal.planet_id = it->planet_id;
+				tempTerminal.posture = it->posture;
+				tempTerminal.ticketid = it->ticketid;
+				tempTerminal.travelterminal = it->travelterminal;
+				tempTerminal.type = it->type;
+				tempTerminal.x = it->x;
+				tempTerminal.y = it->y;
+				tempTerminal.z = it->z;
 			}
-		
-			break; }
-			 	case 0x0B: {
-						spawnID = itemID;
-						ContainerID = ObjID;
-						isEquipped = true;
-						QueuePacket(QUEUE_UpdateContainmentMessage);
-						SEND_QueuedPackets(PLAYER,false);
-			
-						db->UpdateItemEquippedStatus(itemID,true);
-		break;	   }
-	case 0x0C: {
-			spawnID = itemID;
-			ContainerID = InventoryID;
-			isEquipped = false;
-			//QueuePacket(QUEUE_UpdateContainmentMessage);
-			//SEND_QueuedPackets(PLAYER,false);
-			
-			db->UpdateItemEquippedStatus(itemID,false);
-			break; }
-	case 0x86: case 0x87: {
-			QueuePacket(QUEUE_SuiSetSurveyToolRange);
-			SEND_QueuedPackets(PLAYER, false);
-			ResourceToolID = itemID - ITEM_OFFSET;
-			break;
-		}
+		  }
+		  switch(tempTerminal.crc)
+		  {
+		  case 4023332994: //Maintenance terminal
+			  {
+				  switch(button)
+				  {
+						//1 - Examine
+				  case 128: //4 - destroy				// 4 2 128 5 @player_structure:permission_destroy
+					  {
+						  toPlayer << "Destroy Selected";
+						  SendMessageToPlayer(toPlayer.str().c_str());
+						  break;
+					  }
+				  case 124: //5 - status				// 5 2 124 5 @player_structure:management_status
+					  {
+						  toPlayer << "Status Selected";
+						  SendMessageToPlayer(toPlayer.str().c_str());
+						  break;
+					  }
+				  case 129: //	6 - pay maintenance		// 6 2 129 5 @player_structure:management_pay
+					  {
+						  toPlayer << "Pay Maintenance Selected";
+						  SendMessageToPlayer(toPlayer.str().c_str());
+						  break;
+					  }
+				  case 166: //	7 - set name			// 7 2 166 5 @player_structure:management_name_structure
+					  {
+						  toPlayer << "Set Name Selected";
+						  SendMessageToPlayer(toPlayer.str().c_str());
+						  break;
+					  }
+				  case 127: //	8 - declare residence	// 8 2 127 5 @player_structure:management_residence
+					  {
+						  toPlayer << "Declare Residence Selected";
+						  SendMessageToPlayer(toPlayer.str().c_str());
+						  break;
+					  }
+				  case 118: //2 - Structure Management	// 2 0 118 5 @player_structure:management 
+					  {
+						  toPlayer << "Structure Management Selected";
+						  SendMessageToPlayer(toPlayer.str().c_str());
+						  break;
+					  }
+				  case 121: //	9 - administrator list	// 9 3 121 5 @player_structure:permission_admin
+					  {
+						  toPlayer << "Admin List Selected";
+						  SendMessageToPlayer(toPlayer.str().c_str());
+						  break;
+					  }
+				  case 119: //	10- entry list			// 10 3 119 5 @player_structure:permission_enter
+					  {
+						  toPlayer << "Entry List Selected";
+						  SendMessageToPlayer(toPlayer.str().c_str());
+						  break;
+					  }
+				  case 120: //	11- ban list			// 11 3 120 5 @player_structure:permission_banned
+					  {
+						  toPlayer << "Ban List Selected";
+						  SendMessageToPlayer(toPlayer.str().c_str());
+						  break;
+					  }
+				  case 117: //3 - Structure Permissions	// 3 0 117 5 @player_structure:permissions
+					  {
+						  toPlayer << "Structure Permissions Selected";
+						  SendMessageToPlayer(toPlayer.str().c_str());
+						  break;
+					  }
+				  }
+				  break;
+			  }
+		  default:
+			  {
+				  toPlayer << "Terminal Option Selected Terminal:" << itemID << " Button:" << (int)button;
+				  SendMessageToPlayer(toPlayer.str().c_str());
+				  break;
+			  }
+		  }
+		  break;
+	  }
+  case 7: //instance
+	  {
+		  break;
+	  }
+  case 8: //player
+	  {
+		  break;
+	  }
+  case 9: //client object
+	  {
+		  //itemID button
+		  stringstream toPlayer;
+		  int iClientWorldObjectTemplate;
+		  iClientWorldObjectTemplate = db->GetClientWorldObjectTemplateID(itemID);
+		  switch(iClientWorldObjectTemplate)
+		  {
+		  case 14048: //bank
+			  {
+					switch(button)
+					{
+				
+					case 0x46: //3	withdraw all credits = @sui:bank_withdrawall	0x46
+						{
+							SendMessageToPlayer("Bank bank_withdrawall Selected");
+							break;
+						}
+					case 0x47: //4	deposit all credits @sui:bank_depositall		0x47
+						{
+							SendMessageToPlayer("Bank bank_depositall Selected");
+							break;
+						}
+					case 0x48: //5	safety deposit = @sui:bank_items				0x48
+						{
+							SendMessageToPlayer("Bank Items Selected");
+							break;
+						}
+					case 0x49: //6	deposit / withdraw = @sui:bank_credits			0x49
+						{
+							SendMessageToPlayer("Bank bank_credits Selected");
+							break;
+						}
+					default:
+						{
+							SendMessageToPlayer("Unhandled Bank Button");
+							break;
+						}
+					}
+			  }
+		  default:
+			  {
+				  break;
+			  }
+		  }
+		  break;
+	  }
+  default:
+	  {
+		  break;
+	  }
+  }
 
-	default:  
-		printf("Unhandled button num: 0x%.2X on item: 0x%.16X \n",button,itemID);
-	break;
-  } 
-return; }
 
 
+
+
+   
+return;
+ }
+
+
 void ZClient::HANDLE_ChatSendToRoom(ByteBuffer &Packet) {
 			string Text = Packet.readUSTRINGtoASCII();
 						  Packet.readINT();
@@ -803,18 +1191,59 @@
 }
 
 void ZClient::HANDLE_PlanetTravelListRequest(ByteBuffer &Packet) {
-	long Pid = Packet.readLONG();
+/*
+	printf("PTLR\n");
+	int c =0;
+	while(Packet.getBytesLeft() != 0)
+	{
+		char b;
+		b=Packet.readBYTE();
+		if(b>0x10)
+		{
+			printf(" %X",b);
+		}
+		else
+		{
+			printf(" 0%X",b);
+		}
+		if(c==15)
+		{
+			c=0;
+			printf("\n");
+		}
+		else
+		{
+			c++;
+		}
+	}
+	printf("\n");
+	return;
+	*/
+	long PlayerID = Packet.readLONG();
 	string Planet = Packet.readASTRING();
-	planetTravelID = 0;
-	for (int i = 0; i < 10; i++) {
-		if (!strcmp(Planet.c_str(), PlanetNames[i])) {
+	//printf("Planet requested:%s , PID:%X\n",Planet.c_str(),PlayerID);
+	planetTravelID = -1;
+	for (int i = 0; i < 10; i++) 
+	{
+		if (!strcmp(Planet.c_str(), FlattenedPlanetNames[i])) {
 			planetTravelID = i;
-			i = 10;
+			if(debug){printf("Planet id:%i found: %s\n",i,FlattenedPlanetNames[i]);}
 		}
 	}
+	if(FlagCell)
+	{
+		QueuePacket(QUEUE_UpdateTransformParentMessage);
+	}
+	else
+	{
+		QueuePacket(QUEUE_UpdateTransformMessage);
+	}
+	SEND_QueuedPackets(CHATRANGE,false);
+	
 	QueuePacket(QUEUE_PlanetTravelPointListResponse);
 	SEND_QueuedPackets(PLAYER,false);
-	planetTravelID = 0;
+	//planetTravelID = 0;
+
 }
 
 void ZClient::HANDLE_GetMapLocationsMessage(ByteBuffer &Packet) {
@@ -824,9 +1253,7 @@
 	printf("Unknown Int:  %i\n", UnkINT);
 	printf("Get Planet Map: [%s] \n ",Planet.c_str());
 
-
-
-     QueuePacket(QUEUE_GetMapLocationsMessage);
+    QueuePacket(QUEUE_GetMapLocationsMessage);
 	SEND_QueuedPackets(PLAYER,false);
 
 
@@ -837,8 +1264,8 @@
 	//printf("\nHere\n");
 	ObjID = Packet.readLONG();
 
-	PlayerData LoadedPlayerInfo = db->GetPlayerData(ObjID);
-	
+	PlayerData LoadedPlayerInfo = CharacterData;  //db->GetPlayerData(ObjID);
+	//CharacterData = db->GetPlayerData(ObjID);
 		//--
 	iRaceID = LoadedPlayerInfo.appearance_crc;
 	planetID = LoadedPlayerInfo.planet_id;
@@ -863,11 +1290,11 @@
 	
 	
 	//SpawnBuildings Here
-	list<Building> * Buildings;
+	list<Building> Buildings;
 	Buildings = db->SpawnBuildings(planetID);
-	if(Buildings->size() != 0)
+	if(Buildings.size() != 0)
 	{
-		for (std::list<Building>::iterator it = Buildings->begin(); it != Buildings->end(); ++it) 
+		for (std::list<Building>::iterator it = Buildings.begin(); it != Buildings.end(); ++it) 
 		{
 			//stringstream query;
 			//query << "SELECT planet_id FROM character WHERE character_id =" << ObjID;
@@ -893,13 +1320,16 @@
 			if (Client->isValid()) {
 				if (Client != this) {
 					SpawnFellowPlayer(Client->ObjID,Client->oI,Client->oJ,Client->oK,Client->oW,Client->posX,Client->posZ,Client->posY,Client->CellID);
-					if(Client->hasSpawn) { //hardcoded for now so only a swoop can be spawned till this is softcoded
+				
+					if(Client->hasSpawn) 
+					{ //hardcoded for now so only a swoop can be spawned till this is softcoded
 						ownerID = Client->ObjID;
 						isSwoop = true;
 						SpawnCreature(Client->mountID,0xAF6D9F4F,"Speederbike Swoop",256,0,0,0,1,Client->sposX,Client->sposZ,Client->sposY, 0, 0, 0,0,"",0);
 						isSwoop = false;
 						ownerID = 0;
-						if(Client->isMounted) {
+						if(Client->isMounted) 
+						{
 							isEquipped = true;
 							spawnID = Client->ObjID;
 							ContainerID = Client->mountID;
@@ -908,6 +1338,7 @@
 							resetSpawnVariables();
 						}
 					}
+
 				}
 			} 
 		}
@@ -916,11 +1347,11 @@
 
 
 	//	TERMINAL
-	list<Terminal> * Terminals;
+	list<Terminal>  Terminals;
 	Terminals = db->GetTerminal(planetID);
-	if (Terminals->size() !=0)
+	if (Terminals.size() !=0)
 	{
-		for (std::list<Terminal>::iterator it = Terminals->begin(); it != Terminals->end(); ++it) {
+		for (std::list<Terminal>::iterator it = Terminals.begin(); it != Terminals.end(); ++it) {
 			if(it->planet_id == planetID)
 			{
 				SpawnCreature((it->npc_id+TERMINAL_OFFSET),it->crc,it->name,128,it->oI,it->oJ,it->oK,it->oW,it->x,it->z,it->y,0,0,0,it->CellID,"",0);
@@ -929,11 +1360,11 @@
 	}
 
 	//Spawning StaticNPC's
-	list<StaticNPC> * NPCs;
+	list<StaticNPC>  NPCs;
 	NPCs = db->SpawnStaticNPCs(planetID);
-	if (NPCs->size() !=0)
+	if (NPCs.size() !=0)
 	{
-		for (std::list<StaticNPC>::iterator it = NPCs->begin(); it != NPCs->end(); ++it) 
+		for (std::list<StaticNPC>::iterator it = NPCs.begin(); it != NPCs.end(); ++it) 
 			{
 				//if(it->planet_id == planetID)
 				//{
@@ -949,7 +1380,7 @@
 
 
 	//Insert Player into zone
-	PlayerData PlayersData = db->GetPlayerData(ObjID);
+	PlayerData PlayersData = CharacterData; // db->GetPlayerData(ObjID);
 	for (ZServer::ZClientList::iterator i = zServer->Clients.begin(); i != zServer->Clients.end(); ++i) {
 		ZClient* Client = i->second;
 		if (Client) {

Index: C:/Software/SWG Pre-CU/Closed2/src/ZoneServer/ObjControllers.cpp
===================================================================
--- C:/Software/SWG Pre-CU/Closed2/src/ZoneServer/ObjControllers.cpp	(revision 327)
+++ C:/Software/SWG Pre-CU/Closed2/src/ZoneServer/ObjControllers.cpp	(working copy)
@@ -187,17 +187,29 @@
 		movementTicker++;
 	}
 	if(CurrentTravelSpeed>0) resendDelay = UTM_time;
-	
+		
+		CharacterData.x = posX;
+		CharacterData.z = posZ;
+		CharacterData.y = posY;
+		CharacterData.n = oI;
+		CharacterData.s = oJ;
+		CharacterData.e = oK;
+		CharacterData.w = oW;
+		CharacterData.planet_id = planetID;
+		CharacterData.cell_id = CellID;
+
+		LastPingRequestTime = (int)time(0);
 if(debug)
 {
-	LastPingRequestTime = (int)time(0);
 	printf("\nLastPingTime1:%i\n",LastPingRequestTime);
 }
 	return; }
 
+
 void ZClient::RouteInternalEmail(){
 	ZServer * server = ZServer::getServer();
 	_EmailRouterFlags tempFlag;
+	if(ObjID >= 1){return;}
 	tempFlag = server->GetEmailRouterFlags(ObjID,false,0);
 //	printf("Movement:EmailFlags:UserID:%i Flag:%i\n",tempFlag.UserID,tempFlag.EmailsPendingRouting);
 //	for(std::list<_EmailRouterFlags>::iterator erf = server->EmailRouterFlags->begin();erf != server->EmailRouterFlags->end(); erf++)
@@ -206,10 +218,10 @@
 		{
 			server->GetEmailRouterFlags(ObjID,false,1);
 			//Send the player his emails
-			list <Email> * _MessageList = new list<Email>;
+			list <Email> _MessageList;
 			_MessageList = db->GetEmailHeaders(ObjID);
 			bool headsupsent = false;
-			for( std::list<Email>::iterator it = _MessageList->begin(); it != _MessageList->end(); it++)
+			for( std::list<Email>::iterator it = _MessageList.begin(); it != _MessageList.end(); it++)
 			{
 				if(!it->Error)
 				{
@@ -297,72 +309,386 @@
 	}
 
 		movementTicker++;
+
+		CharacterData.x = posX;
+		CharacterData.z = posZ;
+		CharacterData.y = posY;
+		CharacterData.n = oI;
+		CharacterData.s = oJ;
+		CharacterData.e = oK;
+		CharacterData.w = oW;
+		CharacterData.planet_id = planetID;		
+		CharacterData.cell_id = CellID;
+		LastPingRequestTime = (int)time(0);
 	if(debug)
 	{
-		LastPingRequestTime = (int)time(0);
 		printf("\nLastPingTime2:%i\n",LastPingRequestTime);
 	}
 return; }
 
 void ZClient::HANDLE_ObjController_ObjectMenuRequest(ByteBuffer &Packet) {
+	
 	rItemID = Packet.readLONG();
-	int realItemID = rItemID - ITEM_OFFSET;
-	int itemTemplateID = db->GetTemplateID(realItemID);
 	rID = Packet.readLONG();
+
+	int objType;
+	int itemTemplateID;
+	int realItemID;
+
+	objType = ZClient::GetObjectTypeFromID(rItemID);
+	realItemID = rItemID - OffsetList[objType];
+	itemTemplateID = db->GetTemplateID(realItemID);
+	
+	if(debug){printf("ObjMenuReq: rItemID: %u\n",rItemID);printf("ObjMenuReq: TemplateID: %u\n",itemTemplateID);}
+
+	
 	// If we don't know what template ID we have, 
-	if (itemTemplateID == -1) {
-		printf("Unknown item template ID -- returning default menu.\n");
-		rOptionsCount = Packet.readINT();
-		if(rOptionsCount>0) {
-			for(int i=0;i<rOptionsCount;i++) {
-				RadialOptions option;
-				option.OptionNum = Packet.readBYTE();
-				option.ParentMenuID = Packet.readBYTE();
-				option.OptionID = Packet.readBYTE();
-				option.unk2 = Packet.readBYTE();
-				option.unkStr = Packet.readUSTRINGtoASCII();			
-				this->tRadialOptions.push_back(option);
-			}	
+	/*
+		"NPC",//0
+		"BUILDING",//1
+		"CELL_ITEM",//2
+		"WORLD_OBJECT",//3
+		"ITEM",//4
+		"DATAPAD_WAYPOINT",//5
+		"TERMINAL",//6
+		"INSTANCE",//7
+		"PLAYER",//8 
+		"CLIENT_OBJECT",//9
+	*/
+	
+	switch(objType)
+	{
+	case 0://npc
+		{
+			break;
 		}
-		rCounter = Packet.readBYTE();		
-		QueuePacket(QUEUE_ObjControllerMessage_ObjectMenuResponse);
-		SEND_QueuedPackets(PLAYER,false);
-	} else {
-		if (((itemTemplateID >= 14036) && (itemTemplateID <= 14045)) || 
-		(itemTemplateID == 14044)) {				
-				rOptionsCount = 5;
-			int clientOptionsCount = Packet.readINT();
-			for (int i = 0; i < 3; i++) {
-				RadialOptions option;
-				option.OptionNum = Packet.readBYTE();
-				option.ParentMenuID = Packet.readBYTE();
-				option.OptionID = Packet.readBYTE();
-				option.unk2 = Packet.readBYTE();
-				option.unkStr = Packet.readUSTRINGtoASCII();			
-				this->tRadialOptions.push_back(option);
+	case 1:
+		{
+			break;
+		}
+	case 2:
+		{
+			break;
+		}
+	case 3://world object
+		{
+			switch(itemTemplateID)
+			{
+			case 3534://speeder bike
+				{
+					printf("W.O. Speeder Bike Swoop Menu Req\n");
+					rOptionsCount = Packet.readINT();
+					if(rOptionsCount>0) 
+					{
+						for(int i=0;i<rOptionsCount;i++) 
+						{
+							RadialOptions option;
+							option.OptionNum = Packet.readBYTE();
+							option.ParentMenuID = Packet.readBYTE();
+							option.OptionID = Packet.readBYTE();
+							option.unk2 = Packet.readBYTE();
+							option.unkStr = Packet.readUSTRINGtoASCII();			
+							this->tRadialOptions.push_back(option);
+						}	
+					}
+					rCounter = Packet.readBYTE();		
+					QueuePacket(QUEUE_ObjControllerMessage_ObjectMenuResponse);
+					SEND_QueuedPackets(PLAYER,false);
+					break;
+				}
+			default:
+				{
+					break;
+				}
 			}
-			RadialOptions option1;
-			RadialOptions option2;
-			option1.OptionNum = 4;
-			option1.ParentMenuID = 0;
-			option1.OptionID = 0x86;
-			option1.unk2 = 3;
-			option1.unkStr = "@sui:tool_options";
-			this->tRadialOptions.push_back(option1);
-			option2.OptionNum = 5;
-			option2.ParentMenuID = 4;
-			option2.OptionID = 0x87;
-			option2.unk2 = 3;
-			option2.unkStr = "@sui:survey_range";
-			this->tRadialOptions.push_back(option2);
-			rCounter = Packet.readBYTE();
-			QueuePacket(QUEUE_ObjControllerMessage_ObjectMenuResponse);
-			SEND_QueuedPackets(PLAYER,false);
-		} else {
-			printf("Unhandled item template ID %i -- returning default menu.\n", itemTemplateID);
+			break;
+		}
+	case 4: //item
+		{
+			switch(itemTemplateID)
+			{
+			case -1:
+				{
+					printf("Unknown item %X template ID -- returning default menu.\n",rItemID);
+					rOptionsCount = Packet.readINT();
+					if(rOptionsCount>0) 
+					{
+						for(int i=0;i<rOptionsCount;i++) 
+						{
+							RadialOptions option;
+							option.OptionNum = Packet.readBYTE();
+							option.ParentMenuID = Packet.readBYTE();
+							option.OptionID = Packet.readBYTE();
+							option.unk2 = Packet.readBYTE();
+							option.unkStr = Packet.readUSTRINGtoASCII();			
+							this->tRadialOptions.push_back(option);
+						}	
+					}
+					rCounter = Packet.readBYTE();		
+					QueuePacket(QUEUE_ObjControllerMessage_ObjectMenuResponse);
+					SEND_QueuedPackets(PLAYER,false);
+					break;
+				} 
+			case 14036:
+			case 14037:
+			case 14038:
+			case 14039:
+			case 14040:
+			case 14041:
+			case 14042:
+			case 14043:
+			case 14044:
+			case 14045:
+				{				
+					rOptionsCount = 5;
+					int clientOptionsCount = Packet.readINT();
+					for (int i = 0; i < 3; i++) 
+					{
+						RadialOptions option;
+						option.OptionNum = Packet.readBYTE();
+						option.ParentMenuID = Packet.readBYTE();
+						option.OptionID = Packet.readBYTE();
+						option.unk2 = Packet.readBYTE();
+						option.unkStr = Packet.readUSTRINGtoASCII();			
+						this->tRadialOptions.push_back(option);
+					}
+					RadialOptions option1;
+					RadialOptions option2;
+					option1.OptionNum = 4;
+					option1.ParentMenuID = 0;
+					option1.OptionID = 0x86;
+					option1.unk2 = 3;
+					option1.unkStr = "@sui:tool_options";
+					this->tRadialOptions.push_back(option1);
+					option2.OptionNum = 5;
+					option2.ParentMenuID = 4;
+					option2.OptionID = 0x87;
+					option2.unk2 = 3;
+					option2.unkStr = "@sui:survey_range";
+					this->tRadialOptions.push_back(option2);
+					rCounter = Packet.readBYTE();
+					QueuePacket(QUEUE_ObjControllerMessage_ObjectMenuResponse);
+					SEND_QueuedPackets(PLAYER,false);
+					break;
+				} 
+			case 14132://travel ticket
+				{
+					printf("Travel Ticket Menu\n");
+					rOptionsCount = Packet.readINT();
+					if(rOptionsCount>0) 
+					{
+						for(int i=0;i<rOptionsCount;i++) 
+						{
+							RadialOptions option;		
+
+							option.OptionNum = Packet.readBYTE();
+							option.ParentMenuID = Packet.readBYTE();
+							option.OptionID = Packet.readBYTE();
+							option.unk2 = Packet.readBYTE();
+							option.unkStr = Packet.readUSTRINGtoASCII();
+							this->tRadialOptions.push_back(option);
+						}	
+					}
+					rCounter = Packet.readBYTE();		
+					QueuePacket(QUEUE_ObjControllerMessage_ObjectMenuResponse);
+					SEND_QueuedPackets(PLAYER,false);
+					break;
+				}
+			case 3534://Speeder Bike Swoop
+				{
+					printf("Speeder Bike Swoop Menu Req\n");
+					rOptionsCount = Packet.readINT();
+					if(rOptionsCount>0) 
+					{
+						for(int i=0;i<rOptionsCount;i++) 
+						{
+							RadialOptions option;
+
+							option.OptionNum = Packet.readBYTE();
+							option.ParentMenuID = Packet.readBYTE();
+							option.OptionID = Packet.readBYTE();
+							option.unk2 = Packet.readBYTE();
+							option.unkStr = Packet.readUSTRINGtoASCII();
+							this->tRadialOptions.push_back(option);			
+						}	
+						rCounter = Packet.readBYTE();	
+					}
+					
+					QueuePacket(QUEUE_ObjControllerMessage_ObjectMenuResponse);
+					SEND_QueuedPackets(PLAYER,false);
+					break;
+				}
+			case 14029:
+				{
+					rOptionsCount = Packet.readINT();
+					if(rOptionsCount>0) 
+					{
+						for(int i=0;i<rOptionsCount;i++) 
+						{
+							RadialOptions option;
+
+							option.OptionNum = Packet.readBYTE();
+							option.ParentMenuID = Packet.readBYTE();
+							option.OptionID = Packet.readBYTE();
+							option.unk2 = Packet.readBYTE();
+							option.unkStr = Packet.readUSTRINGtoASCII();
+							this->tRadialOptions.push_back(option);			
+						}	
+						rCounter = Packet.readBYTE();	
+					}
+					
+					QueuePacket(QUEUE_ObjControllerMessage_ObjectMenuResponse);
+					SEND_QueuedPackets(PLAYER,false);
+					break;
+				}
+			default:
+				{
+					printf("Unhandled item %X template ID",rItemID);
+					printf("%i -- returning default menu.\n",itemTemplateID);
+					rOptionsCount = Packet.readINT();
+					if(rOptionsCount>0) 
+					{
+						for(int i=0;i<rOptionsCount;i++) 
+						{
+							RadialOptions option;
+							option.OptionNum = Packet.readBYTE();
+							option.ParentMenuID = Packet.readBYTE();
+							option.OptionID = Packet.readBYTE();
+							option.unk2 = Packet.readBYTE();
+							option.unkStr = Packet.readUSTRINGtoASCII();			
+							this->tRadialOptions.push_back(option);
+						}	
+					}
+					rCounter = Packet.readBYTE();		
+					QueuePacket(QUEUE_ObjControllerMessage_ObjectMenuResponse);
+					SEND_QueuedPackets(PLAYER,false);
+					break;
+				}
+		}
+		break;
+		
+		}
+	case 5:
+		{
+			break;
+		}
+	case 6://terminal
+		{
+			if(debug){printf("Returning Radial Options for a Terminal\n");}
+			list<Terminal>  tempTerm ;
+			tempTerm = db->GetTerminal(planetID);
+			int termID = rItemID - OffsetList[objType];
+			uint32 termCRC;
+
+			for(std::list<Terminal>::iterator it = tempTerm.begin(); it != tempTerm.end();it++)
+			{
+				if(it->npc_id == termID)
+				{
+					termCRC = it->crc;
+				}
+			}
+			switch(termCRC)
+			{
+			case 4023332994: //maintenance Terminal
+				{
+					if(debug){printf("Returning Radial Options for a Maintenance Terminal\n");}
+					rOptionsCount = Packet.readINT();
+					if(rOptionsCount>0) 
+					{
+						for(int i=0;i<rOptionsCount;i++) 
+						{
+							RadialOptions option;
+							option.OptionNum = Packet.readBYTE();
+							option.ParentMenuID = Packet.readBYTE();
+							option.OptionID = Packet.readBYTE();
+							option.unk2 = Packet.readBYTE();
+							option.unkStr = Packet.readUSTRINGtoASCII();			
+							this->tRadialOptions.push_back(option);
+						}	
+					}
+					/*
+					//0:OptionNum 1:ParentMenuID 2:OptionID 3:unk2 4:unkStr
+					1 - Examine
+						4 - destroy				// 4 2 128 5 @player_structure:permission_destroy
+						5 - status				// 5 2 124 5 @player_structure:management_status
+						6 - pay maintenance		// 6 2 129 5 @player_structure:management_pay
+						7 - set name			// 7 2 166 5 @player_structure:management_name_structure
+						8 - declare residence	// 8 2 127 5 @player_structure:management_residence
+					2 - Structure Management	// 2 0 118 5 @player_structure:management 
+
+						9 - administrator list	// 9 3 121 5 @player_structure:permission_admin
+						10- entry list			// 10 3 119 5 @player_structure:permission_enter
+						11- ban list			// 11 3 120 5 @player_structure:permission_banned
+					3 - Structure Permissions	// 3 0 117 5 @player_structure:permissions
+					2 0 118 3 @player_structure:management 3 0 117 3 @player_structure:permissions 4 2 128 3 @player_structure:permission_destroy 5 2 124 3 @player_structure:management_status 6 2 129 3 @player_structure:management_pay 7 2 166 3 @player_structure:management_name_structure 8 2 127 3 @player_structure:management_residence 9 3 121 3 @player_structure:permission_admin 10 3 119 3 @player_structure:permission_enter 11 3 120 3 @player_structure:permission_banned 
+					*/
+					string Radial;
+					Radial = db->GetRadialOptionsList(termCRC,0,0).c_str();
+					if(debug){printf("Radials: %s\n",Radial.c_str());}
+					CParam RadialData(Radial.c_str());
+					for(int i = 0;i<RadialData.getnum();i++)
+					{
+						//0:OptionNum 1:ParentMenuID 2:OptionID 3:unk2 4:unkStr
+						RadialOptions option1;
+						//0
+						option1.OptionNum = (uint16)atoi(RadialData.get(i).c_str());
+						i++;
+						//1
+						option1.ParentMenuID = (uint16)atoi(RadialData.get(i).c_str());
+						i++;
+						//2
+						option1.OptionID = (uint16)atoi(RadialData.get(i).c_str());
+						i++;
+						//3
+						option1.unk2 = (uint16)atoi(RadialData.get(i).c_str());
+						i++;
+						//4
+						option1.unkStr = RadialData.get(i).c_str(); 
+						
+						this->tRadialOptions.push_back(option1);
+					}
+					rOptionsCount = this->tRadialOptions.size();
+					rCounter = Packet.readBYTE();		
+					QueuePacket(QUEUE_ObjControllerMessage_ObjectMenuResponse);
+					SEND_QueuedPackets(PLAYER,false);
+					break;
+				}
+			default:
+				{
+					rOptionsCount = Packet.readINT();
+					if(rOptionsCount>0) 
+					{
+						for(int i=0;i<rOptionsCount;i++) 
+						{
+							RadialOptions option;
+							option.OptionNum = Packet.readBYTE();
+							option.ParentMenuID = Packet.readBYTE();
+							option.OptionID = Packet.readBYTE();
+							option.unk2 = Packet.readBYTE();
+							option.unkStr = Packet.readUSTRINGtoASCII();			
+							this->tRadialOptions.push_back(option);
+						}	
+					}
+					rCounter = Packet.readBYTE();		
+					QueuePacket(QUEUE_ObjControllerMessage_ObjectMenuResponse);
+					SEND_QueuedPackets(PLAYER,false);
+					break;
+				}
+			}
+			break;
+		}
+	case 7:
+		{
+			
+			break;
+		}
+	case 8://player
+		{
 			rOptionsCount = Packet.readINT();
-			if(rOptionsCount>0) {
-				for(int i=0;i<rOptionsCount;i++) {
+			if(rOptionsCount>0) 
+			{
+				for(int i=0;i<rOptionsCount;i++) 
+				{
 					RadialOptions option;
 					option.OptionNum = Packet.readBYTE();
 					option.ParentMenuID = Packet.readBYTE();
@@ -375,20 +701,594 @@
 			rCounter = Packet.readBYTE();		
 			QueuePacket(QUEUE_ObjControllerMessage_ObjectMenuResponse);
 			SEND_QueuedPackets(PLAYER,false);
+			break;
+			break;
 		}
+	case 9://client world object
+		{
+			stringstream toPlayer;
+			int iClientWorldObjectTemplate;
+			iClientWorldObjectTemplate = db->GetClientWorldObjectTemplateID(realItemID);
+
+			switch(iClientWorldObjectTemplate)
+			{
+				case 14048: //bank
+					{
+						rOptionsCount = Packet.readINT();
+						if(rOptionsCount>0) 
+						{
+							for(int i=0;i<rOptionsCount;i++) 
+							{
+								RadialOptions option;
+								option.OptionNum = Packet.readBYTE();
+								option.ParentMenuID = Packet.readBYTE();
+								option.OptionID = Packet.readBYTE();
+								option.unk2 = Packet.readBYTE();
+								option.unkStr = Packet.readUSTRINGtoASCII();			
+								this->tRadialOptions.push_back(option);
+							}	
+						}
+				/*  6	deposit / withdraw = @sui:bank_credits			0x49
+					5	safety deposit = @sui:bank_items				0x48
+					4	deposit all credits @sui:bank_depositall		0x47
+					3	withdraw all credits = @sui:bank_withdrawall	0x46
+					*/
+						RadialOptions option1;
+						
+
+						option1.OptionNum = 3;
+						option1.ParentMenuID = 1;
+						option1.OptionID = 0x46;
+						option1.unk2 = 3;
+						option1.unkStr = "@sui:bank_withdrawall";
+						this->tRadialOptions.push_back(option1);
+						
+						option1.OptionNum = 4;
+						option1.ParentMenuID = 1;
+						option1.OptionID = 0x47;
+						option1.unk2 = 3;
+						option1.unkStr = "@sui:bank_depositall";
+						this->tRadialOptions.push_back(option1);
+						
+						option1.OptionNum = 5;
+						option1.ParentMenuID = 1;
+						option1.OptionID = 0x48;
+						option1.unk2 = 3;
+						option1.unkStr = "@sui:bank_items";
+						this->tRadialOptions.push_back(option1);
+
+						option1.OptionNum = 6;
+						option1.ParentMenuID = 1;
+						option1.OptionID = 0x49;
+						option1.unk2 = 3;
+						option1.unkStr = "@sui:bank_credits";
+						this->tRadialOptions.push_back(option1);
+
+						rCounter = Packet.readBYTE();		
+						rOptionsCount = rOptionsCount + 4;
+						QueuePacket(QUEUE_ObjControllerMessage_ObjectMenuResponse);
+						SEND_QueuedPackets(PLAYER,false);
+						
+						break;
+					}
+				case 14075: //Mission Terminal Regular
+					{
+					rOptionsCount = Packet.readINT();
+					if(rOptionsCount>0) 
+					{
+						for(int i=0;i<rOptionsCount;i++) 
+						{
+							RadialOptions option;
+							option.OptionNum = Packet.readBYTE();
+							option.ParentMenuID = Packet.readBYTE();
+							option.OptionID = Packet.readBYTE();
+							option.unk2 = Packet.readBYTE();
+							option.unkStr = Packet.readUSTRINGtoASCII();			
+							this->tRadialOptions.push_back(option);
+						}	
+					}
+					rCounter = Packet.readBYTE();		
+					QueuePacket(QUEUE_ObjControllerMessage_ObjectMenuResponse);
+					SEND_QueuedPackets(PLAYER,false);
+					break;
+				}
+				case 14082: //Explorer Mission Terminal Regular
+					{
+					rOptionsCount = Packet.readINT();
+					if(rOptionsCount>0) 
+					{
+						for(int i=0;i<rOptionsCount;i++) 
+						{
+							RadialOptions option;
+							option.OptionNum = Packet.readBYTE();
+							option.ParentMenuID = Packet.readBYTE();
+							option.OptionID = Packet.readBYTE();
+							option.unk2 = Packet.readBYTE();
+							option.unkStr = Packet.readUSTRINGtoASCII();			
+							this->tRadialOptions.push_back(option);
+						}	
+					}
+					rCounter = Packet.readBYTE();		
+					QueuePacket(QUEUE_ObjControllerMessage_ObjectMenuResponse);
+					SEND_QueuedPackets(PLAYER,false);
+					break;
+				}
+				case 14076: //Artisan Mission Terminal Regular
+					{
+					rOptionsCount = Packet.readINT();
+					if(rOptionsCount>0) 
+					{
+						for(int i=0;i<rOptionsCount;i++) 
+						{
+							RadialOptions option;
+							option.OptionNum = Packet.readBYTE();
+							option.ParentMenuID = Packet.readBYTE();
+							option.OptionID = Packet.readBYTE();
+							option.unk2 = Packet.readBYTE();
+							option.unkStr = Packet.readUSTRINGtoASCII();			
+							this->tRadialOptions.push_back(option);
+						}	
+					}
+					rCounter = Packet.readBYTE();		
+					QueuePacket(QUEUE_ObjControllerMessage_ObjectMenuResponse);
+					SEND_QueuedPackets(PLAYER,false);
+					break;
+				}
+				case 14078: //Entertainer Mission Terminal Regular
+					{
+					rOptionsCount = Packet.readINT();
+					if(rOptionsCount>0) 
+					{
+						for(int i=0;i<rOptionsCount;i++) 
+						{
+							RadialOptions option;
+							option.OptionNum = Packet.readBYTE();
+							option.ParentMenuID = Packet.readBYTE();
+							option.OptionID = Packet.readBYTE();
+							option.unk2 = Packet.readBYTE();
+							option.unkStr = Packet.readUSTRINGtoASCII();			
+							this->tRadialOptions.push_back(option);
+						}	
+					}
+					rCounter = Packet.readBYTE();		
+					QueuePacket(QUEUE_ObjControllerMessage_ObjectMenuResponse);
+					SEND_QueuedPackets(PLAYER,false);
+					break;
+				}
+				case 14079: //Imperial Mission Terminal Regular
+					{
+					rOptionsCount = Packet.readINT();
+					if(rOptionsCount>0) 
+					{
+						for(int i=0;i<rOptionsCount;i++) 
+						{
+							RadialOptions option;
+							option.OptionNum = Packet.readBYTE();
+							option.ParentMenuID = Packet.readBYTE();
+							option.OptionID = Packet.readBYTE();
+							option.unk2 = Packet.readBYTE();
+							option.unkStr = Packet.readUSTRINGtoASCII();			
+							this->tRadialOptions.push_back(option);
+						}	
+					}
+					rCounter = Packet.readBYTE();		
+					QueuePacket(QUEUE_ObjControllerMessage_ObjectMenuResponse);
+					SEND_QueuedPackets(PLAYER,false);
+					break;
+				}
+				case 14081: //Rebellion Mission Terminal 
+					{
+					rOptionsCount = Packet.readINT();
+					if(rOptionsCount>0) 
+					{
+						for(int i=0;i<rOptionsCount;i++) 
+						{
+							RadialOptions option;
+							option.OptionNum = Packet.readBYTE();
+							option.ParentMenuID = Packet.readBYTE();
+							option.OptionID = Packet.readBYTE();
+							option.unk2 = Packet.readBYTE();
+							option.unkStr = Packet.readUSTRINGtoASCII();			
+							this->tRadialOptions.push_back(option);
+						}	
+					}
+					rCounter = Packet.readBYTE();		
+					QueuePacket(QUEUE_ObjControllerMessage_ObjectMenuResponse);
+					SEND_QueuedPackets(PLAYER,false);
+					break;
+				}
+				default:
+				{
+					rOptionsCount = Packet.readINT();
+					if(rOptionsCount>0) 
+					{
+						for(int i=0;i<rOptionsCount;i++) 
+						{
+							RadialOptions option;
+							option.OptionNum = Packet.readBYTE();
+							option.ParentMenuID = Packet.readBYTE();
+							option.OptionID = Packet.readBYTE();
+							option.unk2 = Packet.readBYTE();
+							option.unkStr = Packet.readUSTRINGtoASCII();			
+							this->tRadialOptions.push_back(option);
+						}	
+					}
+					rCounter = Packet.readBYTE();		
+					QueuePacket(QUEUE_ObjControllerMessage_ObjectMenuResponse);
+					SEND_QueuedPackets(PLAYER,false);
+
+					toPlayer << "UnHandled Client World Object Menu Request ItemID: " << rItemID << " TemplateID: " << iClientWorldObjectTemplate;
+					SendMessageToPlayer((char*)toPlayer.str().c_str());
+					break;
+				}
+			}
+			break;
+		}
+	default:
+		{
+			break;
+		}
 	}
+	
+	
+	
 	return; 
 }
+void ZClient::HANDLE_ObjController_RefreshMissionList(ByteBuffer &Packet) {
+	/*	
+	00 0E //Short
+	5B 3F 1B 00 00 00 00 00 //objID
+	9A 6F//crc
+	*/
+	Packet.readSHORT();
+	long lItemID = Packet.readLONG();
+	if(debug){printf("Mission Terminal Refresh Missions Request: TID:%u\n",lItemID);}
+	int ObjType;
+	ObjType = ZClient::GetObjectTypeFromID(lItemID);
+	switch(ObjType)
+	{
+	case 0: //"NPC",//0
+		{
+			break;
+		}
+	case 1: //"BUILDING",//1
+		{
+			break;
+		}
+	case 2: //"CELL_ITEM",//2
+		{
+			break;
+		}
+	case 3: //"WORLD_OBJECT",//3
+		{
+			break;
+		}
+	case 4: //"ITEM",//4
+		{
+			break;
+		}
+	case 5: //"DATAPAD_WAYPOINT",//5
+		{
+			break;
+		}
+	case 6: //"TERMINAL",//6
+		{
+			break;
+		}
+	case 7: //"INSTANCE",//7
+		{
+			break;
+		}
+	case 8: //"PLAYER",//8
+		{
+			break;
+		}
+	case 9: //"CLIENT_OBJECT",//9
+		{
+			break;
+		}
+	default:
+		{
+			break;
+		}
+	}
 
+	return;
+}
 void ZClient::HANDLE_ObjController_UseItem(ByteBuffer &Packet) {    		
-	long uItemID = Packet.readLONG();		     
+	long uItemID = Packet.readLONG();	
+
+	/*
+	printf("\n");
+	int t = 0;
+	while(Packet.getBytesLeft() != 0)
+	{
+		char b;
+		b = Packet.readBYTE();
+		if(b>=0x10)
+		{
+			printf(" %X",b);
+		}
+		else
+		{
+			printf(" 0%X",b);
+		}
+		if(t==15)
+		{
+			t=0;
+			printf("\n");
+		}
+		else
+		{
+			t++;
+		}
+
+	}
+	printf("\n");
+	*/
+
 	
-	if(db->isTerminal(uItemID))
+	
+	int objType = -1;
+	
+	objType = ZClient::GetObjectTypeFromID(uItemID);
+	
+	if(debug)
 	{
-		QueuePacket(QUEUE_EnterTicketPurchaseModeMessage);
-		SEND_QueuedPackets(PLAYER,false);
+		printf("Object Type is:%s\n",OffsetNames[objType]);
+		printf("Object:%u\n",uItemID);
 	}
-		
+	int itemTemplateID = db->GetTemplateID(uItemID - OffsetList[objType]);
+
+	if(uItemID == 0)
+	{return;} //we need to put code here to send an untarget packet here
+
+	switch(objType)
+	{
+	case 0: //NPC
+		{
+			int npcID = uItemID - OffsetList[objType];
+			if(uItemID == 0){break;}
+			NPCID = uItemID;
+			stringstream npcMessage;
+			list<StaticNPC> tempNPC;
+			tempNPC = db->SpawnStaticNPCs(planetID);
+			
+			for(std::list<StaticNPC>::iterator npc = tempNPC.begin(); npc != tempNPC.end(); npc++)
+			{
+				long npcCRC = -1;
+				if(npc->npc_id == npcID)
+				{npcCRC = npc->crc;}
+				switch(npcCRC)
+				{
+				case 4243633165://ticket droid
+					{
+						printf("TicketDroid Clicked\n");
+						list<ItemData> playerItems;
+						playerItems = db->GetItemDataList(ObjID);
+
+						list<Ticket> playerTickets;
+						list<Ticket> ticketList;
+						ticketList = db->GetTickets(npc->planet_id,true);
+						bool hasTicket = false;
+						string NPCDeparturePort;
+						printf("Ticket Droid Ticket ID:%i\n",npc->ticketid);
+						for(std::list<Ticket>::iterator tt = ticketList.begin(); tt != ticketList.end(); tt++)
+						{
+							if(npc->ticketid == tt->ticketID)
+							{
+								NPCDeparturePort = tt->destination.c_str();
+								printf("DeparturePort:%s\n",NPCDeparturePort.c_str());
+								for(std::list<ItemData>::iterator it = playerItems.begin(); it != playerItems.end(); it++)
+								{
+									printf("Departure City:%s  NPC City: %s\n",it->departurecity.c_str(),NPCDeparturePort.c_str());
+									if(it->travelticket && !strcmp(it->departurecity.c_str(),NPCDeparturePort.c_str()))
+									{
+										printf("Inserting Ticket to: %s",it->arrivalcity.c_str());
+										playerTickets.push_back(db->GetTicketDataFromPlayerItem(it->serial));
+										hasTicket = true;
+									}
+								}
+								if(!hasTicket)
+								{
+									//fly text you do not have a ticket to board this transport
+									QueuePacket(QUEUE_NoTravelTicket);
+									SEND_QueuedPackets(PLAYER,false);
+								}
+								else
+								{
+
+									SendMessageToPlayer("You Have a Ticket");
+
+								}
+
+								NPCID=0;
+							}
+						}
+						break;
+					}
+				}
+			}
+			
+			break;
+		}
+	case 1: //Building
+		{
+			SendMessageToPlayer(" Building Function not Implemented");
+			break;
+		}
+	case 2: //Cell Item
+		{
+			SendMessageToPlayer(" Cell Item Function not Implemented");
+			break;
+		}
+	case 3://World Object
+		{	
+			int woID = uItemID - OffsetList[objType];
+			switch(itemTemplateID)
+			{
+			case 3534:
+				{
+					for(std::list<_PlayerSpawnedObjects>::iterator m = PlayerSpawnedObjects.begin(); m != PlayerSpawnedObjects.end(); m++ )
+					{
+						if(m->spawnID == uItemID && m->isMounted)
+						{
+							ByteBuffer SB;
+							SB.writeINT(0);
+							SB.writeINT(0);
+							SB.writeLONG(uItemID);
+							HANDLE_ObjController_CommandQueueEnqueue_dismount(SB);
+						}
+						else if(m->spawnID == uItemID && !m->isMounted)
+						{
+							ByteBuffer SB;
+							SB.writeINT(0);
+							SB.writeINT(0);
+							SB.writeLONG(uItemID);
+							HANDLE_ObjController_CommandQueueEnqueue_mount(SB);
+						}
+					}
+					
+					break;
+				}
+			default:
+				{
+					stringstream toPlayer;
+					toPlayer << "World Object Function not Implemented for Object ID:" << uItemID << " Template ID:" << itemTemplateID;
+					SendMessageToPlayer((char*)toPlayer.str().c_str());
+					break;
+				}
+			}
+			
+			
+
+			break;
+		}
+	case 4://Item
+		{
+			//ticket template id 14132
+			int itemID = uItemID - OffsetList[objType];
+			printf("UseItem ID:%i\n",itemID);
+			if(uItemID == 0){break;}
+			ItemData Item = db->GetItemData(itemID);
+			
+			switch(Item.template_id)
+			{
+			case 14132:
+				{
+					printf("UseItem Travel Ticket\n");
+					break;
+				}
+			case 3534: //speederbike Swoop
+				{
+					printf("UseItem Speederbike Swoop\n");
+					break;
+				}
+			}
+			break;
+		}
+	case 5://Datapad waypoint
+		{
+			
+			SendMessageToPlayer("Waypoint Item");
+				
+			
+			break;
+		}
+	case 6://terminal
+		{
+			printf("Player Clicked on a Terminal\n");
+			list<Terminal>  tempTerm ;
+			tempTerm = db->GetTerminal(planetID);
+			int termID = uItemID - OffsetList[objType];
+
+			for(std::list<Terminal>::iterator t = tempTerm.begin(); t != tempTerm.end(); t++)
+			{
+				if(t->npc_id == termID)
+				{
+					switch (t->crc)
+					{
+					case 2527534357: //House Sign
+						{
+							printf("House Sign Clicked\n");
+							ErrorTitle = "Sign";
+							ErrorMessage = t->name.c_str();
+							QueuePacket(QUEUE_Error_Message);
+							SEND_QueuedPackets(PLAYER,false);
+							ErrorTitle = "";
+							ErrorMessage = "";
+							break;
+						}
+					case 1946349820: //Travel Terminal
+						{
+							selectedTravelTerminal = t->npc_id;
+							travelTerminalTicketID = t->ticketid;
+
+							QueuePacket(QUEUE_EnterTicketPurchaseModeMessage);
+							SEND_QueuedPackets(PLAYER,false);
+							break;
+						}
+					case 4023332994: //maintenance Terminal
+						{
+							stringstream toPlayer;
+							toPlayer << "Use Item Terminal:" << termID ;
+							SendMessageToPlayer(toPlayer.str().c_str());
+							break;
+						}
+					}
+
+				}
+				
+			}
+			break;
+		}
+	case 7://instance
+		{
+			SendMessageToPlayer(" Instance Function not Implemented");
+			break;
+		}
+	case 8://Player
+		{
+			SendMessageToPlayer("Player Clicked -1");
+			break;
+		}
+	case 9://CLIENT_OBJECT
+		{
+			stringstream toPlayer;
+			int iClientWorldObjectTemplate;
+			iClientWorldObjectTemplate = db->GetClientWorldObjectTemplateID(uItemID);
+
+			switch(iClientWorldObjectTemplate)
+			{
+			case 14048: //bank
+				{
+					//toPlayer << "Bank Terminal Client World Object ItemID: " << uItemID << " TemplateID: " << iClientWorldObjectTemplate;
+					//SendMessageToPlayer(toPlayer.str().c_str());
+					break;
+				}
+			default:
+				{
+					
+					toPlayer << "UnHandled Client World Object UseItem ItemID: " << uItemID << " TemplateID: " << iClientWorldObjectTemplate;
+					SendMessageToPlayer(toPlayer.str().c_str());
+					break;
+				}
+			}
+			
+			break;
+		}
+	case -1:
+		{
+			SendMessageToPlayer("Invalid Object Clicked -1");
+			break;
+		}
+	default:
+		{
+			SendMessageToPlayer(" Unknown Item");
+			break;
+		}
+	}
+
 return; 
 }
 
@@ -412,21 +1312,7 @@
 			Log->zbe("    ----Unhandled CommandQueueEnqueue: [0x%.8X]. \n",commandCRC);
 			if(debug)
 			{
-				printf("   ---Packet Contents\n");
-				
-				while(Packet.getBytesLeft() != 0 )
-				{
-					unsigned char b = Packet.readBYTE();
-					if(b >= 0x10)
-					{
-						printf(" %X",b);
-					}
-					else
-					{
-						printf(" 0%X",b);
-					}
-				}
-				printf("\n\n");
+				PrintPacketToScreen(Packet);
 			}
 		}
 		else isHandled = false; }	
@@ -447,11 +1333,60 @@
 		//WARP COMMAND
 		//!!!!!!!!!!!!
 		if(command.get(0) == "&travel") {
-			if(command.getnum() != 5) {
-				sMessage = "Invalid Travel Paramters: Proper usage '&travel (local or planet_id) x z y'";
-				QueuePacket(QUEUE_ChatSystemMessage);
-				SEND_QueuedPackets(PLAYER,false);
-				sMessage = "";	
+			
+			if(command.getnum() == 2)
+			{
+				SendMessageToPlayer("Traveling");
+				list<Ticket> travelTicket;
+				int ticketReq;
+				ticketReq = atoi(command.get(1).c_str());
+				printf("Ticket Requested: %i",ticketReq);
+				for(int i = 0;i<10;i++)
+				{
+					travelTicket = db->GetTickets(i,true);
+					for(std::list<Ticket>::iterator tt = travelTicket.begin(); tt != travelTicket.end(); tt++)
+					{
+						if(tt->ticketID == ticketReq)
+						{
+							CharacterData.x = (tt->x + ((float)(((float) rand() / (float) RAND_MAX) * 3 + 1)));
+							CharacterData.y = (tt->y + ((float)(((float) rand() / (float) RAND_MAX) * 3 + 1)));
+							CharacterData.z = tt->z;
+							CharacterData.planet_id = tt->planet_id;
+							CharacterData.cell_id = 0;
+							
+							db->UpdatePlayerPos(CharacterData,false,0);
+							
+							ByteBuffer SC; SC.writeLONG(ObjID);
+							db->UpdatePopulation(-1);
+							HANDLE_CharacterTravel(SC);
+							return;
+						}
+					}
+				}
+			}
+			else if(command.getnum() != 5) {
+				SendMessageToPlayer("Invalid Travel Paramters: Proper usage '&travel (local or planet_id) x z y'");
+				SendMessageToPlayer("Or you can type &travel <ticketid>");
+				SendMessageToPlayer("Ticket Locations As Follows by Planet:");
+				stringstream toSend;
+				list<Ticket> travelTicket;
+
+				for(int i = 0;i<10;i++)
+				{
+					toSend.str("");
+					toSend << "***** " << PlanetNames[i] << " *****";
+					SendMessageToPlayer((char*)toSend.str().c_str());
+					toSend.str("");
+					
+					travelTicket = db->GetTickets(i,true);
+					for(std::list<Ticket>::iterator tt = travelTicket.begin(); tt != travelTicket.end(); tt++)
+					{
+						toSend.str("");
+						toSend << "Ticket ID: " << tt->ticketID << " City: " << tt->destination.c_str();	
+						SendMessageToPlayer((char*)toSend.str().c_str());
+						toSend.str("");
+					}
+				}
 				return;
 			}
 			else {
@@ -558,7 +1493,7 @@
 	//			SEND_QueuedPackets(PLAYER,false);
 	//			sMessage = "";	
 	//			return;
-	//		}
+	//		
 			//if(command.getnum() != 5)
 
 			// ~zstars
@@ -595,6 +1530,8 @@
 					{
 						_newNPC.CellID = 0;
 					}
+					_newNPC.ticketdroid = false;
+					_newNPC.ticketid = 0;
 					StaticNPC AddedNPC;
 					AddedNPC = db->AddStaticNPC(_newNPC);
 					if (AddedNPC.npc_id != -1)
@@ -628,7 +1565,70 @@
 					}
 				}
 			}
-
+			else if (command.get(1) == "ticketdroid") //we want to drop an npc
+			{
+				if(command.getnum() < 3)
+				{
+					SendMessageToPlayer("Invalid Place Ticket Droid Paramters: Proper usage '&place [ticketdroid] {ticketid}'");
+					return;
+				}
+				else if (command.getnum() == 3)
+				{
+					StaticNPC _newNPC;
+					_newNPC.crc = 4243633165; //(uint32)atof(command.get(2).c_str());
+					_newNPC.name = "Ticket Droid";//command.get(3).c_str();
+					_newNPC.bitmask = 128;
+					_newNPC.oI = CharacterData.n;
+					_newNPC.oJ = CharacterData.s;
+					_newNPC.oK = CharacterData.e;
+					_newNPC.oW = CharacterData.w;
+					_newNPC.x = CharacterData.x;
+					_newNPC.z = CharacterData.z;
+					_newNPC.y = CharacterData.y;
+					_newNPC.planet_id = planetID;
+					if (FlagCell)
+					{
+						_newNPC.CellID = CellID;
+					}
+					else
+					{
+						_newNPC.CellID = 0;
+					}
+					_newNPC.ticketdroid = true;
+					_newNPC.ticketid = atoi(command.get(2).c_str());;
+					StaticNPC AddedNPC;
+					AddedNPC = db->AddStaticNPC(_newNPC);
+					if (AddedNPC.npc_id != -1)
+					{
+						stringstream tempMsg;
+						tempMsg.str("");
+						tempMsg << "-Ticket Droid added to DB with ID:" << AddedNPC.npc_id << " Named:" << AddedNPC.name.c_str() << "-\n";
+						Log->cbe((char*)tempMsg.str().c_str());
+						sMessage = (char*)tempMsg.str().c_str();
+						QueuePacket(QUEUE_ChatSystemMessage);
+						SEND_QueuedPackets(PLAYER,false);
+						sMessage = "";	
+						Log->cbe("Spawning NPC\n");
+						sMessage = "Spawning NPC\n";
+						QueuePacket(QUEUE_ChatSystemMessage);
+						SEND_QueuedPackets(PLAYER,false);
+						sMessage = "";	
+						
+						SpawnCreature(AddedNPC.npc_id + NPC_OFFSET,AddedNPC.crc,AddedNPC.name,AddedNPC.bitmask,AddedNPC.oI,AddedNPC.oJ,AddedNPC.oK,AddedNPC.oW,AddedNPC.x,AddedNPC.z,AddedNPC.y,AddedNPC.health,AddedNPC.action,AddedNPC.mind,AddedNPC.CellID,AddedNPC.dancestring,AddedNPC.posture);
+						
+						return;
+					}
+					else
+					{
+						Log->cbe("AddStaticNPC Failure Npc Not added %i\n",AddedNPC.npc_id);
+						sMessage = "Failed to add new NPC\n";
+						QueuePacket(QUEUE_ChatSystemMessage);
+						SEND_QueuedPackets(PLAYER,false);
+						sMessage = "";	
+						return;
+					}
+				}
+			}
 			else if (command.get(1) == "npc") //we want to drop an npc
 			{
 				if(command.getnum() < 4)
@@ -661,6 +1661,8 @@
 					{
 						_newNPC.CellID = 0;
 					}
+					_newNPC.ticketdroid = false;
+					_newNPC.ticketid = 0;
 					StaticNPC AddedNPC;
 					AddedNPC = db->AddStaticNPC(_newNPC);
 					if (AddedNPC.npc_id != -1)
@@ -717,6 +1719,8 @@
 					{
 						_newNPC.CellID = 0;
 					}
+					_newNPC.ticketdroid = false;
+					_newNPC.ticketid = 0;
 					StaticNPC AddedNPC;
 					AddedNPC = db->AddStaticNPC(_newNPC);
 					if (AddedNPC.npc_id != -1)
@@ -765,14 +1769,16 @@
 					_newTerminal.crc = (uint32)atof(command.get(2).c_str());
 					_newTerminal.name = command.get(3).c_str();
 					_newTerminal.bitmask = 128;
-					_newTerminal.oI = oI;
-					_newTerminal.oJ = oJ;
-					_newTerminal.oK = oK;
-					_newTerminal.oW = oW;
-					_newTerminal.x = posX;
-					_newTerminal.z = posZ;
-					_newTerminal.y = posY;
+					_newTerminal.oI = CharacterData.n;
+					_newTerminal.oJ = CharacterData.s;
+					_newTerminal.oK = CharacterData.e;
+					_newTerminal.oW = CharacterData.w;
+					_newTerminal.x = CharacterData.x;
+					_newTerminal.z = CharacterData.z;
+					_newTerminal.y = CharacterData.y;
 					_newTerminal.planet_id = planetID;
+					_newTerminal.travelterminal = 0;
+					_newTerminal.ticketid = 0;
 					if (FlagCell)
 					{
 						_newTerminal.CellID = CellID;
@@ -840,6 +1846,8 @@
 						_newTerminal.CellID = 0;
 					}
 					_newTerminal.type = 1;
+					_newTerminal.travelterminal = 0;
+					_newTerminal.ticketid = 0;
 
 					Terminal AddedTerminal;
 					AddedTerminal = db->AddTerminal(_newTerminal);
@@ -874,6 +1882,78 @@
 					}
 				}
 			}
+			else if (command.get(1) == "travelterminal") //we want a terminal
+			{
+				if(command.getnum() < 3)
+				{
+					sMessage = "Invalid Place Terminal Paramters: Proper usage '&place [terminal] {crc} {name or name1 name2}'";
+					QueuePacket(QUEUE_ChatSystemMessage);
+					SEND_QueuedPackets(PLAYER,false);
+					sMessage = "";	
+					return;
+				}
+				else if (command.getnum() == 3)
+				{
+					Terminal _newTerminal;
+					_newTerminal.crc = 1946349820; //(uint32)atof(command.get(2).c_str());
+					stringstream tempName;
+					//tempName << command.get(3).c_str() << " " << command.get(4).c_str();
+					_newTerminal.name = "Travel Terminal"; //tempName.str().c_str();
+					_newTerminal.bitmask = 128;
+					_newTerminal.oI = CharacterData.n;
+					_newTerminal.oJ = CharacterData.s;
+					_newTerminal.oK = CharacterData.e;
+					_newTerminal.oW = CharacterData.w;
+					_newTerminal.x = CharacterData.x;
+					_newTerminal.z = CharacterData.z;
+					_newTerminal.y = CharacterData.y;
+					_newTerminal.planet_id = CharacterData.planet_id;
+					if (FlagCell)
+					{
+						_newTerminal.CellID = CellID;
+					}
+					else
+					{
+						_newTerminal.CellID = 0;
+					}
+					_newTerminal.type = 1;
+					_newTerminal.travelterminal = true;//atoi(command.get(5).c_str());
+					_newTerminal.ticketid = atoi(command.get(2).c_str());
+
+					Terminal AddedTerminal;
+					AddedTerminal = db->AddTerminal(_newTerminal);
+					if (AddedTerminal.npc_id != -1)
+					{
+						stringstream tempMsg;
+						tempMsg.str("");
+						tempMsg << "-Travel Terminal added to DB with ID:" << AddedTerminal.npc_id << " Named:" << AddedTerminal.name.c_str() << "-\n";
+						Log->cbe((char*)tempMsg.str().c_str());
+						sMessage = (char*)tempMsg.str().c_str();
+						QueuePacket(QUEUE_ChatSystemMessage);
+						SEND_QueuedPackets(PLAYER,false);
+						sMessage = "";	
+						Log->cbe("Spawning Travel Terminal\n");
+						sMessage = "Spawning Travel Terminal\n";
+						QueuePacket(QUEUE_ChatSystemMessage);
+						SEND_QueuedPackets(PLAYER,false);
+						sMessage = "";	
+						
+						SpawnCreature(AddedTerminal.npc_id + TERMINAL_OFFSET,AddedTerminal.crc,AddedTerminal.name,AddedTerminal.bitmask,AddedTerminal.oI,AddedTerminal.oJ,AddedTerminal.oK,AddedTerminal.oW,AddedTerminal.x,AddedTerminal.z,AddedTerminal.y,0,0,0,AddedTerminal.CellID,"",0);
+						
+						return;
+					}
+
+					else
+					{
+						Log->cbe("AddStaticTerminal Failure Terminal Not added %i\n",AddedTerminal.npc_id);
+						sMessage = "Failed to add new Terminal\n";
+						QueuePacket(QUEUE_ChatSystemMessage);
+						SEND_QueuedPackets(PLAYER,false);
+						sMessage = "";	
+						return;
+					}
+				}
+			}
 			else if (command.get(1) == "building") //we want a building
 			{
 				sMessage = "Command not impelemented";
@@ -904,21 +1984,21 @@
 			stringstream helpMsg;
 			string outMsg;
 			helpMsg.str("");
-			helpMsg << "Current Coords: x:" << posX << ", z:" << posZ << ", y:" << posY;
+			helpMsg << "Current Coords: x:" << CharacterData.x << ", z:" << CharacterData.z << ", y:" << CharacterData.y;
 			outMsg=helpMsg.str().c_str();
 			sMessage = (char*)outMsg.c_str();
 			QueuePacket(QUEUE_ChatSystemMessage);
 			SEND_QueuedPackets(PLAYER,false);
 			sMessage = "";	
 			helpMsg.str("");
-			helpMsg << ", oI:" << oI << ", oJ:" << oJ;
+			helpMsg << ", oI:" << CharacterData.n << ", oJ:" << CharacterData.s;
 			outMsg=helpMsg.str().c_str();
 			sMessage = (char*)outMsg.c_str();
 			QueuePacket(QUEUE_ChatSystemMessage);
 			SEND_QueuedPackets(PLAYER,false);
 			sMessage = "";	
 			helpMsg.str("");
-			helpMsg << ", oK:" << oK << ", oW:" << oW;
+			helpMsg << ", oK:" << CharacterData.e << ", oW:" << CharacterData.w;
 			outMsg=helpMsg.str().c_str();
 			sMessage = (char*)outMsg.c_str();
 			QueuePacket(QUEUE_ChatSystemMessage);
@@ -981,39 +2061,24 @@
 			//	SEND_QueuedPackets(PLAYER,false);
 			}
 		}
-		else if (command.get(0) == "&route") //we want to route emails
+		else if (command.get(0) == "&npcmove") //we want to route emails
 		{
+				SendMessageToPlayer("Attempting to move NPC");
+				
+				npcposX = posX;
+				npcposY = posY;
+				npcposZ = posZ;
+				if(FlagCell)
+				{
+					QueuePacket(QUEUE_UpdateNPCTransformMessage);
+				}
+				else
+				{
+					QueuePacket(QUEUE_UpdateNPCTransformParentMessage);
+				}
+				SEND_QueuedPackets(CHATRANGE,false);
 			
-			/*
-			list <Email> * _MessageList = new list<Email>;
-			_MessageList = db->GetEmailHeaders(ObjID);
 			
-			for( std::list<Email>::iterator it = _MessageList->begin(); it != _MessageList->end(); it++)
-			{
-				if(!it->Error)
-				{
-					PlayerData RecipientData;
-					PlayerData SenderData;
-					RecipientData = db->GetPlayerData(it->Recipient);
-					SenderData = db->GetPlayerData(it->Sender);
-					EmailMessageRecipient = RecipientData.firstname.c_str();
-					EmailMessageID = it->ID;
-					EmailMessageBody = it->Body.c_str();
-					EmailMessageSubject = it->Subject.c_str();
-					EmailMessageSender = SenderData.fullName.c_str();
-					EmailMessageReadFlag = it->Read;
-
-					QueuePacket(QUEUE_NewEmailNotification);
-					SEND_QueuedPackets(PLAYER,false);
-					QueuePacket(QUEUE_SendEmailHeader);
-					SEND_QueuedPackets(PLAYER,false);
-					if(EmailMessageReadFlag)
-					{
-						QueuePacket(QUEUE_SendEmailContent);
-						SEND_QueuedPackets(PLAYER,false);
-					}
-				} 
-			}*/
 		}
 		else if(command.get(0) == "&debug")
 		{
@@ -1100,6 +2165,49 @@
 				}
 			}
 		}
+		else if(command.get(0) == "&credits")
+		{
+			if(command.get(1) == "bank")
+			{
+				CharacterData.bankcredits = atoi(command.get(2).c_str());
+				CharacterData = db->UpdateCharacterCredits(CharacterData);
+			//	QueuePacket(QUEUE_BankCreditsUpdateDelta);
+			//	SEND_QueuedPackets(PLAYER,false);
+			}
+			else if(command.get(1) == "inventory")
+			{
+				CharacterData.invcredits = atoi(command.get(2).c_str());
+				CharacterData = db->UpdateCharacterCredits(CharacterData);
+			//	QueuePacket(QUEUE_InventoryCreditsUpdateDelta);
+			//	SEND_QueuedPackets(PLAYER,false);
+			}
+		}
+		else if(command.get(0) == "&status")
+		{
+			OnlineStatusUpdateFriend._FriendID = ObjID;
+			OnlineStatusUpdateFriend._FriendName = db->GetPlayerData(ObjID).firstname.c_str();
+			OnlineStatusUpdateFriend._ObjID = ObjID;
+			OnlineStatusUpdateFriend.friendGalaxyID = db->GalaxyID;
+			if(OnlineStatusUpdateFriend.onlineStatus == 0x01)
+			{
+				SendMessageToPlayer("Status Set to Off Line");
+				OnlineStatusUpdateFriend.onlineStatus = 0x00;
+				QueuePacket(QUEUE_ChatAccountUpdate);
+				QueuePacket(QUEUE_FriendOfflineStatusUpdate);
+				QueuePacket(QUEUE_FriendOnlineStatusUpdate);
+				SEND_QueuedPackets(PLAYER,false);
+			}
+			else
+			{
+				SendMessageToPlayer("Status Set to On Line");
+				OnlineStatusUpdateFriend.onlineStatus = 0x01;
+				QueuePacket(QUEUE_ChatAccountUpdate);
+				QueuePacket(QUEUE_FriendOfflineStatusUpdate);
+				QueuePacket(QUEUE_FriendOnlineStatusUpdate);
+				SEND_QueuedPackets(PLAYER,false);
+			}
+			
+		}
 		//else if(... additonal commands)
 	}
 
@@ -1137,6 +2245,8 @@
 	//printf("Delete ID Requested %i\nBytes Left in Packet\n",delID);
 	int objType = -1;
 	int i = 0;
+	objType = ZClient::GetObjectTypeFromID(delID);
+	/*
 	while(objType == -1)
 	{
 		long tempID = delID;
@@ -1148,8 +2258,8 @@
 			objType = i;		
 		}
 		i++;
-	}
-	//printf("Object Type is:%s\n",OffsetNames[objType]);
+	}*/
+	if(debug){printf("Object Type is:%s\n",OffsetNames[objType]);}
 
 	switch(objType)
 	{
@@ -1191,9 +2301,18 @@
 			bool result = db->DeleteWaypoint(delID-DATAPAD_WAYPOINT_OFFSET);
 			if(result)
 			{
+				if(delID-DATAPAD_WAYPOINT_OFFSET == FriendWaypointID)
+				{
+					db->UpdateCharacterFriendWaypointID(ObjID,0);
+					FriendWaypointID=0;
+					CharacterData.friend_waypoint_id = 0;
+				}
 				QueuePacket(QUEUE_SceneDestroyObject);//Make the packet  
 				SEND_QueuedPackets(PLAYER,false); //Send the packet and delete item from UI.
 				SendMessageToPlayer("Waypoint Deleted");
+				//ZClient::vClientWaypoints.clear();
+				ZClient::vClientWaypoints = db->LoadWaypoints(ObjID, db->GalaxyID);	
+				
 			}
 			break;
 		}
@@ -1207,6 +2326,14 @@
 			SendMessageToPlayer("Delete Instance Function not Implemented");
 			break;
 		}
+	case 8://Player
+		{
+			break;
+		}
+	case 9://CLIENT_OBJECT
+		{
+			break;
+		}
 	default:
 		{
 			SendMessageToPlayer("Error Deleting Item");
@@ -1287,9 +2414,21 @@
 	int wpID = db->SaveWaypoint(ObjID,wpName.str().c_str(),planetID,X,Z,Y,true,0,false,db->GalaxyID);
 	if(wpID >=1)
 	{
-		vClientWaypoints = db->LoadWaypoints(ObjID, db->GalaxyID);
+		
+		//ZClient::vClientWaypoints.clear();
+		ZClient::vClientWaypoints = db->LoadWaypoints(ObjID, db->GalaxyID);
 		// Insert Datapad Update Here so Players Datapad Receives new Waypoint.
 		SendMessageToPlayer("Waypoint: New waypoint created.");
+		wpReload = true;
+		for (vector<Waypoints>::iterator i = vClientWaypoints.begin(); i != vClientWaypoints.end(); i++) 
+		{
+			if(debug){printf("Deleting Waypoint id:%i : Named: %s Status: %i\n",i->waypointID,i->waypointName.c_str(),i->bActive);}
+			delID = i->waypointID + DATAPAD_WAYPOINT_OFFSET;
+		
+			QueuePacket(QUEUE_SceneDestroyObject);
+			QueuePacket(QUEUE_UpdateContainmentMessage);
+			SEND_QueuedPackets(PLAYER,false);
+		}
 		UpdatePlayerBaselines(ObjID);
 	}
 	else
@@ -1452,6 +2591,191 @@
 	Terminal structureSign;
 	PlayerData structureOwner;
 	structureOwner = db->GetPlayerData(ObjID);
+	stringstream tempStructureName;
+
+	int structuretype;
+
+	if(strstr(BuildingDeedIff.c_str(),"house") != 0)
+	{
+		tempStructureName << structureOwner.firstname.c_str() << "'s House";
+		structuretype = 0;
+
+	}
+	else if(strstr(BuildingDeedIff.c_str(),"guild") != 0)
+	{
+		tempStructureName << structureOwner.firstname.c_str() << "'s Guild Hall";
+		structuretype = 1;
+	}
+	else if(strstr(BuildingDeedIff.c_str(),"cantina") != 0)
+	{
+		tempStructureName << structureOwner.firstname.c_str() << "'s Cantina";
+		structuretype = 3;
+	}
+	else if(strstr(BuildingDeedIff.c_str(),"harvester") != 0)
+	{
+		structuretype = 4;
+		if(strstr(BuildingDeedIff.c_str(),"ore") != 0)
+		{
+			if(strstr(BuildingDeedIff.c_str(),"heavy") != 0)
+			{
+				tempStructureName << "Heavy Mineral Installation";
+			}
+			if(strstr(BuildingDeedIff.c_str(),"s2") != 0)
+			{
+				tempStructureName << "Medium Mineral Installation";
+			}
+			if(strstr(BuildingDeedIff.c_str(),"s1") != 0)
+			{
+				tempStructureName << "Personal Harvester";
+			}
+		}
+		else if(strstr(BuildingDeedIff.c_str(),"flora") != 0)
+		{
+			if(strstr(BuildingDeedIff.c_str(),"heavy") != 0)
+			{
+				tempStructureName << "High Capacity Flora Farm";
+			}
+			else if(strstr(BuildingDeedIff.c_str(),"medium") != 0)
+			{
+				tempStructureName << "Flora Farm";
+			}
+			else
+			{
+				tempStructureName << "Micro Flora Farm";
+			}
+		}
+		else if(strstr(BuildingDeedIff.c_str(),"liquid") != 0) //aka chemical
+		{
+			if(strstr(BuildingDeedIff.c_str(),"heavy") != 0)
+			{
+				tempStructureName << "Heavy Chemical Harvester";
+			}
+			else if(strstr(BuildingDeedIff.c_str(),"medium") != 0)
+			{
+				tempStructureName << "Medium Chemical Harvester";
+			}
+			else
+			{
+				tempStructureName << "Chemical Harvester";
+			}
+		}
+		else if(strstr(BuildingDeedIff.c_str(),"moisture") != 0)
+		{
+			if(strstr(BuildingDeedIff.c_str(),"heavy") != 0)
+			{
+				tempStructureName << "High Capacity Moisture Vaparator";
+			}
+			else if(strstr(BuildingDeedIff.c_str(),"medium") != 0)
+			{
+				tempStructureName << "Moisture Vaparator";
+			}
+			else
+			{
+				tempStructureName << "Personal Moisture Vaparator";
+			}
+		}
+		else if(strstr(BuildingDeedIff.c_str(),"gas") != 0)
+		{
+			if(strstr(BuildingDeedIff.c_str(),"heavy") != 0)
+			{
+				tempStructureName << "Heavy Gas Extractor";
+			}
+			else if(strstr(BuildingDeedIff.c_str(),"medium") != 0)
+			{
+				tempStructureName << "Medium Gas Harvester";
+			}
+			else
+			{
+				tempStructureName << "Personal Gas Harvester";
+			}
+		}
+	}
+	else if(strstr(BuildingDeedIff.c_str(),"bank") != 0)
+	{
+		structuretype = 5;
+		tempStructureName << structureOwner.firstname.c_str() << "'s Bank";
+	}
+	else if(strstr(BuildingDeedIff.c_str(),"garage") != 0)
+	{
+		structuretype = 6;
+		tempStructureName << structureOwner.firstname.c_str() << "'s Vehicle Garage";
+	}
+	else if(strstr(BuildingDeedIff.c_str(),"hospital") != 0)
+	{
+		structuretype = 7;
+		tempStructureName << structureOwner.firstname.c_str() << "'s Hospital";
+	}
+	else if(strstr(BuildingDeedIff.c_str(),"theater") != 0)
+	{
+		structuretype = 8;
+		tempStructureName << structureOwner.firstname.c_str() << "'s Theater";
+	}
+	else if(strstr(BuildingDeedIff.c_str(),"cityhall") != 0)
+	{
+		structuretype = 9;
+		tempStructureName << structureOwner.firstname.c_str() << "'s City Hall";
+	}
+	else if(strstr(BuildingDeedIff.c_str(),"garden") != 0)
+	{
+		structuretype = 10;
+		tempStructureName << structureOwner.firstname.c_str() << "'s Garden";
+	}
+	else if(strstr(BuildingDeedIff.c_str(),"shuttle") != 0)
+	{
+		structuretype = 11;
+		tempStructureName << structureOwner.firstname.c_str() << "'s Shuttle Port";
+	}
+	else if(strstr(BuildingDeedIff.c_str(),"factory") != 0)
+	{
+		structuretype = 12;
+		if(strstr(BuildingDeedIff.c_str(),"clothing") != 0)
+		{
+			tempStructureName << "Wearables Factory";
+		}
+		else if(strstr(BuildingDeedIff.c_str(),"food") != 0)
+		{
+			tempStructureName << "Chemical Factory";
+		}
+		else if(strstr(BuildingDeedIff.c_str(),"item") != 0)
+		{
+			tempStructureName << "Weapons Droid Factory";
+		}
+		else if(strstr(BuildingDeedIff.c_str(),"structure") != 0)
+		{
+			tempStructureName << "Structure Factory";
+		}
+		else
+		{
+			tempStructureName << "Unknown Factory";
+		}
+	}
+	else if(strstr(BuildingDeedIff.c_str(),"generator") != 0)
+	{
+		structuretype = 13;
+		if(strstr(BuildingDeedIff.c_str(),"fusion") != 0)
+		{
+			tempStructureName << "Fusion Ion Generator";
+		}
+		else if(strstr(BuildingDeedIff.c_str(),"solar") != 0)
+		{
+			tempStructureName << "Solar Generator";
+		}
+		else if(strstr(BuildingDeedIff.c_str(),"wind") != 0)
+		{
+			tempStructureName << "Wind Generator";
+		}
+		else
+		{
+			tempStructureName << "Unknown Generator";
+		}
+	}
+	else if(strstr(BuildingDeedIff.c_str(),"merchant") != 0)
+	{
+		structuretype = 14;
+		tempStructureName << structureOwner.firstname.c_str() << "'s Merchant Tent";
+	}
+	structureSign.name = tempStructureName.str().c_str();
+
 	if (BaseRequired)
 	{	//printf("Spawning Base: %s\n",BuildingBase.c_str());
 		//make serial numbers
@@ -1492,7 +2816,7 @@
 		{
 			//printf("Adding Maintenance Terminal\n");
 			structureTerminal.bitmask = 128; //160=attachable NPC
-			structureTerminal.CellID =( (((buID)+(buID * CELL_OFFSET))+BUILDINGS_OFFSET) + Building_terminal_cellID);
+			structureTerminal.CellID =( (((buID * CELL_OFFSET))+BUILDINGS_OFFSET) + Building_terminal_cellID);
 			structureTerminal.crc = SWGCRC(BuildingTerminalIFF.c_str());
 			structureTerminal.name = "Structure Maintenance Terminal";
 			structureTerminal.x = (Building_terminal_x);
@@ -1504,6 +2828,8 @@
 			structureTerminal.oW = (Building_terminal_oW);
 			structureTerminal.planet_id = planetID;
 			structureTerminal.type = 4;
+			structureTerminal.travelterminal = 0;
+			structureTerminal.ticketid = 0;
 			structureTerminal = db->AddTerminal(structureTerminal);
 			//printf("Terminal Added\n");
 			db->UpdateBuildingTerminal(buID,structureTerminal.npc_id);
@@ -1520,10 +2846,7 @@
 			structureSign.bitmask = 128;
 			structureSign.CellID = 0;
 			structureSign.crc = SWGCRC(BuildingSignIFF.c_str());
-			
-			stringstream tempStructureName;
-			tempStructureName << structureOwner.firstname.c_str() << "'s House";
-			structureSign.name = tempStructureName.str().c_str();
+			//structureSign.name = tempStructureName.str().c_str();
 			structureSign.x = (signwayX);
 			structureSign.z = (signwayZ);
 			structureSign.y = (signwayY);
@@ -1533,6 +2856,8 @@
 			structureSign.oW = (signW);
 			structureSign.planet_id = planetID;
 			structureSign.type = 3;
+			structureSign.travelterminal = 0;
+			structureSign.ticketid = 0;
 			structureSign = db->AddTerminal(structureSign);
 			db->UpdateBuildingSign(buID,structureSign.npc_id);
 			//printf("Sign Created:%i %s\n",structureSign.npc_id,structureSign.name);
@@ -1574,6 +2899,8 @@
 			structureTerminal.oW = (Building_terminal_oW);
 			structureTerminal.planet_id = planetID;
 			structureTerminal.type = 4;
+			structureTerminal.travelterminal = 0;
+			structureTerminal.ticketid = 0;
 			structureTerminal = db->AddTerminal(structureTerminal);
 			//printf("Terminal Added\n");
 			db->UpdateBuildingTerminal(buID,structureTerminal.npc_id);
@@ -1590,9 +2917,9 @@
 			structureSign.crc = SWGCRC(BuildingSignIFF.c_str());
 			//PlayerData structureOwner;
 			//structureOwner = db->GetPlayerData(ObjID);
-			stringstream tempStructureName;
-			tempStructureName << structureOwner.firstname.c_str() << "'s House";
-			structureSign.name = tempStructureName.str().c_str();
+			//stringstream tempStructureName;
+			//tempStructureName << structureOwner.firstname.c_str() << StructureNameSuffix.str().c_str();
+			//structureSign.name = tempStructureName.str().c_str();
 			structureSign.x = (signwayX);
 			structureSign.z = (signwayZ);
 			structureSign.y = (signwayY);
@@ -1602,6 +2929,8 @@
 			structureSign.oW = (signW);
 			structureSign.planet_id = planetID;
 			structureSign.type = 3;
+			structureSign.travelterminal = 0;
+			structureSign.ticketid = 0;
 			structureSign = db->AddTerminal(structureSign);
 			db->UpdateBuildingSign(buID,structureSign.npc_id);
 			//printf("Sign Created:%i %s\n",structureSign.npc_id,structureSign.name);
@@ -1617,12 +2946,23 @@
 		{
 			//here is where we make a new waypoint for the building placed and save it to the users data pad.
 			stringstream wpName;
-			wpName << structureOwner.firstname.c_str() << "'s Structure Waypoint";
+			wpName << structureSign.name.c_str() << " Waypoint"; //structureOwner.firstname.c_str() << "'s Structure Waypoint";
 			int wpID = db->SaveWaypoint(ObjID,wpName.str().c_str(),planetID,wayX,wayZ,wayY,true,0,false,db->GalaxyID);
 			if(wpID >= 1)
 			{
-				vClientWaypoints = db->LoadWaypoints(ObjID, db->GalaxyID);
+				//ZClient::vClientWaypoints.clear();
+				ZClient::vClientWaypoints = db->LoadWaypoints(ObjID, db->GalaxyID);
 				//Place update to Players Datapad Here!!
+				wpReload = true;
+				for (vector<Waypoints>::iterator i = vClientWaypoints.begin(); i != vClientWaypoints.end(); i++) 
+				{
+					if(debug){printf("Deleting Waypoint id:%i : Named: %s Status: %i\n",i->waypointID,i->waypointName.c_str(),i->bActive);}
+					delID = i->waypointID + DATAPAD_WAYPOINT_OFFSET;
+				
+					QueuePacket(QUEUE_SceneDestroyObject);
+					QueuePacket(QUEUE_UpdateContainmentMessage);
+					SEND_QueuedPackets(PLAYER,false);
+				}
 				UpdatePlayerBaselines(ObjID);
 			}
 			else
@@ -1632,7 +2972,7 @@
 			
 			//here is where we send the user a new email for the building just created and attach the waypoint to it.
 			stringstream structureMessage;
-			structureMessage << "Your new Structure has been placed on " << PlanetNames[planetID];
+			structureMessage << wpName.str().c_str() << " has been placed on " << PlanetNames[planetID];
 			structureMessage << "\nAt coordinates " << signwayX << ", " << signwayY;
 
 			Email eml;
@@ -1653,19 +2993,205 @@
 return; }
 
 void ZClient::HANDLE_ObjController_CommandQueueEnqueue_purchaseticket(ByteBuffer &Packet) {
+	//0xBFF5BE51  51 BE F5 BF
 	Packet.readINT(); //tick count
 	Packet.readINT(); //commandCRC
-	uint64 tItemID = Packet.readLONG();
-	string tStrn = Packet.readUSTRINGtoASCII();
-		//example of string   naboo SWGPreCU Dev City naboo Theed 0     departure planet  departure city   arival planet arival city  flag 0 or 1 for Roundtrip
-	SpawnItem(false,0,4 + rand() %10000 + ITEM_OFFSET,3667975811,"","","Travel Ticket",0,0,0,0,0,0,0,ObjID + 1,false,false,false,false);
+	long unk = Packet.readLONG();
+	//printf("Unknown Long:%X\n",unk);
+	string ticketStrn = Packet.readUSTRINGtoASCII();
+	if(debug){printf("Purchasing ticket:str: %s\n",ticketStrn.c_str());}
+	//naboo Dee'ja_Peak_Shuttleport naboo Kaadara_Shuttleport 0
+	CParam ticket(ticketStrn.c_str());
+	string departurePlanet;
+	string arrivalPlanet;
+	stringstream departureCity;
+	stringstream arrivalCity;
+	bool roundTrip;
+	int departurePlanetID;
+	int arrivalPlanetID;
+
+/*	for(int i=0;i<ticket.getnum();i++)
+	{
+		printf("[%i] %s\n",i,ticket.get(i).c_str());
+	}*/
+	departurePlanet = ticket.get(0).c_str();
+	arrivalPlanet = ticket.get(2).c_str();
+	roundTrip = atoi(ticket.get(4).c_str());
+	
+	for(int i=0;i<ticket.get(1).length();i++)
+	{
+		string t;
+		t = ticket.get(1)[i];
+		if(!strcmp(t.c_str(),"_"))
+		{
+			departureCity << " ";
+		}
+		else
+		{
+			departureCity << ticket.get(1)[i];
+		}
+	}
+	//printf("Departure City:%s\n",departureCity.str().c_str());
+	for(int i=0;i<ticket.get(3).length();i++)
+	{
+		string t;
+		t = ticket.get(3)[i];
+		if(!strcmp(t.c_str(),"_"))
+		{
+			arrivalCity << " ";
+		}
+		else
+		{
+			arrivalCity << ticket.get(3)[i];
+		}
+	}
+	//printf("Arrival City:%s\n",arrivalCity.str().c_str());
+	//printf("Departure Planet:%s\n",departurePlanet.c_str());
+	
+	
+	for(int i=0;i<10;i++)
+	{
+		if(!strcmp(departurePlanet.c_str(),FlattenedPlanetNames[i]) )
+		{
+			departurePlanetID = i;
+		}
+	}
+	//printf("Arrival Planet:%s\n",arrivalPlanet.c_str());
+	for(int i=0;i<10;i++)
+	{
+		if(!strcmp(arrivalPlanet.c_str(),FlattenedPlanetNames[i]))
+		{
+			arrivalPlanetID = i;
+		}
+	}
+	printf("PlanetsFound: d%i a%i\n",departurePlanetID,arrivalPlanetID);
+	
+	list<Ticket> ticketList;
+	Ticket SelectedTicket;
+	ticketList = db->GetTickets(arrivalPlanetID,true);
+	if(debug){printf("Looking for Destination :%s Planet: %i\n",arrivalCity.str().c_str(),arrivalPlanetID);}
+	for(std::list<Ticket>::iterator tt = ticketList.begin(); tt != ticketList.end(); tt++)
+	{
+		if(debug){printf("Iterating Through: %s\n",tt->destination.c_str());}
+		if(!strcmp(tt->destination.c_str(),arrivalCity.str().c_str()))
+		{
+			if(debug){printf("Found ticket Player is purchasing\n");}
+			SelectedTicket.ticketID = tt->ticketID;
+			SelectedTicket.cost = tt->cost;
+			SelectedTicket.destination = tt->destination.c_str();
+			SelectedTicket.planet_id = tt->planet_id;
+			SelectedTicket.x = tt->x;
+			SelectedTicket.y = tt->y;
+			SelectedTicket.z = tt->z;
+		}
+	}
+
+	int newTicket;
+	int returnTicket;
+	bool bankTransactionOk = false;
+	if(debug){printf("Player Credits: B:%i , I:%i , Ticket cost: %i\n",CharacterData.bankcredits,CharacterData.invcredits,SelectedTicket.cost);}
+	int tc;
+	if(roundTrip)
+	{
+		tc = db->GetTicketPrice(departurePlanetID,arrivalPlanetID);
+		tc = tc + db->GetTicketPrice(arrivalPlanetID,departurePlanetID);
+	}
+	else
+	{
+		tc = db->GetTicketPrice(departurePlanetID,arrivalPlanetID);
+	}
+	if(CharacterData.bankcredits >= tc)
+	{
+		purchasedTicketPrice = tc;
+		CharacterData.bankcredits = CharacterData.bankcredits - tc;
+		PlayerData TempPlayer;
+		TempPlayer = db->UpdateCharacterCredits(CharacterData);
+		if(CharacterData.bankcredits == TempPlayer.bankcredits)
+		{
+		//	QueuePacket(QUEUE_BankCreditsUpdateDelta);
+			QueuePacket(QUEUE_TicketPurchaseFlyText);
+			SEND_QueuedPackets(PLAYER,false);
+			bankTransactionOk = true;
+		}
+	}
+	else if (CharacterData.invcredits >= tc)
+	{
+		purchasedTicketPrice = tc;
+		CharacterData.invcredits = CharacterData.invcredits - tc;
+		PlayerData TempPlayer;
+		TempPlayer = db->UpdateCharacterCredits(CharacterData);
+		if(CharacterData.invcredits == TempPlayer.invcredits)
+		{
+		//	QueuePacket(QUEUE_BankCreditsUpdateDelta);
+			QueuePacket(QUEUE_TicketPurchaseFlyText);
+			SEND_QueuedPackets(PLAYER,false);
+			bankTransactionOk = true;
+		}
+	}
+	else
+	{
+		//QueuePacket(QUEUE_TicketPurchaseFailFlyText);
+		//SEND_QueuedPackets(PLAYER,false);
+		SendPlayerErrorMessage("Ticket Purchase Error","You do not have enough credits to purchase this ticket");
+		return;
+	}
+	
+	if(bankTransactionOk)
+	{
+		
+		newTicket = db->InsertTravelTicketToInventory(SelectedTicket,arrivalCity.str(),departureCity.str(),departurePlanetID,arrivalPlanetID,roundTrip,ObjID);
+		if(roundTrip)
+		{
+			list<Ticket> SelectedReturns;
+			SelectedReturns = db->GetTickets(departurePlanetID,true);
+			for(std::list<Ticket>::iterator sr = SelectedReturns.begin(); sr != SelectedReturns.end(); sr++)
+			{
+				if(!strcmp(sr->destination.c_str(),departureCity.str().c_str()))
+				{
+					printf("ReturnTicketFound");
+					Ticket RetTicket;
+					RetTicket.cost = sr->cost;
+					RetTicket.departure = sr->departure.c_str();
+					RetTicket.departureplanet = sr->departureplanet;
+					RetTicket.destination = sr->destination.c_str();
+					RetTicket.itemID = sr->itemID;
+					RetTicket.planet_id = sr->planet_id;
+					RetTicket.playercityshuttle = sr->playercityshuttle;
+					RetTicket.shuttle = sr->shuttle;
+					RetTicket.starport = sr->starport;
+					RetTicket.ticketID = sr->ticketID;
+					RetTicket.x = sr->x;
+					RetTicket.y = sr->y;
+					RetTicket.z = sr->z;
+					returnTicket = db->InsertTravelTicketToInventory(RetTicket,departureCity.str(),arrivalCity.str(),arrivalPlanetID,departurePlanetID,roundTrip,ObjID);		
+				}
+			}
+			
+		}
+	}
+	if(newTicket != 0)
+	{
+		SpawnItem(false,0,newTicket + ITEM_OFFSET,3667975811,"","","Travel Ticket",0,0,0,0,SelectedTicket.x,SelectedTicket.z,SelectedTicket.y,ObjID + INVENTORY_OFFSET,false,false,false,false);
+		if(roundTrip)
+		{
+			SpawnItem(false,0,returnTicket + ITEM_OFFSET,3667975811,"","","Travel Ticket",0,0,0,0,SelectedTicket.x,SelectedTicket.z,SelectedTicket.y,ObjID + INVENTORY_OFFSET,false,false,false,false);
+		}
+		//sui message for ticket ok goes here
+		lastSurveyWindow = time(0);		
+		QueuePacket(QUEUE_SUI_TicketPurchaseComplete);
+		SEND_QueuedPackets(PLAYER,false);
+
+	}
+	//example of string   naboo SWGPreCU Dev City naboo Theed 0     departure planet  departure city   arival planet arival city  flag 0 or 1 for Roundtrip
+	//SpawnItem(false,0,4 + rand() %10000 + ITEM_OFFSET,3667975811,"","","Travel Ticket",0,0,0,0,0,0,0,ObjID + 1,false,false,false,false);
+	//travel ticket template id is: 14132
 return; }
 
 void ZClient::HANDLE_ObjController_CommandQueueEnqueue_mount(ByteBuffer &Packet) {
 	Packet.readINT(); //tick count
 	Packet.readINT(); //commandCRC
 	//DB stuffs!!!! if mount ID = players mount ONLY then mount
-	uint64 requestedMount = Packet.readLONG();
+	long requestedMount = Packet.readLONG();
 	//mountID = requestedMount;
 	if(debug)
 	{
@@ -1677,7 +3203,7 @@
 
 	bool mountinlist = false;
 	_PlayerSpawnedObjects tempPlayerObject;
-	for(std::list<_PlayerSpawnedObjects>::iterator m = PlayerSpawnedObjects->begin(); m != PlayerSpawnedObjects->end(); m++ )
+	for(std::list<_PlayerSpawnedObjects>::iterator m = PlayerSpawnedObjects.begin(); m != PlayerSpawnedObjects.end(); m++ )
 	{
 		if(m->spawnID == requestedMount)
 		{
@@ -1713,7 +3239,7 @@
 		tempPlayerObject.x = posX + 0.3;
 		tempPlayerObject.z = posZ + 0.3;
 		tempPlayerObject.y = posY + 0.3;;
-		PlayerSpawnedObjects->push_back(tempPlayerObject);
+		PlayerSpawnedObjects.push_back(tempPlayerObject);
 		
 	}
 	int diffX = (int)(tempPlayerObject.x - posX);
@@ -1762,10 +3288,7 @@
 void ZClient::HANDLE_ObjController_CommandQueueEnqueue_dismount(ByteBuffer &Packet) {
 	Packet.readINT(); //tick count
 	Packet.readINT(); //commandCRC
-	if(debug)
-	{
-		printf("Dismount Requested:%u\n",mountID);
-	}
+	if(debug){printf("Dismount Requested:%u\n",mountID);}
 /*
 			printf("Packet Contents on Dismount\n");
 			while(Packet.getBytesLeft() != 0 )
@@ -1785,7 +3308,7 @@
 	//25 5 00 00 00 00 9B
 	bool mountinlist = false;
 	_PlayerSpawnedObjects tempPlayerObject;
-	for(std::list<_PlayerSpawnedObjects>::iterator m = PlayerSpawnedObjects->begin(); m != PlayerSpawnedObjects->end(); m++ )
+	for(std::list<_PlayerSpawnedObjects>::iterator m = PlayerSpawnedObjects.begin(); m != PlayerSpawnedObjects.end(); m++ )
 	{
 		if(m->isMounted && m->spawnID == mountID)
 		{
@@ -1828,7 +3351,7 @@
 		tempPlayerObject.spawnID = mountID;
 		tempPlayerObject.isEquipped = false;
 		tempPlayerObject.isMounted = false;
-		PlayerSpawnedObjects->push_back(tempPlayerObject);
+		PlayerSpawnedObjects.push_back(tempPlayerObject);
 	}
 
 	if(!tempPlayerObject.isMounted) 
@@ -1853,8 +3376,8 @@
 		ContainerID = 0; //tempPlayerObject.spawnID;
 		QueuePacket(QUEUE_SceneDestroyObject);
 		SEND_QueuedPackets(CHATRANGE,false);
-		
-	/*	hasSpawn = true;
+		/*
+		hasSpawn = true;
 		isSwoop = tempPlayerObject.isSwoop;
 		//Client->SpawnCreature(mountID,0xAF6D9F4F,"Speederbike Swoop",256,0,0,0,1,sposX,sposZ,posY, 0, 0, 0,0,"",0);
 		SpawnCreature(	tempPlayerObject.spawnID,
@@ -1875,7 +3398,7 @@
 						tempPlayerObject.perfid.c_str(),
 						tempPlayerObject.stanceID);
 		isSwoop = false;
-	*/	
+		*/
 		hasSpawn = false;				
 		sposX = 0; sposZ = 0; sposY = 0;
 		mountID = 0;
@@ -2041,6 +3564,249 @@
 	
 return; }
 
+void ZClient::HANDLE_ObjController_CommandQueueEnqueue_addfriend(ByteBuffer &Packet){
+
+/*
+
+[0x2A2357ED]. addfriend
+   ---Packet Contents
+
+ 
+00 00 00 00  //int
+ED 57 23 2A //crc command
+00 00 00 00 00 00 00 00 //target id
+//ustring friend being added
+09 00 00 00 
+72 00 69 00 73 00 61 00 6C 00 6A 00 61 00 6E 00 6E 00 
+
+AB ED//crc
+
+
+*/
+	Packet.readINT();
+	Packet.readINT();
+	Packet.readLONG();
+	string friendToAdd = Packet.readUSTRINGtoASCII();
+
+	//printf("FA:%s\n",friendToAdd.c_str());
+	int dotLocation;
+	string _GalaxyName = db->GalaxyName.c_str();
+	string _TempName;
+	dotLocation = friendToAdd.find(".",0);
+	_TempName = friendToAdd.c_str();
+	if(dotLocation >= 1)
+	{
+		_GalaxyName = friendToAdd.substr(0,(dotLocation));
+		_TempName = friendToAdd.substr((dotLocation+1),friendToAdd.length() - (dotLocation +1));
+	}
+	//printf("GalaxyName:%s\n",_GalaxyName.c_str());
+	//printf("TempName:%s\n",_TempName.c_str());
+
+	
+	if(_TempName.length() == 0)
+	{
+		ZClient::SendMessageToPlayer("You must enter a name to AddFriend");
+		return;
+	}
+	_TempName[0] = toupper(_TempName[0]);
+	list<FriendData> tempList;
+	tempList = db->GetFriendsList(ObjID);
+	for(std::list<FriendData>::iterator fl = tempList.begin(); fl != tempList.end(); fl++ )
+	{
+		if(!strcmp(fl->_FriendName.c_str(),_TempName.c_str()))
+		{
+			stringstream toPlayer;
+			toPlayer << fl->_FriendName.c_str() << " is already your friend.";
+			ZClient::SendMessageToPlayer((char*)toPlayer.str().c_str());
+			//FriendList = db->GetFriendsList(ObjID);
+			//QueuePacket(QUEUE_FriendListRequestResponse);
+			//QueuePacket(QUEUE_FriendListDeltasMessage);
+			//SEND_QueuedPackets(PLAYER,false);
+			//QueuePacket(QUEUE_DeltasMessage_FriendListUpdate);
+			//QueuePacket(QUEUE_ObjControllerMessage_FriendListUpdate);
+			//SEND_QueuedPackets(PLAYER,false);
+
+			return;
+		}
+	}
+	if(!db->AddFriend(ObjID,_TempName.c_str(),_GalaxyName.c_str()))
+	{
+		stringstream toPlayer;
+		toPlayer << _TempName.c_str() << " is not a valid friend name.";
+		ZClient::SendMessageToPlayer((char*)toPlayer.str().c_str());
+		return;
+	}
+
+	list<FriendData> TempFriendList;
+	FriendData newFriend;
+
+	TempFriendList = db->GetFriendsList(ObjID);
+	bool existingFriend;
+	for(std::list<FriendData>::iterator nf = TempFriendList.begin(); nf != TempFriendList.end(); nf++)
+	{
+		existingFriend = false;
+		for(std::list<FriendData>::iterator fl = FriendList.begin(); fl != FriendList.end(); fl++)
+		{
+			if(nf->_FriendID == fl->_FriendID)
+			{
+				existingFriend = true;
+			}
+		}
+		if(!existingFriend)
+		{
+			newFriend._FriendID = nf->_FriendID;
+			newFriend._FriendName = nf->_FriendName.c_str();
+			newFriend._ObjID = nf->_ObjID;
+			newFriend.friendGalaxyID = nf->friendGalaxyID;
+			newFriend.id = nf->id;
+			newFriend.onlineStatus = nf->onlineStatus;
+			FriendList.push_back(newFriend);
+		}
+	}
+	QueuePacket(QUEUE_FriendListRequestResponse);
+	QueuePacket(QUEUE_FriendListDeltasMessage);
+	SEND_QueuedPackets(PLAYER,false);
+
+	OnlineStatusUpdateFriend = newFriend;
+	QueuePacket(QUEUE_FriendAddedFlyText);
+	SEND_QueuedPackets(PLAYER,false);
+	QueuePacket(QUEUE_ChatAccountUpdate);
+	QueuePacket(QUEUE_FriendOfflineStatusUpdate);
+	QueuePacket(QUEUE_FriendOnlineStatusUpdate);
+	SEND_QueuedPackets(PLAYER,false);
+	ZClient::UpdateFriendStatus(1,false);
+	
+return;
+}
+void ZClient::HANDLE_ObjController_CommandQueueEnqueue_burstrun(ByteBuffer &Packet){
+/*
+20:45:13:     ----Unhandled CommandQueueEnqueue: [0xFC3D1CB2].
+   ---Packet Contents
+80 00 00 00 
+B2 1C 3D FC 
+00 00 00 00 00 00 00 00 
+00 00 00 00 
+7F B0
+Burst Run
+*/
+	ZClient::PrintPacketToScreen(Packet);
+
+return;
+}
+
+void ZClient::HANDLE_ObjController_CommandQueueEnqueue_removefriend(ByteBuffer &Packet){
+	Packet.readINT();
+	Packet.readINT();
+	Packet.readLONG();
+	string nameToRemove;
+	nameToRemove = Packet.readUSTRINGtoASCII();
+/*
+[0x8E9091D7]. removefriend ---Packet Contents
+00 00 00 00 
+D7 91 90 8E 
+00 00 00 00 00 00 00 00 
+03 00 00 00 65 00 65 00 65 00 //uistring name of friend to remove
+BD FD //crc
+*/
+	//printf("Remove friend Request Name: %s\n",nameToRemove.c_str());
+	int dotLocation;
+	string _GalaxyName = db->GalaxyName.c_str();
+	string _TempName;
+	dotLocation = nameToRemove.find(".",0);
+	_TempName = nameToRemove.c_str();
+
+	if(dotLocation >= 1)
+	{
+		_GalaxyName = nameToRemove.substr(0,(dotLocation));
+		_TempName = nameToRemove.substr((dotLocation+1),nameToRemove.length() - (dotLocation +1));
+	}
+
+	for(int i=0;i<_GalaxyName.length();i++)
+	{
+		_GalaxyName[i] = tolower(_GalaxyName[i]);
+	}
+	
+
+	list<Galaxy> tempGalaxyList;
+	tempGalaxyList = db->GrabGalaxyInfo();
+	int tempGalaxyID = db->GalaxyID;
+	for(std::list<Galaxy>::iterator gl = tempGalaxyList.begin(); gl != tempGalaxyList.end(); gl++)
+	{
+		string tGal;
+		tGal = gl->sGalaxyName.c_str();
+		for(int i=0;i<tGal.length();i++)
+		{
+			tGal[i] = tolower(tGal[i]);
+		}
+		if(!strcmp(_GalaxyName.c_str(),tGal.c_str()))
+		{
+			tempGalaxyID = gl->iGalaxyID;
+		}
+	}
+
+	for(int i=0;i<_TempName.length();i++)
+	{
+		_TempName[i] = tolower(_TempName[i]);
+	}
+	_TempName[0] = toupper(_TempName[0]);
+
+	bool areFriends;
+	areFriends = false;
+	bool retval;
+	int deleteFriendID = 0;
+	list<FriendData> tempFriendList;
+	FriendData tempFriend;
+	for(std::list<FriendData>::iterator fl = FriendList.begin(); fl != FriendList.end(); fl++)
+	{
+		if(!strcmp(fl->_FriendName.c_str(),_TempName.c_str()) && fl->friendGalaxyID == tempGalaxyID)
+		{
+			areFriends = true;
+			retval = db->RemoveFriend(fl->id);
+			deleteFriendID = fl->id;
+			OnlineStatusUpdateFriend._FriendID = fl->_FriendID;
+			OnlineStatusUpdateFriend._FriendName = fl->_FriendName.c_str();
+			OnlineStatusUpdateFriend._ObjID = fl->_ObjID;
+			OnlineStatusUpdateFriend.id = fl->id;
+			fl->onlineStatus = 0x00;
+			OnlineStatusUpdateFriend.onlineStatus = 0x00;
+			QueuePacket(QUEUE_FriendOfflineStatusUpdate);
+			QueuePacket(QUEUE_FriendRemovedFlyText);
+			SEND_QueuedPackets(PLAYER,false);
+		}
+	}
+	if(retval && areFriends)
+	{
+		tempFriendList = FriendList;
+		FriendList.clear();
+		for(std::list<FriendData>::iterator fl = tempFriendList.begin(); fl != tempFriendList.end(); fl++)
+		{
+			if(fl->id != deleteFriendID)
+			{
+				tempFriend._FriendID = fl->_FriendID;
+				tempFriend._FriendName = fl->_FriendName.c_str();
+				tempFriend._ObjID = fl->_ObjID;
+				tempFriend.friendGalaxyID = fl->friendGalaxyID;
+				tempFriend.id = fl->id;
+				tempFriend.onlineStatus = fl->onlineStatus;
+				FriendList.push_back(tempFriend);
+			}
+		}
+		//re-send friends list
+		//OnlineStatusUpdateFriend
+		QueuePacket(QUEUE_FriendListRequestResponse);
+		QueuePacket(QUEUE_FriendListDeltasMessage);
+		SEND_QueuedPackets(PLAYER,false);
+		ZClient::UpdateFriendStatus(1,false);
+		friendLastListUpdate = time(0);
+	}
+	else
+	{	
+		stringstream toPlayer;
+		toPlayer << _TempName.c_str() << " is not in your Friends List.";
+		SendMessageToPlayer(toPlayer.str().c_str());
+	}
+}
+
 void ZClient::HANDLE_ObjController_CommandQueueEnqueue_synchronizeduilisten(ByteBuffer &Packet) {
 	 Packet.readINT(); //tick count
 	 Packet.readINT(); //commandCRC
@@ -2085,14 +3851,406 @@
 
 return; }
 
-//This handler will control what option 1 from a radial menu does on an item.
-void ZClient::HANDLE_ObjController_CommandQueueEnqueue_itemradialop1(ByteBuffer &Packet) {
-	Packet.readINT(); //tick count
-	Packet.readLONG(); //commandCRC
-	//Packet.readLONG();
+
+void ZClient::HANDLE_ObjController_CommandQueueEnqueue_getattributesbatch(ByteBuffer &Packet) {
+/*
+	This handler gets a list of objects that the client wants attributes for
+*/
+	Packet.readINT();
+	Packet.readINT(); // command
+	Packet.readINT();
+	Packet.readINT();		
+	string attributesRequest;
+	attributesRequest = Packet.readUSTRINGtoASCII(); //list of items requesting attributes
+	CParam reqList(attributesRequest.c_str());
+	int objType;
+	//lAttributes
+	for(int i=0;i<reqList.getnum();i++)
+	{
+		//printf("[%i] ItemID: %u\n",i,atol(reqList.get(i).c_str() ));
+		if(reqList.get(i).length() >= 1)
+		{
+			objType = GetObjectTypeFromID((long long)atol(reqList.get(i).c_str()));
+		}
+		else
+		{
+			objType = -1;
+		}
+		
+		switch(objType)
+		{
+			case 0: //NPC
+				{
+					
+					break;
+				}
+			case 1: //Building
+				{
+					
+					break;
+				}
+			case 2: //Cell Item
+				{
+					
+					break;
+				}
+			case 3://World Object
+				{
+					int iItemID = atol(reqList.get(i).c_str()) - OffsetList[objType]; //ITEM_OFFSET;
+					if(iItemID == 0){break;}
+					ItemData tempItem;
+					tempItem = db->GetItemData(iItemID);
+					switch (tempItem.template_id)
+					{
+					case 3534: //speeder bike Swoop
+						{
+							int iItemID = atol(reqList.get(i).c_str()) - OffsetList[objType];							
+							if(iItemID == 0){break;}
+							//if(debug){printf("Sending Default Data\n");}
+							//lAttributes 	//Attribute
+							_Attribute tempAttribute;
+							lAttributes.clear();
+							if(lAttributes.empty())
+							{
+								//this has to be db driven, insert each attribute into the list in order to be sent
 	
+								tempAttribute.sAttributeName = "volume";
+								tempAttribute.sAttributeValue = "1";
+								lAttributes.push_back(tempAttribute);
+								
+								tempAttribute.sAttributeName = "serial_number";								
+								tempAttribute.sAttributeValue = GetSerialFromID(reqList.get(i).c_str());
+								lAttributes.push_back(tempAttribute);
+								
+								tempAttribute.sAttributeName = "condition";
+								stringstream cond;
+								cond << tempItem.cur_condition << " / " << tempItem.max_condition;
+								tempAttribute.sAttributeValue = cond.str();
+								lAttributes.push_back(tempAttribute);
+
+								PlayerData td;
+								td = db->GetPlayerData(tempItem.character_id);
+								tempAttribute.sAttributeName = "owner";								
+								tempAttribute.sAttributeValue = td.fullName.c_str();
+								lAttributes.push_back(tempAttribute);
+
+								_ItemAttributeID = tempItem.serial + OffsetList[objType];
+								//printf("ID Sent In Packet:%u\n",_ItemAttributeID);
+								QueuePacket(QUEUE_SendAttributesBatch);
+								if(FlagCell)
+								{
+									QueuePacket(QUEUE_UpdateTransformParentMessage);
+								}
+								else
+								{
+									QueuePacket(QUEUE_UpdateTransformMessage);
+								}
+								SEND_QueuedPackets(PLAYER,false);
+								
+							}
+							break;
+						}
+					default:
+						{
+							int iItemID = atol(reqList.get(i).c_str()) - OffsetList[objType];							
+							if(iItemID == 0){break;}
+							//if(debug){printf("Sending Default Data\n");}
+							//lAttributes 	//Attribute
+							_Attribute tempAttribute;
+							lAttributes.clear();
+							if(lAttributes.empty())
+							{
+								//this has to be db driven, insert each attribute into the list in order to be sent
 	
+								tempAttribute.sAttributeName = "volume";
+								tempAttribute.sAttributeValue = "1";
+								lAttributes.push_back(tempAttribute);
+								
+								tempAttribute.sAttributeName = "serial_number";								
+								tempAttribute.sAttributeValue = GetSerialFromID(reqList.get(i).c_str());
+								lAttributes.push_back(tempAttribute);
+								
+								tempAttribute.sAttributeName = "condition";
+								stringstream cond;
+								cond << tempItem.cur_condition << " / " << tempItem.max_condition;
+								tempAttribute.sAttributeValue = cond.str();
+								lAttributes.push_back(tempAttribute);
 
+								_ItemAttributeID = tempItem.serial + OffsetList[objType];
+								//printf("ID Sent In Packet:%u\n",_ItemAttributeID);
+								QueuePacket(QUEUE_SendAttributesBatch);
+								if(FlagCell)
+								{
+									QueuePacket(QUEUE_UpdateTransformParentMessage);
+								}
+								else
+								{
+									QueuePacket(QUEUE_UpdateTransformMessage);
+								}
+								SEND_QueuedPackets(PLAYER,false);
+								
+							}
+							break;
+						}
+
+					}
+
+					break;
+				}
+			case 4://Item
+				{	
+					
+					int iItemID = atol(reqList.get(i).c_str()) - OffsetList[objType]; //ITEM_OFFSET;
+					if(iItemID == 0){break;}
+					ItemData tempItem;
+					tempItem = db->GetItemData(iItemID);
+					if(debug){printf("Sending Item Data: Named: %s ID:%i TemplateID:\n",tempItem.item_name.c_str(),iItemID,tempItem.template_id);}
+					//find by template id
+					switch (tempItem.template_id)
+					{
+					case 14132://travel ticket
+						{
+							//if(debug){printf("Sending Travel Ticket Data\n");}
+							//lAttributes 	//Attribute
+							_Attribute tempAttribute;
+							lAttributes.clear();
+							if(lAttributes.empty())
+							{
+								//this has to be db driven, insert each attribute into the list in order to be sent
+								tempAttribute.sAttributeName = "volume";
+								tempAttribute.sAttributeValue = "1";
+								lAttributes.push_back(tempAttribute);
+
+								tempAttribute.sAttributeName = "travel_departure_planet";
+								tempAttribute.sAttributeValue = PlanetNames[tempItem.departureplanet];
+								lAttributes.push_back(tempAttribute);
+								
+								tempAttribute.sAttributeName = "travel_departure_point";
+								tempAttribute.sAttributeValue = tempItem.departurecity.c_str();
+								lAttributes.push_back(tempAttribute);
+
+								tempAttribute.sAttributeName = "travel_arrival_planet";
+								tempAttribute.sAttributeValue = PlanetNames[tempItem.arrivalplanet];
+								lAttributes.push_back(tempAttribute);
+
+								tempAttribute.sAttributeName = "travel_arrival_point";
+								tempAttribute.sAttributeValue = tempItem.arrivalcity.c_str();
+								lAttributes.push_back(tempAttribute);
+
+								_ItemAttributeID = tempItem.serial + OffsetList[objType]; 
+							//	printf("ID Sent In Packet:%u\n",_ItemAttributeID);
+								QueuePacket(QUEUE_SendAttributesBatch);
+								if(FlagCell)
+								{
+									QueuePacket(QUEUE_UpdateTransformParentMessage);
+								}
+								else
+								{
+									QueuePacket(QUEUE_UpdateTransformMessage);
+								}
+								SEND_QueuedPackets(PLAYER,false);
+							}
+							break;
+						}
+						case 3534: //speeder bike Swoop
+						{
+							int iItemID = atol(reqList.get(i).c_str()) - OffsetList[objType];							
+							if(iItemID == 0){break;}
+							//if(debug){printf("Sending Default Data\n");}
+							//lAttributes 	//Attribute
+							_Attribute tempAttribute;
+							lAttributes.clear();
+							if(lAttributes.empty())
+							{
+								//this has to be db driven, insert each attribute into the list in order to be sent
+	
+								tempAttribute.sAttributeName = "volume";
+								tempAttribute.sAttributeValue = "1";
+								lAttributes.push_back(tempAttribute);
+								
+								tempAttribute.sAttributeName = "serial_number";								
+								tempAttribute.sAttributeValue = GetSerialFromID(reqList.get(i).c_str());
+								lAttributes.push_back(tempAttribute);
+								
+								tempAttribute.sAttributeName = "condition";
+								stringstream cond;
+								cond << tempItem.cur_condition << " / " << tempItem.max_condition;
+								tempAttribute.sAttributeValue = cond.str();
+								lAttributes.push_back(tempAttribute);
+
+								PlayerData td;
+								td = db->GetPlayerData(tempItem.character_id);
+								tempAttribute.sAttributeName = "owner";								
+								tempAttribute.sAttributeValue = td.fullName.c_str();
+								lAttributes.push_back(tempAttribute);
+
+								_ItemAttributeID = tempItem.serial + OffsetList[objType];
+								//printf("ID Sent In Packet:%u\n",_ItemAttributeID);
+								QueuePacket(QUEUE_SendAttributesBatch);
+								if(FlagCell)
+								{
+									QueuePacket(QUEUE_UpdateTransformParentMessage);
+								}
+								else
+								{
+									QueuePacket(QUEUE_UpdateTransformMessage);
+								}
+								SEND_QueuedPackets(PLAYER,false);
+								
+							}
+							break;
+						}
+					default:
+						{
+							
+							int iItemID = atol(reqList.get(i).c_str()) - OffsetList[objType];
+							if(iItemID == 0){break;}
+							//if(debug){printf("Sending Default Data\n");}
+							//lAttributes 	//Attribute
+							_Attribute tempAttribute;
+							lAttributes.clear();
+							if(lAttributes.empty())
+							{
+								//this has to be db driven, insert each attribute into the list in order to be sent
+	
+								tempAttribute.sAttributeName = "volume";
+								tempAttribute.sAttributeValue = "1";
+								lAttributes.push_back(tempAttribute);
+								
+								tempAttribute.sAttributeName = "serial_number";								
+								tempAttribute.sAttributeValue = GetSerialFromID(reqList.get(i).c_str());
+								lAttributes.push_back(tempAttribute);
+								
+								tempAttribute.sAttributeName = "condition";
+								stringstream cond;
+								cond << tempItem.cur_condition << " / " << tempItem.max_condition;
+								tempAttribute.sAttributeValue = cond.str();
+								lAttributes.push_back(tempAttribute);
+
+								_ItemAttributeID = tempItem.serial + OffsetList[objType];
+								//printf("ID Sent In Packet:%u\n",_ItemAttributeID);
+								QueuePacket(QUEUE_SendAttributesBatch);
+								if(FlagCell)
+								{
+									QueuePacket(QUEUE_UpdateTransformParentMessage);
+								}
+								else
+								{
+									QueuePacket(QUEUE_UpdateTransformMessage);
+								}
+								SEND_QueuedPackets(PLAYER,false);
+								
+							}
+							break;
+						}
+						switch(tempItem.deed_id)
+						{
+						case 0:
+							{
+								break;
+							}
+						default:
+							{
+								list<DeedObject> tempDeed;
+								
+								std::list<DeedObject>::iterator d = tempDeed.begin();
+								
+								tempDeed = db->GetDeedObject(tempItem.deed_id);
+								_Attribute tempAttribute;
+								lAttributes.clear();
+								if(lAttributes.empty())
+								{
+									//this has to be db driven, insert each attribute into the list in order to be sent
+		
+									tempAttribute.sAttributeName = "volume";
+									tempAttribute.sAttributeValue = "1";
+									lAttributes.push_back(tempAttribute);
+									
+									tempAttribute.sAttributeName = "name";
+									tempAttribute.sAttributeValue = d->name.c_str();
+									lAttributes.push_back(tempAttribute);
+
+									tempAttribute.sAttributeName = "serial_number";								
+									tempAttribute.sAttributeValue = GetSerialFromID(reqList.get(i).c_str());
+									lAttributes.push_back(tempAttribute);
+									
+									tempAttribute.sAttributeName = "condition";
+									stringstream cond;
+									cond << tempItem.cur_condition << " / " << tempItem.max_condition;
+									tempAttribute.sAttributeValue = cond.str();
+									lAttributes.push_back(tempAttribute);
+
+									tempAttribute.sAttributeName = "crafter";
+									tempAttribute.sAttributeValue = "";
+									lAttributes.push_back(tempAttribute);
+
+									tempAttribute.sAttributeName = "maintenance_rate";
+									tempAttribute.sAttributeValue = d->maintenance_rate;
+									lAttributes.push_back(tempAttribute);
+
+									_ItemAttributeID = tempItem.serial + OffsetList[objType];
+									
+									QueuePacket(QUEUE_SendAttributesBatch);
+									if(FlagCell)
+									{
+										QueuePacket(QUEUE_UpdateTransformParentMessage);
+									}
+									else
+									{
+										QueuePacket(QUEUE_UpdateTransformMessage);
+									}
+									SEND_QueuedPackets(PLAYER,false);
+									
+								}
+		
+								
+
+								break;
+							}
+						}
+					}
+					
+					break;
+				}
+			case 5://Datapad waypoint
+				{
+					
+					break;
+				}
+			case 6://terminal
+				{
+					
+					break;
+				}
+			case 7://instance
+				{
+					
+					break;
+				}
+			case 8://Player
+				{
+					
+					break;
+				}
+			case 9://CLIENT_OBJECT
+				{
+					int iItemID = atol(reqList.get(i).c_str()) - OffsetList[objType]; //ITEM_OFFSET;
+					SendMessageToPlayer("Client Object Attributes Requested");
+					break;
+				}
+			case -1: //invalid object
+				{
+					break;
+				}
+			default:
+				{
+					
+					break;
+				}
+		}
+	}
+
+
 return; }
 
 void ZClient::HANDLE_ClientSendEmailRequest(ByteBuffer &Packet) {
@@ -2624,14 +4782,19 @@
 	{	wpID = db->SaveWaypoint(ObjID,wpName.str().c_str(),planetID,cmdX,cmdZ,cmdY,true,0,false,db->GalaxyID);
 		if(wpID >= 1)
 		{
-			vClientWaypoints = db->LoadWaypoints(ObjID, db->GalaxyID);
+			//ZClient::vClientWaypoints.clear();
+			ZClient::vClientWaypoints = db->LoadWaypoints(ObjID, db->GalaxyID);
 			// Insert Datapad Update Here so Players Datapad Receives new Waypoint.
-			//QueuePacket(QUEUE_UpdateTransformMessage);
+			wpReload = true;
+			for (vector<Waypoints>::iterator i = vClientWaypoints.begin(); i != vClientWaypoints.end(); i++) 
+			{
+				if(debug){printf("Deleting Waypoint id:%i : Named: %s Status: %i\n",i->waypointID,i->waypointName.c_str(),i->bActive);}
+				delID = i->waypointID + DATAPAD_WAYPOINT_OFFSET;
 			
-			//QueuePacket(QUEUE_BaselinesMessage_PLAY8);
-
-			//QueuePacket(QUEUE_SceneEndBaselines);
-			//SEND_QueuedPackets(PLAYER,false);
+				QueuePacket(QUEUE_SceneDestroyObject);
+				QueuePacket(QUEUE_UpdateContainmentMessage);
+				SEND_QueuedPackets(PLAYER,false);
+			}
 			UpdatePlayerBaselines(ObjID);
 			SendMessageToPlayer("Waypoint: New waypoint created.");
 		}
@@ -2696,22 +4859,28 @@
 	int cCRC = Packet.readINT(); // Command CRC
 	long wpID = Packet.readLONG();
 	string _Data = Packet.readUSTRINGtoASCII();
-	//printf("Waypoint Toggle Status Data:\n wpID:%u\n Data:%s\n",wpID,_Data.c_str());
+	if(debug){printf("Waypoint Toggle Status Data:\n wpID:%u\n Data:%s\n",wpID,_Data.c_str());}
 
 	int dbID = wpID - DATAPAD_WAYPOINT_OFFSET;
-	if(!strcmp(_Data.c_str(),"off"))
+	if(wpReload){printf("ReloadVal:%i\n",wpReload);return;}
+	if(wpID == delID){return;}
+
+	if(!strcmp(_Data.c_str(),"off") )
 	{
-		//printf("Waypoint:%i OFF\n",dbID);
+		if(debug){printf("Waypoint:%i OFF\n",dbID);}
 		db->ToggleWaypointStatus(dbID,false);
+		//ZClient::vClientWaypoints.clear();
+		ZClient::vClientWaypoints = db->LoadWaypoints(ObjID, db->GalaxyID);
 	}
-	else
+	if(!strcmp(_Data.c_str(),"on"))
 	{
-		//printf("Waypoint:%i ON\n",dbID);
+		if(debug){printf("Waypoint:%i ON\n",dbID);}
 		db->ToggleWaypointStatus(dbID,true);
+		//ZClient::vClientWaypoints.clear();
+		ZClient::vClientWaypoints = db->LoadWaypoints(ObjID, db->GalaxyID);
 	}
-	vClientWaypoints = db->LoadWaypoints(ObjID, db->GalaxyID);
-	QueuePacket(QUEUE_UpdateTransformMessage);
-	SEND_QueuedPackets(CHATRANGE,false);
+	
+	
 	return;
 }
 void ZClient::HANDLE_ObjController_CommandQueueEnqueue_ClientRenameWaypoint(ByteBuffer &Packet){
@@ -2738,11 +4907,29 @@
 	{
 		printf("\n*** Waypoint Rename request:ID:%i New Name:%s\n",wpID,_wpName.c_str());
 	}
-	
 	db->RenameWaypoint(dbID,_wpName.c_str());
 	
-	vClientWaypoints = db->LoadWaypoints(ObjID, db->GalaxyID);
+	if(dbID = FriendWaypointID)
+	{
+		FriendWaypointID = 0;
+		db->UpdateCharacterFriendWaypointID(ObjID,FriendWaypointID);
+		CharacterData.friend_waypoint_id = FriendWaypointID;
+	}
+	//ZClient::vClientWaypoints.clear();
+	ZClient::vClientWaypoints = db->LoadWaypoints(ObjID, db->GalaxyID);
+	if (ZClient::vClientWaypoints.empty()){printf("Waypoint List empty!!!\n");}
+	wpReload = true;
+/*	for (vector<Waypoints>::iterator i = vClientWaypoints.begin(); i != vClientWaypoints.end(); i++) 
+	{
+		if(debug){printf("Deleting Waypoint id:%i : Named: %s Status: %i\n",i->waypointID,i->waypointName.c_str(),i->bActive);}
+		delID = i->waypointID + DATAPAD_WAYPOINT_OFFSET;
 	
+		QueuePacket(QUEUE_SceneDestroyObject);
+		QueuePacket(QUEUE_UpdateContainmentMessage);
+		SEND_QueuedPackets(PLAYER,false);
+	}*/
+	UpdatePlayerBaselines(ObjID);
+	/*
 	for (vector<Waypoints>::iterator i = vClientWaypoints.begin(); i != vClientWaypoints.end(); i++)
 	{
 		if(i->waypointID == dbID)
@@ -2766,14 +4953,14 @@
 				printf("Waypoint Update Delta Not Sent\n");
 			}
 			//new play 8 or a delta to be sent.
-			QueuePacket(QUEUE_DeltasMessage_UpdWaypoint);
+			//QueuePacket(QUEUE_DeltasMessage_UpdWaypoint);
 			//QueuePacket(QUEUE_BaselinesMessage_PLAY8);
 			//SEND_QueuedPackets(PLAYER,false);
 			//QueuePacket(QUEUE_BaselinesMessage_PLAY9);
 			//QueuePacket(QUEUE_SceneEndBaselines);
-			SEND_QueuedPackets(PLAYER,false);
+			//SEND_QueuedPackets(PLAYER,false);
 		}
-	}
+	}*/
 			
 
 	return;
@@ -2802,7 +4989,86 @@
 	message = Packet.readUSTRINGtoASCII();
 	Packet.readINT();
 	messagecounter = Packet.readINT();
+	im_counter = messagecounter;
+	bool messagesuccess = false;
 
+	for (int i=0;i<recipient.length();i++)
+	{
+		recipient[i]=tolower(recipient[i]);	
+	}
+	string tempCharName;
+
+	if(!strcmp(servername.c_str(),db->GalaxyName.c_str()))
+	{
+		if(debug){printf("Tell to User on this Galaxy\n");}
+		for (ZServer::ZClientList::iterator i = zServer->Clients.begin(); i != zServer->Clients.end(); ++i) 
+		{
+			if(debug){printf("Iterating Through Clients\n");}
+			ZClient* Client = i->second;
+			if (Client) 
+			{
+				if (Client->isValid()) 
+				{
+						//message is for someone else
+					if(debug){printf("Looking for client to send tell\n");}
+					tempCharName = Client->CharacterData.firstname.c_str();
+					for (int i=0;i<tempCharName.length();i++)
+					{
+						tempCharName[i]=tolower(tempCharName[i]);	
+					}
+					if (!strcmp(tempCharName.c_str(),recipient.c_str())) 
+					{		
+						if(debug){printf("The Message is for: %s\n",Client->CharacterData.firstname.c_str());}
+						if (!strcmp(Client->CharacterData.firstname.c_str(),this->CharacterData.firstname.c_str()) )
+						{
+							//message is for self 
+							if(debug){printf("Message is for self\n");}
+							
+							TellMessage = message.c_str();
+							MessageState = 5;//echo message or success
+							QueuePacket(QUEUE_ChatInstantMessageToClient);
+							SEND_QueuedPackets(PLAYER,false);
+							messagesuccess = true;
+
+						}
+						else
+						{
+							if(debug){printf("Found Client The Message is for\n");}
+							Client->TellMessage = message.c_str();
+							Client->MessageState = 5;
+							Client->TellSender = this->CharacterData.firstname.c_str();
+							Client->SendTellToClient();
+							QueuePacket(QUEUE_ChatOnSendInstantMessage);
+							SEND_QueuedPackets(PLAYER,false);
+							messagesuccess = true;
+						}
+					}
+				} 
+			}
+		}
+		if(!messagesuccess)
+		{
+			if(debug){printf("Message is for someone not on line or other server\n");}
+			//TellMessage = message.c_str();
+			MessageState = 4;
+			QueuePacket(QUEUE_ChatOnSendInstantMessage);
+			SEND_QueuedPackets(PLAYER,false);
+		}
+
+
+	}
+	else
+	{
+		//message os for osmeone on another server galaxy
+		//until we can route from galaxy to galaxy we just tell them it was sent
+		if(debug){printf("Message is for someone not on line or other server\n");}
+		//TellMessage = message.c_str();
+		MessageState = 10;
+		
+		QueuePacket(QUEUE_ChatOnSendInstantMessage);
+		SEND_QueuedPackets(PLAYER,false);
+	}
+
 	printf(" ClusterName:%s\n Server:%s\n Recipient:%s\n Message:%s\n ClientMessageCounter:%i\n",clustername.c_str(),servername.c_str(),recipient.c_str(),message.c_str(),messagecounter);
 	
 	/*
@@ -2831,18 +5097,196 @@
 	*/
 return;
 }	
+void ZClient::HANDLE_ObjController_CommandQueueEnqueue_toggleawayfromkeyboard(ByteBuffer &Packet) {
+	
+	if(debug)
+	{
+		printf("AFK Chat Message Handler:\n");
+		int charcnt = 0;
+		while(Packet.getBytesLeft() != 0)
+		{
+			char b = Packet.readBYTE();
+			if(b>0x10)
+			{
+				printf(" %X",b);
+				charcnt++;
+			}
+			else
+			{
+				printf(" 0%X",b);
+				charcnt++;
+			}
+			if(charcnt == 15)
+			{
+				charcnt = 0;
+				printf("\n");
+			}
+		}
+		printf("\n");
+	}
 
+	if(ZClient::CharacterData.afk)
+	{
+		ZClient::CharacterData.afk = false;
+	}
+	else
+	{
+		ZClient::CharacterData.afk = true;
+	}
+	if(debug){printf("Player AFK Status is:%i\n",ZClient::CharacterData.afk);}
+	//QueuePacket(QUEUE_ToggleAFKDelta);
+	//SEND_QueuedPackets(PLAYER,false);
+
+}
+void ZClient::HANDLE_ObjController_CommandQueueEnqueue_findfriend(ByteBuffer &Packet){
+/*
+20:26:24:     ----Unhandled CommandQueueEnqueue: [0x30BE6EE9]. Findfriend
+   ---Packet Contents
+00 00 00 00 
+E9 6E BE 30 //findfriend 0x30BE6EE9
+00 00 00 00 00 00 00 00 //long 0
+07 00 00 00 //ustring length int
+6C 00 61 00 6F 00 73 00 61 00 65 00 72 //ustring friend name
+
+00 2B 15 // comp+crc
+*/
+string FriendName;
+Packet.readINT();
+Packet.readINT();
+Packet.readLONG();
+FriendName = Packet.readUSTRINGtoASCII();
+if(debug){printf("%s is looking for Friend:%s\n",CharacterData.firstname.c_str(),FriendName.c_str());}
+
+for (ZServer::ZClientList::iterator i = zServer->Clients.begin(); i != zServer->Clients.end(); ++i) 
+{
+	if(debug){printf("Iterating Through Clients\n");}
+	ZClient* Client = i->second;
+	if (Client) 
+	{
+		if (Client->isValid()) 
+		{
+			
+			{
+					//message is for someone else
+				if(debug){printf("Looking for client\n");}
+				string tempCharName;
+				tempCharName = Client->CharacterData.firstname.c_str();
+				for (int i=0;i<tempCharName.length();i++)
+				{
+					tempCharName[i]=tolower(tempCharName[i]);	
+				}
+				for (int i=0;i<FriendName.length();i++)
+				{
+					FriendName[i]=tolower(FriendName[i]);	
+				}
+			
+					if (!strcmp(tempCharName.c_str(),FriendName.c_str())) 
+					{
+						//printf("Found Friend %s at Coords %f %f %f\n",Client->CharacterData.firstname.c_str(),Client->CharacterData.x,Client->CharacterData.z,Client->CharacterData.y);
+						bool areFriends;
+						areFriends = false;
+						for(std::list<FriendData>::iterator ffl = Client->FriendList.begin(); ffl != Client->FriendList.end(); ffl++)
+						{
+							if(ffl->_FriendID == ObjID)
+							{
+								areFriends = true;
+							}
+						}
+						if(!areFriends)
+						{
+							stringstream toPlayer;
+							toPlayer << "You are not on " << Client->CharacterData.firstname.c_str() << "'s Friends List";
+							SendMessageToPlayer(toPlayer.str().c_str());
+							return;
+						}
+
+						if(FriendWaypointID != 0)
+						{
+							if(debug){printf("Friend Waypoint Exists Updating\n");}
+							db->UpdateWaypointCoordinates(ObjID,FriendWaypointID,Client->CharacterData.x,Client->CharacterData.z,Client->CharacterData.y,db->GalaxyID);
+							db->RenameWaypoint(FriendWaypointID,Client->CharacterData.firstname.c_str());
+						}
+						else
+						{
+							if(debug){printf("Friend Waypoint is New\n");}
+							FriendWaypointID = db->SaveWaypoint(ObjID,Client->CharacterData.firstname.c_str(),Client->CharacterData.planet_id,Client->CharacterData.x,Client->CharacterData.z,Client->CharacterData.y,true,0,false,db->GalaxyID);
+							CharacterData.friend_waypoint_id = FriendWaypointID;
+							db->UpdateCharacterFriendWaypointID(ObjID,FriendWaypointID);
+						}
+							
+						//ZClient::vClientWaypoints.clear();
+						ZClient::vClientWaypoints = db->LoadWaypoints(ObjID, db->GalaxyID);	
+						wpReload = true;
+						for (vector<Waypoints>::iterator i = vClientWaypoints.begin(); i != vClientWaypoints.end(); i++) 
+						{
+							if(debug){printf("Deleting Waypoint id:%i : Named: %s Status: %i\n",i->waypointID,i->waypointName.c_str(),i->bActive);}
+							delID = i->waypointID + DATAPAD_WAYPOINT_OFFSET;
+							QueuePacket(QUEUE_SceneDestroyObject);
+							QueuePacket(QUEUE_UpdateContainmentMessage);
+							SEND_QueuedPackets(PLAYER,false);
+						}
+						UpdatePlayerBaselines(ObjID);
+				}
+			}
+			if(Client->CharacterData.planet_id != this->CharacterData.planet_id)
+			{
+				SendMessageToPlayer("Waypoint Created");
+			}
+		}
+	}
+}
+return;
+}
+
 void ZClient::HANDLE_SuiEventNotification(ByteBuffer &Packet) {
 	int iWindowID = Packet.readINT();
 	int unknown1 = Packet.readINT();
 	int unknown2 = Packet.readINT();
 	int unknown3 = Packet.readINT();
-	//char * toolOption = Packet.readUSTRINGtoASCII();
-	unsigned int iToolOption = (unsigned int)atoi((const char *)Packet.readUSTRINGtoASCII());
-	string basePlayer = Packet.readUSTRINGtoASCII();
-	db->UpdateResourceToolRangeOption(iToolOption, ResourceToolID);
+
+	if(iWindowID == lastSurveyWindow)
+	{
+		//char * toolOption = Packet.readUSTRINGtoASCII();
+		unsigned int iToolOption = (unsigned int)atoi((const char *)Packet.readUSTRINGtoASCII());
+		string basePlayer = Packet.readUSTRINGtoASCII();
+		db->UpdateResourceToolRangeOption(iToolOption, ResourceToolID);
+	}
+	else if(iWindowID == lastTicketWindow)
+	{
+		//do something here after ticket purchased
+	}
+	
+	
 }
+void ZClient::HANDLE_ObjController_CommandQueueEnqueue_SetGodMode(ByteBuffer &Packet) {
+/*
+	SetGodMode		= 0x6CAFFD66,
+	00 00 00 00 //int
+	66 FD AF 6C //int SetGodMode
+	00 00 00 00 00 00 00 00 //long
+	00 00 00 00 //int 
+	A0 A5 //crc
+*/
+	Packet.readINT();
+	Packet.readINT();
+	Packet.readLONG();
+	Packet.readINT();
+	if(gm)
+	{
+		if(godMode)
+		{
+			godMode = false;
+			SendMessageToPlayer("God Mode Off");
+		}
+		else
+		{
+			godMode = true;
+			SendMessageToPlayer("God Mode On");
+		}
+	}
 

Index: C:/Software/SWG Pre-CU/Closed2/src/ZoneServer/PacketFactory.cpp
===================================================================
--- C:/Software/SWG Pre-CU/Closed2/src/ZoneServer/PacketFactory.cpp	(revision 327)
+++ C:/Software/SWG Pre-CU/Closed2/src/ZoneServer/PacketFactory.cpp	(working copy)
@@ -174,8 +174,14 @@
 	CSS->writeFLOAT (sX); //x -- needs to be db driven.. should be last location of player
 	CSS->writeFLOAT (sZ);  //z -- needs to be db driven.. should be last location of player
 	CSS->writeFLOAT (sY);  //y -- needs to be db driven.. should be last location of player 
+	if(spaceLaunch)
+	{
+		CSS->writeFLOAT (sW);  //w -- this coord variable is needed to launch to space apparently
+	}
 	CSS->writeASTRING(RaceModels[iRaceID]); //TODO: add option to send a model .iff for support of non traditional player models (ie playing as vader) -- -> needs to be db driven... should be player race model id
-	CSS->writeLONG(1); 
+	CSS->writeLONG(spaceCmdStartScene); 
+	spaceCmdStartScene = 1;
+
 return CSS; }
 
 ByteBuffer* ZClient::BUILD_ServerTimeMessage() {
@@ -209,6 +215,7 @@
 	SDO->opcode2(SceneDestroyObject);
 	SDO->writeLONG(delID);
 	SDO->writeBYTE(0); //unk
+	delID = 0;
 return SDO; } 
 
 ByteBuffer* ZClient::BUILD_SceneEndBaselines() {
@@ -242,13 +249,13 @@
 	UCCM->writeLONG(spawnID);
 	UCCM->writeLONG(CellID);
 	UCCM->writeINT(0xFFFFFFFF);
-	list<CellObject> * objects = db->GetCellObjects(CellID);
-	for (std::list<CellObject>::iterator it = objects->begin(); it != objects->end(); ++it) 
+	list<CellObject>  objects = db->GetCellObjects(CellID);
+	for (std::list<CellObject>::iterator it = objects.begin(); it != objects.end(); ++it) 
 	{
 		templateData theData = db->GetTemplateData(it->template_id);
 		SpawnItem(true,CellID,it->serial,theData.itemCRC," ", theData.itemName.c_str(), theData.itemName.c_str(), it->oI,it->oJ,it->oK,it->oW, it->x,it->z,it->y,CellID,false,0,false,false);
 	}
-	delete objects;
+	
 return UCCM; }
 
 ByteBuffer* ZClient::BUILD_BaselinesMessage_TANO3() {
@@ -545,6 +552,7 @@
 	int PacketSize = 76; //Size without xp or waypoints
 	int waypointListSize = 0;
 	for (vector<Waypoints>::iterator i = vClientWaypoints.begin(); i != vClientWaypoints.end(); i++) {
+		if(debug){printf("Waypoint in vector: %i :Named: %s Status: %i\n",i->waypointID,i->waypointName.c_str(),i->bActive);}
 		waypointListSize += (i->waypointName.size() * 2) + 51;
 	}
 	PacketSize = PacketSize + typeSize + waypointListSize;	
@@ -769,10 +777,11 @@
 
 
 ByteBuffer* ZClient::BUILD_BaselinesMessage_WEAO9() {
+	//This packet builds the  friend list
 	ByteBuffer *WEAO9 = new ByteBuffer(20, 2);
 	WEAO9->uType(OBJECT_UPDATE);
 	WEAO9->opcode2(BaselinesMessage);
-	WEAO9->writeLONG(spawnID);
+	WEAO9->writeLONG(spawnID); 
 	WEAO9->writeReversedINT(*(unsigned int*)"WEAO");
 	WEAO9->writeBYTE(9);
 	WEAO9->writeINT(2); //pk size
@@ -833,9 +842,14 @@
 return STAO6; }
 
 ByteBuffer* ZClient::BUILD_BaselinesMessage_ITNO3() {
-	string STFName = "monster_name";
-	string stringName = "speederbike_swoop";
-	int totalsize = 26 + STFName.size() + stringName.size();
+
+	//wonka 1
+	//string STFName = "monster_name";
+	//string stringName = "speederbike_swoop";
+	//NameSTF		= sNameSTF;
+	//STFName		= sSTFName;
+	//CustomName	= sCustomName;
+	int totalsize = 26 + STFName.size() + NameSTF.size();
 	ByteBuffer *ITNO3 = new ByteBuffer(20, totalsize);
 	ITNO3->uType(OBJECT_UPDATE);
 	ITNO3->opcode2(BaselinesMessage);
@@ -843,11 +857,11 @@
 	ITNO3->writeReversedINT(*(unsigned int*)"ITNO");
 	ITNO3->writeBYTE(3);
 	ITNO3->writeINT(totalsize);
-	ITNO3->writeSHORT(5); //opperand count
+	ITNO3->writeSHORT(5); //operand count
 	ITNO3->writeFLOAT(1.0);
 	ITNO3->writeASTRING(STFName.c_str());
 	ITNO3->writeINT(0);
-	ITNO3->writeASTRING(stringName.c_str());
+	ITNO3->writeASTRING(NameSTF.c_str());
 	ITNO3->writeINT(0); //unk
 	ITNO3->writeINT(1); //unk
 	ITNO3->writeINT(0); //unk
@@ -855,9 +869,9 @@
 }
 
 ByteBuffer* ZClient::BUILD_BaselinesMessage_ITNO6() {
-	string STFName = "monster_detail";
-	string stringName = "speederbike_swoop";
-	int totalsize = 14 + STFName.size() + stringName.size();
+	//string STFName = "monster_detail";
+	//string stringName = "speederbike_swoop";
+	int totalsize = 14 + STFName.size() + NameSTF.size();
 	ByteBuffer *ITNO6 = new ByteBuffer(20, totalsize);
 	ITNO6->uType(OBJECT_UPDATE);
 	ITNO6->opcode2(BaselinesMessage);
@@ -869,7 +883,7 @@
 	ITNO6->writeINT(74); //unk
 	ITNO6->writeASTRING(STFName.c_str());
 	ITNO6->writeINT(0);
-	ITNO6->writeASTRING(stringName.c_str());
+	ITNO6->writeASTRING(NameSTF.c_str());
 return ITNO6; }
 
 ByteBuffer* ZClient::BUILD_BaselinesMessage_ITNO8() {
@@ -1069,6 +1083,7 @@
 return CSM; }
 
 ByteBuffer* ZClient::BUILD_ObjControllerMessage_ObjectMenuResponse() {
+	int packetSize = 47 + (8 * rOptionsCount);
 	ByteBuffer *OMR = new ByteBuffer();
 	OMR->uType(OBJECT_UPDATE);
 	OMR->opcode2(ObjControllerMessage);
@@ -1086,16 +1101,24 @@
 		OMR->writeBYTE(it->OptionID);
 		OMR->writeBYTE(it->unk2);
 		
-		printf("Option Num : %i \n",it->OptionNum);printf("Parent Menu ID : %i \n",it->ParentMenuID);printf("Option ID: %i \n",it->OptionID);
-		printf("Unknown 2 : %i \n",it->unk2);printf("Unkown String : %s \n",it->unkStr.c_str());
-			if(it->unk2>1) OMR->writeUSTRING(it->unkStr.c_str()); 
-		    else OMR->writeINT(0);
-	
+		printf("Option Num : %i \n",it->OptionNum);
+		printf("Parent Menu ID : %i \n",it->ParentMenuID);
+		printf("Option ID: %i \n",it->OptionID);
+		printf("Unknown 2 : %i \n",it->unk2);
+		printf("Unkown String : %s \n",it->unkStr.c_str());
+		if(it->unk2>1) {
+			OMR->writeUSTRING(it->unkStr.c_str()); 
+		} else {
+			OMR->writeINT(0);
+		}
+		packetSize += (it->unkStr.size() * 2);
 	}
 
 	tRadialOptions.clear();
 	OMR->writeBYTE(rCounter);
+	OMR->setPacketSize(packetSize);
 return OMR;
+
 }
 
 ByteBuffer* ZClient::BUILD_StopClientEffectObjectByLabelMessage() {
@@ -1179,6 +1202,7 @@
 return;
 }
 void ZClient::UpdatePlayerBaselines(int _ObjID) {
+	
 	Log->cb("UpdatePlayerBaselines\n");
 			sN		= oI;	  
 			sS		= oJ;	   
@@ -1191,9 +1215,11 @@
 			spawnID = _ObjID + PLAY_OFFSET; 
 			spawnCRC = 0x619BAE21;
 			ContainerID = _ObjID; 
-			isEquipped = true;
-			//QueuePacket(QUEUE_SceneCreateObjectByCrc);
+			isEquipped = false;	
+			
 
+			
+			
 			QueuePacket(QUEUE_UpdateContainmentMessage);
 			QueuePacket(QUEUE_BaselinesMessage_PLAY3);	
 			QueuePacket(QUEUE_BaselinesMessage_PLAY6);
@@ -1203,6 +1229,8 @@
 			QueuePacket(QUEUE_BaselinesMessage_PLAY9);	
 			QueuePacket(QUEUE_SceneEndBaselines);		 
 			SEND_QueuedPackets(PLAYER,false);
+			
+			wpReload = false;
 			resetSpawnVariables();
 			return;
 }
@@ -1273,6 +1301,7 @@
 	sZ		= posZ;	
 	sY		= posY;
 	sCellID	= LoadedPlayerData.cell_id;
+	wpReload = false;
 
 	inventory_credits	= LoadedPlayerData.invcredits;
 	bank_credits		= LoadedPlayerData.bankcredits;	
@@ -1284,8 +1313,9 @@
 	BankID				= char_id + BANK_OFFSET; 
 	PlayID				= char_id + PLAY_OFFSET; 
 	DatapadID			= char_id + DATAPAD_OFFSET;	
+	FriendListID		= char_id + FRIEND_LIST_OFFSET;
 	fullName			= LoadedPlayerData.fullName.c_str();   
-	
+	FriendWaypointID	= LoadedPlayerData.friend_waypoint_id; //char_id + FRIEND_WAYPOINT_OFFSET; this is what i was thinking but realized only wp without problems is 0
 
 
 	QueuePacket(QUEUE_SceneCreateObjectByCrc);	
@@ -1327,43 +1357,119 @@
 	SEND_QueuedPackets(PLAYER,false);
 	resetSpawnVariables();
 
-	SpawnItem(true,ObjID,InventoryID,0x3969E83B,"item_n","inventory","null",oI,oJ,oK,oW,0,0,0,0,false,false,false,false); //spawn the inventory
-	SpawnItem(true,ObjID,DatapadID,0x73BA5001,"item_n","'datapad","null",oI,oJ,oK,oW,0,0,0,0,false,false,false,false); //spawn the datapad
+	stringstream tempInvName;
+	tempInvName << LoadedPlayerData.firstname << "'s Inventory";
+	SpawnItem(true,ObjID,InventoryID,0x3969E83B,"item_n","'inventory",tempInvName.str().c_str(),oI,oJ,oK,oW,0,0,0,0,false,false,false,false); //spawn the inventory
+	SpawnItem(true,ObjID,DatapadID,0x73BA5001,"item_n","'datapad","Datapad",oI,oJ,oK,oW,0,0,0,0,false,false,false,false); //spawn the datapad
 	SpawnItem(true,ObjID,ObjID+HAIR_OFFSET,SWGCRC(sCharacterHairObject.c_str()),"hair_name","hair","null",oI,oJ,oK,oW,0,0,0,0,false,false,false,false);
-	SpawnItem(true,ObjID,BankID,0x70FD1394,"item_n","bank","null",oI,oJ,oK,oW,0,0,0,0,false,false,false,false);
+	SpawnItem(true,ObjID,BankID,0x70FD1394,"item_n","'bank","Bank",oI,oJ,oK,oW,0,0,0,0,false,false,false,false);
 	//SpawnItem(false,ObjID,0x2344+ITEM_OFFSET,937103853,"item_n","CDEF Pistol","null",0,0,0,1,0,0,0,InventoryID,false,true,false,false);
 	
+
+	
+	//spawn friends list
+	spawnID = FriendListID;
+	spawnCRC = 0x619BAE21;
+	ContainerID = char_id; 
+	isEquipped = true;
+	QueuePacket(QUEUE_SceneCreateObjectByCrc);	  
+	QueuePacket(QUEUE_UpdateContainmentMessage);
+	QueuePacket(QUEUE_BaselinesMessage_PLAY3);	
+	QueuePacket(QUEUE_BaselinesMessage_PLAY6);
+	SEND_QueuedPackets(PLAYER,false);
+	QueuePacket(QUEUE_BaselinesMessage_PLAY8);
+	SEND_QueuedPackets(PLAYER,false);
+	QueuePacket(QUEUE_BaselinesMessage_PLAY9);	
+	QueuePacket(QUEUE_SceneEndBaselines);		 
+	SEND_QueuedPackets(PLAYER,false); 
+	resetSpawnVariables();
+	//end friends list
+
+
 	//TODO: make datapad items db driven
-	int dataPadSwoopID = (rand() % 23000)+NPC_OFFSET; 
-	SpawnItem(false,0,dataPadSwoopID,0x85231D5A,"null","null","null",oI,oJ,oK,oW,0,0,0,DatapadID,false,false,false,true); //spawn the players swoop
+	//int dataPadSwoopID = (rand() % 23000)+NPC_OFFSET; 
+	//SpawnItem(false,0,dataPadSwoopID,0x85231D5A,"null","null","Dev Speederbike Swoop",oI,oJ,oK,oW,0,0,0,DatapadID,false,false,false,true); //spawn the players swoop
+	//datapad items
+	
 
 	
-	list<Item> * PInventory;
-	PInventory = db->GetInventory(ObjID, InventoryID);
-
-	printf("\n\n");
-	for ( std::list<Item>::iterator it = PInventory->begin(); it != PInventory->end(); ++it) 
+	//inventory items
+	list<Item>  PInventory;
+	PInventory = db->GetInventory(ObjID);
+	//printf("DatapadID: %u",DatapadID);
+	//printf("\n\n");
+	for ( std::list<Item>::iterator it = PInventory.begin(); it != PInventory.end(); ++it) 
 	{
-		templateData theData = db->GetTemplateData(it->itemtemplate);
-		
-
-		if (sizeof(it->itemname) >= 1)
+		printf("Inserting: %i %s\n",it->itemtemplate,it->itemname.c_str());
+		printf("ContainerID: %u\n",it->containerid);
+		templateData theData;
+		theData = db->GetTemplateData(it->itemtemplate);
+		if(it->containerid == InventoryID)
 		{
-			//string tempItemName = it->itemname.c_str();
-			//printf("1Spawning Item: %i %s %i \n",it->serial,tempItemName.c_str(),it->itemname.size());
-			SpawnItem(it->equiped ,ObjID, it->serial+ITEM_OFFSET, theData.itemCRC ," ", " ", it->itemname.c_str(),oI,oJ,oK,oW,0,0,0,InventoryID,false,it->slot_id,false,false, (it->itemtemplate > 15315) && (it->itemtemplate <= 15355), it->stack_size);
-			//SpawnItem(it->equiped ,ObjID, it->serial+ITEM_OFFSET, theData.itemCRC ," ", theData.itemName.c_str(), theData.itemName.c_str(),0,0,0,1,0,0,0,InventoryID,false,it->slot_id,false,false);
+			printf("Inserting to Inventory\n");
+			if (it->itemname.length() >= 1)
+			{
+				//string tempItemName = it->itemname.c_str();
+				//printf("1Spawning Item: %i %s %i \n",it->serial,tempItemName.c_str(),it->itemname.size());
+				SpawnItem(it->equiped ,ObjID, it->serial+ITEM_OFFSET, theData.itemCRC ," ", " ", it->itemname.c_str(),oI,oJ,oK,oW,0,0,0,it->containerid,false,it->slot_id,false,false, (it->itemtemplate > 15315) && (it->itemtemplate <= 15355), it->stack_size);
+				//SpawnItem(it->equiped ,ObjID, it->serial+ITEM_OFFSET, theData.itemCRC ," ", theData.itemName.c_str(), theData.itemName.c_str(),0,0,0,1,0,0,0,InventoryID,false,it->slot_id,false,false);
+			}
+			else if (theData.itemName.length() >= 1)
+			{
+				//printf("2Spawning Item: %i %s %i \n",it->serial,it->itemname,it->itemname.size());
+				SpawnItem(it->equiped ,ObjID, it->serial+ITEM_OFFSET, theData.itemCRC ," ", " ", theData.itemName.c_str(),oI,oJ,oK,oW,0,0,0,it->containerid,false,it->slot_id,false,false, (it->itemtemplate > 15315) && (it->itemtemplate <= 15355), it->stack_size);
+			}
+			else 
+			{
+				//printf("3Spawning Item: %i %s %i \n",it->serial,it->itemname,it->itemname.size());
+				SpawnItem(it->equiped ,ObjID, it->serial+ITEM_OFFSET, theData.itemCRC ," ", " ", "Unknown Name",oI,oJ,oK,oW,0,0,0,it->containerid,false,it->slot_id,false,false, (it->itemtemplate > 15315) && (it->itemtemplate <= 15355), it->stack_size);
+			}
 		}
-		else if ( sizeof(theData.itemName) >=1 )
+		else if(it->containerid == DatapadID)
 		{
-			//printf("2Spawning Item: %i %s %i \n",it->serial,it->itemname,it->itemname.size());
-			SpawnItem(it->equiped ,ObjID, it->serial+ITEM_OFFSET, theData.itemCRC ," ", " ", theData.itemName.c_str(),oI,oJ,oK,oW,0,0,0,InventoryID,false,it->slot_id,false,false, (it->itemtemplate > 15315) && (it->itemtemplate <= 15355), it->stack_size);
+			printf("Inserting to Datapad\n");
+			if (it->itemname.length() >= 1)
+			{
+				//string tempItemName = it->itemname.c_str();
+				printf("Spawning DPItem: %s \n",it->itemname.c_str());
+				SpawnItem(it->equiped ,DatapadID, it->serial+ITEM_OFFSET, theData.itemCRC ,theData.itemName.c_str(),theData.STFName.c_str(), it->itemname.c_str(),oI,oJ,oK,oW,0,0,0,it->containerid,false,false,false,true,false,0);
+		      //SpawnItem(false       ,0, dataPadSwoopID        ,0x85231D5A       ,"null","null","Dev Speederbike Swoop",oI,oJ,oK,oW,0,0,0,DatapadID,false,false,false,true); //spawn the players swoop
+				//SpawnItem(it->equiped ,ObjID, it->serial+ITEM_OFFSET, theData.itemCRC ," ", theData.itemName.c_str(), theData.itemName.c_str(),0,0,0,1,0,0,0,InventoryID,false,it->slot_id,false,false);
+			}
+			else if (theData.itemName.length() >= 1)
+			{
+				//printf("2Spawning Item: %i %s %i \n",it->serial,it->itemname,it->itemname.size());
+				SpawnItem(it->equiped ,DatapadID, it->serial+ITEM_OFFSET, theData.itemCRC ,theData.itemName.c_str(),theData.STFName.c_str(), theData.itemName.c_str(),oI,oJ,oK,oW,0,0,0,it->containerid,false,false,false,true,false,0);
+
+			}
+			else 
+			{
+				//printf("3Spawning Item: %i %s %i \n",it->serial,it->itemname,it->itemname.size());
+				SpawnItem(it->equiped ,DatapadID, it->serial+ITEM_OFFSET, theData.itemCRC ," ", " ", "Unknown Name",oI,oJ,oK,oW,0,0,0,it->containerid,false,false,false,true,false,0);
+			}
 		}
-		else 
+		else if(it->containerid == BankID)
 		{
-			//printf("3Spawning Item: %i %s %i \n",it->serial,it->itemname,it->itemname.size());
-			SpawnItem(it->equiped ,ObjID, it->serial+ITEM_OFFSET, theData.itemCRC ," ", " ", "Unknown Name",oI,oJ,oK,oW,0,0,0,InventoryID,false,it->slot_id,false,false, (it->itemtemplate > 15315) && (it->itemtemplate <= 15355), it->stack_size);
+			printf("Inserting to Bank\n");	
+			if (it->itemname.length() >= 1)
+			{
+				//string tempItemName = it->itemname.c_str();
+				//printf("1Spawning Item: %i %s %i \n",it->serial,tempItemName.c_str(),it->itemname.size());
+				SpawnItem(it->equiped ,BankID, it->serial+ITEM_OFFSET, theData.itemCRC ," ", " ", it->itemname.c_str(),oI,oJ,oK,oW,0,0,0,it->containerid,false,it->slot_id,false,false, (it->itemtemplate > 15315) && (it->itemtemplate <= 15355), it->stack_size);
+				//SpawnItem(it->equiped ,ObjID, it->serial+ITEM_OFFSET, theData.itemCRC ," ", theData.itemName.c_str(), theData.itemName.c_str(),0,0,0,1,0,0,0,InventoryID,false,it->slot_id,false,false);
+			}
+			else if (theData.itemName.length() >= 1)
+			{
+				//printf("2Spawning Item: %i %s %i \n",it->serial,it->itemname,it->itemname.size());
+				SpawnItem(it->equiped ,BankID, it->serial+ITEM_OFFSET, theData.itemCRC ," ", " ", theData.itemName.c_str(),oI,oJ,oK,oW,0,0,0,it->containerid,false,it->slot_id,false,false, (it->itemtemplate > 15315) && (it->itemtemplate <= 15355), it->stack_size);
+			}
+			else 
+			{
+				//printf("3Spawning Item: %i %s %i \n",it->serial,it->itemname,it->itemname.size());
+				SpawnItem(it->equiped ,BankID, it->serial+ITEM_OFFSET, theData.itemCRC ," ", " ", "Unknown Name",oI,oJ,oK,oW,0,0,0,it->containerid,false,it->slot_id,false,false, (it->itemtemplate > 15315) && (it->itemtemplate <= 15355), it->stack_size);
+			}
 		}
+
 	} 
 
 	oI		= LoadedPlayerData.n; 
@@ -1393,6 +1499,12 @@
 	QueuePacket(QUEUE_UpdatePvpStatusMessage);   
 	SEND_QueuedPackets(PLAYER,false);
 	resetSpawnVariables();
+
+	
+	
+	
+
+	//send player emails
 	ZServer * server = ZServer::getServer();
 	_EmailRouterFlags tempFlag;
 
@@ -1400,11 +1512,10 @@
 	tempFlag = server->GetEmailRouterFlags(ObjID,false,1);
 	server->GetEmailRouterFlags(ObjID,false,2);
 
-	//Send the player his emails
-	list <Email> * _MessageList = new list<Email>;
+	list <Email>  _MessageList;
 	_MessageList = db->GetEmailHeaders(ObjID);
 	bool headsupsent;
-	for( std::list<Email>::iterator it = _MessageList->begin(); it != _MessageList->end(); it++)
+	for( std::list<Email>::iterator it = _MessageList.begin(); it != _MessageList.end(); it++)
 	{
 		if(!it->Error)
 		{
@@ -1529,22 +1640,25 @@
 	SpawnItem(true,sPlayerID,sPlayerID+HAIR_OFFSET,SWGCRC(sCharacterHairObject.c_str()),"hair_name","hair","null",0,0,0,1,0,0,0,0,false,false,false,false);
 
 	// TODO -- This should be in the database.		to be moved by pf soon
-	MYSQL_RES * QResult;
-	MYSQL_ROW QRow;
-	list<Item> * PInventory;
-	PInventory = db->GetInventory(sPlayerID, sInventoryID);
-	for ( std::list<Item>::iterator it = PInventory->begin(); it != PInventory->end(); ++it) 
+	//MYSQL_RES * QResult;
+	//MYSQL_ROW QRow;
+	list<Item> PInventory;
+	PInventory = db->GetInventory(sPlayerID);
+	for ( std::list<Item>::iterator it = PInventory.begin(); it != PInventory.end(); ++it) 
 	{
-		stringstream query;
-		query << "SELECT * FROM item_template WHERE template_id =" << it->itemtemplate;
-		mysql_query(db->conn,query.str().c_str());
-		QResult = mysql_use_result(db->conn);
-		QRow = mysql_fetch_row(QResult);
+		//stringstream query;
+		//query << "SELECT * FROM item_template WHERE template_id =" << it->itemtemplate;
+		//mysql_query(db->conn,query.str().c_str());
+		//QResult = mysql_use_result(db->conn);
+		//QRow = mysql_fetch_row(QResult);
+		templateData theData = db->GetTemplateData(it->itemtemplate);
+		
 		if (it->equiped)
 		{
-		SpawnItem(it->equiped ,sPlayerID, it->serial+ITEM_OFFSET, atof(QRow[8]) ," ", QRow[3], QRow[3],0,0,0,1,0,0,0,sInventoryID,false,it->slot_id,false,false,(it->itemtemplate > 15315) && (it->itemtemplate <= 15355), it->stack_size);
+			//SpawnItem(it->equiped ,sPlayerID, it->serial+ITEM_OFFSET, atof(QRow[8]) ," ", QRow[3], QRow[3],0,0,0,1,0,0,0,sInventoryID,false,it->slot_id,false,false,(it->itemtemplate > 15315) && (it->itemtemplate <= 15355), it->stack_size);
+			SpawnItem(it->equiped ,sPlayerID, it->serial+ITEM_OFFSET, theData.itemCRC ,"","",it->itemname,0,0,0,1,0,0,0,it->containerid,false,it->slot_id,false,false,(it->itemtemplate > 15315) && (it->itemtemplate <= 15355), it->stack_size);
 		}
-		mysql_free_result(QResult);
+//		mysql_free_result(QResult);
 	} 
 
 	spawnID = sPlayerID;
@@ -1601,6 +1715,7 @@
 return; }
 
 void ZClient::SpawnCreature(uint64 cID,uint32 cCRC,string cName,int cPvPStatus,float headingN,float headingS,float headingE,float headingW,float cposX, float cposZ, float cposY, int health, int action, int mind, long cellID,string perfid,int StanceID) {
+
 	iCurrentHAM[0] = health;
 	iMaxHAM[0] = health;
 	iCurrentHAM[3] = action;
@@ -1625,7 +1740,7 @@
 	QueuePacket(QUEUE_UpdatePvpStatusMessage);   
 	SEND_QueuedPackets(PLAYER,false);
     perf = "";
-   iStance = 0;
+	iStance = 0;
 	spawnID = 0;
     ContainerID = 0;
 
@@ -1826,6 +1941,55 @@
 	DMC->writeSHORT(12); //update type
 	DMC->writeINT(SongID); //Update 11 Song&Insterment Number's
     return DMC; }
+ByteBuffer* ZClient::BUILD_DeltasMessage_FriendListUpdate() {
+	ByteBuffer *FLUDM = new ByteBuffer();
+/*
+05 00 //OBJECT_UPDATE 
+53 21 86 12 //0x12862153 DeltasMessage
+A6 05 49 05 00 00 00 00 //toon id
+4F 45 52 43 //creo 
+06 //6
+0C 00 00 00 //size of update dec = 12
+01 00 //update count
+0C 00 //update type
+00 00 00 00 00 00 00 00 //target id
+*/
+	FLUDM->writeSHORT(OBJECT_UPDATE); //05 00 //OBJECT_UPDATE 
+	FLUDM->writeINT(DeltasMessage); // 53 21 86 12 //0x12862153 DeltasMessage
+	FLUDM->writeLONG(ObjID); // A6 05 49 05 00 00 00 00 //toon id
+	FLUDM->writeReversedINT(*(unsigned int*)"CREO"); // 4F 45 52 43 //creo 
+	FLUDM->writeBYTE(6); // 06 //6
+	FLUDM->writeINT(12); // 0C 00 00 00 //size of update dec = 12
+	FLUDM->writeSHORT(1); // 01 00 //update count
+	FLUDM->writeSHORT(0x0C); //0C 00 //update type
+	FLUDM->writeLONG(0); // 00 00 00 00 00 00 00 00 //target id
+	return FLUDM;
+}
+ByteBuffer* ZClient::BUILD_ObjControllerMessage_FriendListUpdate() {
+	ByteBuffer *FLUCM = new ByteBuffer();
+/*
+05 00 //OBJECT_UPDATE 
+46 5E CE 80 //ObjControllerMessage 0x80CE5E46
+0B 00 00 00 //11
+48 04 00 00 //1096 //Friends List Response
+
+A6 05 49 05 00 00 00 00 //toon id recipient
+
+00 00 00 00 //int 0
+00 00 00 00 00 00 00 00 //long 0
+00 //byte 0
+*/
+	FLUCM->writeSHORT(OBJECT_UPDATE); // 05 00 //OBJECT_UPDATE 
+	FLUCM->writeINT(ObjControllerMessage); // 46 5E CE 80 //ObjControllerMessage 0x80CE5E46
+	FLUCM->writeINT(11); // 0B 00 00 00 //11
+	FLUCM->writeINT(1096); // 48 04 00 00 //1096 //Friends List Response
+	FLUCM->writeLONG(ObjID); //A6 05 49 05 00 00 00 00 //toon id recipient
+	FLUCM->writeINT(0); // 00 00 00 00 //int 0
+	FLUCM->writeLONG(0); // 00 00 00 00 00 00 00 00 //long 0
+	//FLUCM->writeBYTE(0); // 00 //byte 0
+
+return FLUCM;
+}
 ByteBuffer * ZClient::BUILD_EnterStructurePlacementMode(){
 	ByteBuffer *ESPM = new ByteBuffer();
 	ESPM->uType(ACCOUNT_UPDATE);
@@ -1837,10 +2001,14 @@
 
 
 ByteBuffer * ZClient::BUILD_EnterTicketPurchaseModeMessage(){
-	PlayerData pd;
-	pd = db->GetPlayerData(ObjID);
+		
+	if(debug){printf("BUILD_EnterTicketPurchaseModeMessage\n");}
 	string defaulttick;
-	std::list<Ticket>* Tickets = db->GetTickets(pd.planet_id);
+	std::list<Ticket> Tickets = db->GetTickets(planetID,true);
+	
+	//selectedTravelTerminal = t->npc_id;
+	//travelTerminalTicketID = t->ticketid;
+	if(debug){printf("Looking For ticket:%i\n",travelTerminalTicketID);}
 	ByteBuffer *ETPMM = new ByteBuffer();
 	ETPMM->uType(SERVER_UPDATE);
 	ETPMM->opcode2(EnterTicketPurchaseModeMessage);
@@ -1850,22 +2018,34 @@
 	//	ETPMM->writeASTRING(PlanetNames[0]); //Planet in list for now hardcoded so tutorial does not crash the client.
 	//}
 	//else
+	//printf("EnterTicketPurchaseModeMessage Planet:%s\n",FlattenedPlanetNames[planetID]);
+	ETPMM->writeASTRING(FlattenedPlanetNames[planetID]); //Planet in list
+	
+	//this function has to return the location where were sitting at.
+	bool ticketfound = false;
+	isShuttlePort = false;
+	for(std::list<Ticket>::iterator st = Tickets.begin();st != Tickets.end();st++)
 	{
-		ETPMM->writeASTRING(PlanetNames[pd.planet_id]); //Planet in list
+		if(st->ticketID == travelTerminalTicketID)
+		{	
+			if(debug){printf("Ticket Iterated: %i %s\n",st->ticketID,st->destination.c_str());}
+			ETPMM->writeASTRING(st->destination.c_str()); //Location? default location
+			if(debug){printf("Ticket Found: %i %s\n",st->ticketID,st->destination.c_str());}
+			isShuttlePort = st->shuttle;
+			ticketfound = true;
+		}
 	}
 	
-	Ticket aTicket;
-	if (Tickets->size() > 0) {
-		aTicket = Tickets->front();
-		ETPMM->writeASTRING(aTicket.destination.c_str()); //Location? default location
-	} else {
-		// This should never happen as we will ALWAYS have SOMEWHERE we can go.  Even if 
-		// we eventually support Kashyyyk and/or Mustafar (via SWGEmods), we'll have SOMEWHERE
-		// we can go.
+	if(!ticketfound)
+	{
+		if(debug){printf("Ticket not found\n");}
 		ETPMM->writeSHORT(0);
 	}
 	ETPMM->writeSHORT(0);
-	delete Tickets;
+//	delete Tickets;
+	selectedTravelTerminal = 0;
+	travelTerminalTicketID = 0;
+	
 	return ETPMM;
 }
 
@@ -1906,55 +2086,105 @@
 
 
 ByteBuffer * ZClient::BUILD_PlanetTravelPointListResponse(){
+/*
+	This function sends the list of available travel destinations
+	But when sendind the destination we cannot send all starports and shuttel ports.
+	Only shuttle ports for the local planet the toon is on has to be sent.
+	All other planets must be sent only with the starport locations for that planet.
+	If shuttles are sent for non local planets then the client will crash.
+	--BUG--
+	Atm there is a bug where the client will only populate some of the starports sent.
+*/
 	ByteBuffer *PTPLR = new ByteBuffer();
-
-//	PlayerData pd;
-//	pd = db->GetPlayerData(ObjID);
-	list<Ticket> * Tickets = db->GetTickets(planetTravelID);
-	int destcount = Tickets->size();
-	std::list<Ticket>::iterator it = Tickets->begin();
-	PTPLR->uType(SERVER_UPDATE);
-	PTPLR->opcode2(PlanetTravelPointListResponse);
-	PTPLR->writeASTRING(PlanetNames[planetTravelID]); //Planet being mapped
-	
-	PTPLR->writeINT(destcount); //List Count of destinations
-	//int itrCount = 0;
-	for ( it = Tickets->begin(); it != Tickets->end(); ++it) 
+	printf("PlanetTravelPointListResponse\n");
+	list<Ticket>  Tickets ;
+	int destcount = 0;
+	if(planetTravelID == planetID)
 	{
-		PTPLR->writeASTRING(it->destination.c_str());
+		Tickets = db->GetTickets(planetTravelID,true);
 	}
+	else
+	{
+		Tickets = db->GetTickets(planetTravelID,false);
+	}	
+	std::list<Ticket>::iterator it = Tickets.begin();
+	bool listAllowed = false;
 
-    PTPLR->writeINT(destcount); //List Count of Coordinates
-
-	for ( it = Tickets->begin(); it != Tickets->end(); ++it) 
+	for ( it = Tickets.begin(); it != Tickets.end(); it++) 
 	{
-		PTPLR->writeFLOAT(it->x);  //x
-		PTPLR->writeFLOAT(it->z); // z
-		PTPLR->writeFLOAT(it->y); //y
+		if(isShuttlePort && it->planet_id == planetTravelID)
+		{
+			listAllowed = true;
+		}
+		else if(!isShuttlePort)
+		{
+			listAllowed = true;
+		}
 	}
-
-    PTPLR->writeINT(destcount); // cost list
-
-	for (it = Tickets->begin(); it != Tickets->end(); ++it) 
+	if(listAllowed)
 	{
-		PTPLR->writeINT(it->cost);
+		destcount = Tickets.size();
+		PTPLR->uType(SERVER_UPDATE);
+		PTPLR->opcode2(PlanetTravelPointListResponse);
+		PTPLR->writeASTRING(FlattenedPlanetNames[planetTravelID]); //Planet being mapped
+		PTPLR->writeINT(destcount); //List Count of destinations
+		for ( it = Tickets.begin(); it != Tickets.end(); it++) 
+		{
+			PTPLR->writeASTRING(it->destination.c_str());
+			printf("Sending Destination:%s\n",it->destination.c_str());
+		}
+		PTPLR->writeINT(destcount); //List Count of Coordinates
+		
+		for ( it = Tickets.begin(); it != Tickets.end(); it++) 
+		{
+			PTPLR->writeFLOAT(it->x);  //x
+			PTPLR->writeFLOAT(it->z); // z
+			PTPLR->writeFLOAT(it->y); //y
+			printf("Sending Coodrs: x:%f, z:%f, y:%f \n",it->x,it->z,it->y);
+		}
+		PTPLR->writeINT(destcount); // cost list
+		for (it = Tickets.begin(); it != Tickets.end(); it++) 
+		{
+			PTPLR->writeINT(db->GetTicketPrice(it->departureplanet,it->planet_id));
+			printf("Cost:%i\n",it->cost);
+		}
+		PTPLR->writeINT(1);//1
+		PTPLR->writeSHORT(5);//5
 	}
-
-    PTPLR->writeINT(1);//
-	PTPLR->writeSHORT(5);//
-
-	delete Tickets;
-
+	else
+	{
+		destcount = 0; //Tickets.size();
+		PTPLR->uType(SERVER_UPDATE);
+		PTPLR->opcode2(PlanetTravelPointListResponse);
+		PTPLR->writeASTRING(FlattenedPlanetNames[planetTravelID]); //Planet being mapped
+		PTPLR->writeINT(destcount); //List Count of destinations
+		//for ( it = Tickets.begin(); it != Tickets.end(); it++) 
+		//{
+		//	PTPLR->writeASTRING(it->destination.c_str());
+		//	printf("Sending Destination:%s\n",it->destination.c_str());
+		//}
+		PTPLR->writeINT(destcount); //List Count of Coordinates
+		
+		//for ( it = Tickets.begin(); it != Tickets.end(); it++) 
+		//{
+	//		PTPLR->writeFLOAT(it->x);  //x
+	//		PTPLR->writeFLOAT(it->z); // z
+	//		PTPLR->writeFLOAT(it->y); //y
+	//		printf("Sending Coodrs: x:%f, z:%f, y:%f \n",it->x,it->z,it->y);
+	//	}
+		PTPLR->writeINT(destcount); // cost list
+	//	for (it = Tickets.begin(); it != Tickets.end(); it++) 
+	//	{
+	//		PTPLR->writeINT(it->cost);
+	//		printf("Cost:%i\n",it->cost);
+	//	}
+		PTPLR->writeINT(1);//1
+		PTPLR->writeSHORT(5);//5
+	}
+	//delete Tickets;
+	planetTravelID = 0;
     return PTPLR;
 }
-
-
-
-
-
-
-
-
 	ByteBuffer* ZClient::BUILD_DeltasMessage_UpdPosture() {
 	ByteBuffer *DMUP = new ByteBuffer();
     int PacketSize = 4 + 1;
@@ -1975,7 +2205,8 @@
 	OCM->opcode2(OpenedContainerMessage);
     OCM->writeINT(3);//UNK
 	OCM->writeLONG(ContID);//COntainer to Open
-	OCM->writeSHORT(0); OCM->writeBYTE(0); //Unk yes its 00 00 00 
+	OCM->writeSHORT(0); 
+	OCM->writeBYTE(0); //Unk yes its 00 00 00 
 
 	
 	return OCM;}
@@ -2042,17 +2273,14 @@
 	SWM->uType(OBJECT_UPDATE);
 	SWM->opcode2(ServerWeatherMessage);
     SWM->writeINT(SongID);
-   SWM->writeFLOAT(0);
-SWM->writeFLOAT(0);
-SWM->writeFLOAT(0);
-SWM->writeFLOAT(5);
-
-
+	SWM->writeFLOAT(0);
+	SWM->writeFLOAT(0);
+	SWM->writeFLOAT(0);
+	SWM->writeFLOAT(5);
 return SWM;}
 
 ByteBuffer* ZClient::BUILD_SendUICommand(){
 	ByteBuffer *SUIC = new ByteBuffer();
-	//SUIC->uType(CLIENT_UI_UPDATE);
 	SUIC->writeSHORT(2);
 	SUIC->writeASTRING("ui");
 	SUIC->writeINT(sizeof(uiCommandCodes[ZClient::uiCommand]));
@@ -2084,7 +2312,7 @@
 	31 27 //crc
 
 	*/
-	printf("Sending Email Header\n");
+	//printf("Sending Email Header\n");
 	SEH->uType(WORLD_UPDATE);
 	SEH->opcode2(ServerSendEmailMessage);
 	SEH->writeASTRING(ZClient::EmailMessageSender.c_str());
@@ -2132,7 +2360,7 @@
 	07 7D                       //CRC
 	*/
 
-	printf("Sending Email Content\n");
+	//printf("Sending Email Content\n");
 	SEC->uType(WORLD_UPDATE);
 	SEC->opcode2(ServerSendEmailMessage);
 	SEC->writeASTRING(ZClient::EmailMessageRecipient.c_str());
@@ -2144,22 +2372,22 @@
 
 	if(ZClient::EmailAttachmentFlag)
 	{
-		printf("Email has Attachments\n");
+		//printf("Email has Attachments\n");
 		int _attachmentCount = 0;
 		int aCnt = 0;
-		for(std::list<_EmailAttachment>::iterator a = ZClient::EmailAttachmentList->begin();a != ZClient::EmailAttachmentList->end(); a++)
+		for(std::list<_EmailAttachment>::iterator a = ZClient::EmailAttachmentList.begin();a != ZClient::EmailAttachmentList.end(); a++)
 		{
 			_attachmentCount = _attachmentCount + a->name.length();
 			_attachmentCount = _attachmentCount + 25;
 			aCnt++;
 		}
 		SEC->writeINT(_attachmentCount);// Count of attachments Formula 25+ustringlength
-		printf("Attachment Count:%i\n",aCnt);
-		printf("_attachmentCount:%i\n",_attachmentCount);
+		//printf("Attachment Count:%i\n",aCnt);
+		//printf("_attachmentCount:%i\n",_attachmentCount);
 
-		for(std::list<_EmailAttachment>::iterator a = ZClient::EmailAttachmentList->begin();a != ZClient::EmailAttachmentList->end(); a++)
+		for(std::list<_EmailAttachment>::iterator a = ZClient::EmailAttachmentList.begin();a != ZClient::EmailAttachmentList.end(); a++)
 		{
-			printf("Attachment ID:%i\n",a->id);
+			//printf("Attachment ID:%i\n",a->id);
 			SEC->writeSHORT(1);// 2
 			SEC->writeBYTE(4);
 			SEC->writeINT(0xFFFFFFFD);//8 FD FF FF FF ///FFFFFFFD
@@ -2179,17 +2407,17 @@
 	}
 	else
 	{
-		printf("Email has NO Attachments\n");
+		//printf("Email has NO Attachments\n");
 		SEC->writeINT(0);		
 	}
 	if(ZClient::EmailMessageReadFlag)
 	{
-		printf("Email is Read\n");
+		//printf("Email is Read\n");
 		SEC->writeBYTE(0X52);
 	}
 	else
 	{
-		printf("Email is Not Read\n");
+		//printf("Email is Not Read\n");
 		SEC->writeBYTE(0x4E);//email status ascII character B2 = R for read 4E = N for New
 	}
 	SEC->writeINT(ZClient::EmailTimeStamp);
@@ -2198,12 +2426,12 @@
 }
 ByteBuffer* ZClient::BUILD_NewEmailNotification(){
 	ByteBuffer *NEN = new ByteBuffer();
+	/*
+	01 00 //CLIENT_UI_UPDATE
+	BE E9 2F D7  //NewMail  0xD72FE9BE
+	*/
 	NEN->uType(CLIENT_UI_UPDATE);
-	//01 00 //CLIENT_UI_UPDATE
 	NEN->opcode2(NewEmailNotification);
-	//BE E9 2F D7  //NewMail  0xD72FE9BE
-	//NEN->writeINT(0);
-	//00 //byte 0
 	return NEN;
 }
 ByteBuffer* ZClient::BUILD_Error_Message(){
@@ -2242,6 +2470,7 @@
 	ERR->writeINT(ClientUIErrorMessage);
 	ERR->writeASTRING(ErrorTitle.c_str());
 	ERR->writeASTRING(ErrorMessage.c_str());
+	ERR->writeINT(0);
 
 	return ERR;
 }
@@ -2252,15 +2481,14 @@
 		03 73 //tic
 		03 00 //ACCOUNT_UPDATE
 		81 B3 DB 88 //ChatOnSendInstantMessage
-		04 00 00 00 //command ok chat sent but user not online
-		02 00 00 00 //char counter
-		00 //byte0
-		D5 B8//crc 
+		04 00 00 00 //
+		02 00 00 00 //im_counter
+		00 D5 B8//comp + crc //no need to send
 	*/
-	im_counter++;
-	TELL->writeSHORT(3);
+	
+	TELL->writeSHORT(ACCOUNT_UPDATE);
 	TELL->writeINT(ChatOnSendInstantMessage);
-	TELL->writeINT(4);
+	TELL->writeINT(0); //status //,4 fail, 5 echo message to self,10 invalid to XXX
 	TELL->writeINT(im_counter);
 	
 	return TELL;
@@ -2269,56 +2497,97 @@
 	ByteBuffer *TELL = new ByteBuffer();
 	/*
 	===
+	
+	Data A
 	ChatInstantMessageToClient
 
-	00 09 
-	03 6A 
-	00 19 
-	2B 
-	04 00 
-	ED 5C 56 3C 
-	03 00 53 57 47 
-	06 00 
-	46 6C 75 72 72 79 
-	04 00 
-	76 6F 68 6F 
-	05 00 00 00 
-	68 00 65 00 6C 00 6C 00 6F 00 
-	00 00 00 00 
-	0E 
+	199.108.6.149:44463 -> 192.168.1.50:3430(Server -> Client)
+	Enc: T   Comp: T    Seed: 0x616E201C    Length: 67
 
-	03 00 
-	81 B3 DB 88 
-	00 00 00 00 
-	01 00 00 00        
+	00 09 03 92 00 19 2B 04 00 ED 5C 56 3C 03 00 53        ......+...\V<..S
+	57 47 06 00 46 6C 75 72 72 79 04 00 76 6F 68 6F        WG..Flurry..voho
+	05 00 00 00 68 00 65 00 6C 00 6C 00 6F 00 00 00        ....h.e.l.l.o...
+	00 00 0E 03 00 81 B3 DB 88 00 00 00 00 05 00 00        ................
+	00 E1 97                                               ...
+
+	+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 	===
 
 	00 09 
 	03 92 
 	00 19 
 	2B 
-	04 00 
-	ED 5C 56 3C 
-	03 00 53 57 47 
+	04 00 //operand SERVER_UPDATE
+	ED 5C 56 3C //opcode ChatInstantMessageToClient
+	03 00 
+	53 57 47 //SWG astring
 	06 00 
-	46 6C 75 72 72 79 
+	46 6C 75 72 72 79 //server name astring
 	04 00 
-	76 6F 68 6F 
-	05 00 00 00 
-	68 00 65 00 6C 00 6C 00 6F 00 
-	00 00 00 00 
-	0E 
-	03 00 
-	81 B3 DB 88 
-	00 00 00 00 
-	05 00 00 00 
-	E1 97                                               ...
+	76 6F 68 6F //Sender astring
+	05 00 00 00 //ustring length int
+	68 00 65 00 6C 00 6C 00 6F 00 //ustring message
+	00 00 00 00 //spacer
+	0E //always seen as 0E
 
 	===
 	*/
+	TELL->writeSHORT(SERVER_UPDATE);
+	TELL->writeINT(ChatInstantMessageToClient);
+	TELL->writeASTRING("SWG");
+	TELL->writeASTRING(db->GalaxyName.c_str());
+	TELL->writeASTRING(TellSender.c_str());
+	TELL->writeUSTRING(TellMessage.c_str());
+	TELL->writeINT(0);
+	return TELL;
+}
+ByteBuffer* ZClient::BUILD_ToggleAFKDelta() {
+	ByteBuffer* AFK = new ByteBuffer();
+/*
+DeltasMessage
 
+00 09 
+03 6E 
 
-	return TELL;
+05 00 //OBJECT_UPDATE
+53 21 86 12 //DeltasMessage = 0x12862153,
+B0 05 49 05 00 00 00 00 //toon id
+59 41 4C 50 //play
+03 //3
+18 00 00 00 //int packet size 24 bytes
+01 00 //short update count
+05 00 //short //operand
+04 00 00 00 //int
+04 00 00 00 //4 = off 84 = on//int
+00 00 00 00 //int
+00 00 00 00 //int
+00 00 00 00 //int        
+
+*/
+	AFK->writeSHORT(OBJECT_UPDATE);
+	AFK->writeINT(DeltasMessage);
+	AFK->writeLONG(ObjID);
+	AFK->writeReversedINT(*(unsigned int*)"PLAY");
+	AFK->writeBYTE(3);
+	AFK->writeINT(12);
+	AFK->writeSHORT(1);
+	AFK->writeSHORT(5);
+	AFK->writeINT(4);
+	if(CharacterData.afk)
+	{
+		AFK->writeINT(0x84);
+	}
+	else
+	{
+		AFK->writeINT(0x04);
+	}
+	
+	AFK->writeINT(0);
+	AFK->writeINT(0);
+	AFK->writeINT(0);
+	
+
+return AFK;
 }
 
 
@@ -2343,7 +2612,8 @@
 	SSTR->setHeaderSize(0);
 	SSTR->uType(WORLD_UPDATE);
 	SSTR->opcode2(SuiCreatePageMessage);
-	SSTR->writeINT(1206605); // Window ID.  This can be anything, according to Meanmon.
+	lastSurveyWindow = time(0);
+	SSTR->writeINT(lastSurveyWindow); // Window ID.  This can be anything, according to Meanmon.
 	SSTR->writeASTRING("Script.listBox"); // This is the type of script we're running.  listBox, messageBox, etc. etc.
 	SSTR->writeINT(iUpdates); // Number of updates we are performing to this box.
 	//--------------------------------
@@ -2481,6 +2751,7 @@
 	int iPacketSize = 10;
 	string toolTypeForPacket;
 	vector<SpawnedResourceData> theToolVector = server->SpawnedResourceMap->getSpawnedResourceVectorByPlanetBySurveyTool((planetID+1), ResourceToolType);
+	
 	for (std::vector<SpawnedResourceData>::iterator it = theToolVector.begin();
 		it != theToolVector.end(); ++it) 
 		{
@@ -2630,13 +2901,1328 @@
 	} else {
 		db->UpdateWaypointCoordinates(ObjID, updWaypoint.waypointID, updWaypoint.x, updWaypoint.z,
 			updWaypoint.y,  cfg->galaxy_id);
+		vClientWaypoints.clear();
 		vClientWaypoints = db->LoadWaypoints(ObjID, cfg->galaxy_id);
 	}
 
 	delete localdensities;
 	return SM;
 }
+ByteBuffer* ZClient::BUILD_UpdateNPCTransformMessage() {
+	ByteBuffer *UTM = new ByteBuffer();
+	MovCounter++;
+	UTM->uType(UPDATE_TEN);
+	UTM->opcode2(UpdateTransformMessage);
+	if(!isMounted) UTM->writeLONG(NPCID);
+	else UTM->writeLONG(mountID);
+	UTM->writeSHORT((npcposX*4)+0.5);
+	UTM->writeSHORT((npcposZ*4)+0.5);
+	UTM->writeSHORT((npcposY*4)+0.5);
+	UTM->writeINT(MovCounter);
+	UTM->writeBYTE(0); //unk seen as 0,1,2
+	UTM->writeBYTE(MovAngle/0.0625); //direction	
+return UTM; }
+ByteBuffer* ZClient::BUILD_UpdateNPCTransformParentMessage() {
+	ByteBuffer *UTPM = new ByteBuffer();
+	MovCounter++;
+	UTPM->uType(SCENE_UPDATE);
+	UTPM->opcode2(UpdateTransformParentMessage);
+	UTPM->writeLONG(CellID);
+	UTPM->writeLONG(NPCID);
+	UTPM->writeSHORT((npcposX*8)+0.5);
+	UTPM->writeSHORT((npcposZ*8)+0.5);
+	UTPM->writeSHORT((npcposY*8)+0.5);
+	UTPM->writeINT(MovCounter);
+	UTPM->writeBYTE(0); //unk seen as 0,1,2
+	UTPM->writeBYTE(MovAngle/0.0625); //direction		
+return UTPM; }
 
+ByteBuffer* ZClient::BUILD_SUI_TicketPurchaseComplete(){
+	printf("Building SuiPurchaseTicketComplete.\n");
+	ByteBuffer *STPC = new ByteBuffer();
+	//int iBytesWritten = 0;
+	//SSTR->writeSHORT(SOE_CHL_DATA_A);
+	//SSTR->writeSHORT(server_sequence);
+	// Packet size.  Can be 1 of 5 values.  Each list item is 94 bytes long.
+	// If 5 menu options, packet size = 977 bytes.
+	// If 4 menu options, packet size = 883 bytes.
+	// If 3 menu options, packet size = 789 bytes.
+	// If 2 menu options, packet size = 695 bytes.  Should be 695.
+	// If only 1 menu option, packet size = 601 bytes.
+	//SSTR->writeINT(977);
+
+	/*
+	00 09 
+	04 7D 
+	02 00 //WORLD_UPDATE
+	59 72 4B D4 //SuiCreatePageMessage	= 0xD44B7259,
+	4C 8E 04 00 //window ID
+	11 00 //astring length
+	53 63 72 69 70 74 2E 6D 65 73 73 61 67 65 42 6F 78 // Script.messageBox //astring
+	08 00 00 00 //int num of updates
+	05 // byte 5 //
+	00 00 00 00 //int 0
+	03 00 00 00 //list size
+	00 00 //short 0
+	01 //byte 1
+	00 //byte 0
+	09 //byte 9
+	09 00 //astring length
+	68 61 6E 64 6C 65 53 55 49 //handleSUI //astring
+	05 //byte 5
+	00 00 00 00 //int 0 
+	03 00 00 00 //int 3
+	00 00 //short 0
+	01 //byte 1
+	00 //byte 0
+	0A //byte 0A
+	09 00 //astring length
+	68 61 6E 64 6C 65 53 55 49 //handleSUI //astring
+	03 
+	01 00 00 00 //item in list
+	20 00 00 00 //ustring length
+	40 00 74 00 72 00 61 00 76 00 65 00 6C 00 3A 00        @.t.r.a.v.e.l.:.
+	74 00 69 00 63 00 6B 00 65 00 74 00 5F 00 70 00        t.i.c.k.e.t._.p.
+	75 00 72 00 63 00 68 00 61 00 73 00 65 00 5F 00        u.r.c.h.a.s.e._.
+	63 00 6F 00 6D 00 70 00 6C 00 65 00 74 00 65 00        c.o.m.p.l.e.t.e.
+
+	02 00 00 00 //int 2
+	10 00 //astring length
+	50 72 6F 6D 70 74 2E 6C 62 6C 50 72 6F 6D 70 74 //Prompt.lblPrompt // astring
+	
+	04 00 //astring length
+	54 65 78 74 //text astring
+	03 //byte 3
+	01 //byte 1
+	00 00 //short 0
+	00 //byte 0
+	10 00 00 00 //ustring length
+	40 00 62 00 61 00 73 00 65 00 5F        
+	00 70 00 6C 00 61 00 79 00 65 00 72 00 3A 00 73        
+	00 77 00 67 00 //@.b.a.s.e._.p.l.a.y.e.r.:.s.w.g.
+	
+	02 00 00 00 //item in list
+	13 00 
+	62 67 2E 63 61 70 74 69 6F 6E 2E 6C 62 6C 54 69 74 6C 65  //bg.caption.lblTitle..
+	04 00 //astring length
+	54 65 78 74 //Text//astring
+	03 
+	01 00 00 00 
+	05 00 00 00 
+	46 00 61 00 6C 00 73 00 65 00 //F.a.l.s.e.
+	02 00 00 00 
+	09 00 
+	62 74 6E 43 61 6E 63 65 6C //btnCancel
+	07 00 
+	45 6E 61 62 6C 65 64 //Enabled
+	03        
+	01 00 00 00 
+	05 00 00 00 
+	46 00 61 00 6C 00 73 00 65 00 //F.a.l.s.e.
+	02 00 00 00 
+	09 00 
+	62 74 6E 43 61 6E 63 65 6C //btnCancel
+	07 00 
+	56 69 73 69 62 6C 65 //Visible 
+	03 
+	01 00 00 00 
+	05 00 00 00 
+	46 00 61 00 6C 00 73 00 65 00 //F.a.l.s.e.
+	02 00 00 00 
+	09 00 
+	62 74 6E 52 65 76 65 72 74 //btnRevert
+	07 00 
+	45 6E 61 62 6C 65 64 //Enabled
+	03 
+	01 00 00 00 
+	05 00 00 00 
+	46 00 61 00 6C 00 73 00 65 00 //F.a.l.s.e
+	02 00 00 00 
+	09 00 
+	62 74 6E 52 65 76 65 72 74 //btnRevert
+	07 00 
+	56 69 73 69 62 6C 65 //Visible
+	00 00 00 00 00 00 00 00 //// Object ID of the item generating the dialog box (if any).
+	00 00 00 00 //spacer
+	00 00 00 00 00 00 00 00 //players id
+	37 21 //crc                      
+
+	*/
+	STPC->uType(WORLD_UPDATE);
+	STPC->opcode2(SuiCreatePageMessage);
+	STPC->writeINT(lastTicketWindow); // Window ID.  This can be anything, according to Meanmon.
+	STPC->writeASTRING("Script.messageBox"); // This is the type of script we're running.  listBox, messageBox, etc. etc.
+	STPC->writeINT(0x08);//int num of updates
+	STPC->writeBYTE(0x05); // byte 5 //
+	STPC->writeINT(00); //int 0
+	STPC->writeINT(0x03); //list size
+	STPC->writeSHORT(0x00); //short 0
+	STPC->writeBYTE(0x01); //byte 1
+	STPC->writeBYTE(0x00); //byte 0
+	STPC->writeBYTE(0x09); //byte 9
+	STPC->writeASTRING("handleSUI");//09 00 //astring length 	68 61 6E 64 6C 65 53 55 49 //handleSUI //astring
+	STPC->writeBYTE(0x05); //byte 5
+	STPC->writeINT(0x00);  //int 0 
+	STPC->writeINT(0x03); //int 3
+	STPC->writeSHORT(0x00); //short 0
+	STPC->writeBYTE(0x01); //byte 1
+	STPC->writeBYTE(0x00); //byte 0
+	STPC->writeBYTE(0x0A); //byte 0A
+	STPC->writeASTRING("handleSUI");//09 00 //astring length 	68 61 6E 64 6C 65 53 55 49 //handleSUI //astring
+	STPC->writeBYTE(0x03);
+	STPC->writeINT(0x01); //item in list
+	//20 00 00 00 //ustring length
+	//40 00 74 00 72 00 61 00 76 00 65 00 6C 00 3A 00        @.t.r.a.v.e.l.:.
+	//74 00 69 00 63 00 6B 00 65 00 74 00 5F 00 70 00        t.i.c.k.e.t._.p.
+	//75 00 72 00 63 00 68 00 61 00 73 00 65 00 5F 00        u.r.c.h.a.s.e._.
+	//63 00 6F 00 6D 00 70 00 6C 00 65 00 74 00 65 00        c.o.m.p.l.e.t.e.
+	STPC->writeUSTRING("@travel:ticket_purchase_complete");
+	STPC->writeINT(0x02); //int 2
+	STPC->writeASTRING("Prompt.lblPrompt");//10 00 //astring length 	50 72 6F 6D 70 74 2E 6C 62 6C 50 72 6F 6D 70 74 //Prompt.lblPrompt // astring
+	STPC->writeASTRING("Text"); //	04 00 //astring length	54 65 78 74 //text astring
+	STPC->writeBYTE(0x03); //byte 3
+	STPC->writeBYTE(0x01); //byte 1
+	STPC->writeSHORT(0x00); //short 0
+	STPC->writeBYTE(0x00);//byte 0
+	//10 00 00 00 //ustring length 40 00 62 00 61 00 73 00 65 00 5F 00 70 00 6C 00 61 00 79 00 65 00 72 00 3A 00 73 00 77 00 67 00 //@.b.a.s.e._.p.l.a.y.e.r.:.s.w.g.
+	STPC->writeUSTRING("@base_player:swg");
+	STPC->writeINT(0x02);//item in list
+	STPC->writeASTRING("bg.caption.lblTitle");    //13 00 	62 67 2E 63 61 70 74 69 6F 6E 2E 6C 62 6C 54 69 74 6C 65  //bg.caption.lblTitle..
+	STPC->writeASTRING("Text"); //	04 00 //astring length	54 65 78 74 //text astring
+	STPC->writeBYTE(0x03); //byte 3
+	STPC->writeINT(0x01);//int 1
+	STPC->writeUSTRING("False");//05 00 00 00  	46 00 61 00 6C 00 73 00 65 00 //F.a.l.s.e.
+	STPC->writeINT(0x02);//int 2
+	STPC->writeASTRING("btnCancel");// 09 00 62 74 6E 43 61 6E 63 65 6C //btnCancel
+	STPC->writeASTRING("Enabled");//07 00 45 6E 61 62 6C 65 64 //Enabled
+	STPC->writeBYTE(0x03); //byte 3        
+	STPC->writeINT(0x01);//int 1 01 00 00 00 
+	STPC->writeUSTRING("False");//05 00 00 00 46 00 61 00 6C 00 73 00 65 00 //F.a.l.s.e.
+	STPC->writeINT(0x02);//02 00 00 00 
+	STPC->writeASTRING("btnCancel");//09 00 62 74 6E 43 61 6E 63 65 6C //btnCancel
+	STPC->writeASTRING("Visible");//07 00 56 69 73 69 62 6C 65 //Visible 
+	STPC->writeBYTE(0x03); //03
+	STPC->writeINT(0x01);//int 1 01 00 00 00 
+	STPC->writeUSTRING("False");//05 00 00 00 46 00 61 00 6C 00 73 00 65 00 //F.a.l.s.e.
+	STPC->writeINT(0x02);//	02 00 00 00 
+	STPC->writeASTRING("btnRevert");//09 00 62 74 6E 52 65 76 65 72 74 //btnRevert
+	STPC->writeASTRING("Enabled");//07 00 45 6E 61 62 6C 65 64 //Enabled
+	STPC->writeBYTE(0x03);//03 
+	STPC->writeINT(0x01);//int 1 01 00 00 00 
+	STPC->writeUSTRING("False");//05 00 00 00 46 00 61 00 6C 00 73 00 65 00 //F.a.l.s.e
+	STPC->writeINT(0x02); //02 00 00 00 
+	STPC->writeASTRING("btnRevert");//09 00 62 74 6E 52 65 76 65 72 74 //btnRevert
+	STPC->writeASTRING("Visible");//07 00 56 69 73 69 62 6C 65 //Visible
+	STPC->writeLONG(0x00); //	00 00 00 00 00 00 00 00 //// Object ID of the item generating the dialog box (if any).
+	STPC->writeINT(0x0); //00 00 00 00 //spacer
+	STPC->writeLONG(0x00); //00 00 00 00 00 00 00 00 //players id
+	return STPC;
+}
+ByteBuffer* ZClient::BUILD_SUI_MessageBox(){
+	printf("Building BUILD_SUI_MessageBox.\n");
+	ByteBuffer *STPC = new ByteBuffer();
+
+	/*
+	00 09 
+	04 7D 
+	02 00 //WORLD_UPDATE
+	59 72 4B D4 //SuiCreatePageMessage	= 0xD44B7259,
+	4C 8E 04 00 //window ID
+	11 00 //astring length
+	53 63 72 69 70 74 2E 6D 65 73 73 61 67 65 42 6F 78 // Script.messageBox //astring
+	08 00 00 00 //int num of updates
+	05 // byte 5 //
+	00 00 00 00 //int 0
+	03 00 00 00 //list size
+	00 00 //short 0
+	01 //byte 1
+	00 //byte 0
+	09 //byte 9
+	09 00 //astring length
+	68 61 6E 64 6C 65 53 55 49 //handleSUI //astring
+	05 //byte 5
+	00 00 00 00 //int 0 
+	03 00 00 00 //int 3
+	00 00 //short 0
+	01 //byte 1
+	00 //byte 0
+	0A //byte 0A
+	09 00 //astring length
+	68 61 6E 64 6C 65 53 55 49 //handleSUI //astring
+	03 
+	01 00 00 00 //item in list
+	20 00 00 00 //ustring length
+	40 00 74 00 72 00 61 00 76 00 65 00 6C 00 3A 00        @.t.r.a.v.e.l.:.
+	74 00 69 00 63 00 6B 00 65 00 74 00 5F 00 70 00        t.i.c.k.e.t._.p.
+	75 00 72 00 63 00 68 00 61 00 73 00 65 00 5F 00        u.r.c.h.a.s.e._.
+	63 00 6F 00 6D 00 70 00 6C 00 65 00 74 00 65 00        c.o.m.p.l.e.t.e.
+
+	02 00 00 00 //int 2
+	10 00 //astring length
+	50 72 6F 6D 70 74 2E 6C 62 6C 50 72 6F 6D 70 74 //Prompt.lblPrompt // astring
+	
+	04 00 //astring length
+	54 65 78 74 //text astring
+	03 //byte 3
+	01 //byte 1
+	00 00 //short 0
+	00 //byte 0
+	10 00 00 00 //ustring length
+	40 00 62 00 61 00 73 00 65 00 5F        
+	00 70 00 6C 00 61 00 79 00 65 00 72 00 3A 00 73        
+	00 77 00 67 00 //@.b.a.s.e._.p.l.a.y.e.r.:.s.w.g.
+	
+	02 00 00 00 //item in list
+	13 00 
+	62 67 2E 63 61 70 74 69 6F 6E 2E 6C 62 6C 54 69 74 6C 65  //bg.caption.lblTitle..
+	04 00 //astring length
+	54 65 78 74 //Text//astring
+	03 
+	01 00 00 00 
+	05 00 00 00 
+	46 00 61 00 6C 00 73 00 65 00 //F.a.l.s.e.
+	02 00 00 00 
+	09 00 
+	62 74 6E 43 61 6E 63 65 6C //btnCancel
+	07 00 
+	45 6E 61 62 6C 65 64 //Enabled
+	03        
+	01 00 00 00 
+	05 00 00 00 
+	46 00 61 00 6C 00 73 00 65 00 //F.a.l.s.e.
+	02 00 00 00 
+	09 00 
+	62 74 6E 43 61 6E 63 65 6C //btnCancel
+	07 00 
+	56 69 73 69 62 6C 65 //Visible 
+	03 
+	01 00 00 00 
+	05 00 00 00 
+	46 00 61 00 6C 00 73 00 65 00 //F.a.l.s.e.
+	02 00 00 00 
+	09 00 
+	62 74 6E 52 65 76 65 72 74 //btnRevert
+	07 00 
+	45 6E 61 62 6C 65 64 //Enabled
+	03 
+	01 00 00 00 
+	05 00 00 00 
+	46 00 61 00 6C 00 73 00 65 00 //F.a.l.s.e
+	02 00 00 00 
+	09 00 
+	62 74 6E 52 65 76 65 72 74 //btnRevert
+	07 00 
+	56 69 73 69 62 6C 65 //Visible
+	00 00 00 00 00 00 00 00 //// Object ID of the item generating the dialog box (if any).
+	00 00 00 00 //spacer
+	00 00 00 00 00 00 00 00 //players id
+	37 21 //crc                      
+
+	*/
+	STPC->uType(WORLD_UPDATE);
+	STPC->opcode2(SuiCreatePageMessage);
+	STPC->writeINT(lastTicketWindow); // Window ID.  This can be anything, according to Meanmon.
+	STPC->writeASTRING("Script.messageBox"); // This is the type of script we're running.  listBox, messageBox, etc. etc.
+	STPC->writeINT(0x08);//int num of updates
+	STPC->writeBYTE(0x05); // byte 5 //
+	STPC->writeINT(00); //int 0
+	STPC->writeINT(0x03); //list size
+	STPC->writeSHORT(0x00); //short 0
+	STPC->writeBYTE(0x01); //byte 1
+	STPC->writeBYTE(0x00); //byte 0
+	STPC->writeBYTE(0x09); //byte 9
+	STPC->writeASTRING("handleSUI");//09 00 //astring length 	68 61 6E 64 6C 65 53 55 49 //handleSUI //astring
+	STPC->writeBYTE(0x05); //byte 5
+	STPC->writeINT(0x00);  //int 0 
+	STPC->writeINT(0x03); //int 3
+	STPC->writeSHORT(0x00); //short 0
+	STPC->writeBYTE(0x01); //byte 1
+	STPC->writeBYTE(0x00); //byte 0
+	STPC->writeBYTE(0x0A); //byte 0A
+	STPC->writeASTRING("handleSUI");//09 00 //astring length 	68 61 6E 64 6C 65 53 55 49 //handleSUI //astring
+	STPC->writeBYTE(0x03);
+	STPC->writeINT(0x01); //item in list
+	//20 00 00 00 //ustring length
+	//40 00 74 00 72 00 61 00 76 00 65 00 6C 00 3A 00        @.t.r.a.v.e.l.:.
+	//74 00 69 00 63 00 6B 00 65 00 74 00 5F 00 70 00        t.i.c.k.e.t._.p.
+	//75 00 72 00 63 00 68 00 61 00 73 00 65 00 5F 00        u.r.c.h.a.s.e._.
+	//63 00 6F 00 6D 00 70 00 6C 00 65 00 74 00 65 00        c.o.m.p.l.e.t.e.
+	STPC->writeUSTRING("@travel:ticket_purchase_complete");
+	STPC->writeINT(0x02); //int 2
+	STPC->writeASTRING("Prompt.lblPrompt");//10 00 //astring length 	50 72 6F 6D 70 74 2E 6C 62 6C 50 72 6F 6D 70 74 //Prompt.lblPrompt // astring
+	STPC->writeASTRING("Text"); //	04 00 //astring length	54 65 78 74 //text astring
+	STPC->writeBYTE(0x03); //byte 3
+	STPC->writeBYTE(0x01); //byte 1
+	STPC->writeSHORT(0x00); //short 0
+	STPC->writeBYTE(0x00);//byte 0
+	//10 00 00 00 //ustring length 40 00 62 00 61 00 73 00 65 00 5F 00 70 00 6C 00 61 00 79 00 65 00 72 00 3A 00 73 00 77 00 67 00 //@.b.a.s.e._.p.l.a.y.e.r.:.s.w.g.
+	STPC->writeUSTRING("@base_player:swg");
+	STPC->writeINT(0x02);//item in list
+	STPC->writeASTRING("bg.caption.lblTitle");    //13 00 	62 67 2E 63 61 70 74 69 6F 6E 2E 6C 62 6C 54 69 74 6C 65  //bg.caption.lblTitle..
+	STPC->writeASTRING("Text"); //	04 00 //astring length	54 65 78 74 //text astring
+	STPC->writeBYTE(0x03); //byte 3
+	STPC->writeINT(0x01);//int 1
+	STPC->writeUSTRING("False");//05 00 00 00  	46 00 61 00 6C 00 73 00 65 00 //F.a.l.s.e.
+	STPC->writeINT(0x02);//int 2
+	STPC->writeASTRING("btnCancel");// 09 00 62 74 6E 43 61 6E 63 65 6C //btnCancel
+	STPC->writeASTRING("Enabled");//07 00 45 6E 61 62 6C 65 64 //Enabled
+	STPC->writeBYTE(0x03); //byte 3        
+	STPC->writeINT(0x01);//int 1 01 00 00 00 
+	STPC->writeUSTRING("False");//05 00 00 00 46 00 61 00 6C 00 73 00 65 00 //F.a.l.s.e.
+	STPC->writeINT(0x02);//02 00 00 00 
+	STPC->writeASTRING("btnCancel");//09 00 62 74 6E 43 61 6E 63 65 6C //btnCancel
+	STPC->writeASTRING("Visible");//07 00 56 69 73 69 62 6C 65 //Visible 
+	STPC->writeBYTE(0x03); //03
+	STPC->writeINT(0x01);//int 1 01 00 00 00 
+	STPC->writeUSTRING("False");//05 00 00 00 46 00 61 00 6C 00 73 00 65 00 //F.a.l.s.e.
+	STPC->writeINT(0x02);//	02 00 00 00 
+	STPC->writeASTRING("btnRevert");//09 00 62 74 6E 52 65 76 65 72 74 //btnRevert
+	STPC->writeASTRING("Enabled");//07 00 45 6E 61 62 6C 65 64 //Enabled
+	STPC->writeBYTE(0x03);//03 
+	STPC->writeINT(0x01);//int 1 01 00 00 00 
+	STPC->writeUSTRING("False");//05 00 00 00 46 00 61 00 6C 00 73 00 65 00 //F.a.l.s.e
+	STPC->writeINT(0x02); //02 00 00 00 
+	STPC->writeASTRING("btnRevert");//09 00 62 74 6E 52 65 76 65 72 74 //btnRevert
+	STPC->writeASTRING("Visible");//07 00 56 69 73 69 62 6C 65 //Visible
+	STPC->writeLONG(0x00); //	00 00 00 00 00 00 00 00 //// Object ID of the item generating the dialog box (if any).
+	STPC->writeINT(0x0); //00 00 00 00 //spacer
+	STPC->writeLONG(0x00); //00 00 00 00 00 00 00 00 //players id
+	return STPC;
+}
+ByteBuffer* ZClient::BUILD_BankCreditsUpdateDelta(){
+	ByteBuffer* BCUD = new ByteBuffer();
+	/* 	Parsed. By Maach_Ine
+		05 00 // Object_Update
+		53 21 86 12 // Deltas Message DeltasMessage	= 0x12862153,
+		A6 05 49 05 00 00 00 00 // Character ID
+		4F 45 52 43 01 // CREO1
+		08 00 00 00 // Packet size -- 8 bytes?
+		01 00 // Update count
+		00 00 // Update Type -- 00 = player bank credit value 01 inventory????
+		6A 21 01 00 // New value. -- 1216A == 74,090
+	*/
+	BCUD->writeSHORT(OBJECT_UPDATE);
+	BCUD->writeINT(DeltasMessage);
+	BCUD->writeLONG(ObjID);
+	BCUD->writeReversedINT(*(unsigned int*)"CREO");
+	BCUD->writeINT(0x01);
+	BCUD->writeINT(8);
+	BCUD->writeSHORT(1);
+	BCUD->writeSHORT(0);
+	BCUD->writeINT(CharacterData.bankcredits);
+	return BCUD;
+}
+ByteBuffer* ZClient::BUILD_InventoryCreditsUpdateDelta(){
+	ByteBuffer* BCUD = new ByteBuffer();
+	/* 
+
+		00 09 
+		08 CC 
+		00 19 
+		1F 
+
+		05 00 
+		53 21 86 12 
+		DE F4 F0 C8 0E 00 00 00  //char id
+		4F 45 52 43 01 
+		08 00 00 00 
+		01 00 
+		00 00 
+		04 77 66 00 
+		
+		9D 
+		04 00 
+		13 64 2A 6D 00 00 00 	00 00 47 00 00 00 01 00 01 FF FF FF FF 0B 00 62        ..G............b
+		61 73 65 5F 70 6C 61 79 65 72 00 00 00 00 16 00        ase_player......
+		70 72 6F 73 65 5F 70 61 79 5F 61 63 63 74 5F 73        prose_pay_acct_s
+		75 63 63 65 73 73 00 00 00 00 00 00 00 00 00 00        uccess..........
+		00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00        ................
+		00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00        ................
+		00 00 00 00 00 00 0C 00 6D 6F 6E 65 79 2F 61 63        ........money/ac
+		63 74 5F 6E 00 00 00 00 0C 00 74 72 61 76 65 6C        ct_n......travel
+		73 79 73 74 65 6D 00 00 00 00 C8 00 00 00 00 00        system..........
+		00 00 00 00 AE 11                                      ......
+		Parsed. By Maach_Ine
+		05 00 // Object_Update
+		53 21 86 12 // Deltas Message
+		A6 05 49 05 00 00 00 00 // Character ID
+		4F 45 52 43 01 // CREO1
+		08 00 00 00 // Packet size -- 8 bytes?
+		01 00 // Update count
+		00 00 // Update Type -- 00 = player bank credit value 01 inventory????
+		6A 21 01 00 // New value. -- 1216A == 74,090
+	*/
+	BCUD->writeSHORT(OBJECT_UPDATE);
+	BCUD->writeINT(DeltasMessage);
+	BCUD->writeLONG(ObjID);
+	BCUD->writeReversedINT(*(unsigned int*)"CREO");
+	BCUD->writeINT(0x01);
+	BCUD->writeINT(8);
+	BCUD->writeSHORT(1);
+	BCUD->writeSHORT(1);
+	BCUD->writeINT(CharacterData.bankcredits);
+	return BCUD;
+}
+
+ByteBuffer* ZClient::BUILD_TicketPurchaseFlyText(){
+	ByteBuffer* BTPFT = new ByteBuffer();
+
+/*
+04 00 // SERVER_UPDATE
+13 64 2A 6D // ChatSystemMessage -- With STF file reference.
+00
+00 00 00 00 // UString length of non-STF message.
+47 00 00 00 // Unknown
+01 00 // Unknown
+01 // Unknown
+FF FF FF FF // Unknown
+0B 00 //String length
+62 61 73 65 5F 70 6C 61 79 65 72 // "base_player_
+00 00 00 00 // Spacer
+16 00 // String length.
+70 72 6F 73 65 5F 70 61 79 5F 61 63 63 74 5F 73 75 63 63 65 73 73 // "prose_pay_acct_success"
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  // Huge number of null bytes.  (48 of 'em)
+0C 00 // String length.
+6D 6F 6E 65 79 2F 61 63 63 74 5F 6E // "money/acct_n"
+00 00 00 00 // Spacer
+0C 00 // String length
+74 72 61 76 65 6C 73 79 73 74 65 6D // "travelsystem"
+00 00 00 00 // Spacer
+BC 02 00 00 //ticket price int
+00 00 00 00 //int
+00 00 //short
+5F 86 // CRC
+
+*/
+	BTPFT->writeSHORT(SERVER_UPDATE); //04 00 // SERVER_UPDATE
+	BTPFT->writeINT(ChatSystemMessage); //13 64 2A 6D // ChatSystemMessage -- With STF file reference.
+	BTPFT->writeBYTE(0);//00
+	BTPFT->writeINT(0); //00 00 00 00 // UString length of non-STF message.
+	BTPFT->writeINT(0x47); //47 00 00 00 // Unknown
+	BTPFT->writeSHORT(1); //01 00 // Unknown
+	BTPFT->writeBYTE(0x01); //01 // Unknown
+	BTPFT->writeINT(0xFFFFFFFF); //FF FF FF FF // Unknown
+	BTPFT->writeASTRING("base_player"); //0B 00 //String length //	62 61 73 65 5F 70 6C 61 79 65 72 // base_player
+	BTPFT->writeINT(0); //00 00 00 00 // Spacer
+	BTPFT->writeASTRING("prose_pay_acct_success"); //16 00 // String length.//70 72 6F 73 65 5F 70 61 79 5F 61 63 63 74 5F 73 75 63 63 65 73 73 // "prose_pay_acct_success"
+	BTPFT->writeLONG(0); //00 00 00 00 00 00 00 00 
+	BTPFT->writeLONG(0); //00 00 00 00 00 00 00 00 
+	BTPFT->writeLONG(0); //00 00 00 00 00 00 00 00 
+	BTPFT->writeLONG(0); //00 00 00 00 00 00 00 00 
+	BTPFT->writeLONG(0); //00 00 00 00 00 00 00 00 
+	BTPFT->writeLONG(0); //00 00 00 00 00 00 00 00   // Huge number of null bytes.  (48 of 'em)
+	BTPFT->writeASTRING("money/acct_n"); //0C 00 // String length. //	6D 6F 6E 65 79 2F 61 63 63 74 5F 6E // "money/acct_n"
+	BTPFT->writeINT(0); //00 00 00 00 // Spacer
+	BTPFT->writeASTRING("travelsystem"); //0C 00 // String length//	74 72 61 76 65 6C 73 79 73 74 65 6D // "travelsystem"
+	BTPFT->writeINT(0); //00 00 00 00 // Spacer
+	BTPFT->writeINT(purchasedTicketPrice); //BC 02 00 00 //ticket price int
+	BTPFT->writeINT(0); //00 00 00 00 // Spacer
+	BTPFT->writeSHORT(0); //00 00 //short
+	//5F 86 // CRC
+	return BTPFT;
+}
+ByteBuffer* ZClient::BUILD_NoTravelTicket(){
+	ByteBuffer* BTPFT = new ByteBuffer();
+
+/*
+
+00 09 
+09 1D
+ 
+04 00 //SERVER_UPDATE
+13 64 2A 6D //ChatSystemMessage -- With STF file reference.
+00 
+00 00 00 00  // UString length of non-STF message.
+32 00 00 00 // Unknown
+01 00 // Unknown
+01 // Unknown
+FF FF FF FF // Unknown
+06 00 
+74 72 61 76 65 6C //travel //astring
+00 00 00 00 
+09 00 
+6E 6F 5F 74 69 63 6B 65 //no_ticket //astring
+74 00 00 00 
+00 00 00 00 00 00 00 00 
+00 00 00 00 00 00 00 00 
+00 00 00 00 00 00 00 00 
+00 00 00 00 00 00 00 00 
+00 00 00 00 00 00 00 00 
+00 00 00 00 00 00 00 00 
+00 00 00 00 00 00 00 00 
+00 00 00 00 00 00 00 00 
+00 00 
+00 
+*/
+	BTPFT->writeSHORT(SERVER_UPDATE); //04 00 // SERVER_UPDATE
+	BTPFT->writeINT(ChatSystemMessage); //13 64 2A 6D // ChatSystemMessage -- With STF file reference.
+	BTPFT->writeBYTE(0);//00
+	BTPFT->writeINT(0); //00 00 00 00 // UString length of non-STF message.
+	BTPFT->writeINT(0x32); //47 00 00 00 // Unknown
+	BTPFT->writeSHORT(1); //01 00 // Unknown
+	BTPFT->writeBYTE(0x01); //01 // Unknown
+	BTPFT->writeINT(0xFFFFFFFF); //FF FF FF FF // Unknown
+	BTPFT->writeASTRING("travel"); 
+	BTPFT->writeINT(0); //00 00 00 00 // Spacer
+	BTPFT->writeASTRING("no_ticket");
+	BTPFT->writeLONG(0); //00 00 00 00 00 00 00 00 
+	BTPFT->writeLONG(0); //00 00 00 00 00 00 00 00 
+	BTPFT->writeLONG(0); //00 00 00 00 00 00 00 00 
+	BTPFT->writeLONG(0); //00 00 00 00 00 00 00 00 
+	BTPFT->writeLONG(0); //00 00 00 00 00 00 00 00 
+	BTPFT->writeLONG(0); //00 00 00 00 00 00 00 00 
+	BTPFT->writeLONG(0); //00 00 00 00 00 00 00 00 
+	BTPFT->writeLONG(0); //00 00 00 00 00 00 00 00 
+	BTPFT->writeSHORT(0); //00 00 //short
+	BTPFT->writeBYTE(0);
+	
+	return BTPFT;
+}
+
+
+ByteBuffer* ZClient::BUILD_SendAttributesBatch(){
+	ByteBuffer* BSAB = new ByteBuffer();
+/*
+
+00 09 //soe op code
+03 D8 //tic
+05 00 //OBJECT_UPDATE
+2A 2F F1 F3 //AttributesList = 0XF3F12F2A,
+23 45 37 7C 24 00 00 00 //objID
+00 00 //short 00
+05 00 00 00 //attribute count
+
+//attribute 1
+06 00 //astring length 
+76 6F 6C 75 6D 65 //volume
+//attribute 1 value
+01 00 00 00 //ustring length
+31 00 //ustring volume displayed
+
+17 00 //astring length//23 dec
+74 72 61 76 65 6C 5F 64 65 70 61 72 74 75 72 65 5F 70 6C 61 6E 65 74 //travel_departure_planet
+08 00 00 00 //ustring length
+43 00 6F 00 72 00 65 00 6C 00 6C 00 69 00 61 00 //ustring C.o.r.e.l.l.i.a.
+
+16 00 //astring length 
+74 72 61 76 65 6C 5F 64 65 70 61 72 74 75 72 65 5F 70 6F 69 6E 74 //travel_departure_point
+10 00 00 00 //ustring length
+43 00 6F 00 72 00 6F 00 6E 00 65 00 74 00 20 00 53 00 74 00 61 00 72 00 70 00 6F 00 72 00 74 00 // C.o.r.o.n.e.t...S.t.a.r.p.o.r.t.
+
+15 00 //astring length
+74 72 61 76 65 6C 5F 61 72 72 69 76 61 6C 5F 70 6C 61 6E 65 74 //travel_arrival_planet
+05 00 00 00 //ustring length
+4E 00 61 00 62 00 6F 00 6F 00 //N.a.b.o.o.
+
+14 00 //astring length
+74 72 61 76 65 6C 5F 61 72 72 69 76 61 6C 5F 70 6F 69 6E 74 // travel_arrival_point
+06 00 00 00 //ustr length
+4D 00 6F 00 65 00 6E 00 69 00 61 00 //M.o.e.n.i.a.
+
+FF FF FF FF //end of attributes
+C2 1F        //crc                                                  
+
+
+
+*/
+	
+
+	BSAB->writeSHORT(OBJECT_UPDATE); //05 00 //OBJECT_UPDATE
+	BSAB->writeINT(AttributesList); //2A 2F F1 F3 //AttributesList = 0XF3F12F2A,
+	BSAB->writeLONG(_ItemAttributeID); //23 45 37 7C 24 00 00 00 //objID
+	//BSAB->writeSHORT(0); //00 00 //short 00 not needed
+	BSAB->writeINT(ZClient::lAttributes.size()); //05 00 00 00 //attribute count
+	for(std::list<_Attribute>::iterator l = ZClient::lAttributes.begin(); l != ZClient::lAttributes.end(); l++)
+	{
+		BSAB->writeASTRING(l->sAttributeName.c_str());
+		BSAB->writeUSTRING(l->sAttributeValue.c_str());
+	}
+	BSAB->writeINT(0xFFFFFFFF); //FF FF FF FF //end of attributes
+
+return BSAB;
+}
+ByteBuffer* ZClient::BUILD_FriendListDeltasMessage(){
+	ByteBuffer* FLDM = new ByteBuffer();
+/*
+05 00 //OBJECT_UPDATE
+53 21 86 12 //DeltasMessage = 0x12862153,
+33 12 5C 14 06 00 00 00  //player ID + (11 FRIEND_LIST_OFFSET)
+59 41 4C 50 //YALP
+09 //9
+F1 01 00 00 //packet size // 497
+01 00 //short operand count 
+07 00 //Short Friends list ? 
+
+3A 00 00 00 //int list items count: 3A HEX = 58 DEC
+
+24 01 00 00 
+03 
+
+39 00  //Short Name Count dec 57 names
+
+//1
+06 00 
+73 61 6C 6C 75 73 
+//2
+04 00 
+6D 65 6C 6F 
+//3
+06 00 
+73 70 61 77 6E 2D 
+//4
+05 00 
+65 74 65 65 76 
+//5
+06 00 
+6C 6F 65 67 6F 70 
+//6
+05 00 
+74 69 67 67 7A 
+//7
+09 00 
+62 72 69 64 67 65 74 74 65 
+//8
+04 00 
+6F 72 66 79 
+//9
+06 00 
+61 74 72 61 79 75 
+//10
+08 00 
+6B 69 6C 6C 68 65 61 64 
+//11
+07 00 
+67 61 6E 74 61 6E 61 
+//12
+05 00 
+69 70 65 6B 6F 
+//13
+07 00 
+69 64 61 72 65 79 61 
+//14
+08 00 
+6D 69 6E 6F 73 68 6B 61 
+//15
+05 00 
+61 79 72 65 65 
+//16
+05 00 
+66 65 63 61 6D 
+//17
+04 00 
+6F 77 75 76 
+//18
+06 00 
+7A 61 64 61 74 61 
+//19
+08 00 
+61 73 65 65 6E 6E 61 76 
+//20
+05 00 
+6C 61 63 68 69 
+//21
+07 00 
+71 75 69 74 61 72 61 
+//22
+07 00 
+6D 69 6B 65 79 62 27 
+//23
+04 00 
+61 6D 69 69 
+//24
+09 00 
+6D 6F 72 67 61 68 6E 6E 61 
+//25
+07 00 
+61 74 68 65 61 6E 61 
+//26
+06 00 
+79 75 6B 69 79 75 
+//27
+05 00 
+73 69 6C 6F 6E 
+//28
+06 00 
+61 62 64 69 61 73 
+//29
+06 00 
+6E 65 6F 77 61 6E 
+//30
+09 00 
+65 6D 65 74 27 65 6C 65 64 
+//31
+07 00 
+6B 69 6D 61 72 69 61 
+//32
+08 00 
+7A 61 69 72 65 65 6B 61 
+//33
+07 00 
+73 61 72 74 6F 72 69 
+//34
+0A 00 
+73 68 69 62 62 79 6B 69 6B 6F 
+//35
+06 00 
+6F 6E 61 65 67 6F 
+//36
+06 00 
+65 73 74 69 77 65 
+//37
+0D 00 
+6D 6F 6E 6B 65 79 62 75 62 62 6C 65 73 
+//38
+0A 00 
+62 75 62 62 6C 65 73 62 6F 6F 
+//39
+06 00 
+74 65 6B 61 6C 61 
+//40
+07 00 
+61 70 6F 6C 6C 61 73 
+//41
+05 00 
+74 6F 64 61 72 
+//42
+06 00 
+6C 65 69 72 6F 69 
+//43
+08 00 
+61 74 72 61 79 69 61 6E 
+//44
+05 00 
+73 68 6F 66 69 
+//45
+06 00 
+6D 61 79 64 61 79 
+//46
+04 00 
+69 77 65 70 
+//47
+07 00 
+6C 79 73 65 6C 69 61 
+//48
+06 00
+6C 6F 72 6E 6F 73 
+//49
+06 00 
+7A 65 6C 6D 61 6B 
+//50
+08 00 
+74 61 73 73 65 6C 6F 66 
+//51
+05 00 
+6D 6F 6F 6E 65 
+//52
+06 00 
+69 73 69 73 6B 61 
+//53
+08 00 
+6B 61 6C 6C 61 72 79 6E 
+//54
+05 00 
+79 6C 6F 73 73 
+//55
+06 00 
+7A 74 72 61 79 61 
+//56
+05 00 
+68 61 6C 75 6B 
+//57
+07 00 
+62 72 61 27 74 61 6B 
+
+00 64 E6  //compcrc
+
+*/
+friendListUpdateCounter++;
+int ByteCount;
+ByteCount = 15; //  count without names
+
+for(std::list<FriendData>::iterator fl = FriendList.begin(); fl != FriendList.end(); fl++)
+{
+	ByteCount = ByteCount + (fl->_FriendName.length() + 2); //+2 for the astring length short
+}
+
+FLDM->writeSHORT(OBJECT_UPDATE); //05 00 //OBJECT_UPDATE
+FLDM->writeINT(DeltasMessage); //53 21 86 12 //DeltasMessage = 0x12862153,
+FLDM->writeLONG(ZClient::FriendListID); //33 12 5C 14 06 00 00 00  //player ID + (11 FRIEND_LIST_OFFSET)//A6 05 49 05 054905a6 = 88671654 , B0 05 49 05 054905b0 = 88671664
+FLDM->writeReversedINT(*(unsigned int*)"PLAY");; //59 41 4C 50 //YALP  //54905AD  AD 05 49 05
+FLDM->writeBYTE(9); //09 //9
+FLDM->writeINT(ByteCount); // F1 01 00 00 //Byte Count after this int
+FLDM->writeSHORT(1); //01 00 //short operand count 
+FLDM->writeSHORT(7); //07 00 //Short Friends list ? 
+FLDM->writeINT(ZClient::FriendList.size() + 1); //3A 00 00 00 //int list items count: 3A HEX = 58 DEC
+FLDM->writeINT(friendListUpdateCounter); //24 01 00 00 update counter
+FLDM->writeBYTE(3); //03 unknown
+FLDM->writeSHORT((short)ZClient::FriendList.size()); //39 00  //Short Name Count dec 57 names
+
+for(std::list<FriendData>::iterator fl = FriendList.begin(); fl != FriendList.end(); fl++)
+{
+	FLDM->writeASTRING(fl->_FriendName.c_str()); //astring friend name //06 00 73 61 6C 6C 75 73 
+}
+
+return FLDM;
+}
+ByteBuffer* ZClient::BUILD_ChatAccountUpdate(){
+	ByteBuffer* CAU = new ByteBuffer();
+	/*
+	03 00 //ACCOUNT_UPDATE
+	94 0D 2A 2B // 2B2A0D94
+	00 00 00 00 00 00 00 00 
+	*/
+	CAU->writeSHORT(ACCOUNT_UPDATE); //03 00 //ACCOUNT_UPDATE
+	CAU->writeINT(0x2B2A0D94); //94 0D 2A 2B // 0x2B2A0D94
+	CAU->writeLONG(0); //00 00 00 00 00 00 00 00 
+	return CAU;
+}
+ByteBuffer* ZClient::BUILD_FriendOfflineStatusUpdate(){
+	ByteBuffer* FOSUD = new ByteBuffer();
+	list<Galaxy> TempGalaxy;
+	TempGalaxy = db->GrabGalaxyInfo();
+	/*
+		06 00 //UPDATE_SIX
+		26 67 33 54  // 0x54336726 ChatFriendOfflineUpdate
+		A6 05 49 05 00 00 00 00 //player id receiving the message
+		03 00 53 57 47 //astring game name
+		06 00 46 6C 75 72 72 79 //astring server name
+		04 00 76 6F 68 6F //astring player going off line
+		00 00 00 00 //spacer
+		01 00 00 00 //status count
+		00 //byte 0
+	*/
+		FOSUD->writeSHORT(UPDATE_SIX); // 06 00 //UPDATE_SIX
+		FOSUD->writeINT(ChatFriendOfflineUpdate); // 26 67 33 54  // 0x54336726 ChatFriendOfflineUpdate
+		FOSUD->writeLONG(ObjID); // A6 05 49 05 00 00 00 00 //player id receiving the message
+		FOSUD->writeASTRING("SWG"); // 03 00 53 57 47 //game
+		for(std::list<Galaxy>::iterator gl = TempGalaxy.begin(); gl != TempGalaxy.end(); gl++)
+		{	
+			if(gl->iGalaxyID == OnlineStatusUpdateFriend.friendGalaxyID)
+			{
+				FOSUD->writeASTRING(gl->sGalaxyName.c_str()); // 06 00 46 6C 75 72 72 79 //server
+			}
+		}
+		FOSUD->writeASTRING(OnlineStatusUpdateFriend._FriendName.c_str()); // 04 00 76 6F 68 6F  //name
+
+		FOSUD->writeINT(0); // 00 00 00 00 //spacer
+		if(OnlineStatusUpdateFriend.onlineStatus == 0x01)
+		{
+			FOSUD->writeINT(1); // 01 00 00 00 //status flag
+		}
+		else if(OnlineStatusUpdateFriend.onlineStatus == 0x00)
+		{
+			FOSUD->writeINT(0); // 01 00 00 00 //status flag
+		}
+		else
+		{
+			FOSUD->writeINT(0); // 01 00 00 00 //status flag
+		}
+		
+		FOSUD->writeBYTE(0x00); // 00 //byte 0
+
+	return FOSUD;
+}
+ByteBuffer* ZClient::BUILD_FriendOnlineStatusUpdate(){
+	ByteBuffer* FOSUD = new ByteBuffer();
+	/*
+	03 00 //ACCOUNT_UPDATE
+	D8 FC D2 6C //0x6CD2FCD8 ChatFriendOnlineUpdate
+	03 00 53 57 47 //game
+	06 00 46 6C 75 72 72 79 //server
+	04 00 76 6F 68 6F  //name
+	01 //byte online status
+	*/
+	list<Galaxy> TempGalaxy;
+	TempGalaxy = db->GrabGalaxyInfo();
+	FOSUD->writeSHORT(ACCOUNT_UPDATE); // 03 00 //ACCOUNT_UPDATE
+	FOSUD->writeINT(ChatFriendOnlineUpdate); //D8 FC D2 6C //0x6CD2FCD8 ChatFriendOnlineUpdate
+
+	FOSUD->writeASTRING("SWG"); // 03 00 53 57 47 //game
+	for(std::list<Galaxy>::iterator gl = TempGalaxy.begin(); gl != TempGalaxy.end(); gl++)
+	{
+		if(gl->iGalaxyID == OnlineStatusUpdateFriend.friendGalaxyID)
+		{
+			FOSUD->writeASTRING(gl->sGalaxyName.c_str()); // 06 00 46 6C 75 72 72 79 //server
+		}
+	}
+	FOSUD->writeASTRING(OnlineStatusUpdateFriend._FriendName.c_str()); // 04 00 76 6F 68 6F  //name
+
+	FOSUD->writeBYTE(OnlineStatusUpdateFriend.onlineStatus); // 01 //byte online status
+
+	return FOSUD;
+}
+ByteBuffer* ZClient::BUILD_FriendAddedFlyText(){
+	ByteBuffer* FAFT = new ByteBuffer();
+/*
+	04 00 //SERVER_UPDATE
+	13 64 2A 6D //0x6D2A6413 ChatSystemMessage
+	00 00 00 00 
+	00 
+	37 00 00 00 // message type
+	01 00 
+	01 
+	FF FF FF FF
+	05 00 63 6D 6E 74 79 //cmnty
+	00 00 00 00 
+	0C 00 66 72 69 65 6E 64 5F 61 64 64 65 64 //friend_added
+	00 00 00 00 00 00 00 00 
+	00 00 00 00 00 00 00 00 
+	00 00 00 00 00 00 00 00 
+	00 00 00 00 00 00 00 00 
+	00 00 00 00 
+	04 00 00 00 76 00 6F 00 68 00 6F 00 //ustring voho friend name added
+	00 00 00 00 00 00 00 00 
+	00 00 00 00 00 00 00 00 
+	00 00 00 00 00 00 00 00 
+	00 00 00 00 
+	00 00 
+*/
+	FAFT->writeSHORT(SERVER_UPDATE); //04 00 //SERVER_UPDATE
+	FAFT->writeINT(ChatSystemMessage); //13 64 2A 6D //0x6D2A6413 ChatSystemMessage
+	FAFT->writeINT(0); //00 00 00 00 
+	FAFT->writeBYTE(0); //00 
+	FAFT->writeINT(0x37); //37 00 00 00 // message type
+	FAFT->writeSHORT(1); //01 00 
+	FAFT->writeBYTE(0x01); //01 
+	FAFT->writeINT(0xFFFFFFFF); //FF FF FF FF
+	FAFT->writeASTRING("cmnty"); //05 00 63 6D 6E 74 79 //cmnty
+	FAFT->writeINT(0); //00 00 00 00 
+	FAFT->writeASTRING("friend_added"); //0C 00 66 72 69 65 6E 64 5F 61 64 64 65 64 //friend_added //12 chars
+	FAFT->writeLONG(0); //00 00 00 00 00 00 00 00 
+	FAFT->writeLONG(0); //00 00 00 00 00 00 00 00 
+	FAFT->writeLONG(0); //00 00 00 00 00 00 00 00 
+	FAFT->writeLONG(0); //00 00 00 00 00 00 00 00 
+	FAFT->writeINT(0); //00 00 00 00 
+	FAFT->writeUSTRING(OnlineStatusUpdateFriend._FriendName.c_str()); //04 00 00 00 76 00 6F 00 68 00 6F 00 //ustring voho friend name added
+	FAFT->writeLONG(0); //00 00 00 00 00 00 00 00 
+	FAFT->writeLONG(0); //00 00 00 00 00 00 00 00 
+	FAFT->writeLONG(0); //00 00 00 00 00 00 00 00 
+	FAFT->writeINT(0); //00 00 00 00 
+	FAFT->writeSHORT(0); // 00 00 
+
+	return FAFT;
+}
+
+ByteBuffer* ZClient::BUILD_FriendRemovedFlyText(){
+	ByteBuffer* FRFT = new ByteBuffer();
+/*
+	
+	04 00 
+	13 64 2A 6D //0x6D2A6413
+	00 00 00 00 
+	00 
+	3B 00 00 00 
+	01 00 
+	01 
+	FF FF FF FF 
+	05 00 63 6D 6E 74 79 //cmnty
+	00 00 00 00 
+	0E 00 66 72 69 65 6E 64 5F 72 65 6D 6F 76 65 64 //friend_removed
+	00 00 00 00 00 00 00 00 
+	00 00 00 00 00 00 00 00 
+	00 00 00 00 00 00 00 00 
+	00 00 00 00 00 00 00 00 
+	00 00 00 00 
+
+	07 00 00 00 6B 00 65 00 69 00 6C 00 61 00 6E 00 69 00 
+	00 00 00 00 00 00 00 00 
+	00 00 00 00 00 00 00 00 
+	00 00 00 00 00 00 00 00 
+	00 00 00 00 
+	00 00 
+
+*/
+	FRFT->writeSHORT(SERVER_UPDATE); //04 00 //SERVER_UPDATE
+	FRFT->writeINT(ChatSystemMessage); //13 64 2A 6D //0x6D2A6413 ChatSystemMessage
+	FRFT->writeINT(0); //00 00 00 00 
+	FRFT->writeBYTE(0); //00 
+	FRFT->writeINT(0x3B); //3B 00 00 00  // message type
+	FRFT->writeSHORT(1); //01 00 
+	FRFT->writeBYTE(0x01); //01 
+	FRFT->writeINT(0xFFFFFFFF); //FF FF FF FF
+	FRFT->writeASTRING("cmnty"); //05 00 63 6D 6E 74 79 //cmnty
+	FRFT->writeINT(0); //00 00 00 00 
+	FRFT->writeASTRING("friend_removed"); //0C 00 66 72 69 65 6E 64 5F 61 64 64 65 64 //friend_removed
+	FRFT->writeLONG(0); //00 00 00 00 00 00 00 00 
+	FRFT->writeLONG(0); //00 00 00 00 00 00 00 00 
+	FRFT->writeLONG(0); //00 00 00 00 00 00 00 00 
+	FRFT->writeLONG(0); //00 00 00 00 00 00 00 00 
+	FRFT->writeINT(0); //00 00 00 00 
+	FRFT->writeUSTRING(OnlineStatusUpdateFriend._FriendName.c_str()); //04 00 00 00 76 00 6F 00 68 00 6F 00 //ustring voho friend name added
+	FRFT->writeLONG(0); //00 00 00 00 00 00 00 00 
+	FRFT->writeLONG(0); //00 00 00 00 00 00 00 00 
+	FRFT->writeLONG(0); //00 00 00 00 00 00 00 00 
+	FRFT->writeINT(0); //00 00 00 00 
+	FRFT->writeSHORT(0); // 00 00 
+
+	return FRFT;
+}
+
+ByteBuffer* ZClient::BUILD_FriendListRequestResponse(){
+	ByteBuffer* FLRR = new ByteBuffer();
+	list<Galaxy> TempGalaxy;
+	TempGalaxy = db->GrabGalaxyInfo();
+/*
+03 00 // ACCOUNT_UPDATE
+
+94 B5 7A E9 // 0xE97AB594 // FriendListRequestResponse // 94B57AE9
+
+28 12 5C 14 06 00 00 00 //player id
+
+39 00 00 00 //INT LIST NAME COUNT
+
+03 00 53 57 47 //SWG GAME NAME
+04 00 42 72 69 61 //SERVER NAME
+06 00 73 61 6C 6C 75 73 //PLAYER NAME
+
+03 00 
+53 57 47 
+04 00 42 72 69 61 
+04 00 6D 65 6C 6F 
+
+03 00 53 57 47 
+04 00 42 72 69 61 
+06 00 73 70 61 77 6E 2D 
+
+03 00 53 57 47 
+04 00 42 72 69 61 
+05 00 65 74 65 65 76 
+
+03 00 53 57 47 
+0A 00 54 65 73 74 43 65 6E 74 65 72 
+06 00 6C 6F 65 67 6F 70 
+
+03 00 53 57 47 
+0A 00 54 65 73 74 43 65 6E 74 65 72 
+05 00 74 69 67 67 7A 
+
+03 00 53 57 47 
+04 00 42 72 69 61 
+09 00 62 72 69 64 67 65 74 74 65 
+
+03 00 53 57 47 
+04 00 42 72 69 61 
+04 00 6F 72 66 79 
+
+03 00 53 57 47
+04 00 42 72 69 61 
+06 00 61 74 72 61 79 75 
+
+03 00 53 57 47 
+04 00 42 72 69 61 
+08 00 6B 69 6C 6C 68 65 61 64 
+
+03 00 53 57 47 
+04 00 42 72 69 61 
+07 00 67 61 6E 74 61 6E 61 
+
+03 00 53 57 47 
+04 00 42 72 69 61 
+05 00 69 70 65 6B 6F 
+
+03 00 53 57 47 
+04 00 42 72 69 61 
+07 00 69 64 61 72 65 79 61 
+
+03 00 53 57 47 
+04 00 42 72 69 61 
+08 00 6D 69 6E 6F 73 68 6B 61 
+
+03 00 53 57 47 
+04 00 42 72 69 61 
+05 00 61 79 72 65 65 
+
+03 00 53 57 47 
+04 00 42 72 69 61 
+05 00 66 65 63 61 6D 
+
+03 00 53 57 47 
+04 00 42 72 69 61 
+04 00 6F 77 75 76 
+
+03 00 53 57 47 
+04 00 42 72 69 61 
+06 00 7A 61 64 61 74 61 
+
+03 00 53 57 47 
+04 00 42 72 69 61 
+08 00 61 73 65 65 6E 6E 61 76 
+
+03 00 53 57 47 
+04 00 42 72 69 61 
+05 00 6C 61 63 68 69 
+
+03 00 53 57 47 
+04 00 42 72 69 61 
+07 00 71 75 69 74 61 72 61 
+
+03 00 53 57 47 
+04 00 42 72 69 61 
+07 00 6D 69 6B 65 79 62 27 
+
+03 00 53 57 47 
+04 00 42 72 69 61 
+04 00 61 6D 69 69 
+
+03 00 53 57 47 
+04 00 42 72 69 61 
+09 00 6D 6F 72 67 61 68 6E 6E 61 
+
+03 00 53 57 47 
+04 00 42 72 69 61 
+07 00 61 74 68 65 61 6E 61 
+
+03 00 53 57 47 
+0A 00 54 65 73 74 43 65 6E 74 65 72 
+06 00 79 75 6B 69 79 75 
+
+03 00 53 57 47 
+0A 00 54 65 73 74 43 65 6E 74 65 72 
+05 00 73 69 6C 6F 6E 
+
+03 00 53 57 47 
+0A 00 54 65 73 74 43 65 6E 74 65 72 
+06 00 61 62 64 69 61 73 
+
+03 00 53 57 47 
+04 00 42 72 69 61 
+06 00 6E 65 6F 77 61 6E 
+
+03 00 53 57 47 
+04 00 42 72 69 61 
+09 00 65 6D 65 74 27 65 6C 65 64 
+
+03 00 53 57 47 
+04 00 42 72 69 61 
+07 00 6B 69 6D 61 72 69 61 
+
+03 00 53 57 47 
+04 00 42 72 69 61 
+08 00 7A 61 69 72 65 65 6B 61 
+
+03 00 53 57 47 
+09 00 43 6F 72 62 61 6E 74 69 73 
+07 00 73 61 72 74 6F 72 69 
+
+03 00 53 57 47 
+04 00 42 72 69 61 
+0A 00 73 68 69 62 62 79 6B 69 6B 6F 
+
+03 00 53 57 47 
+04 00 42 72 69 61 
+06 00 6F 6E 61 65 67 6F 
+
+03 00 53 57 47 
+04 00 42 72 69 61 
+06 00 65 73 74 69 77 65 
+
+03 00 53 57 47 
+04 00 42 72 69 61 
+0D 00 6D 6F 6E 6B 65 79 62 75 62 62 6C 65 73 
+
+03 00 53 57 47 
+04 00 42 72 69 61 
+0A 00 62 75 62 62 6C 65 73 62 6F 6F 
+
+03 00 53 57 47 
+04 00 42 72 69 61 
+06 00 74 65 6B 61 6C 61 
+
+03 00 53 57 47 
+04 00 42 72 69 61 
+07 00 61 70 6F 6C 6C 61 73 
+
+03 00 53 57 47 
+04 00 42 72 69 61 
+05 00 74 6F 64 61 72 
+
+03 00 53 57 47 
+04 00 42 72 69 61 
+06 00 6C 65 69 72 6F 69 
+
+03 00 53 57 47 
+04 00 42 72 69 61 
+08 00 61 74 72 61 79 69 61 6E 
+
+03 00 53 57 47 
+04 00 42 72 69 61 
+05 00 73 68 6F 66 69 
+
+03 00 53 57 47 
+04 00 42 72 69 61 
+06 00 6D 61 79 64 61 79 
+
+03 00 53 57 47 
+04 00 42 72 69 61 
+04 00 69 77 65 70 
+
+03 00 53 57 47 
+04 00 42 72 69 61 
+07 00 6C 79 73 65 6C 69 61 
+
+03 00 53 57 47 
+04 00 42 72 69 61 
+06 00 6C 6F 72 6E 6F 73 
+
+03 00 53 57 47 
+04 00 42 72 69 61 
+06 00 7A 65 6C 6D 61 6B 
+
+03 00 53 57 47 
+04 00 42 72 69 61 
+08 00 74 61 73 73 65 6C 6F 66 
+
+03 00 53 57 47 
+04 00 42 72 69 61 
+05 00 6D 6F 6F 6E 65 
+
+03 00 53 57 47 
+04 00 42 72 69 61 
+06 00 69 73 69 73 6B 61 
+
+03 00 53 57 47 
+04 00 42 72 69 61 
+08 00 6B 61 6C 6C 61 72 79 6E 
+
+03 00 53 57 47 
+04 00 42 72 69 61 
+05 00 79 6C 6F 73 73 
+
+03 00 53 57 47 
+04 00 42 72 69 61 
+06 00 7A 74 72 61 79 61 
+
+03 00 53 57 47 
+04 00 42 72 69 61 
+05 00 68 61 6C 75 6B 
+
+03 00 53 57 47 
+04 00 42 72 69 61 
+07 00 62 72 61 27 74 61 6B 
+
+*/
+	FLRR->writeSHORT(ACCOUNT_UPDATE);    //03 00 // ACCOUNT_UPDATE
+	FLRR->writeINT(FriendListRequestResponse); //94 B5 7A E9 // 0xE97AB594 // FriendListRequestResponse // 94B57AE9
+	FLRR->writeLONG(ObjID); //28 12 5C 14 06 00 00 00 //player id
+	FLRR->writeINT(ZClient::FriendList.size()); //39 00 00 00 //INT LIST NAME COUNT
+	for(std::list<FriendData>::iterator fl = ZClient::FriendList.begin(); fl != ZClient::FriendList.end(); fl++)
+	{
+		FLRR->writeASTRING("SWG"); //03 00 53 57 47 //SWG GAME NAME
+		for(std::list<Galaxy>::iterator gl = TempGalaxy.begin(); gl != TempGalaxy.end(); gl++)
+		{
+			if(gl->iGalaxyID == fl->friendGalaxyID)
+			{
+				FLRR->writeASTRING(gl->sGalaxyName.c_str()); //04 00 42 72 69 61 //SERVER NAME
+			}
+		}
+		FLRR->writeASTRING(fl->_FriendName.c_str()); //00 73 61 6C 6C 75 73 //PLAYER NAME
+	}
+
+return FLRR;
+}
+
 // ***************************************************************** //
 // *************************** DO NOT USE ************************** //
 // ***************************************************************** //
@@ -2725,4 +4311,4 @@
 	RCNO9->writeINT(2);
 	RCNO9->writeSHORT(0);
 	return RCNO9;
-}
\ No newline at end of file
+}



Index: C:/Software/SWG Pre-CU/Closed2/src/ZoneServer/PacketFactory.h
===================================================================
--- C:/Software/SWG Pre-CU/Closed2/src/ZoneServer/PacketFactory.h	(revision 327)
+++ C:/Software/SWG Pre-CU/Closed2/src/ZoneServer/PacketFactory.h	(working copy)
@@ -1,12 +1,6 @@
 //CAUTION:This file is inserted directly into the ZClient class! All of the functions and 
 //variables defined in this file will be members of the ZClient Class
-		struct RadialOptions {
-			uint16 OptionNum;
-			uint16 ParentMenuID;
-			uint16 OptionID;
-			uint16 unk2;
-			string unkStr;
-		};
+		
 		uint64 rItemID;
 		uint64 rID;		
 		uint64 rOptionsCount;
@@ -20,6 +14,8 @@
 		float sposX,sposZ,sposY; 
 		std::list<RadialOptions> tRadialOptions;
 		uint64 delID;
+		uint64 NPCID;
+
 		void QueuePacket(ZClient::PacketBuilder packet); //used by OverTime Thread
 		void returnPacketToQueue(ZClient::PacketBuilder packet);
 		PacketBuilder getQueuedPacket(); 
@@ -118,3 +114,23 @@
 		ByteBuffer* BUILD_ResourceListForSurveyMessage();
 		ByteBuffer* BUILD_PlayClientEffectLocMessage();
 		ByteBuffer* BUILD_SurveyMessage();
+		ByteBuffer* BUILD_ToggleAFKDelta();
+		ByteBuffer* BUILD_UpdateNPCTransformMessage();
+		ByteBuffer* BUILD_UpdateNPCTransformParentMessage();
+		ByteBuffer* BUILD_SUI_TicketPurchaseComplete();
+		ByteBuffer* BUILD_BankCreditsUpdateDelta();
+		ByteBuffer* BUILD_InventoryCreditsUpdateDelta();
+		ByteBuffer* BUILD_TicketPurchaseFlyText();
+		ByteBuffer* BUILD_SendAttributesBatch();
+		ByteBuffer* BUILD_SUI_MessageBox();
+		ByteBuffer* BUILD_NoTravelTicket();
+		ByteBuffer* BUILD_FriendListRequestResponse();
+		ByteBuffer* BUILD_FriendListDeltasMessage();
+		ByteBuffer* BUILD_DeltasMessage_FriendListUpdate();
+		ByteBuffer* BUILD_ObjControllerMessage_FriendListUpdate();
+		ByteBuffer* BUILD_FriendOnlineStatusUpdate();
+		ByteBuffer* BUILD_FriendOfflineStatusUpdate();
+		ByteBuffer* BUILD_ChatAccountUpdate();
+		ByteBuffer* BUILD_FriendAddedFlyText();
+		ByteBuffer* BUILD_FriendRemovedFlyText();
+

Index: C:/Software/SWG Pre-CU/Closed2/src/ZoneServer/ScriptHandler.cpp
===================================================================
--- C:/Software/SWG Pre-CU/Closed2/src/ZoneServer/ScriptHandler.cpp	(revision 0)
+++ C:/Software/SWG Pre-CU/Closed2/src/ZoneServer/ScriptHandler.cpp	(revision 0)
@@ -0,0 +1,108 @@
+/*
+ScriptHandler.CPP
+   SWG Pre-CU SWG Server (C) 2007 SWG Pre-CU Team. www.swgprecu.com
+   
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or (at
+   your option) any later version.
+
+   This program 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
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; see the file COPYING; if not, write to the
+   Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+   MA 02110-1301 USA
+*/
+/*
+----------------------------------------------------------------------------------
+Change Log for this File. Please add changes as you do them
+----------------------------------------------------------------------------------
+DATE	|AUTHOR		|DESCRIPTION
+----------------------------------------------------------------------------------
+07-23-07 PlasmaFlow	Created ScriptHandler.CPP and added to project for handling npc scripting.
+
+
+*/
+
+/*
+//CAUTION:: THIS FILE RUNS ON ITS OWN THREAD! BE VERY CARFUL WHEN MANULATING VARIABLES OUTSIDE THE SCOPE OF THIS FILE
+//CAUTION:: THIS FILE RUNS ON ITS OWN THREAD! BE VERY CARFUL WHEN MANULATING VARIABLES OUTSIDE THE SCOPE OF THIS FILE
+//CAUTION:: THIS FILE RUNS ON ITS OWN THREAD! BE VERY CARFUL WHEN MANULATING VARIABLES OUTSIDE THE SCOPE OF THIS FILE
+//CAUTION:: THIS FILE RUNS ON ITS OWN THREAD! BE VERY CARFUL WHEN MANULATING VARIABLES OUTSIDE THE SCOPE OF THIS FILE
+//CAUTION:: THIS FILE RUNS ON ITS OWN THREAD! BE VERY CARFUL WHEN MANULATING VARIABLES OUTSIDE THE SCOPE OF THIS FILE
+//CAUTION:: THIS FILE RUNS ON ITS OWN THREAD! BE VERY CARFUL WHEN MANULATING VARIABLES OUTSIDE THE SCOPE OF THIS FILE
+*/
+
+#include "ZoneServer.h"
+
+void ZServer::ScriptHandler(void *parm)
+{
+	int heartbeat = time(0);
+	int beatdiff;
+	bool EndLoop = false;
+	//init the script handler here
+	//load all npcs into the variable list.
+	Log->cb("ZServer::ScriptHandler::Scripting Engine Initializing\n");
+	list<StaticNPC>  ServerNPCList ;
+	
+	Log->cb("ZServer::ScriptHandler::Loading Scripted NPC's\n");
+	for(int i=0;i<9;i++) //need to make this more dynamic later incase more planets are added
+	{
+		//printf("Loading NPCs for planet %i\n",i);
+		list<StaticNPC>  tempNPCList ;
+		tempNPCList= db->SpawnStaticNPCs(i);
+		for(std::list<StaticNPC>::iterator s = tempNPCList.begin(); s != tempNPCList.end(); s++)
+		{
+			if(!strcmp(s->script.c_str(),"None") && s->script.length() != 0)
+			{
+				StaticNPC t;
+				t.action = s->action;
+				t.bitmask = s->bitmask;
+				t.CellID = s->CellID;
+				t.crc = s->crc;
+				t.dancestring = s->dancestring;
+				t.health = s->health;
+				t.mind = s->mind;
+				t.name = s->name.c_str();
+				t.npc_id = s->npc_id;
+				t.oI = s->oI;
+				t.oJ = s->oJ;
+				t.oK = s->oK;
+				t.oW = s->oW;
+				t.planet_id = s->planet_id;
+				t.posture = s->posture;
+				t.script = s->script.c_str();
+				t.x = s->x;
+				t.y = s->y;
+				t.z = s->z;
+				stringstream toLog;
+				toLog << "Loading NPC:ID " << s->npc_id << " Named: " << s->name.c_str() << " PlanetID:" << s->planet_id << "\n";
+				Log->cb((char*)toLog.str().c_str());
+				ServerNPCList.push_back(t);
+			}
+		}
+	}
+	
+	Log->cb("ZServer::ScriptHandler::Scripting Engine Initialized\n");
+	while(!EndLoop) 
+	{
+		Sleep(100); //Delay threaded loop by 1/10th of a second
+		beatdiff = time(0) - heartbeat;
+		if(beatdiff > 1199){heartbeat = time(0); Log->cb("Script Engine Heartbeat\n");}
+		/*	
+		if(!ServerNPCList->empty())
+		{
+			for(std::list<StaticNPC>::iterator l = ServerNPCList->begin(); l != ServerNPCList->end(); l++)
+			{
+				
+			}
+		}
+		*/
+	}
+	_endthread();
+	return;
+}

Index: C:/Software/SWG Pre-CU/Closed2/src/ZoneServer/ZoneClient.cpp
===================================================================
--- C:/Software/SWG Pre-CU/Closed2/src/ZoneServer/ZoneClient.cpp	(revision 327)
+++ C:/Software/SWG Pre-CU/Closed2/src/ZoneServer/ZoneClient.cpp	(working copy)
@@ -91,7 +91,8 @@
 	 iRaceID = -1;
 	 iResourceSurveyWaypointID = 0;
 	 ResourceBeingSurveyedName = "";
-	 im_counter = 0;
+	 
+	 
 	 resetSpawnVariables(); //initilize spawner varaibles
 }
 
@@ -184,7 +185,7 @@
 				if (pData[2] == 'x') pData = Decompress(pData,nLength); }
 			Log->pkf(pData,nLength,true);
 
-			for(std::list<_PlayerSpawnedObjects>::iterator m = PlayerSpawnedObjects->begin(); m != PlayerSpawnedObjects->end(); m++ )
+			for(std::list<_PlayerSpawnedObjects>::iterator m = PlayerSpawnedObjects.begin(); m != PlayerSpawnedObjects.end(); m++ )
 			{
 				if(m->isSpawned)
 				{
@@ -648,7 +649,11 @@
 					// all the fragments, the update type of the original packet, and the
 					// opcode2 of the original packet.
 					if (i == 0) {
-						OutGoingPacket.writeReversedINT(totalPacketSize); 
+						if (totalPacketSize == 0) {
+							OutGoingPacket.writeReversedINT(QueuedPacket->getSize());
+						} else {
+							OutGoingPacket.writeReversedINT(totalPacketSize); 
+						}
 						OutGoingPacket.uType(QueuedPacket->readSHORT());
 						OutGoingPacket.opcode2(QueuedPacket->readINT());
 						iBytesWrittenThisFragment = 16;
@@ -806,6 +811,7 @@
 
 void ZClient::DisconnectClient() {
 	//printf("Client Disconnect Requested ID:%i,Conn:%u\n",ObjID,connection_id);
+	
 	validClient = false;
 	ByteBuffer dcClient;
 	dcClient.opcode(SOE_DISCONNECT);
@@ -816,6 +822,7 @@
 	delID = ObjID;
 	QueuePacket(QUEUE_SceneDestroyObject);
 	SEND_QueuedPackets(XCHATRANGE,false);
+	
 	server_sequence = 0;
 	
 return; 
@@ -846,9 +853,10 @@
 			disconnectPlayer.character_id = ObjID;
 			db->UpdatePlayerPos(disconnectPlayer,FlagCell,CellID);
 			db->UpdatePopulation(-1);
-
-			for(std::list<_PlayerSpawnedObjects>::iterator m = PlayerSpawnedObjects->begin(); m != PlayerSpawnedObjects->end(); m++ )
+			if(!PlayerSpawnedObjects.empty())
 			{
+			for(std::list<_PlayerSpawnedObjects>::iterator m = PlayerSpawnedObjects.begin(); m != PlayerSpawnedObjects.end(); m++ )
+			{
 				if(m->isSpawned)
 				{
 					if(!m->isMounted) 
@@ -881,7 +889,173 @@
 				}
 			}
 			DisconnectClient();
+			}
 		}
 return; 
 	}
 
+void ZClient::SendTellToClient() {
+	/*
+		This function sends a tell to a client.
+		using the TellMessage variable.
+	*/
+	if(debug){printf("SendTellToClient Sending Message to:%i\n",ObjID);}
+	QueuePacket(QUEUE_ChatInstantMessageToClient);
+	SEND_QueuedPackets(PLAYER,false);
+
+return;
+}
+void ZClient::SendPlayerErrorMessage(string _ErrorTitle,string _ErrorMessage){
+
+	ErrorTitle = _ErrorTitle.c_str();
+	ErrorMessage = _ErrorMessage.c_str();
+	QueuePacket(QUEUE_Error_Message);
+	SEND_QueuedPackets(PLAYER,false);
+	ErrorTitle = "";
+	ErrorMessage = "";
+}
+
+void ZClient::PrintPacketToScreen(ByteBuffer &Packet) {
+	
+	printf("******PrintPacketToScreen*******\n");
+	int t = 0;
+	while(Packet.getBytesLeft() != 0)
+	{
+		unsigned char b = Packet.readBYTE();
+		if(b >= 0x10)
+		{
+			printf(" %X",b);
+			t++;
+		}
+		else
+		{
+			printf(" 0%X",b);
+			t++;
+		}
+		if(t==15)
+		{
+			printf("\n");
+			t=0;
+		}
+	}
+	printf("\n****************END*************\n");
+}
+int ZClient::GetObjectTypeFromID(long long _ObjID) {
+
+	int objType = -1;
+	int i = 0;
+	while(objType == -1)
+	{
+		long long tempID = _ObjID;
+		long long bareID = tempID - OffsetList[i];
+		long long compOffset = tempID - bareID;
+		//printf("Checking Offset:%i,%u,%u,%i\n",i,OffsetList[i],(tempID - bareID),bareID);
+		if(compOffset == OffsetList[i] && OffsetList[0] > bareID )
+		{
+			objType = i;		
+		}
+		i++;
+	}
+	//if(objType == -1)
+	{
+		if(_ObjID >= 20000000 && _ObjID <= 99999999)
+		{
+			objType = 8; //player
+		}
+		else if(_ObjID <= 19999999)
+		{
+			objType = 9; //clientObject
+		}
+
+	}
+	return objType;
+}
+string ZClient::GetSerialFromID(string _ObjID){
+	stringstream retVal;
+
+	for(int i=0;i<_ObjID.length();i++)
+	{
+		string s;
+		s = _ObjID[i];
+		int v = atoi(s.c_str());
+		retVal << serialNumbers[v];
+	}
+
+	return retVal.str().c_str();
+}
+void ZClient::UpdateFriendStatus(int _mode,bool _initialize){
+	int timediff;
+	timediff = 0;
+	timediff = ((int)time(0) - friendLastListUpdate);
+	if(!_mode) //if _mode = 0 then run Timed Only , if _mode = 1 run Forced
+	{
+		if( 29 >= timediff)
+		{
+			return;
+		}
+	}
+	int updCount = 0;
+	friendLastListUpdate = time(0);
+	if(debug){printf("UpdateFriendStatus\n");}
+	bool flagFriendFound;
+	for(std::list<FriendData>::iterator fl = FriendList.begin(); fl != FriendList.end(); fl++)
+	{
+		flagFriendFound = false;
+		for (ZServer::ZClientList::iterator i = zServer->Clients.begin(); i != zServer->Clients.end(); ++i) 
+		{
+			ZClient* Client = i->second;
+			if (Client) 
+			{
+				if (Client->isValid()) 
+				{
+					if(Client->ObjID == fl->_FriendID)
+					{
+						if(!(bool)fl->onlineStatus)
+						{
+							//printf("online\n");
+							OnlineStatusUpdateFriend._FriendID = fl->_FriendID;
+							OnlineStatusUpdateFriend._FriendName = fl->_FriendName.c_str();
+							OnlineStatusUpdateFriend.friendGalaxyID = fl->friendGalaxyID;
+							fl->onlineStatus = 0x01;
+							OnlineStatusUpdateFriend.onlineStatus = fl->onlineStatus;
+							QueuePacket(QUEUE_ChatAccountUpdate);
+							QueuePacket(QUEUE_FriendOfflineStatusUpdate);
+							QueuePacket(QUEUE_FriendOnlineStatusUpdate);
+							SEND_QueuedPackets(PLAYER,false);		
+							updCount++;
+						}
+						flagFriendFound = true;
+					}
+				}
+			}
+		}
+		if(_initialize && !flagFriendFound)
+		{
+			OnlineStatusUpdateFriend._FriendID = fl->_FriendID;
+			OnlineStatusUpdateFriend._FriendName = fl->_FriendName.c_str();
+			OnlineStatusUpdateFriend.friendGalaxyID = fl->friendGalaxyID;
+			OnlineStatusUpdateFriend.onlineStatus = fl->onlineStatus;
+			QueuePacket(QUEUE_ChatAccountUpdate);
+			QueuePacket(QUEUE_FriendOfflineStatusUpdate);
+			//QueuePacket(QUEUE_FriendOnlineStatusUpdate);
+			SEND_QueuedPackets(PLAYER,false);	
+			updCount++;
+		}
+		if(!flagFriendFound && (bool)fl->onlineStatus && !_initialize)
+		{
+			//printf("offline\n");
+			OnlineStatusUpdateFriend._FriendID = fl->_FriendID;
+			OnlineStatusUpdateFriend._FriendName = fl->_FriendName.c_str();
+			OnlineStatusUpdateFriend.friendGalaxyID = fl->friendGalaxyID;
+			fl->onlineStatus = 0x00;
+			OnlineStatusUpdateFriend.onlineStatus = fl->onlineStatus;
+			QueuePacket(QUEUE_ChatAccountUpdate);
+			QueuePacket(QUEUE_FriendOfflineStatusUpdate);
+			QueuePacket(QUEUE_FriendOnlineStatusUpdate);
+			SEND_QueuedPackets(PLAYER,false);		
+			updCount++;
+		} 
+	}
+	if(debug){printf("Friends Updated %i for Player %s\n",updCount,CharacterData.firstname.c_str());}
+	return;
+}
\ No newline at end of file

Index: C:/Software/SWG Pre-CU/Closed2/src/ZoneServer/ZoneClient.h
===================================================================
--- C:/Software/SWG Pre-CU/Closed2/src/ZoneServer/ZoneClient.h	(revision 327)
+++ C:/Software/SWG Pre-CU/Closed2/src/ZoneServer/ZoneClient.h	(working copy)
@@ -152,6 +152,7 @@
 			byte   Mood;
 			// deed data
 			string BuildingIff;
+			string BuildingDeedIff;
 			string BuildingBase;
 			bool BaseRequired;
 			int cell_num;
@@ -220,6 +221,7 @@
 			float  sX;
 			float  sZ;
 			float  sY;
+			float jtlW;
 			bool   isEquipped;
 			int    sCellCount;
 			long    sCellID;  
@@ -255,6 +257,7 @@
 			string SpatText;
 		    bool FlagCell;
 			vector<Waypoints> vClientWaypoints;
+			bool wpReload;
 			int iWaypointUpdateCount;
 			int iResourceSurveyWaypointID;
 			bool bUpdatingResourceWaypoint;
@@ -296,6 +299,7 @@
 		void HANDLE_ObjController_CommandQueueEnqueue(ByteBuffer &Packet);
 		void HANDLE_ObjController_ObjectMenuRequest(ByteBuffer &Packet);
 		void HANDLE_ObjController_UseItem(ByteBuffer &Packet);
+		void HANDLE_ObjController_RefreshMissionList(ByteBuffer &Packet);
 		void HANDLE_ChatSendToRoom(ByteBuffer &Packet);
 		void HANDLE_ObjController_CommandQueueEnqueue_spatialchatinternal(ByteBuffer &Packet);
 		void HANDLE_ObjController_CommandQueueEnqueue_socialinternal(ByteBuffer &Packet);
@@ -312,7 +316,7 @@
 		void HANDLE_ObjController_CommandQueueEnqueue_requestcraftingsession(ByteBuffer  &Packet);
 		void HANDLE_ObjController_CommandQueueEnqueue_StartMusic(ByteBuffer  &Packet);
 		void HANDLE_ObjController_CommandQueueEnqueue_StartDance(ByteBuffer  &Packet);
-		void HANDLE_ObjController_CommandQueueEnqueue_itemradialop1(ByteBuffer &Packet);
+		void HANDLE_ObjController_CommandQueueEnqueue_getattributesbatch(ByteBuffer &Packet);
 		void HANDLE_ObjController_CommandQueueEnqueue_emailrelatedenqueurequest(ByteBuffer &Packet);
 		void HANDLE_ObjController_CommandQueueEnqueue_RequestSurveySession(ByteBuffer &Packet);
 		void HANDLE_ClientSendEmailRequest(ByteBuffer &Packet);
@@ -321,21 +325,74 @@
 		void HANDLE_ObjController_CommandQueueEnqueue_ClientRequestSlashWay(ByteBuffer &Packet);
 		void HANDLE_ObjController_CommandQueueEnqueue_ToggleWaypointStatus(ByteBuffer &Packet);
 		void HANDLE_ObjController_CommandQueueEnqueue_ClientRenameWaypoint(ByteBuffer &Packet);
+		void HANDLE_ObjController_CommandQueueEnqueue_toggleawayfromkeyboard(ByteBuffer &Packet);
 		void RouteInternalEmail();
 		void RemoveLDPlayers();
 		void HANDLE_ClientChatSystemTell(ByteBuffer &Packet);
 		void HANDLE_ChatInstantMessageToCharacter(ByteBuffer &Packet);
 		void HANDLE_SuiEventNotification(ByteBuffer &Packet);
+		void HANDLE_ObjController_CommandQueueEnqueue_SetGodMode(ByteBuffer &Packet);
+		void HANDLE_ObjController_CommandQueueEnqueue_findfriend(ByteBuffer &Packet);
 		void HANDLE_ObjController_CommandQueueEnqueue_RequestSampleSession(ByteBuffer &Packet);
+		void HANDLE_ObjController_CommandQueueEnqueue_addfriend(ByteBuffer &Packet);
+		void HANDLE_ObjController_CommandQueueEnqueue_removefriend(ByteBuffer &Packet);
+		void HANDLE_ObjController_CommandQueueEnqueue_burstrun(ByteBuffer &Packet);
+
+		void SendPlayerErrorMessage(string _ErrorTitle,string _ErrorMessage);
+		void PrintPacketToScreen(ByteBuffer &Packet);
+		int GetObjectTypeFromID(long long _ObjID);
+		string GetSerialFromID(string _ObjID);
+		//npc move variables
+		float npcoI;
+		float npcoJ;
+		float npcoK;
+		float npcoW;
+		float npcposX;
+		float npcposZ;
+		float npcposY;
 		//Public Client/Character Variables	
 		uint64 InventoryID; 
 		uint64 BankID;
 		uint64 PlayID;
 		uint64 DatapadID;
+		uint64 FriendListID;
 		uint64 ObjID;
 		uint64 ResourceToolID;
+		uint64 FriendWaypointID;
 		string ResourceBeingSurveyedName;
+		
+		bool godMode;
+
+		//jtl space variables
+		bool spaceLaunch;
+		long spaceCmdStartScene;
 		unsigned int ResourceToolType;
+		PlayerData CharacterData;
+		//travel terminal vars
+		int selectedTravelTerminal;
+		int travelTerminalTicketID;
+		string travelDepartureTerminal;
+		int purchasedTicketPrice;
+		bool isShuttlePort;
+		//window variables
+		int lastSurveyWindow;
+		int lastTicketWindow;
+		int lastUseTicketWindow;
+		
+		//Tell Chat Variables
+		string TellMessage;
+		int MessageState;
+		string TellSender;
+		
+		//friendlist counter
+		int friendListUpdateCounter;
+		FriendData OnlineStatusUpdateFriend;
+		int friendLastListUpdate;
+		void UpdateFriendStatus(int _mode,bool _initialize);
+		list<FriendData> FriendList;
+
+		bool welcomeSent;
+
 		int nameResponseCode;
 		int uiCommand;
 		int MovCounter;
@@ -351,7 +408,7 @@
 		bool gm;
 		int lvlgm; // determines the level of gm of this player
 		int movementTicker; // we increment by one every time a movement packet is sent.
-
+		
 		float CurrentTravelSpeed;
 		float MovAngle;
 		float fScale;
@@ -379,10 +436,16 @@
 		bool EmailsPendingRouting;
 		bool EmailAttachmentFlag;
 		int EmailTimeStamp;
-		list<_EmailAttachment> * EmailAttachmentList;
+		list<_EmailAttachment> EmailAttachmentList;
 		
+		
+		//Attributes List
+		list<_Attribute> lAttributes;
+		long _ItemAttributeID;
+
 		//instant messaging
 		int im_counter;
+
 		//Character Spawned Objects List
 		struct _PlayerSpawnedObjects{
 				long spawnID;
@@ -408,7 +471,7 @@
 				string perfid;
 				int stanceID;
 			};
-		list<_PlayerSpawnedObjects> *PlayerSpawnedObjects;
+		list<_PlayerSpawnedObjects> PlayerSpawnedObjects;
 
 		//OverTime Thread Variables
 		void OverTimeUpdate();
@@ -423,8 +486,9 @@
 		void SpawnBuilding(uint64 sBuildingID,uint32 sBuildingCRC,int cellCount,float oN,float oS,float oE,float oW,float bX,float bZ,float bY);
 		void SpawnCreature(uint64 cID,uint32 cCRC,string cName,int cType,float headingN,float headingS,float headingE,float headingW,float cposX, float cposZ, float cposY, int health, int action, int mind,long cellID,string perfid,int StanceID);
 		void resetSpawnVariables();
-
+		void SendTellToClient();
 		
+		
 		//Accesser Functions
 		inline bool isValid() {return validClient;};
 		inline int lastPingTime() {return LastPingRequestTime;}; 



Index: C:/Software/SWG Pre-CU/Closed2/src/ZoneServer/ZoneServer.cpp
===================================================================
--- C:/Software/SWG Pre-CU/Closed2/src/ZoneServer/ZoneServer.cpp	(revision 327)
+++ C:/Software/SWG Pre-CU/Closed2/src/ZoneServer/ZoneServer.cpp	(working copy)
@@ -117,8 +117,8 @@
 	_EmailRouterFlags tempFlag;
 	tempFlag.EmailsPendingRouting = false;
 	tempFlag.UserID = 0;
-	EmailRouterFlags = new list<_EmailRouterFlags>;
-	EmailRouterFlags->push_back(tempFlag);
+	EmailRouterFlags.clear();
+	EmailRouterFlags.push_back(tempFlag);
 	GetEmailRouterFlags(0,false,2);
 	LastDatabasePing = 0;
     return true;
@@ -131,10 +131,12 @@
 	bool threadStarted = false;
         do 
 		{
-			if(!threadStarted) {
-			 threadStarted = true;
-			 _beginthread(OverTime,0,(void *)this); }
-
+			if(!threadStarted) 
+			{
+				threadStarted = true;
+				_beginthread(OverTime,0,(void *)this); 
+				_beginthread(ScriptHandler,0,(void *)this);
+			}
 			ostringstream SenderIP;
             uint16 len = 0;
             len = recvfrom(Socket, Buffer, MAX_INC_PACKET, 0, (struct sockaddr*)&inc_addr, &ia_len);
@@ -273,7 +275,7 @@
 		case 0://get
 			{
 				bool userinRouterList = false;
-				for(std::list<_EmailRouterFlags>::iterator erf = EmailRouterFlags->begin();erf != EmailRouterFlags->end();erf++)
+				for(std::list<_EmailRouterFlags>::iterator erf = EmailRouterFlags.begin();erf != EmailRouterFlags.end();erf++)
 				{
 					if(erf->UserID == _ObjID)
 					{
@@ -290,7 +292,7 @@
 					tempFlag.UserID = _ObjID;
 					tempFlag.EmailsPendingRouting = true;
 					//printf("Flag Returned:OP0:UserID:%i FlagStatus:%i\n",tempFlag.UserID,tempFlag.EmailsPendingRouting);
-					EmailRouterFlags->push_back(tempFlag);
+					EmailRouterFlags.push_back(tempFlag);
 				}
 				
 				break;
@@ -299,7 +301,7 @@
 			{
 
 				bool userinRouterList = false;
-				for(std::list<_EmailRouterFlags>::iterator erf = EmailRouterFlags->begin();erf != EmailRouterFlags->end();erf++)
+				for(std::list<_EmailRouterFlags>::iterator erf = EmailRouterFlags.begin();erf != EmailRouterFlags.end();erf++)
 				{
 					if(erf->UserID == _ObjID)
 					{
@@ -318,7 +320,7 @@
 					tempFlag.UserID = _ObjID;
 					tempFlag.EmailsPendingRouting = _Flag;
 					//printf("OP1 Flags Set to UserID:%i Flag:%i\n",tempFlag.UserID,tempFlag.EmailsPendingRouting);
-					EmailRouterFlags->push_back(tempFlag);
+					EmailRouterFlags.push_back(tempFlag);
 
 				}
 				//printf("Flag Returned:UserID:OP1:%i FlagStatus:%i\n",tempFlag.UserID,tempFlag.EmailsPendingRouting);
@@ -327,7 +329,7 @@
 		case 2://list to screen
 			{
 				printf("Users in Email Router List\n");
-				for(std::list<_EmailRouterFlags>::iterator erf = EmailRouterFlags->begin();erf != EmailRouterFlags->end();erf++)
+				for(std::list<_EmailRouterFlags>::iterator erf = EmailRouterFlags.begin();erf != EmailRouterFlags.end();erf++)
 				{
 					printf("UserID:%i FlagStatus:%i\n",erf->UserID,erf->EmailsPendingRouting);

Index: C:/Software/SWG Pre-CU/Closed2/src/ZoneServer/ZoneServer.h
===================================================================
--- C:/Software/SWG Pre-CU/Closed2/src/ZoneServer/ZoneServer.h	(revision 327)
+++ C:/Software/SWG Pre-CU/Closed2/src/ZoneServer/ZoneServer.h	(working copy)
@@ -76,6 +76,7 @@
 		static inline ZServer*		getServer()		{return zone_server;};
 
 		static void OverTime(void *parm); //static void
+		static void ScriptHandler(void *parm); //static void
 		void GlobalSystemMessage(char* sysMsg);
 		void GlobalWeatherMessage(int weatherid);
 		Resources * SpawnedResourceMap;
@@ -83,10 +84,12 @@
 		int iCurSysTime;
 
 		
-		list <_EmailRouterFlags> * EmailRouterFlags;
+		list <_EmailRouterFlags> EmailRouterFlags;
 		_EmailRouterFlags GetEmailRouterFlags(int _ObjID,bool _Flag,int _Operation);
 		int LastDatabasePing;
 		static void DatabaseKeepAlive();
+		
+
 };
 
 #define zServer ZServer::getServer()
 				}

>>LAST


----
Modified : /Documents/master_opcode_list.txt
Modified : /ProjectFiles/ZoneServer/ZoneServer.vcproj
Modified : /dbScript/Terminals.6.sql
Modified : /dbScript/item_template.2.SQL
Modified : /dbScript/static_npcs.3.sql
Modified : /dbScript/swgprecu.1.sql
Modified : /dbScript/swgprecu.sql.changelog.txt
Modified : /src/LoginServer/HandleLogin.cpp
Modified : /src/LoginServer/LoginClient.cpp
Modified : /src/LoginServer/LoginClient.h
Modified : /src/LoginServer/LoginServer.cpp
Modified : /src/LoginServer/PacketFactory.cpp
Modified : /src/LoginServer/SWGPreCU_Login.cpp
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/OverTime.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/PacketFactory.h
Added : /src/ZoneServer/ScriptHandler.cpp
Modified : /src/ZoneServer/ZoneClient.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/ZoneServer/ZoneServer.cpp
Modified : /src/ZoneServer/ZoneServer.h
Modified : /src/shared/Common.h
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h
Modified : /src/shared/opcodes.h


Revision: 327
Author: interesting
Date: 10:00:54 AM, Tuesday, August 14, 2007
Message:
Update to the profession table, see changelog for specifics.
----
Modified : /dbScript/ProfesionData/profession_template.sql
Modified : /dbScript/swgprecu.sql.changelog.txt


Revision: 326
Author: interesting
Date: 8:17:47 AM, Sunday, August 12, 2007
Message:
Updated Profession Data. Read the change log for specifics.
----
Modified : /dbScript/ProfesionData/profession_template.sql
Modified : /dbScript/swgprecu.sql.changelog.txt


Revision: 325
Author: interesting
Date: 7:13:28 AM, Saturday, August 11, 2007
Message:
Uploading correct version(s). Also fixed minor spelling errors.

Note: 6:30AM is not a good time for sql work.
----
Deleted : /dbScript/ProfesionData/character_proffesion.sql
Added : /dbScript/ProfesionData/character_proffession.sql
Modified : /dbScript/ProfesionData/character_skill_mod.sql
Modified : /dbScript/ProfesionData/character_skills.sql
Deleted : /dbScript/ProfesionData/profesion_template.sql
Added : /dbScript/ProfesionData/profession_template.sql
Modified : /dbScript/ProfesionData/racial_abilities.sql
Modified : /dbScript/swgprecu.sql.changelog.txt


Revision: 324
Author: interesting
Date: 7:04:18 AM, Saturday, August 11, 2007
Message:
Beginning groundwork for Starting Proffesions (Database-side).

Added Several New Tables:
character_profesion (The table storing what character has what proffesion)
profesion_template (storing the profesion data)
Skill_mod_table (Stores the template for skill mods
racial_abilities (This table will be used to give racial abilities to players on creation)
character_skill_mod (This will store what character has what skill mods)
skill_template (this will store what profesion gives what skills, and what profesion gives what skill mods, note this table wont grant skill mods, but rather will tell the server what skill mods to insert into character_skill_mod)
character_skills (This table will store what character has what skill)

This are stored temporarily in a seperate folder in the database folder, DO NOT TOUCH THIS FOLDER. I will continue to modify these tables and they will be merged.
----
Added : /dbScript/ProfesionData
Added : /dbScript/ProfesionData/character_proffesion.sql
Added : /dbScript/ProfesionData/character_skill_mod.sql
Added : /dbScript/ProfesionData/character_skills.sql
Added : /dbScript/ProfesionData/profesion_template.sql
Added : /dbScript/ProfesionData/racial_abilities.sql
Added : /dbScript/ProfesionData/skill_mod_table.sql
Added : /dbScript/ProfesionData/skill_template.sql
Modified : /dbScript/swgprecu.sql.changelog.txt


Revision: 323
Author: maach_ine
Date: 1:38:08 PM, Thursday, August 09, 2007
Message:

----
Modified : /src/shared/Database.cpp


Revision: 322
Author: maach_ine
Date: 9:33:06 AM, Sunday, July 29, 2007
Message:
Wiki TODO -- Updated Login Server to verify we have a valid client verison.

Currently, the only version that is verified is the Publish 13 client.
----
Modified : /src/LoginServer/HandleLogin.cpp
Modified : /src/LoginServer/LoginClient.h
Modified : /src/LoginServer/PacketFactory.cpp


Revision: 321
Author: maach_ine
Date: 7:19:03 PM, Saturday, July 28, 2007
Message:
Resource items will now appear in inventory without crashing the client.

However:  They will spawn as bone, with 967 units (or so).  The resource baseline message is extremely hardcoded atm.

The RCNO6 baseline packet is still broken and is not currently being sent.

Rewrote the way the server parses incoming multipackets.  It appears to now be working correctly, but needs more testing.  (A.K.A. nothing broke, and the server now correctly sees that we want to start a crafting session).
----
Modified : /src/ZoneServer/OverTime.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.cpp
Modified : /src/ZoneServer/ZoneServer.cpp
Modified : /src/ZoneServer/ZoneServer.h


Revision: 320
Author: maach_ine
Date: 3:32:25 PM, Wednesday, July 25, 2007
Message:
*** YOU MUST ONCE AGAIN DUMP/FLUSH/RINSE YOUR DATABASE FOR THIS REVISION ***  Sorry, folks.

Update -- Moved the time delay during surveying into the clients OvertimeUpdate function.

Sampling resources and actually getting them to spawn in inventory is now 99% complete.  However, I am not able to actually spawn these items without crashing the client.  Therefore, the spawning of the resource items is currently disabled.

Updated SpawnItem for the eventual spawning of resource items.

Updated Database -- InsertItem for the eventual creation of resource items.

Added database function to load a specific resource by name, as apparently getting the resource out of its vector can occasionally invalidate it's pointers.
/boggle

Surveying / sampling now appears to be fully working, EXCEPT that resources are not actually put in the players inventory.
----
Modified : /dbScript/swgprecu.1.sql
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/OverTime.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/PacketFactory.h
Modified : /src/ZoneServer/ZoneClient.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/ZoneServer/resources.cpp
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h
Modified : /src/shared/opcodes.h


Revision: 319
Author: maach_ine
Date: 4:30:54 PM, Sunday, July 22, 2007
Message:
Many many many additions.

You MUST dump / flush / rinse the entire database before attempting to run this revision!

Renamed tickettable.5.sql tickettable.legacy.sql, as this sql file is now part of swgprecu.1.sql
Long and the short of it is:  We now have soft-coded surveying implemented.

To use:  Right click your survey tool in inventory, go down to Tool Options, select "Set Survey Range".

Set the survey range.

Drag the survey tool into your toolbar, and then press the appropriate keyboard key to use it.

Known issues, and their causes:  Occasionally the tool does not function.  Cause:  Client is waiting for the server to respond to the last useage command.  Workaround:  Close the client, and reconnect.

Occasionally, server throws an unhandled exception reading from one of the vectors.  Cause:  Unknown.  Workaround:  None.  Just restart the zone server, and it should not happen again.
----
Modified : /dbScript/item_template.2.SQL
Modified : /dbScript/swgprecu.1.sql
Deleted : /dbScript/tickettable.5.sql
Added : /dbScript/tickettable.legacy.sql
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/PacketFactory.h
Modified : /src/ZoneServer/ZoneClient.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/ZoneServer/resources.cpp
Modified : /src/shared/Common.h
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h
Modified : /src/shared/opcodes.h


Revision: 318
Author: maach_ine
Date: 11:57:59 PM, Friday, July 20, 2007
Message:
Bugfix -- Under certain circumstances, the automagic packet fragmenter was not detecting that another packet fragment was needed.  This generally occured when the last fragment was to be smaller than 10 bytes long.  This should now be corrected.
----
Modified : /src/ZoneServer/ZoneClient.cpp


Revision: 317
Author: plasmaflow
Date: 6:49:47 PM, Friday, July 20, 2007
Message:
Missed 2 declarations and corrected something i fatfingered.
----
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/PacketFactory.h
Modified : /src/ZoneServer/ZoneClient.h


Revision: 316
Author: plasmaflow
Date: 6:22:24 PM, Friday, July 20, 2007
Message:
NEW DATABASE CHANGES YOU WILL NEED NEW DB HERE

-OVERVIEW-

Config file now asks for the galaxystartupstatus default is 2 online.
Options are: 0-offline, 1-loading, 2-Online, 3-locked.

When the galaxy is set to status 3 any account tagged as GM 1 or 2 can login
no matter the status of 3. this is so devs adn admins can test on a 
server that can be seen live without ppl login in.

Email from user to user routes and pops up immediately or very very 
fast.
Email attachaments can now be sent.
Email Attachments can now be saved.
Invalid recipient email and invalid errored email messages are
sent fro mthe email routing to the sender in case this happens.


Place structure will save a wp to your dp and send you an email with 
the wp attached.

Newbies will receive a starter email.

Newbie start waypoint is saved to the datapad.

LD Clients will now be removed from the world in 10 minutes.
This will also remove their vehicles and any other spawned objects.

When you delete a character all character related items, email, 
waypoints, attachments houses, will be set not to spawn and have a 
destroy flag and a destroy date.
based on date a system admin can elect to delete permanently the items
or restore them. This will allow for admins ti restore deleted chars 
be it on purpose or by accident or malicious attack.

future release will have an automatic maintenance system to delete 
items based on a time limit.

When you delete and item from you invoentory or a waypoint the delete 
item function  now identifies the proper item and deletes from the
correct place. 
Delete function only flags the items to destoryed no spawn with a date.
Again this allows admins to restore deleted items.

DatabaseKeepAlive function has been implemente for login and zone.
this pings the database once every 30 minutes. this prevents the
servers from diconnecting from the db due to inactivity.

error popup message packet is in the code no workign yet will work 
on it after this commit.

several db functions have been deleted no longer used.
many db functions have been documented.
several unneeded function that were phased out at earlier commit
have been deleted.

Tutorial Bug
There was a bug that prevented players from loading into the tutorial 
hall. it has been corrected. tutorial is still in the works.
a newbie email with instructions on how to get out will be sent
to new players.



-CHANGES-
Database Changes

-- -------------------------------------------------------------------------------------------------------------------------------------------------
--
-- 07-20-07 PlasmaFlow email attachments table needed to be changed because the correct structure was not in place.
-- new structure as follows:
--  `waypoint_name` varchar(100) NOT NULL default '',
--  `planet_id` int(10) unsigned NOT NULL default '0',
--  `ccode` bigint(20) NOT NULL,
--  `planet_crc` bigint(20) NOT NULL,
--  `x` float NOT NULL,
--  `z` float NOT NULL,
--  `y` float NOT NULL,
--  `character_id` int(10) unsigned NOT NULL,
--  `destroy` tinyint(1) NOT NULL default '0',
--  `destroy_date` datetime default NULL,
--  PRIMARY KEY  (`id`)
-- ) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=ascii;
-- --------------------------------------------------------------------------------------------------------------------------------------------------

CODE CHANGES

SHARED

CONFIG.CPP / CONFIG.h
07-19-07 PlasmaFlow Added new config variable to set the startup status of the server.
					cfg->galaxystartupstatus, 0-offline, 1-loading, 2-online, 3-locked

Database.cpp / .h
07-20-07 PlasmaFlow Documented several undocumented functions
					Removed undeeded code comments or commented out code thats no longer needed.
					DBConnect::lLoadClientCharactersFromDatabase function updated to move a variable outside a loop so we can use it for other things.
					DBConnect::RouteNewEmailFromUser Function changed to return a Struct Email record so we know the toon that made the mail, the mail id created and any errors
					added new function called : bool DBConnect::PingDatabase() this function is for sending a query to the database to keep it alive.
					the query is initiated from a timer in zone and login so they dont lose connection to the db. the call is made every 30 mins.
					Updated vector<Waypoints> DBConnect::LoadWaypoints(uint64 characterID, int galaxyID) , it now returns only waypoints that have not been
					deleted by the player.
					Added function: void DBConnect::ToggleWaypointStatus(int _dbID,bool _status){ to change the active inactive status of a waypoint in the db.
					Added Function: void DBConnect::RenameWaypoint(int _dbID,string _wpName){ to change the name of a wp in the db.
					Added Function: bool DBConnect::DeleteWaypoint(int _wpID) { to tag a way point for deletion.
					Added Function: list<_EmailAttachment> * DBConnect::GetEmailAttachments(int _EmailID) { to return a list of email attachments for a particular email message
					Added Function: bool DBConnect::GetGmStatus(int _AccountID){ to return if a player is gm or not to allow gms to login even when a galaxy is locked.

opcodes.h
07-20-07 PlasmaFlow Added new op codes 	
					ClientUIErrorMessage					= 0xB5ABF91A,
					ClientChatSystemTell					= 0x84BB21F7,
					Added comand endqueue request crcs
					ToggleWaypointStatus			= 0xC3EDA6B6,
					ClientRenameWaypoint			= 0x398F891A,

Database.h
07-20-07 PlasmaFlow Added new struct for email messages struct _EmailAttachment
					Updated Struct Waypoints: struct Waypoints values for  int waypointID;  int characterID;  int iWaypointType;
					the following functions were updated due to changes in database.cpp
					Email RouteNewEmailFromUser( int from_character_id,string to_address, int message_time,string message_subject,string message_text,bool attachment_flag); // Returns the message id created
					bool SaveAttachment ( int _message_id, string _waypoint_name,int _planet_id,int _ccode,long _planet_crc,float x,float z,float y,int _character_id);
					The following functions were added or updated due to chnages in databse.cpp
					bool PingDatabase();
					vector<Waypoints> LoadWaypoints(uint64 characterID, int galaxyID);
					void ToggleWaypointStatus(int _dbID,bool _status);
					void RenameWaypoint(int _dbID,string _wpName);
					bool DeleteWaypoint(int _wpID);
					list<_EmailAttachment> * GetEmailAttachments(int _EmailID);
					bool GetGmStatus(int _AccountID);

LOGINSERVER

Loginclient.h
7-20-07 PlasmaFlow Added new Variable bool gm; to tell when a player is a gm and let him log in even tho the galaxy is locked

PacketFactory.cpp
07-20-07 PlasmaFlow		Corrected problem in ByteBuffer* LClient::BUILD_LoginClusterStatus() { where galaxy status was causing an error
						Updated function to allow gms to login even if the galaxy is locked
						if(gm && it->iServerStatus == 1 || gm && it->iServerStatus == 3 )
						{
							LCS->writeINT(2);
						}
						else
						{
							LCS->writeINT(it->iServerStatus); 
						}
LoginServer.CPP
07-20-07 Plasmaflow	Added Variable 	LastDatabasePing = 0; so its initialized on boot. this var is used to ping the db every 30 mins and it contains 
					the value from time(0).
					Updated: int LServer::UDPReceive() {	to start a new OverTime thread to control overtime functions this includes the new database keepalive
					Added new Function:
					void LServer::DatabaseKeepAlive() {
					int timediff;
					LServer * lserver = LServer::getServer();
					
					timediff = time(0) - lserver->LastDatabasePing;
					
					if(timediff >= 1800)
					{
						//printf("-LastDBPing:%i\n",lserver->LastDatabasePing);
						lserver->LastDatabasePing = time(0);
						//printf("+LastDBPing:%i\n",lserver->LastDatabasePing);
						if(!db->PingDatabase())
						{
							Log->lb("LServer::Database connection lost!\n");
						}
						else
						{
							Log->lb("LServer::DatabaseKeepAlive\n");
						}
					}		
					return;}
					This function sends a query to the database every 30 mins to keep it alive.
HandleLogin.cpp
07-20-07 PlasmaFlow		Added new call to new db function: 	
						gm = db->GetGmStatus(this->iStationID);
						if(gm){printf("Account is game admin account\n");}
						this tags a player as gm to let him login even if the server is locked.


LoginServer.h

07-20-07 PlasmaFlow	Added Functions and variable due to changes in CPP files for login server
					static void OverTime(void *parm);  	int LastDatabasePing; 	static void DatabaseKeepAlive();
						
OverTime.CPP
07-20-07 PlasmaFlow	 File Added for handling things that need a timer.

ZONESERVER
OverTime.CPP
07-20-07 PlasmaFlow	Added new calls to function into the overtime thread
					Client->RouteInternalEmail(); Routes email to players and between players
					Client->RemoveLDPlayers(); Removed ld players from the world
					DatabaseKeepAlive(); keep a connection alive to the db every 30 mins


OBJControllers.cpp
07-20-07 PlasmaFlow	 Added a packet decode function to print to screen the contents of unknown packets
					 These only work if the player issues the '&debug' command from the client ui
					 Added Function: void ZClient::RouteInternalEmail(){ to route emails to players and send correct packets.
					 Function updated to only send one headsup indication on new email so we hear beep for new email
					 This function resided inside the Update coordinates parent function it has been moved to be its own and
					 run from the overtime thread.
					 Updated Function: void ZClient::HANDLE_ObjController_CommandQueueEnqueue_serverdestroyobject(ByteBuffer &Packet) {
					 This function can now determine what kind of object to destroy and use the appropiate function to do so.
					 This had to be done because waypoints are deleted from a different table as items.
					 Now it distinguishes between each type of id in the system
					 Updated Function: void ZClient::HANDLE_ObjController_CommandQueueEnqueue_requestwaypointatposition(ByteBuffer &Packet) {
					 This function now uses Cparam to parse out the commands received from request wp at pos.
					 the function also now parses the name of the waypoint since the same function is used when movin an attachment form email to datapad.
					 the function reloads the waypoints vector when a new wp is added.
					 Updates Function: void ZClient::HANDLE_ObjController_CommandQueueEnqueue_requestwaypointatposition(ByteBuffer &Packet) {
					 to use Cparam to parse out commands received while placing a building.
					 This function now creates a waypoint in the players datapad and sends and email with the attached wp.
					 Updated Function: void ZClient::HANDLE_ObjController_CommandQueueEnqueue_mount(ByteBuffer &Packet) {
					 this function now uses a list of items spawned by the player so we can keep track of droids pets and vehicles.
					 this allows to despawn any items in the world when the player logs off or crashes.
					 Updates function: void ZClient::HANDLE_ObjController_CommandQueueEnqueue_mount(ByteBuffer &Packet) {
					 to use player spawned objects variable to dismount and tag it as dismounted.
					 Updated function : void ZClient::HANDLE_ObjController_CommandQueueEnqueue_mount(ByteBuffer &Packet) {
					 to use Cparam function to parse data frm command.
					 Added Function: void ZClient::HANDLE_ObjController_CommandQueueEnqueue_mount(ByteBuffer &Packet) {
					 to handle a players new email sending request.
					 Function now parses any attachments and saves them to the attachments table,
					 Updated Function: void ZClient::HANDLE_ClientRequestEmailContent(ByteBuffer &Packet){
					 To route not only email but attachments properly by using a new variable for attachments.
					 Added Function: void ZClient::HANDLE_ObjController_CommandQueueEnqueue_ToggleWaypointStatus(ByteBuffer &Packet){
					 to toggle status of a waypoint.
					 Added Function: void ZClient::HANDLE_ObjController_CommandQueueEnqueue_ClientRenameWaypoint(ByteBuffer &Packet){
					 to change the name of a wp in db.

Zoneclient.cpp
07-20-07 Plasmaflow Added a new packet counter for updates for waypoint_update_counter = 0;
					Updated: case SOE_DISCONNECT:  to despawn any spawned objects for a player on disconnect.
					Added Pritn packet content functions if debug has been turned on from client ui using
					'&debug' command.
					Added New Function: void ZClient::RemoveLDPlayers(){
					This function removes dead players from the world and their objects after 10 mins.
PacketFactory.cpp
07-20-07 Plasmaflow Added new Packet: ByteBuffer* ZClient::BUILD_DeltasMessage_UpdWaypoint() {
					This packet is not fully working yet.
					Updated: void ZClient::SpawnPlayer(PlayerData LoadedPlayerData) {
					to send attachments to player when they spawn if message is read.
					Updated:void ZClient::SpawnPlayer(PlayerData LoadedPlayerData) {
					to send attachments when a new message is read.
					Added new Packet for ByteBuffer* ZClient::BUILD_Error_Message(){
					Not in function yet will be in next rev. need more packet data.

Zoneclient.h
07-20-07 PlasmaFlow	Added new Variable int LastPingRequestTime; to allow us to determine last time a client
					was connected and alive to us. this allows us to disconnect after 10 mins.
					Added bool debug; to turn on debug packet messages to console.
					Added Function: void HANDLE_CharacterTravel(ByteBuffer &Packet); this function will handle travel.
					handle select character cannot be used for travel since it initializes variables that should only be
					inited once not every tine we travel.
					Added New Functions due to changes in ZoneClient.CPP
					void HANDLE_ObjController_CommandQueueEnqueue_ToggleWaypointStatus(ByteBuffer &Packet);
					void HANDLE_ObjController_CommandQueueEnqueue_ClientRenameWaypoint(ByteBuffer &Packet);
					void RouteInternalEmail();
					void RemoveLDPlayers();
					void HANDLE_ClientChatSystemTell(ByteBuffer &Packet);
					void UpdatePlayerBaselines(int _ObjID);
					void SendMessageToPlayer(string _Message);
					inline int lastPingTime() {return LastPingRequestTime;}; 
					Added new Variables and structs for handling various.
					//Character Waypoint to Update
					Waypoints updWaypoint;
					int waypoint_update_counter;
					
					//error message box variables
					string ErrorTitle;
					string ErrorMessage;
					bool EmailAttachmentFlag;
					int EmailTimeStamp;
					list<_EmailAttachment> * EmailAttachmentList;

					//Character Spawned Objects List
					struct _PlayerSpawnedObjects{
							long spawnID;
							int bitmask;
							long objectType;
							bool isMounted;
							bool isEquipped;
							bool isSpawned;
							bool isSwoop;
							uint32 crc;
							string cName;
							float n;
							float s;
							float e;
							float w;
							float x;
							float z;
							float y;
							int health;
							int action;
							int mind;
							long cellID;
							string perfid;
							int stanceID;
						};
					list<_PlayerSpawnedObjects> *PlayerSpawnedObjects;


Zoneserver.cpp
07-20-07 PlasmaFlow Updated bool ZServer::StartServer(uint16 Port) {
					to call if (!db->SetServerStatus(db->GetGalaxyID(),cfg->galaxystartstatus))
					to use the config file startup status instead of a hard coded value.
					Added Variable	LastDatabasePing = 0; for pingin database every 30 mins.
					Updated Function: _EmailRouterFlags ZServer::GetEmailRouterFlags(int _ObjID,bool _Flag,int _Operation){
					to not update invalid object ids
					Added Function void ZServer::DatabaseKeepAlive() {to pind db every 10 mins form overtime function.

PackerFactory.h
07-20-07 PlasmaFLow Updated mountID to be a long not a uint 64
			Added new functions:
			ByteBuffer* BUILD_DeltasMessage_UpdWaypoint();
			ByteBuffer* BUILD_NewEmailNotification();
			ByteBuffer* BUILD_Error_Message();

Zoneserver.h
07-20-07 PlasmaFlow Added Function and var		int LastDatabasePing;
		static void DatabaseKeepAlive(); due to changes in cpp file.
Constants.h
07-20-07 PlasmaFlow Added 	{ClientChatSystemTell,		" --ClientChatSystemTell \n",		&ZClient::HANDLE_ClientChatSystemTell		},
					to handle tells.
					Added: 07-20-07 PlasmaFlow Added 	{ClientChatSystemTell,		" --ClientChatSystemTell \n",		&ZClient::HANDLE_ClientChatSystemTell		},
					to handle tells.
					Added: 07-20-07 PlasmaFlow Added 	{ClientChatSystemTell,		" --ClientChatSystemTell \n",		&ZClient::HANDLE_ClientChatSystemTell		},
					to handle tells.
					#define QUEUE_Error_Message									(&ZClient::BUILD_Error_Message)
					Added new cstatic constants
					const static long OffsetList[] = {
						NPC_OFFSET,
						BUILDINGS_OFFSET,
						CELL_ITEM_OFFSET,
						WORLD_OBJECT_OFFSET,
						ITEM_OFFSET,
						DATAPAD_WAYPOINT_OFFSET,
						TERMINAL_OFFSET,
						INSTANCE_OFFSET,
					};
					const static char* OffsetNames[] = {
						"NPC",
						"BUILDING",
						"CELL_ITEM",
						"WORLD_OBJECT",
						"ITEM",
						"DATAPAD_WAYPOINT",
						"TERMINAL",
						"INSTANCE",
Handlezone.cpp
07-20-07 PlasmaFlow Updated Function: void ZClient::HANDLE_ClientRandomNameRequest(ByteBuffer &Packet) {	
					to retry name generation if the name generated was already in db or was rejected.
					Updated: 	int character_id; to be at top of function for create new char.
					Newbie email and waypoint updated not to crash or mess up.
					Updated: void ZClient::HANDLE_SelectCharacter(ByteBuffer &Packet) {
					to init the following vars.
					debug = false;
					PlayerSpawnedObjects = new list <_PlayerSpawnedObjects>;
					EmailAttachmentList = new list<_EmailAttachment>;
					vClientWaypoints = db->LoadWaypoints(ObjID, db->GalaxyID);
					this is why the travel function was created.
					Updated: void ZClient::HANDLE_ObjectMenuSelectMessage(ByteBuffer &Packet) {
					to create new swoop spawn and save it ot a player spawns variable so weh know when it  still exists or not.
					Added Function: void ZClient::HANDLE_ObjectMenuSelectMessage(ByteBuffer &Packet) {
					to handle travel only.
----
Modified : /ProjectFiles/SWGPreCU.vcproj
Modified : /dbScript/swgprecu.1.sql
Modified : /dbScript/swgprecu.sql.changelog.txt
Modified : /src/LoginServer/HandleLogin.cpp
Modified : /src/LoginServer/LoginClient.h
Modified : /src/LoginServer/LoginServer.cpp
Modified : /src/LoginServer/LoginServer.h
Added : /src/LoginServer/Overtime.cpp
Modified : /src/LoginServer/PacketFactory.cpp
Modified : /src/LoginServer/SWGPreCU_Login.cpp
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/OverTime.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/PacketFactory.h
Modified : /src/ZoneServer/ZoneClient.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/ZoneServer/ZoneServer.cpp
Modified : /src/ZoneServer/ZoneServer.h
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h
Modified : /src/shared/config.cpp
Modified : /src/shared/config.h
Modified : /src/shared/opcodes.h


Revision: 315
Author: maach_ine
Date: 6:17:28 PM, Thursday, July 19, 2007
Message:
Bugfix:  Fixed a crash associated with the starting location waypoint on new character creation.

Added:  The packet queue will now automagically fragment any packets larger than MaxPacketSize!

-- Modified the ByteBuffer class.  Now has 2 more private variables -- iHeaderSize and iPacketSize.  iHeaderSize is the size of the original packet from  Update Type to the last byte of the original packet size inclusive.  iPacketSize is the size of the rest of the packet, NOT including the comp + CRC bytes.
ByteBuffer also has 4 new functions, which are self-explanatory.  getHeaderSize(), getPacketSize(), setHeaderSize(unsigned int iHeaderSize), setPacketSize(unsigned int iPacketSize).

Modified the PacketFactory -- All Creo and Play packets should now be passing the ByteBuffer their respective header and packet sizes.

Modified the ZoneClient -- Packet Queue -- It now detects if a packet is too large, and automatically splits the packet into fragments.
----
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.cpp
Modified : /src/shared/ByteBuffer.cpp
Modified : /src/shared/ByteBuffer.h
Modified : /src/shared/opcodes.h


Revision: 314
Author: maach_ine
Date: 12:11:07 AM, Tuesday, July 17, 2007
Message:
Preliminary fix for waypoints:  Having more than 2 waypoints was causing a client crash.  The issue appears to be that the client expects the Play 8 packet larger than 250 bytes to be sent "by itself".

Outstanding issue:  Having more than 5 or 6 waypoints will cause a client disconnect, as the Play 8 packet is not being fragmented by the packet queue.  This will be an issue with any other large packets we wish to send, as well (such as anything to do with the SUI opcode packets.) and is a priority to implement.  (Classification:  Basic server functionality / stability)
----
Modified : /Documents/master_opcode_list.txt
Modified : /src/ZoneServer/PacketFactory.cpp


Revision: 313
Author: plasmaflow
Date: 7:20:43 AM, Monday, July 16, 2007
Message:
Added Waypoint Packet Breakdowns
----
Added : /Documents/Packets/Waypoint Packets
Added : /Documents/Packets/Waypoint Packets/Waypoint Delta Breakdown By Maach.txt
Added : /Documents/Packets/Waypoint Packets/Waypoint cap.txt


Revision: 312
Author: plasmaflow
Date: 7:19:37 AM, Monday, July 16, 2007
Message:
Added new Packet Decodes for Email
----
Added : /Documents/Packets/Email
Added : /Documents/Packets/Email/Email From Server to client.txt
Added : /Documents/Packets/Email/NewEmailRequestMessage.txt


Revision: 311
Author: maach_ine
Date: 11:18:04 PM, Sunday, July 15, 2007
Message:
YOU MUST RUN Waypoints.7.sql AGAIN FOR THIS REVISION TO RUN PROPERLY.

Change (addition) to the waypoints table.  Added a "waypoint_type" field to the table.

Database:  Wrote function that loads waypoints from the Database.

Constants:  Added int array which holds CRC-like values that are necessary for telling the client what planet a waypoint is on.

HandleZone:  A waypoint is now created, with the name "Starting Location", when the user creates a new character.

ZoneClient:  Added variable "iWaypointUpdateCounter", which will in the future be used in waypoint delta messages.

PacketFactory:  Added waypoints to the Play 8 packet.
----
Modified : /dbScript/Waypoints.7.sql
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 310
Author: zstars
Date: 8:57:17 AM, Saturday, July 14, 2007
Message:
My first commit to this repository, just some small fixes / adds:

- Added deed_buildings to the load order, because
  apparently it is necessary to spawn a house.

- Now, to avoid crashes because of the logging system, the directories to store the logs are or can be created programatically. Previously, if the project was not configured properly, the loggers would try to open the wrong files, and lead to a crash. Note that at the moment, it is still not being checked whether the files opened successfully or not. It might be a good idea to add both error checking and an exception throwing / catching system.

- Added command &place npciff, which is a copy of &place npc, which instead of taking a numerical CRC as an argument takes the path to the .iff file, such as object/mobile/shared_darth_vader.iff.


 
----
Modified : /dbScript/LoadOrder.txt
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/OverTime.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/shared/tlog.cpp


Revision: 309
Author: plasmaflow
Date: 1:36:30 AM, Saturday, July 14, 2007
Message:
DATABASE TABLE CORRECTION

This commit correct swgprecu.1.sql table email_messages

Several columns had to be edited and by mistake were not commited in previous commit.

These have been corrected. This caused emails not to go through.
----
Modified : /dbScript/swgprecu.1.sql
Modified : /src/shared/Database.cpp


Revision: 308
Author: plasmaflow
Date: 12:50:52 AM, Saturday, July 14, 2007
Message:
Commit new terminals file containing new rows for terminals deletions
----
Added : /dbScript/Deeds.4.sql
Deleted : /dbScript/TEST FILE.TXT
Added : /dbScript/Terminals.6.sql


Revision: 307
Author: plasmaflow
Date: 12:48:20 AM, Saturday, July 14, 2007
Message:
Remove files for errors
----
Deleted : /dbScript/Deeds.4.sql
Deleted : /dbScript/Terminals.6.sql


Revision: 306
Author: plasmaflow
Date: 11:53:14 PM, Friday, July 13, 2007
Message:
NEW DB LOAD THIS COMMIT!!!!!


Highlights
When we delete a character we flag all items and buildings of said toon to not spawn and to be deleted.

When an item is requested to be deleted we flag it for destruction and set it to not spawn.

Building placement is a bit better now so most of the time we dont spawn underground.

New Waypoint table is in the db load now for adding waypoints.

Name filter works very differently now and we now issue the right response based on the type of name denial.
we also filter names for the existance of a string instead of the whole word. now we can see if ass in in wineasseed and deny the name.

Email system works now and email will be sent deleted delivered and deleted on char deletion.

Structures will send an email when placed.

New players will get a welcome email.

ZServer has a new subroutine to handle email routing flags for users.
This subroutine uses a new email routing flag variable list houses in the ZServer.
The ZClient sets the values here and checks for the flag per player.
As players login they are added to the Variable.
When players login they receive all emails sent while off line.
All email has proper timestamps and delivered flags.

all new packets for email have been added.
We handle email creation delivery deletion and all.


All character deletions will be done via flags and wont be loaded if the
destroy flag is true. this will allow admins to restore deleted characters items or emails and or buildings.

If you add anything in to the database that belongs to a character it has to be deleted on the delete character routine.
If you dont understand how to do it please leave me a note ill add it and make sure its deleted properly.

Please forgive me if i missed any comments or data i will correct any missing docs please dont revert.

All code tested in debugger.
----
opcodes.h
07-05-07 Plasmaflow Added ClientNameDeclinedResponse				= 0x9B2C6BA7,//added by PF 07-02-07

Database.cpp / Database.h
07-10-07 PlasmaFlow  Deleted function bDoesQueryExist and all related calls to it.
					 Deleted Function bDidQueryExecute and all related calls to it.
					 Updated DeleteItem and DeleteCharacter functions not to use the 2 mentioned functions above.
					 All areas to do equivalent functions have been updated and added with safety in mind.
					Removed the check to see if a characters name is in use or not from the CreateNewCharacter Function
					Since the HandleZone functions that calls it already checks to see if the name exists.
					Updated CheckNewCharacter Function and Renamed it to CheckNewCharcterName. Function now returns proper 
					SWG return value according to expected return values for rejected names. see function
					for correct return values. This function now uses better ways of checking if a name contains a 
					filtered string by using strstr() function.
					Deleted DBUpdateItemContainment and replaced with UpdateItemEquippedStatus.
					This new function and all calls to it have been changed, also this new function is much more stable and reliable.
					Added UpdateItemEquippedStatus Function. It has better safeguards for falied queries.
					Added new function DeleteCharacterBuildings, this function deletes all buildings fomr a toon by setting new
					flags for destruction and not to spawn in the world. also saves the date it was deleted. it moves any players inside the structures outside the 
					structure so we dont crash. also any items inside the building are flagged for destruction and
					save the date of destruction. we also remove the terminals for the building and signs.
					Updated any function that deletes characters or items not to delete them but to flag them for deletion and no spawn.
					This applies to terminals

LoginClient.cpp
07-06-07 PlasmaFlow    Updated HandleIncoming function. had a log call with some errors through the debugger.
						corrected call to log not to make error.
						Updated many Log Calls to log only to file since functions are pretty much
						well tested.

HandleZone.cpp
07-06-07 PlasmaFlow Updated ClientRandomNameRequest, to check the name and verify it is not in use.
					Also updated function to return proper codes as per what client uses.
					Changed newCharacterName and newCharacterRace to be part of ZClient.
					Updated clientCreate character to leave last name blank if the toon has only a first name. 
					also function makes sure that if last name is blank we dont put the first name in the last name.
					Updated function calls to update the status of an equipped / de equipped item.

Database updates:
-- ----------------------------------------------------------------------------------------------------------------------
-- 07-10-07 PlasmaFlow 	Added several fields to several tables as follows:
--			table character - destroy tinyint , this will signal a destruction of a toon froma player, destroy_date this will tell us when it was destroyed
--			table item - destroy,packed,spawn as tiny int to allow for determination of a building destruction or packup
--			destroy_date to let us know when the item was destroyed.
--			table name_filter - deny reason int - this is the reason the new name filtering system will return when a name is denied.
--			Updated some filter names as they were no linger needed.
--			table spawned_structures - destroy,packed,spawn as tiny int to allow for determination of a building destruction or packup
--			destroy_date to let us know when the building was destroyed. updated default building values.
--			Added a new waypoint table. 
--			table terminals - destroy,packed,spawn as tiny int to allow for determination of a building destruction or packup
--			destroy_date to let us know when the terminal was destroyed. updated default terminal values.
----
Modified : /src/LoginServer/LoginClient.cpp
Modified : /src/LoginServer/PacketFactory.cpp
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/OverTime.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/PacketFactory.h
Modified : /src/ZoneServer/SWGPreCU_Zone.cpp
Modified : /src/ZoneServer/ZoneClient.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/ZoneServer/ZoneServer.cpp
Modified : /src/ZoneServer/ZoneServer.h
Modified : /src/shared/Common.h
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h
Modified : /src/shared/opcodes.h


Revision: 305
Author: plasmaflow
Date: 11:47:37 PM, Friday, July 13, 2007
Message:
Commit Changes Log file for Database
----
Modified : /dbScript/swgprecu.sql.changelog.txt


Revision: 304
Author: plasmaflow
Date: 11:46:57 PM, Friday, July 13, 2007
Message:
Commit of new swgprecu.1.sql
----
Modified : /dbScript/swgprecu.1.sql


Revision: 303
Author: plasmaflow
Date: 11:46:29 PM, Friday, July 13, 2007
Message:
Commit of New Load Order
----
Modified : /dbScript/LoadOrder.txt


Revision: 302
Author: plasmaflow
Date: 11:43:35 PM, Friday, July 13, 2007
Message:
Commit of new Waypoints Table
----
Added : /dbScript/Waypoints.7.sql


Revision: 301
Author: plasmaflow
Date: 11:42:32 PM, Friday, July 13, 2007
Message:
Test Upload
----
Added : /dbScript/TEST FILE.TXT


Revision: 300
Author: interesting
Date: 10:37:05 AM, Sunday, July 01, 2007
Message:
Starter items are now 100%, and every one tested -- Not a single crash.
If you find something you don't like, please tell me rather than changing it yourself.
These items are 95% realistic to Sony's pre-cu minus the deeds.
----
Deleted : /Documents/Database Item Documentation.txt
Deleted : /Documents/RaceID.rtf
Deleted : /Documents/[GUIDE]Getting started (Setting up your server).URL
Modified : /dbScript/swgprecu.1.sql
Modified : /dbScript/swgprecu.sql.changelog.txt


Revision: 299
Author: plasmaflow
Date: 5:45:56 PM, Friday, June 29, 2007
Message:
Database.cpp
Corrected a minor glitch in insert items query.
----
Modified : /src/shared/Database.cpp


Revision: 298
Author: plasmaflow
Date: 11:29:11 AM, Friday, June 29, 2007
Message:
Forgotten comment.
zoneserver now uses the galaxy port to receive packets declared in the Database.asm

Documents/useful queries.txt added
----
Added : /Documents/useful queries.txt


Revision: 297
Author: plasmaflow
Date: 11:25:05 AM, Friday, June 29, 2007
Message:
swgprecu.1.sql
Updated the tutorial skipped building to spawn in the correct heading.


Common.h
06-29-07 PlasmaFlow Added a new Offset called INSTANCE_OFFSET.

Database.cpp
06-29-07 PlasmaFlow  Server Status variable in grabgalaxy info was being read as short from db. changed it
					 to be read as int. tested in debugger with no issues.

Opcodes.h
06-29-07 PlasmaFlow  added new commanditemradialop1			= 0x164550EF, to enqueue

Config.cpp / Config.h
06-29-07 Plasmaflow Added the loginserver login port variable to set the login port on the logins server
					from it. also moved some print statements to only show up if the section is not configured.

SWGPreCU_Login.cpp
06-29-07 PlasmaFlow	Changed main to pass login port to start server from config file.
					if (!Server.StartServer(cfg->loginport)), login port is no longer hardcoded

Handlezone.cpp / ZoneClient.h
06-29-07 PlasmaFlow	Updated all calls to SpawnFellowPlayer to contain the cell id 	.
					if were afk and we receive the afk flag we update the cell position
					otherwise we dont update the position.
					Added check to building placement so we dont try to spawn a building indoors.
					also changed it so that clicking on a ticket or other objects will not try to place a naboo bank.
					or any other structure for that matter.we also send a message for it.

06-29-07 PlasmaFlow  added void Handle_ObjController_CommandQueueEnqueue_itemradialop1(ByteBuffer &Packet);
			Updated all calls to SpawnFellowPlayer to contain the cell id 	.



OBJControllers.cpp
06-29-07 PlasmaFlow  updated HANDLE_ObjController_DataTransform to set cellid to 0
					 otherwise we pass the wrong cell id during updates while outside since 
					 the parent function sets it to an invalid value upon exiting a cell.
					 Changes &position command to pass the cellid all the time not checking for flagcell.
					 Added void ZClient::Handle_ObjController_CommandQueueEnqueue_itemradialop1(ByteBuffer &Packet) {
					 to handle the pressing of buttons on an item. needs work.

Constants.h
06-29-07 PlasmaFlow	Added {commanditemradialop1,		"    ----use item radial option 1 \n",  &ZClient::Handle_ObjController_CommandQueueEnqueue_itemradialop1		    },
					added tutorial to the terrain list


PacketFactory.cpp
06-29-07 PlasmaFlow	Removed check from planets listing because tutorial terrain is included.

----
Modified : /dbScript/swgprecu.1.sql
Modified : /src/LoginServer/SWGPreCU_Login.cpp
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/SWGPreCU_Zone.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/ZoneServer/ZoneServer.cpp
Modified : /src/shared/Common.h
Modified : /src/shared/Database.cpp
Modified : /src/shared/config.cpp
Modified : /src/shared/config.h
Modified : /src/shared/opcodes.h


Revision: 296
Author: plasmaflow
Date: 12:48:16 PM, Thursday, June 28, 2007
Message:
NEW DATABASE CHANGES IN THIS REV
---
highlights

If you select to enter the tutorial you will enter the tutorial when making a new toon.
We can now save inside a building and re spawn in it successfully any building not just city structures.
All cell ids have been changed to long since cell ids can get very big an int cannot hold them.
we now correct erroneous cell ids in case of a crash.

all code tested in debugger 



-----------------
sql changelog

-- ----------------------------------------------------------------------------------------------------------------------
-- 06-28-07 PlasmaFlow  Deleted the default building in spawnstructures and added the 2 newbie tutorial buildings in swgprecu.1.sql
--			Updated item_template to be merged to contain some more deed names.
--			
-- ----------------------------------------------------------------------------------------------------------------------

common.h

06-29-07 Plasmaflow	Added new Global constant for cell separation in buildings #define BUILDINGS_OFFSET 200000000
					separation has to be 60 because the corellian corvette mission takes 66 cells

Database.cpp

06-28-07 PlasmaFlow	 Database.cpp createnecharacter now reveived the cell id where we want the character to spawn
					 and saves it to the character table.
					 updatePlayer Position now checks to make sure we received a valid cell id.
					 if the cell is invalid we set it to 0. this allows for correction of crashes.


handlezone.cpp

06-28-07 PlasmaFlow Clientcreate character has new newbie coords and spawn data for choosing to enter tutorial.
					added whole new section for player decision to enter tutorial.
					this section sets the new variables and spawns you at the space station for your tutorial.
					we now pass these new coordinate values to the create character function so we can save the toon at that location.
					select character did not pass or set the cellid for spawning we do now.
					In order to spawn a player inside a building we need to spawn the player after the buildings
					have spawned. so spawnplayer in select character function now spawns player after
					all buildings are spawned. otherwise we spawn in an invalid cell id.


objectcontrollers.cpp

06-28-07 PlasmaFlow	 changed hardcoded celloffset to new CELL_OFFSET

packetfactory.cpp

06-28-07 PlasmaFlow	 Added setting for spawnplayer to set the sCellID variable when spawning the player.
					added a check to the enter ticket purchasemode message to see if 
					we are requesting a list of planets from the tutorial.

all declarations for cellid CellID sCellID cell_id and any others have been changed to be a long.
----
Modified : /dbScript/item_template TO BE MERGED INTO CURRENT.sql
Modified : /dbScript/swgprecu.1.sql
Modified : /dbScript/swgprecu.sql.changelog.txt
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/shared/Common.h
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 295
Author: plasmaflow
Date: 10:49:18 PM, Wednesday, June 27, 2007
Message:
YOU WILL NEED TO LOAD THIS DATABASE FOR SUCCESSFUL BOOT.
ALL CODE TESTED IN DEBUGGER.

*** For some reason Deeds.4.sql does not commit a server error ofsome sort ill let ead fix it.
*** i have submitted a new BuildingDeeds.4.sql file to replace it use this one instead.


Database.CPP

06-27-07 PlasmaFlow		Updated GetIntFromQuery Function, caused a crash if the return row was null.
						Function now returns a 0 if row is null.
						Updated create new character function, query had some missing ` signs.
						Updated AddNewBuilding Function to now save the maintenance rate from the deed the maintenance pool value and 
						The maintenance terminal id and the sign id
						updated inventorydeed function naming conventions for row and result.
						also added checking to make sure we handle errors.
						Added several new row items from deeds table that allow to place a sign
						properly by getting the position modifiers. these are in the getdeeds function.
						also added checking for errors.
						Updated AddStaticNPC and Add Terminal to check for the existance of the ' symbol
						and add 2 \\ so we pass to the database a query with \' and not fail the query
						thus causing a crash.
						Added UpdateBuildingTerminal and UpdateBuildingSign functions to set the terminal id and sign id for a building.

Database.h

06-27-07 PlasmaFlow		Added new variables to the deedobject struct to allow all new variables for terminal and sign placement.

Handlezone.cpp

06-27-07 PlasmaFlow	 Updated objectmenuselectmessage handler to get and save all new sign and terminal coordinate
					 modifiers.

ObjectControllers.cpp

06-27-07 PlasmaFlow	 changed the movement ticker update when indoors. This allows for movement to be updated
					 every 4 ticks while inside a building.
					 Corrected &travel function to update population properly.

sql changelog -

-- 06-27-07 PlasmaFlow  Deeds table has new columns needed to spawn the admin terminal, the outside sign and maintenance rates . 
--                      to spawn the signs we will need coords for it so will be for the indoor terminal. coordinate rows
--                      for both have been added. we dont read them yet that will code next rev.
--			we also save the cell id for the terminal, terminal cell id will be the actual cell integer where it has to be.
--                      this cell till be added to the buildings spawn id+cellid to determine the cell where the terminal will spawn.
-- 			Updated spawned_structures table to have maintenance rate maintenance pool terminal id and sign id
--			ItemTemplateTobemerged has changes in the data not structure.
-- ----------------------------------------------------------------------------------------------------------------------
----
Added : /dbScript/BuildingDeeds.4.sql
Modified : /dbScript/item_template TO BE MERGED INTO CURRENT.sql
Modified : /dbScript/swgprecu.1.sql
Modified : /dbScript/swgprecu.sql.changelog.txt
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 294
Author: maach_ine
Date: 3:19:41 PM, Wednesday, June 27, 2007
Message:
Organic / Inorganic resources may now be spawned into the Database.  They are also loaded from the database, to be used in the surveying / sampling process and the actual creation of resource items in a character's inventory.

Added several classes and functions to the database, modified the zoneserver startup to actually construct the resources, and added new file "resources.cpp"

NOTE:  This commit WILL need a database refresh, as a new field is necessary for a few of the resources tables to make life easier when sending the information to the client.
----
Modified : /ProjectFiles/ZoneServer/ZoneServer.vcproj
Modified : /dbScript/ResourceData.sql
Modified : /dbScript/swgprecu.1.sql
Modified : /dbScript/swgprecu.sql.changelog.txt
Modified : /src/ZoneServer/ZoneServer.cpp
Modified : /src/ZoneServer/ZoneServer.h
Added : /src/ZoneServer/resources.cpp
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 293
Author: plasmaflow
Date: 11:38:35 AM, Monday, June 25, 2007
Message:

ALL CODE HAS BEEN RUN THROUGH THE DEBUGGER.

06-24-07 Plasmaflow	 Added new function to the &commands called &position. It sends the players position 
					 data for finding out where the player is sitting at in the game world.
					 Updated npc and terminal spawn functions to pass cell id 0 if were not in a cell.
					 Seems the world sends a bogus cellid outside.

06-24-07 Plasmaflow	 Corrected planet id on soe disconnect planet id was not being passed.

06-23-07 PlasmaFlow    Updated GetInventory to get the name of the item from the item table
06-24-07     			also made the function a bit more secure and made it use local result an row variables, also function only returns buildings for the planet passed as argument ot it.
						also made the function cleanup results and only pass back results if the query is successful.
					   Updated Spawnbuildings function to only return buildings in the planet passed to it as argument and 
					    made the function use local row and result variables.
						also made the function cleanup results and only pass back results if the query is successful.
					   Updated insert starter items to use the iRaceIndex to get the list of starter items per race.
					   als made the function use local result and row values,
					   made the function cleanup results. Also the function now saves the name of the starter item to the items table so we can populate the right item name from it.
					   Updated insertitem function print an error to the console if we fail insertion of an item.
						also function inserts the starter items name into the db.	
						Updated Spawnstaticnpcs function to only return npcs in the planet passed to it as argument and 
					    made the function use local row and result variables.
						also made the function cleanup results and only pass back results if the query is successful.
						Updated Getterminal function to only return terminals in the planet passed to it as argument and 
					    made the function use local row and result variables.
						also made the function cleanup results and only pass back results if the query is successful.
						Updated temnplate data to get item name only if it is a valid name and not null. added cleanup of results and made row and result variables local
						Updated Some printfs not to come out anymore.
						Updated Get intfromquery function its being used in severalplaces and it works fine now that is has local vasriables
						and it despawns results. Function uses a single IF statement now
						Updated grabgalaxy info to use a single if statement as local variables for row and result.
						also logs to file any sql errors.

building terminals coming in next rev along with building maint and building signs.
----
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/ZoneClient.cpp
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 292
Author: plasmaflow
Date: 11:25:47 AM, Monday, June 25, 2007
Message:
No changes in this commit this is a test commit to verify SVN Functionality. 
This is same Rev as previous 291.
NO CHANGES
----
Modified : /src/ZoneServer/SWGPreCU_Zone.cpp


Revision: 291
Author: interesting
Date: 10:46:44 AM, Sunday, June 24, 2007
Message:
Added Rodian Items.
Added Auto_increment to the ID field in starter_items to save time and work on my part.
----
Modified : /dbScript/swgprecu.1.sql
Modified : /dbScript/swgprecu.sql.changelog.txt


Revision: 290
Author: ead
Date: 2:55:18 AM, Sunday, June 24, 2007
Message:
FIXED STUPDID SHIT  THAT IS THE RESULT OF LASSYNESS  BAD SQL VIA NAVACAT IN Deeds.sql
SQL FILES REQUIRED THAT ARNT NUMBERD  
Terminals.6.sql Deeds.4.sql tickettable.5.sql
I WILL KICK THE PERSON IN THE NUTS THAT DOSE THIS  THIS IS 2ICE ONCE BEFORE THE ROLL BACK  ONCE AFTER  ITS SIMPLE STUPID SHIT
----
Added : /dbScript/Deeds.4.sql(Copy from path: /dbScript/Deeds.sql, Revision, 289
Deleted : /dbScript/Deeds.sql
Added : /dbScript/Terminals.6.sql(Copy from path: /dbScript/Terminals.sql, Revision, 289
Deleted : /dbScript/Terminals.sql
Added : /dbScript/tickettable.5.sql(Copy from path: /dbScript/tickettable.sql, Revision, 289
Deleted : /dbScript/tickettable.sql


Revision: 289
Author: plasmaflow
Date: 9:51:08 PM, Saturday, June 23, 2007
Message:
NEW DATABASE CHANGES THIS REV U WILL NEED TO LOAD FILES IN THIS REV

06-23-07 Plasmaflow	 Updated SpawnPlayer to take playerdata as an arguemnt instead of 
					 the objid since pdata has the obj id in it
					 this allows us to do only one database call per character loaded instead of 2

06-23-07 PlasmaFlow    Updated GetInventory to get the name of the item from the item table
						also made the function a bit more secure and made it use local result an row variables, also function only returns buildings for the planet passed as argument ot it.
						also made the function cleanup results and only pass back results if the query is successful.
					   Updated Spawnbuildings function to only return buildings in the planet passed to it as argument and 
					    made the function use local row and result variables.
						also made the function cleanup results and only pass back results if the query is successful.
					   Updated insert starter items to use the iRaceIndex to get the list of starter items per race.
					   als made the function use local result and row values,
					   made the function cleanup results. Also the function now saves the name of the starter item to the items table so we can populate the right item name from it.
					   Updated insertitem function print an error to the console if we fail insertion of an item.
						also function inserts the starter items name into the db.	
						Updated Spawnstaticnpcs function to only return npcs in the planet passed to it as argument and 
					    made the function use local row and result variables.
						also made the function cleanup results and only pass back results if the query is successful.
						Updated Getterminal function to only return terminals in the planet passed to it as argument and 
					    made the function use local row and result variables.
						also made the function cleanup results and only pass back results if the query is successful.
						Updated temnplate data to get item name only if it is a valid name and not null. added cleanup of results and made row and result variables local

-- 06-23-07 PlasmaFlow  Changed item table to have a new row at end for item name this is required for all items.
--			Restored npcs table back from previous rev.
-- 						
-- -------------------------------------------------------------------------------------------------------------------
----
Modified : /dbScript/item_template TO BE MERGED INTO CURRENT.sql
Modified : /dbScript/static_npcs.3.sql
Modified : /dbScript/swgprecu.1.sql
Modified : /dbScript/swgprecu.sql.changelog.txt
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 288
Author: interesting
Date: 12:43:46 PM, Saturday, June 23, 2007
Message:
Updated Starter items to the new format.
Deleted my starter item entries from the item_template table.
Cleaned up change log.
----
Modified : /dbScript/item_template.2.SQL
Modified : /dbScript/swgprecu.1.sql
Modified : /dbScript/swgprecu.sql.changelog.txt


Revision: 287
Author: Zewi
Date: 3:08:32 PM, Friday, June 22, 2007
Message:

----
Modified : /dbScript/Terminals.sql
Modified : /dbScript/static_npcs.3.sql


Revision: 286
Author: interesting
Date: 3:03:11 PM, Friday, June 22, 2007
Message:
Updated starter items to there new format. Please do not touch them as I am going to be working on them all day today.
Please do not modify item_template starter item entries or it will break all of this work. Let me take care of it.
----
Modified : /dbScript/swgprecu.1.sql
Modified : /dbScript/swgprecu.sql.changelog.txt


Revision: 285
Author: plasmaflow
Date: 2:32:55 PM, Friday, June 22, 2007
Message:
06-22-07 PlasmaFlow SpwanBuilding returns a bool now.
06-22-07 PlasmaFlow  Changed placestructure controller to check if we saved a proper building or not
                     also corrected all coords to be floats out to the save buildings function.
			we also pass the character id and save it to the db so we know who spawned a building.
			we also marry the base to the building using the buildings id.

06-22-07 Plasmaflow    Changed name of SpawnBuildingInDB to AddNewBuilding
						also changed function to return the id of the building created.
						The function now takes 2 arguments which is the character_id so we know who spawned a building
						and the base_id so we know what base belongs to a building.


database table change

-- 06-22-07 PlasmaFlow spawned structures table has 2 new columns, character_id to indicate who owns a structure and 
--                     Base ID to indicate what base belongs to a building. this is for deletion purposes.

Changed galaxy field for updates to 150 from 1000, 1000=movementupd every 66 minutes 150 = 10

----
Modified : /dbScript/swgprecu.1.sql
Modified : /dbScript/swgprecu.sql.changelog.txt
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 284
Author: interesting
Date: 11:22:02 AM, Friday, June 22, 2007
Message:
Added more starter items.
Specifically notable is now the server wont crash because all created characters will have a deed in there inventory as a place holder until all items are done.
----
Modified : /dbScript/swgprecu.1.sql
Modified : /dbScript/swgprecu.sql.changelog.txt


Revision: 283
Author: maach_ine
Date: 11:07:05 AM, Friday, June 22, 2007
Message:
Corrected CRC for Shared Rodian Female model.
----
Modified : /src/ZoneServer/Constants.h


Revision: 282
Author: plasmaflow
Date: 9:30:52 AM, Friday, June 22, 2007
Message:
NEW SQL FILES IN THIS LOAD OR UPDATED ONES.
NEW ITEM TEMPLATE FILE ADDED BY PlasmaFlow.
DEEDS TABLE HAS TO BE RELOADED IT HAS 2 NEW COLS READ ON FOR INFO 

This new item_template file needs to be merged by ead into current swgprecu.1.sql
file to add deed names i have added so far. More deed names to come.
In the mean time you may load the new file instead of the old one.

tickettable.sql has been added to the swgprecu.1.sql no need to load tickettable.sql by it self.

LoadOrder.txt has been updated.

Changed ObjControllers.cpp to make sure we spawn a buildings base before we spawn the building.
this will set the terrain properly and remove vegetation.

Deeds.sql has been updated to include 2 new columns: 
object_base varchar(255) - this will contain the proper base for a building or object.
base_required tynyint(3) - this will be a flag boolean for knowing if the object needs a 
                           base or not. Default is 0 meaning no. When you add a new deed the
                           proper base iff file name has to be added. building base names 
                           are like this: 'object/building/base/shared_base_bank.iff'.
                           Bases are in the 'object/building/base/' or contain the
                           string 'shared_base_' in the name.

HandleZone.cpp has been updated to add the proper value to the buildings spawn variables.
ZoneClient.h has been updated to add the 2 new values to a buildings spawn variables.
Database.cpp load the 2 new building values into the iterator list generated when loading a building.

Someone or eventually i will have to write in the buildings destroy functions. when this is done care
must be taken to remove the base as well, this mean at some point we need to marry the building and the base
when the building is added to the Database.

crc.h and crc.cpp
06-22-07 Plasmaflow  Changed SWGCRC to return an unsigned long instead of a long.
                     internally in the function the crc was being calcualted as 
					 unsigned long. i believ this is part of the cause of problems with starter items.

06-20-07 PlasmaFlow		Removed GetSpeciesFromAppearance no longer needed replaced all calls to it with SWGCRC()


Bugs Found.
CityHalls will save to db but will crash the client. looks like a cell issue or a bad crc issue.
If you spawn a City hall it will crash your client on every login there after so you need to delete the city hall and its base from the db so the crash stops.

----
Modified : /dbScript/Deeds.sql
Modified : /dbScript/DevCityBackup.sql
Modified : /dbScript/LoadOrder.txt
Added : /dbScript/item_template TO BE MERGED INTO CURRENT.sql
Modified : /dbScript/swgprecu.1.sql
Modified : /dbScript/swgprecu.sql.changelog.txt
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h
Modified : /src/shared/crc.cpp
Modified : /src/shared/crc.h


Revision: 281
Author: interesting
Date: 1:07:15 PM, Thursday, June 21, 2007
Message:
Added Starting Items. Specifics in the change log.
At the moment Human Male & Female are my main priority, because maach says multizone is broken, I have no way to test the rest of the items, so I wont bother adding them until multi-zone crashes are fixed.

DO NOT MODIFY THE DATA OR TABLE STRUCTURE OF STARTING ITEMS PLEASE!
----
Modified : /dbScript/swgprecu.1.sql
Modified : /dbScript/swgprecu.sql.changelog.txt


Revision: 280
Author: maach_ine
Date: 7:46:42 PM, Wednesday, June 20, 2007
Message:
A couple of bug squashes.  Moved some database query code that was outside of the database into the database.  Added a raceIndex int to the ZoneClient for use when we are looking up data by the array position of the character race.

****** STARTER ITEMS ARE TOTALLY BROKEN IN THIS COMMIT PENDING A COMMIT BY INTERESTING *******

****** MULTI-ZONE IS CONFIRMED BROKEN IN THIS AND EARLIER COMMITS FOR MOST SPECIES!!  ONLY CONFIRMED WORKING SPECIES IS HUMAN MALE!!! PRIORITY 1 TOFIX!!! ******
----
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 279
Author: plasmaflow
Date: 12:29:05 PM, Wednesday, June 20, 2007
Message:
All changes have been documented in the change logs.
All changes have been tested to work.
No changes to Database Structure or data.

Changes as follows

HandleZone.cpp
Added gm = LoadedPlayerInfo.gm; in HANDLE_SelectCharacter to set the Zclient Global gm to tell if a player is a gm or not.

ZoneClient.h
Added bool gm; to Zclient::


Database.cpp
Added Function StaticNPC AddStaticNPC(StaticNPC _npcData); // This function adds a new Static NPC To the Static NPCS Table.
						Changed GetPlayerData to get if the player is a gm or not this also adds the tag of [GM]or [DEV] to the players name.
						To dawn the new tag you need to set your account gm setting to: 0=not GM, 1=GM 2=DEV This will also set a global for the
						client called gm which is a boolean to determine if the player is a gm or not.
						Added Function Terminal AddTerminal(Terminal _terminalData);//This function adds a new Terminal to the Terminals Table.

Database.h
Added Function int AddStaticNPC(StaticNPC _npcData); // This function adds a new Static NPC To the Static NPCS Table.
						Terminal AddTerminal(Terminal _terminalData);//This function adds a new Terminal to the Terminals Table.

ObjControllers.cpp

					 Added new & Commands  &Place with sub command npc, terminal, building, lair
					 These commands allow for a gm to place any of these using his own coords and orientation
					 they also take a first name or last name and deal with the object being placed inside or
					 outside a cell. This will speed up the population of databases since placing an object
					 in the world saves it to the database and spawns the item automatically.
					 Added &help command to list available commands. When adding more commands to the help list
					 add new messages in no more than 2 full lines of text or it causes a client crash.
----
Modified : /ProjectFiles/ZoneServer/ZoneServer.vcproj
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 278
Author: Zewi
Date: 10:59:58 AM, Wednesday, June 20, 2007
Message:
houses work again/deeds!
----
Modified : /dbScript/swgprecu.1.sql


Revision: 277
Author: Zewi
Date: 10:45:03 AM, Wednesday, June 20, 2007
Message:
finished starter item deed proplm.. still places a bank!!
----
Modified : /dbScript/swgprecu.1.sql


Revision: 276
Author: maach_ine
Date: 9:52:35 AM, Wednesday, June 20, 2007
Message:
Recommit, and a bug fix in what I wrote earlier.  Previously, if there were no ticket destinations, we would crash getting the first destination.

Notes from original commit follow.

Fixed memory leakage in PacketFactory functions BUILD_EnterTicketPurchaseModeMessage and BUILD_PlanetTravelPointListResponse.

Both were creating 2 lists using "new" without deleting them afterward.  Now they create only 1 "new" list, which is deleted afterwards.

Updated HandleZone function HANDLE_PlanetTravelListRequest -- it will now read the planet name from the packet, determine the planet ID that the name matches up with, and then set a variable so that we send back appropriate data.
----
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.h


Revision: 275
Author: Zewi
Date: 3:21:10 AM, Wednesday, June 20, 2007
Message:
 Zewi Updated the starter item to spawn house if u look at the swgprecu squl file and went down to the 
starter items u would notice that the last zero is for deeds `deed_id` int not null,  it was zero when u have a deed the
number needs to be 1.. so instead of this INSERT INTO `starter_items` VALUES( 7, 'crafting_artisan', 101601749, 9288, 0, 0, 0, 0, 0);
it needed to be this INSERT INTO `starter_items` VALUES( 7, 'crafting_artisan', 101601749, 9288, 0, 0, 0, 0, 1);  However u dont spawn 
a house u spawn soemthing else, I have looked into the DEEDS sql and have checked that and everything is right number 9288(from the Item_template
is the correct number for Naboo small house style.02 so i do not no what the proplem is unless numbers are off some where!!! or hard coded!!
it worked once when this was first implemented but someone complied over the ones with a zero or the one(1) was never implemented So the house deed works
but it is not spawing a naboo house it spawns a bank.. more then lilkly this is harded coded!!!
----
Modified : /dbScript/swgprecu.1.sql
Modified : /dbScript/swgprecu.sql.changelog.txt


Revision: 274
Author: ead
Date: 2:18:45 AM, Wednesday, June 20, 2007
Message:
ROLLBACK TO 258 DUE TO BROKEN STUFF
DEEDS BROKEN 
CLOHTING/STARTER ITEMS BROKEN
AN @ COMMAND WAS ADDED
DECISION BY MEANMON ZEWI EAD
----
Added : /Documents/Database Item Documentation.txt(Copy from path: /Documents/Database Item Documentation.txt, Revision, 258
Added : /Documents/[GUIDE]Getting started (Setting up your server).URL(Copy from path: /Documents/[GUIDE]Getting started (Setting up your server).URL, Revision, 258
Deleted : /dbScript/Deeds.5.sql
Modified : /dbScript/LoadOrder.txt
Deleted : /dbScript/Terminals.4.sql
Added : /dbScript/Terminals.sql(Copy from path: /dbScript/Terminals.sql, Revision, 258
Modified : /dbScript/static_npcs.3.sql
Modified : /dbScript/swgprecu.1.sql
Modified : /dbScript/swgprecu.sql.changelog.txt
Deleted : /dbScript/tickettable.6.sql
Added : /dbScript/tickettable.sql(Copy from path: /dbScript/tickettable.sql, Revision, 258
Modified : /src/LoginServer/SWGPreCU_Login.cpp
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h
Modified : /src/shared/config.cpp
Modified : /src/shared/config.h


Revision: 273
Author: Zewi
Date: 1:33:41 AM, Wednesday, June 20, 2007
Message:
Updated the starter item to spawn house if u look at the swgprecu squl file and went down to the 
starter items u would notice that the las zero is for deeds `deed_id` int not null, will it was zero when u have a deed the
number needs to be 1.. so instead of this INSERT INTO `starter_items` VALUES( 7, 'crafting_artisan', 101601749, 9288, 0, 0, 0, 0, 0);
it needed to be this INSERT INTO `starter_items` VALUES( 7, 'crafting_artisan', 101601749, 9288, 0, 0, 0, 0, 1);  However u dont spawn 
a house u spawn soemthing else, I have looked into the DEEDS sql and have checked that and everything is right number 9288 is the correct 
number for Naboo small house style.02 so i do not no what the proplem is unless numbers are off some where!!! or hard coded!!
it wored once when this was first implemented but someone compied over the ones with a zero or the one was never implemented So the house deed works
but it is not spawing the right thing.
----
Modified : /dbScript/swgprecu.1.sql
Modified : /dbScript/swgprecu.sql.changelog.txt


Revision: 272
Author: maach_ine
Date: 10:13:57 PM, Tuesday, June 19, 2007
Message:
Fixed memory leakage in PacketFactory functions BUILD_EnterTicketPurchaseModeMessage and BUILD_PlanetTravelPointListResponse.

Both were creating 2 lists using "new" without deleting them afterward.  Now they create only 1 "new" list, which is deleted afterwards.

Updated HandleZone function HANDLE_PlanetTravelListRequest -- it will now read the planet name from the packet, determine the planet ID that the name matches up with, and then set a variable so that we send back appropriate data.
----
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.h


Revision: 271
Author: plasmaflow
Date: 2:24:08 PM, Tuesday, June 19, 2007
Message:
All changes have been documented in the change logs.
All changes have been tested to work.
No changes to Database Structure or data.

Changes as follows

config.cpp
Updated default login server port from 44457 to 44453

HandleZone.cpp
Added gm = LoadedPlayerInfo.gm; in HANDLE_SelectCharacter to set the Zclient Global gm to tell if a player is a gm or not.

ZoneClient.h
Added bool gm; to Zclient::


Database.cpp
Added Function StaticNPC AddStaticNPC(StaticNPC _npcData); // This function adds a new Static NPC To the Static NPCS Table.
						Changed GetPlayerData to get if the player is a gm or not this also adds the tag of [GM]or [DEV] to the players name.
						To dawn the new tag you need to set your account gm setting to: 0=not GM, 1=GM 2=DEV This will also set a global for the
						client called gm which is a boolean to determine if the player is a gm or not.
						Added Function Terminal AddTerminal(Terminal _terminalData);//This function adds a new Terminal to the Terminals Table.

Database.h
Added Function int AddStaticNPC(StaticNPC _npcData); // This function adds a new Static NPC To the Static NPCS Table.
						Terminal AddTerminal(Terminal _terminalData);//This function adds a new Terminal to the Terminals Table.

ObjControllers.cpp
Added check to see if player is a GM or not to allow or disallow usage of & commands
					 Added new & Commands  &Place with sub command npc, terminal, building, lair
					 These commands allow for a gm to place any of these using his own coords and orientation
					 they also take a first name or last name and deal with the object being placed inside or
					 outside a cell. This will speed up the population of databases since placing an object
					 in the world saves it to the database and spawns the item automatically.
					 Added &help command to list available commands. When adding more commands to the help list
					 add new messages in no more than 2 full lines of text or it causes a client crash.
----
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h
Modified : /src/shared/config.cpp


Revision: 270
Author: interesting
Date: 9:37:04 AM, Tuesday, June 19, 2007
Message:
Removed two obsolete document files.
Both were created by me and are no longer up to date.
----
Deleted : /Documents/Database Item Documentation.txt
Deleted : /Documents/[GUIDE]Getting started (Setting up your server).URL


Revision: 269
Author: compileserver
Date: 1:33:04 AM, Tuesday, June 19, 2007
Message:
06-18-07 ead			added login port number support
FIXED DEBUG START ORDER
----
Modified : /src/LoginServer/SWGPreCU_Login.cpp
Modified : /src/shared/config.cpp
Modified : /src/shared/config.h


Revision: 268
Author: compileserver
Date: 11:55:25 PM, Monday, June 18, 2007
Message:
COMMIT BY EAD REMOVED DROP IF EXIST FROM static_npcs.3.sql
----
Modified : /dbScript/static_npcs.3.sql


Revision: 267
Author: compileserver
Date: 11:46:44 PM, Monday, June 18, 2007
Message:
COMMIT BY EAD VIA COMPILE SERVER updated sql file names
----
Modified : /dbScript/LoadOrder.txt
Deleted : /dbScript/Terminals.sql
Added : /dbScript/tickettable.6.sql(Copy from path: /dbScript/tickettable.sql, Revision, 266
Deleted : /dbScript/tickettable.sql


Revision: 266
Author: Zewi
Date: 10:58:45 PM, Monday, June 18, 2007
Message:
fixed Driod/terminal in theed shuttle port #1
----
Modified : /dbScript/Terminals.4.sql
Modified : /dbScript/static_npcs.3.sql


Revision: 265
Author: Zewi
Date: 10:37:40 PM, Monday, June 18, 2007
Message:
updated what sql files to load!!! AGAIN!!!
----
Added : /dbScript/Deeds.5.sql
Added : /dbScript/Terminals.4.sql


Revision: 264
Author: Zewi
Date: 10:33:11 PM, Monday, June 18, 2007
Message:
updated what sql files to load!!!
----
Modified : /dbScript/swgprecu.sql.changelog.txt
Modified : /src/ZoneServer/ObjControllers.cpp


Revision: 263
Author: ead
Date: 8:57:43 AM, Monday, June 18, 2007
Message:
REV 262 REVERT  SMAP IS GETTING MESSED WITH BY SOME OTHER PEACE OF CODE IT WORKS FINE IN THE IDE IN DEBUG BUT WHEN RUN STANDALONE  IT CRASHES  WHILE MALLOCING CELL 198 OF PLANET 0
----
Modified : /Lib/AutoItX3.lib
Modified : /ProjectFiles/ZoneServer/ZoneServer.vcproj
Modified : /debug/ZoneServer/AutoItX3.dll
Modified : /debug/loginserver/AutoItX3.dll
Modified : /smap/Debug/smap.exe
Modified : /smap/Release/smap.exe
Modified : /smap/main.cpp
Modified : /smap/smap.ncb
Modified : /smap/smap.suo
Modified : /smap/smap.vcproj
Modified : /src/ZoneServer/SWGPreCU_Zone.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/ZoneServer/ZoneServer.cpp
Modified : /src/ZoneServer/ZoneServer.h
Modified : /src/shared/AutoIt3.h


Revision: 262
Author: ead
Date: 1:24:58 AM, Monday, June 18, 2007
Message:
06-18-07 EAD	FIXED/ADDED SMAP FUNCTONALTY SMAP IS NOT YET INTGRATED OR WORKING IT MEARLY STARTS AND STOPS WITHOUT ERROR A MEMORY MANAGMENT ERROR STILL EXIST IN OWER PROGRAM  NOT IN SMAP  THAT WAS CAUSING A CRASH WITH SMAPS 500X500 ARRAY  ANY ARRAY ADDED TO THE ZSERVER SINGLETON WILL CAUSE A CRASH IF IT IS BIG ENUFF  THIS WAS A STATICLY MADE ARRAY SMAP[500][500] AND SHULD NEVER CAUSE A PROB CURRENTLY USING MALLOC TO MAKE THE ARRAY SMAP IS DOUBLE POINTER AS A TEMP FIX TELL THE MEMORY LEAK NOT CAUSED BY SMAP CAN BE FOUND
other msic changes to smap project 
updated AutoItX3 ini systems libarys and header to latist version as a atempt to find the memory leak   

the leak i do not beleve to be in autoit as it landed on line 104 config.cpp
	if( (vread[0] == bad[0] && vread[1] == bad[1] && vread[2] == bad[2]) || reconfig)
im guessing the leak just simply shows up in config  but that config is liekly not the source  but that i dont know for shure
----
Modified : /Lib/AutoItX3.lib
Modified : /ProjectFiles/ZoneServer/ZoneServer.vcproj
Modified : /debug/ZoneServer/AutoItX3.dll
Modified : /debug/loginserver/AutoItX3.dll
Modified : /smap/Debug/smap.exe
Modified : /smap/Release/smap.exe
Modified : /smap/main.cpp
Modified : /smap/smap.ncb
Modified : /smap/smap.suo
Modified : /smap/smap.vcproj
Modified : /src/ZoneServer/SWGPreCU_Zone.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/ZoneServer/ZoneServer.cpp
Modified : /src/ZoneServer/ZoneServer.h
Modified : /src/shared/AutoIt3.h


Revision: 261
Author: plasmaflow
Date: 9:40:25 PM, Sunday, June 17, 2007
Message:
Added back function in CanLogin to lowercase the name
of users logging in and store it as lower case only.

All we do is this.

printf("UserName As entered:%s\n",username.c_str());
	for (int i=0;i<username.length();i++)
	{
		username[i]=tolower(username[i]);	
	}
	printf("UserName As Lowered:%s\n",username.c_str());

This has been tested to work with user names that are multi case and names with numbers like TeSt and T3St.

Plasma
----
Modified : /src/shared/Database.cpp


Revision: 260
Author: plasmaflow
Date: 6:42:34 PM, Sunday, June 17, 2007
Message:
Change log update my IDE did not update the notes properly from my notes file
----
Modified : /src/shared/Database.cpp


Revision: 259
Author: plasmaflow
Date: 6:30:09 PM, Sunday, June 17, 2007
Message:
Changed UpdatePlayerPos Function to now save the planet id properly. it also updates the population properly when you move from planet to planet.
----
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/ZoneClient.cpp
Modified : /src/shared/Database.cpp


Revision: 258
Author: ead
Date: 12:06:27 AM, Sunday, June 17, 2007
Message:
smap roll back
----
Modified : /ProjectFiles/ZoneServer/ZoneServer.vcproj
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/ZoneServer/ZoneServer.cpp
Modified : /src/ZoneServer/ZoneServer.h
Deleted : /src/ZoneServer/player.h


Revision: 257
Author: meanmon13
Date: 12:05:46 AM, Sunday, June 17, 2007
Message:
smap commit -- too be reverted
----
Modified : /ProjectFiles/ZoneServer/ZoneServer.vcproj
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/ZoneServer/ZoneServer.cpp
Modified : /src/ZoneServer/ZoneServer.h
Added : /src/ZoneServer/player.h


Revision: 256
Author: ead
Date: 11:36:51 PM, Saturday, June 16, 2007
Message:
smap roll back 
----
Modified : /ProjectFiles/ZoneServer/ZoneServer.vcproj
Modified : /smap/smap.ncb
Modified : /smap/smap.suo
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/ZoneServer/ZoneServer.cpp
Modified : /src/ZoneServer/ZoneServer.h
Deleted : /src/ZoneServer/player.h
Modified : /src/shared/Common.h


Revision: 255
Author: meanmon13
Date: 9:46:19 PM, Saturday, June 16, 2007
Message:
smap commit -- too be rolled back
----
Modified : /ProjectFiles/ZoneServer/ZoneServer.vcproj
Modified : /smap/smap.ncb
Modified : /smap/smap.suo
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/ZoneServer/ZoneServer.cpp
Modified : /src/ZoneServer/ZoneServer.h
Added : /src/ZoneServer/player.h
Modified : /src/shared/Common.h


Revision: 254
Author: ead
Date: 7:41:23 PM, Saturday, June 16, 2007
Message:
fixed smap project
----
Modified : /smap/Release/smap.exe
Added : /smap/smap.ncb
Modified : /smap/smap.sln
Modified : /smap/smap.suo
Added : /smap/smap.vcproj
Added : /smap/smap.vcproj.LANMASTERCMD.pat.user


Revision: 253
Author: meanmon13
Date: 7:16:35 PM, Saturday, June 16, 2007
Message:
found issue with 247... the planet id of the player was not being saved right when using the &travel command... I am unable to fix this because i cannot change how the position update saves planet ids... thus &travel only works for the planet the player is currently on... fix how position update saves planet id and interplentary travel will again be possible
----
Modified : /src/LoginServer/PacketFactory.cpp
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/PacketFactory.cpp


Revision: 252
Author: ead
Date: 6:23:43 PM, Saturday, June 16, 2007
Message:
removal of rev 247
----
Modified : /Release/PingServer/BuildLog.htm
Modified : /Release/PingServer/PingServer.exe
Modified : /Release/SWGPreCU_Ping.cod
Modified : /Release/SWGPreCU_Ping.obj
Modified : /Release/mt.dep
Modified : /Release/vc80.idb
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/shared/Database.cpp


Revision: 251
Author: ead
Date: 6:05:43 PM, Saturday, June 16, 2007
Message:
fix on termnals  REMOVED  IF EXIST DROP 
preposed changes to word and name filter
----
Modified : /dbScript/Terminals.sql
Added : /dbScript/filter.ods


Revision: 250
Author: lordcorm
Date: 4:30:31 PM, Saturday, June 16, 2007
Message:
Database tickets.
----
Added : /dbScript/tickettable.sql
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 249
Author: Zewi
Date: 2:35:06 PM, Saturday, June 16, 2007
Message:
Added more trainers to the Static NPC SQL file Thanks to Interesting for helping getting location's
----
Modified : /dbScript/Terminals.sql
Modified : /dbScript/static_npcs.3.sql
Modified : /dbScript/swgprecu.sql.changelog.txt


Revision: 248
Author: nogard
Date: 1:44:59 PM, Saturday, June 16, 2007
Message:
Fxied Zewi cry baby tantrum...
----
Modified : /Weather Client/SWGWeather.exe
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/admin.cpp


Revision: 247
Author: meanmon13
Date: 1:21:12 PM, Saturday, June 16, 2007
Message:
as per Zewi's request i added in an in-game command for easy travel

the command is "&travel" proper usage is "&travel (local or planet_id) x z y"

NOTE: shuttles will practically be a cut and paste job of the &travel command code
----
Modified : /Release/PingServer/BuildLog.htm
Modified : /Release/PingServer/PingServer.exe
Modified : /Release/SWGPreCU_Ping.cod
Modified : /Release/SWGPreCU_Ping.obj
Modified : /Release/mt.dep
Modified : /Release/vc80.idb
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/shared/Database.cpp


Revision: 246
Author: Zewi
Date: 1:46:30 AM, Saturday, June 16, 2007
Message:
Fixed Static NPC's and Terminal SQL. Per Lords Request
----
Modified : /dbScript/Terminals.sql
Modified : /dbScript/static_npcs.3.sql
Modified : /dbScript/swgprecu.sql.changelog.txt


Revision: 245
Author: lordcorm
Date: 1:37:47 AM, Saturday, June 16, 2007
Message:
fix saving possission, step 1 of tickets
----
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/shared/Common.h
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 244
Author: nogard
Date: 9:16:22 PM, Friday, June 15, 2007
Message:

----
Modified : /src/ZoneServer/HandleZone.cpp


Revision: 243
Author: nogard
Date: 8:00:25 PM, Friday, June 15, 2007
Message:
Reverted back...
----
Modified : /Weather Client/README.txt
Modified : /Weather Client/SWGWeather.exe
Deleted : /Weather Client/VText.dll


Revision: 242
Author: nogard
Date: 7:54:00 PM, Friday, June 15, 2007
Message:
Added missing DLL
----
Modified : /Weather Client/README.txt
Added : /Weather Client/VText.dll


Revision: 241
Author: nogard
Date: 7:48:15 PM, Friday, June 15, 2007
Message:
Added Config Files and Such dont work 100% yet
----
Added : /Weather Client/Config
Added : /Weather Client/Config/Config.CFG
Modified : /Weather Client/SWGWeather.exe


Revision: 240
Author: nogard
Date: 7:30:09 PM, Friday, June 15, 2007
Message:
Opps forgot to add a file
----
Added : /Weather Client/MSWINSCK.OCX
Modified : /Weather Client/README.txt


Revision: 239
Author: nogard
Date: 7:23:38 PM, Friday, June 15, 2007
Message:
Added Abunch of stuff
added Weather Client/SWGWeather.exe for chaning NABOO ONLY atm but it does change them all program wise. must be on you pc atm untill i write the InitSocket
added /pickup 
/drop
/open
/flourish 
music and dance works .
----
Added : /Weather Client
Added : /Weather Client/EARTH.ICO
Added : /Weather Client/README.txt
Added : /Weather Client/SWGWeather.exe
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/PacketFactory.h
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/ZoneServer/ZoneServer.cpp
Modified : /src/ZoneServer/ZoneServer.h
Modified : /src/ZoneServer/admin.cpp
Modified : /src/shared/opcodes.h


Revision: 238
Author: Zewi
Date: 7:03:18 PM, Friday, June 15, 2007
Message:

----
Added : /dbScript/Terminals.sql


Revision: 237
Author: Zewi
Date: 6:59:05 PM, Friday, June 15, 2007
Message:
Added Trainers in Naboo Theed(some are facing the wrong way that needs to be fixed) Aslo
Added a Terminals SQl file for Ticket Droids and terminals.
----
Modified : /dbScript/static_npcs.3.sql
Modified : /dbScript/swgprecu.sql.changelog.txt


Revision: 236
Author: lordcorm
Date: 5:29:42 PM, Friday, June 15, 2007
Message:
for zewi
----
Modified : /src/ZoneServer/HandleZone.cpp


Revision: 235
Author: ead
Date: 1:01:51 AM, Friday, June 15, 2007
Message:
recommited formating changes UPDATE BEFORE YOU COMMIT OR DIE
SMAP WORKS FIXED CRASH  20000 OBJECTS LOADED IN 32Mhz  or 15 miliseconds
----
Deleted : /smap/Debug/BuildLog.htm
Deleted : /smap/Debug/mt.dep
Added : /smap/Debug/smap.exe
Deleted : /smap/Debug/stree.exe
Deleted : /smap/Debug/stree.exe.intermediate.manifest
Deleted : /smap/Debug/stree.map
Deleted : /smap/Release/BuildLog.htm
Added : /smap/Release/smap.exe
Deleted : /smap/Release/vc80.idb
Modified : /smap/main.cpp
Modified : /smap/smap.suo
Deleted : /smap/stree.ncb
Deleted : /smap/stree.vcproj
Deleted : /smap/stree.vcproj.LANMASTERCMD.pat.user
Modified : /src/shared/config.cpp


Revision: 234
Author: maach_ine
Date: 4:09:54 PM, Thursday, June 14, 2007
Message:
Update for Zewi's placing NPCs around the galaxy.

Slightly modified the @warp command to be more useable.  The format MUST still be:

@warp XXXX YYYY ZZZZ
OR
@warp -XXXX -YYYY -ZZZZ
OR
any combination of +- XXXX, YYYY, ZZZZ.

Added:
@planet command

Format MUST be:

@planet II

The planet ID MUST BE 2 characters long, or the zone server will crash.  The planet ID MUST be a positive number, or the client will crash.

NOTE:  The above commands WILL BE REMOVED when Zewi is done with them.  That is why they are not more user friendly.

Updates to the Zone Client:  It is now aware of what planet it should be on.  For purposes of sending the StartScene packet, the client is now aware of it's X,Y,Z co-ordinates earlier in the zoning in process.
----
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 233
Author: maach_ine
Date: 11:58:19 PM, Wednesday, June 13, 2007
Message:
****** SEMI-STABLE COMMIT ******

DO NOT START A CHAT LINE WITH THE CHARACTER @ AND HAVE "warp" IN THE CHAT LINE OR YOU WILL CRASH THE SERVER UNLESS YOU FOLLOW THE FORMAT LAID OUT BELOW.

This commit is the first step in handling player warping.  The format needed is:

@warp XXXX YYYY ZZZZ

where XXXX, YYYY and ZZZZ are the coordinates we want to warp to.

TODO:  Build the correct packets to send after we update the player's posX, posY, posZ
----
Modified : /src/ZoneServer/ObjControllers.cpp


Revision: 232
Author: lordcorm
Date: 7:19:08 PM, Wednesday, June 13, 2007
Message:
you now can save in cells :) and euip weapons :)
----
Modified : /dbScript/swgprecu.1.sql
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.cpp
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 231
Author: ead
Date: 11:12:54 PM, Tuesday, June 12, 2007
Message:
06-12-07 Ead		cleaned up time format now uses hh:mm:sec
06-12-07 Ead		cleanup of database quarry/connect error message   nolonger will it be hard to read
----
Modified : /src/shared/config.cpp
Modified : /src/shared/tlog.cpp


Revision: 230
Author: ead
Date: 10:54:45 PM, Tuesday, June 12, 2007
Message:
06-12-07 EAD		iStance was not set to 0 on creation   sometimes for pepole
					without  compile option (set values to 0 on start) enabled  would get stuck incapactated
----
Modified : /src/ZoneServer/ZoneClient.cpp


Revision: 229
Author: Zewi
Date: 9:59:05 PM, Tuesday, June 12, 2007
Message:
Added deeds to itmes per lordcorms request!!
----
Modified : /dbScript/static_npcs.3.sql
Modified : /dbScript/swgprecu.1.sql
Modified : /dbScript/swgprecu.sql.changelog.txt


Revision: 228
Author: lordcorm
Date: 6:31:40 PM, Tuesday, June 12, 2007
Message:

----
Added : /Release
Added : /Release/PingServer
Added : /Release/PingServer/BuildLog.htm
Added : /Release/PingServer/PingServer.exe
Added : /Release/PingServer.exe.intermediate.manifest
Added : /Release/SWGPreCU_Ping.cod
Added : /Release/SWGPreCU_Ping.obj
Added : /Release/mt.dep
Added : /Release/vc80.idb


Revision: 227
Author: lordcorm
Date: 6:08:42 PM, Tuesday, June 12, 2007
Message:
not used any more
----
Deleted : /dbScript/BuildingDeeds.4.sql
Deleted : /dbScript/cellobject.sql


Revision: 226
Author: lordcorm
Date: 6:07:37 PM, Tuesday, June 12, 2007
Message:
Made changes to item handling system.....  a temperary fix for equipping stuff, cell objectsare now handled throw the item table.
----
Added : /dbScript/Deeds.sql
Modified : /dbScript/swgprecu.1.sql
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 225
Author: ead
Date: 10:39:09 PM, Monday, June 11, 2007
Message:
06-11-07 EAD			added lordcorms databasedef.h and set it up moddeed existing ussage of _galaxy_id
----
Modified : /ProjectFiles/SWGPreCU.sln
Modified : /ProjectFiles/SWGPreCU.vcproj
Modified : /ProjectFiles/ZoneServer/ZoneServer.vcproj
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 224
Author: ead
Date: 7:58:06 PM, Monday, June 11, 2007
Message:
REVERT TO REV 207
----
Modified : /ProjectFiles/SWGPreCU.sln
Modified : /ProjectFiles/SWGPreCU.vcproj
Modified : /ProjectFiles/ZoneServer/ZoneServer.vcproj
Modified : /dbScript/BuildingDeeds.4.sql
Modified : /dbScript/DevCityBackup.sql
Modified : /dbScript/LoadOrder.txt
Deleted : /dbScript/Planets.6.sql
Deleted : /dbScript/Waypoints.7.sql
Deleted : /dbScript/cellobject.5.sql
Deleted : /dbScript/datapad.sql
Modified : /dbScript/item_template.2.SQL
Modified : /dbScript/static_npcs.3.sql
Modified : /dbScript/swgprecu.1.sql
Modified : /dbScript/swgprecu.sql.changelog.txt
Deleted : /dbScript/tickettable.8.sql
Deleted : /dbScript/tickettable.sql
Added : /smap/Debug/BuildLog.htm(Copy from path: /smap/Debug/BuildLog.htm, Revision, 207
Added : /smap/Debug/mt.dep(Copy from path: /smap/Debug/mt.dep, Revision, 207
Added : /smap/Debug/stree.exe.intermediate.manifest(Copy from path: /smap/Debug/stree.exe.intermediate.manifest, Revision, 207
Added : /smap/Debug/stree.map(Copy from path: /smap/Debug/stree.map, Revision, 207
Modified : /smap/main.cpp
Modified : /smap/smap.suo
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h
Deleted : /src/shared/databasedef.h
Modified : /src/shared/opcodes.h


Revision: 223
Author: ead
Date: 9:05:42 PM, Sunday, June 10, 2007
Message:
06-10-07 EAD			start of name filter rebuild  server works now
fixed build order and start order
PING SERVER SHULD NOT BE BUILT THIS IS CORRECT  
PING SERVER SHULD BE STARTED IN NON DEBUG RELASE MODE  NOMATTER WHAT MODE WE ARE IN
these 2 things are set up properly now
----
Modified : /ProjectFiles/SWGPreCU.sln
Modified : /src/shared/Database.cpp


Revision: 222
Author: lordcorm
Date: 6:35:49 PM, Sunday, June 10, 2007
Message:
Database fixes
----
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h
Modified : /src/shared/databasedef.h


Revision: 221
Author: lordcorm
Date: 5:22:32 PM, Sunday, June 10, 2007
Message:
New SQL update, as ead says do not touch this file without talking to him, YOUR NOT HELPING IF YOUR GOING FAST!
----
Modified : /dbScript/swgprecu.1.sql


Revision: 220
Author: ead
Date: 5:05:08 PM, Sunday, June 10, 2007
Message:
06-10-07 EAD			BROKEN COMMIT FOR MERGE WITH LOARDCORM  
----
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h
Modified : /src/shared/databasedef.h


Revision: 219
Author: maach_ine
Date: 9:32:16 AM, Sunday, June 10, 2007
Message:
FIXED:  Invalid pointer in ZoneServer.vcproj  -- was looking for databasedef.h in the ZoneServer subdirectory instead of the shared subdirectory.

FIXED/PATCHED:  DBConnect::GetPlanets() no longer causes a server crash.  Cause of crash:  Array index out of bounds where i = 128.  Increased size of arrays by 1.
----
Modified : /ProjectFiles/ZoneServer/ZoneServer.vcproj
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 218
Author: ead
Date: 4:10:49 AM, Sunday, June 10, 2007
Message:
FORGOT TO ADD FILE databasedef.h
06-09-07 lordcorm		intial commit  to database.cpp to be moved over 
06-09-07 EAD			added row def file for lordcorm     do not use numbers as iterators for rows use the def name now

-- 06-09-07 EAD removed the swg precu master.sql as part of partal code roll back it may be back after cleanup

fixed build order   pingserver is not bulit by default and shuld be built manualy if you need its exe 
----
Added : /src/shared/databasedef.h


Revision: 217
Author: ead
Date: 4:10:18 AM, Sunday, June 10, 2007
Message:
06-09-07 lordcorm		intial commit  to database.cpp to be moved over 
06-09-07 EAD			added row def file for lordcorm     do not use numbers as iterators for rows use the def name now

-- 06-09-07 EAD removed the swg precu master.sql as part of partal code roll back it may be back after cleanup

fixed build order   pingserver is not bulit by default and shuld be built manualy if you need its exe 
----
Modified : /ProjectFiles/SWGPreCU.sln
Modified : /ProjectFiles/SWGPreCU.vcproj
Modified : /ProjectFiles/ZoneServer/ZoneServer.vcproj
Deleted : /dbScript/SWG Pre CU Master.sql
Modified : /dbScript/swgprecu.sql.changelog.txt
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 216
Author: lordcorm
Date: 12:33:31 AM, Sunday, June 10, 2007
Message:
Database Structures for EAD :D
----
Modified : /src/shared/Database.h


Revision: 215
Author: ead
Date: 12:08:25 AM, Sunday, June 10, 2007
Message:
removed 
bDoesQueryExist(string query);
bDidQueryExecute(string query);
rewrote del item and del charater  latter of witch will only set del flag to true
item shuld dump data to a log file before deleat is run
----
Deleted : /smap/Debug/BuildLog.htm
Deleted : /smap/Debug/mt.dep
Deleted : /smap/Debug/stree.exe.intermediate.manifest
Deleted : /smap/Debug/stree.map
Modified : /smap/main.cpp
Modified : /smap/smap.suo
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 214
Author: ead
Date: 7:30:11 PM, Saturday, June 09, 2007
Message:
-- 06-09-07 EAD ADDED del COLUM TO CHARATER  SET TO 1 IF TOON WAS DELEETED
----
Modified : /dbScript/swgprecu.1.sql
Modified : /dbScript/swgprecu.sql.changelog.txt


Revision: 213
Author: ead
Date: 3:50:43 PM, Saturday, June 09, 2007
Message:
Database.cpp Database.h
fixed canlogin	only uses max of 2 sqlquarrys  encrypt key is recreated in database.cpp at sever start
fixed canlogin	encryption of passwords  works right now
BUG FOUND	DBConnect::GetPlanets()	CAUSES CRASH  commented out its function call
BUG FOUND	DBConnect::InventoryDeed crash if result empty  added if result and fixed result and row names

removed datapad.9.sql  it is integrated with the swgprecu.1.sql

REMOVED  DROP IF EXIST IN ALL SQL FILES

DISTRUCTIVE COMMANDS ARE NOT TO BE AUTOMATED BY SQL FILES  YOU NEED TO STOP AND THINK ABOUT WHAT YOU ARE ABOUT TO DELETE BEFORE YOU DO IT 
DROP COMMANDS ARE NOT ALLOWED IN SQL FILES  FINAL DECISION!!!!!
----
Modified : /dbScript/BuildingDeeds.4.sql
Modified : /dbScript/Planets.6.sql
Modified : /dbScript/Waypoints.7.sql
Modified : /dbScript/cellobject.5.sql
Deleted : /dbScript/datapad.9.sql
Modified : /dbScript/item_template.2.SQL
Modified : /dbScript/static_npcs.3.sql
Modified : /dbScript/swgprecu.1.sql
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 212
Author: lordcorm
Date: 7:44:52 PM, Friday, June 08, 2007
Message:
Fixed the packets for containment message when equiping and unequipping to go to chatrange and not player
----
Modified : /src/ZoneServer/HandleZone.cpp


Revision: 211
Author: plasmaflow
Date: 7:38:30 PM, Friday, June 08, 2007
Message:
Updated sql Files
Change log updated
LoadOrder.txt updated
We have 9 individual files to load as of this commit.

SWG Pre CU Master.sql has been updated and tested to load.
----
Modified : /dbScript/LoadOrder.txt
Modified : /dbScript/SWG Pre CU Master.sql
Added : /dbScript/datapad.9.sql
Modified : /dbScript/swgprecu.sql.changelog.txt
Added : /dbScript/tickettable.8.sql


Revision: 210
Author: lordcorm
Date: 7:15:00 PM, Friday, June 08, 2007
Message:
Updated
--------
Made Datapad db driven so update your DB's with datapad.sql.

Made it so you can equip and unequip items in your inventory and it will save to db.

----
Modified : /dbScript/cellobject.5.sql
Added : /dbScript/datapad.sql
Added : /dbScript/tickettable.sql
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 209
Author: plasmaflow
Date: 4:01:43 PM, Friday, June 08, 2007
Message:
Corrected Alaguerranos retrieval of the coordinates when the new waypoint button on the data pad was pressed. X and Y were inverted.

changed waypoint save function to accept the name of the waypoint since the /way command can pass the name.

/way x y command op codes have been added.
----
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 208
Author: plasmaflow
Date: 3:42:14 PM, Friday, June 08, 2007
Message:
NEW SQL FILES NEEDED TO WORK.

ADDED A NEW SQL MASTER FILE I WILL KEEP UP TO DATE AS NEW TABLES ARISE TO LOAD A SINGLE SCRIPT.

Corrected bug where females would get no items iven if in the template table.

Waypoints table is in.
Planets table is in.
cellobjects 5 file is updates.
LoadOrder.txt updated.

SQL Change log is updated,
----
Modified : /dbScript/BuildingDeeds.4.sql
Modified : /dbScript/DevCityBackup.sql
Modified : /dbScript/LoadOrder.txt
Added : /dbScript/Planets.6.sql
Added : /dbScript/SWG Pre CU Master.sql
Added : /dbScript/Waypoints.7.sql
Added : /dbScript/cellobject.5.sql
Modified : /dbScript/item_template.2.SQL
Modified : /dbScript/swgprecu.1.sql
Modified : /dbScript/swgprecu.sql.changelog.txt
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h
Modified : /src/shared/opcodes.h


Revision: 207
Author: nogard
Date: 3:48:28 AM, Friday, June 08, 2007
Message:
added in OpenContainers and THe Posture update and some goodies 
----
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/PacketFactory.h
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/shared/Database.cpp
Modified : /src/shared/opcodes.h


Revision: 206
Author: nelk
Date: 9:57:38 PM, Thursday, June 07, 2007
Message:
crafting logs ftw
----
Added : /Documents/Packets/Crafting/crafting.txt
Added : /Documents/Packets/Crafting/crafting2.txt
Added : /Documents/Packets/Crafting/craftingcopperinc.txt


Revision: 205
Author: Alaguerrano
Date: 5:55:33 PM, Thursday, June 07, 2007
Message:
**First Step to get Create New Waypoint**
By now the zone server console shows, the charID who wants to create a new waypoint, and the coords and planet of the new waypoint.
Changes:
-In opcodes.h Added requestwaypointatposition opcode in CommandQueueEnqueue_CRCs
-In Constants.h Added requestwaypointatposition in PacketIdentifyer CommandQueueEnqueues[]
-In ObjControllers.cpp Added HANDLE_ObjController_CommandQueueEnqueue_requestwaypointatposition function.
By now, it shows in the zone server console the CharacterID who requests the new waypoint, the coords and the planet of the new waypoint.
TODO: Driven from DB. Need a waypoint table. Code the answer to the client from the server.
-In ZoneClient.h Added void HANDLE_ObjController_CommandQueueEnqueue_requestwaypointatposition(ByteBuffer &Packet);
----
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/shared/opcodes.h


Revision: 204
Author: Interesting
Date: 5:37:10 PM, Thursday, June 07, 2007
Message:
Added the missing CRC.

Thanks zewi.
----
Modified : /dbScript/item_template.2.SQL


Revision: 203
Author: meanmon13
Date: 5:23:17 PM, Thursday, June 07, 2007
Message:
hopefully out of order packets should not be an issue... its a quick fix not a perminate solution but it shouldn't be an issue
----
Modified : /src/ZoneServer/ZoneClient.cpp


Revision: 202
Author: Interesting
Date: 2:36:47 PM, Thursday, June 07, 2007
Message:
Starter items are now named correctly and added to the bottom of the database as plasmaflow suggested.
Final phase will be tomorrow; I'm going to verify the entries and update the starting item table.
----
Modified : /dbScript/item_template.2.SQL


Revision: 201
Author: ead
Date: 10:44:52 PM, Wednesday, June 06, 2007
Message:
06-06-07 EAD FIXED NULLS IN `static_npcs` IE  C++ CANT DO NULLS IT CRASHES THE SERVER  DONT USE THEM PLS  THANKS
----
Modified : /dbScript/static_npcs.3.sql
Modified : /dbScript/swgprecu.sql.changelog.txt


Revision: 200
Author: Zewi
Date: 9:28:11 PM, Wednesday, June 06, 2007
Message:
fixed naboo player house deed!
----
Modified : /dbScript/swgprecu.1.sql


Revision: 199
Author: Zewi
Date: 8:43:19 PM, Wednesday, June 06, 2007
Message:
building database update
----
Modified : /dbScript/BuildingDeeds.4.sql


Revision: 198
Author: Zewi
Date: 8:37:37 PM, Wednesday, June 06, 2007
Message:
Added to the BuildingDeeds Sql file!
----
Modified : /dbScript/BuildingDeeds.4.sql
Modified : /dbScript/swgprecu.sql.changelog.txt


Revision: 197
Author: lordcorm
Date: 8:30:07 PM, Wednesday, June 06, 2007
Message:
DB stuff for adding NPC's to cells!
----
Modified : /dbScript/static_npcs.3.sql
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 196
Author: nogard
Date: 7:46:38 PM, Wednesday, June 06, 2007
Message:
added the fixes for lordcorm in SpawnCreature 
buildings should no longer spawn each time a player logs in
----
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.h


Revision: 195
Author: maach_ine
Date: 7:21:19 PM, Wednesday, June 06, 2007
Message:
Bug squashing: 

Fixed client crash when player character list larger than 4 or 5 players.  (Tested for list up to 10 characters long).

We no longer send the character's last name in BUILD_EnumerateCharacterId if the character's last name is " " or a 0-length string.  (Fix for Wookiees)

HANDLE_LoginClusterStatus now sends back the actual status of the Zone Server according to the database (was previously sending back an online status no matter what.)
----
Modified : /src/LoginServer/HandleLogin.cpp
Modified : /src/LoginServer/PacketFactory.cpp


Revision: 194
Author: lordcorm
Date: 6:05:47 PM, Wednesday, June 06, 2007
Message:
Woops forgot the new .sql file for cellobjects. Sorry meanmon for the double commit
----
Added : /dbScript/cellobject.sql


Revision: 193
Author: lordcorm
Date: 6:04:57 PM, Wednesday, June 06, 2007
Message:
Fixed PlasmaFlows function to update player data in the Database.

Added cell object spawning from DB! Player Housing soon! Yay!
----
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/ZoneClient.cpp
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 192
Author: meanmon13
Date: 5:18:31 PM, Wednesday, June 06, 2007
Message:
Housekeeping changes and new system for CommandQueueEnqueue :-D
----
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/shared/ByteBuffer.cpp
Modified : /src/shared/ByteBuffer.h
Modified : /src/shared/opcodes.h


Revision: 191
Author: plasmaflow
Date: 3:09:20 PM, Wednesday, June 06, 2007
Message:
Dev City File updated first rev before i implement the whole city. Sorry city over water cannot be done. Due to  buildings not meshing up with the platforms over water. When exiting the building on a platform over water you end up in the water.

City is on the cove now.

Default spawn coords will randomize around the new starport.
changed several log entries from printing to the console. will keep on changin more as i can.

Player update now will check if coords are cell based when cell coords are passed i will update the function to save cell instead of world coords.

Npc table contains the ticket droid. Removed the hardcoded npc from code and added it to the npc table.
NOTE NPC TABLE HAS TO BE LOADED

*****BUG******
If an account has 4 characters or more defined the client will crash on login. Aparently enum character will pass something wrong to the client.
----
Modified : /dbScript/DevCityBackup.sql
Modified : /dbScript/static_npcs.3.sql
Modified : /dbScript/swgprecu.sql.changelog.txt
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.cpp
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 190
Author: meanmon13
Date: 3:01:20 PM, Wednesday, June 06, 2007
Message:
ChatSendToRoom is now handled
----
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/shared/opcodes.h


Revision: 189
Author: maach_ine
Date: 1:45:21 PM, Wednesday, June 06, 2007
Message:
Housekeeping.  Removed a couple of debug printfs that are no longer needed.
----
Modified : /src/ZoneServer/HandleZone.cpp


Revision: 188
Author: Interesting
Date: 12:40:36 PM, Wednesday, June 06, 2007
Message:
Phase 2 of corrections to the starting items. This was done with both zewi, plasmaflow, AND maach's approval. 

Please do not un-do this work, or modify it in any way until I finish phase 3 tomorrow.
----
Modified : /dbScript/item_template.2.SQL


Revision: 187
Author: Interesting
Date: 11:39:45 AM, Wednesday, June 06, 2007
Message:
Deleted all the names from the item table in preparation for adding new entries for starter items.

Talk to plasmaflow before yelling at me :P
----
Modified : /dbScript/item_template.2.SQL


Revision: 186
Author: maach_ine
Date: 11:34:36 AM, Wednesday, June 06, 2007
Message:
Fixed character creation crash.  Issue was:

If a character was created with no hair, we were attempting to read the hair customization data anyway.  This involved creating arrays with invalid lengths, writing data to non-existant arrays, performing replace functions on empty strings, etc.  We now check to see if the hair object exists before we try to read any other hair data.  If there is a hair object, great.  If not, we skip all that.  Every character can now be created, with or without hair (although some currently have no starter items.)
----
Modified : /src/ZoneServer/HandleZone.cpp


Revision: 185
Author: Interesting
Date: 11:09:55 AM, Wednesday, June 06, 2007
Message:
Deleted obsolete table from the dbscript folder.
----
Deleted : /dbScript/starter_items.sql
Modified : /dbScript/swgprecu.sql.changelog.txt


Revision: 184
Author: Interesting
Date: 9:35:23 AM, Wednesday, June 06, 2007
Message:
Cleaned the change log. Come on people, start being a little more neat when updating it.
----
Modified : /dbScript/swgprecu.sql.changelog.txt


Revision: 183
Author: meanmon13
Date: 4:15:18 AM, Wednesday, June 06, 2007
Message:
swoops will be destroyed when dismounting... this is a temprarary fix until it can be figured out why remounting does not work
----
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/PacketFactory.h
Modified : /src/shared/opcodes.h


Revision: 182
Author: meanmon13
Date: 2:33:32 AM, Wednesday, June 06, 2007
Message:
swoop movement test
----
Modified : /src/ZoneServer/ObjControllers.cpp


Revision: 181
Author: meanmon13
Date: 2:13:35 AM, Wednesday, June 06, 2007
Message:
Swoop movement fix :-D
----
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/PacketFactory.cpp


Revision: 180
Author: meanmon13
Date: 1:41:40 AM, Wednesday, June 06, 2007
Message:
swoop movment test
----
Modified : /src/ZoneServer/PacketFactory.cpp


Revision: 179
Author: meanmon13
Date: 1:27:46 AM, Wednesday, June 06, 2007
Message:
swoop movment test
----
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/PacketFactory.cpp


Revision: 178
Author: maach_ine
Date: 1:18:40 AM, Wednesday, June 06, 2007
Message:
Fixed:

Creo3 packet on NPC spawn crashing client.
NPCs having same ham as you.
Fellow players having same HAM as you.
Fellow players having same hair as you (if they did).
----
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.cpp
Modified : /src/ZoneServer/ZoneClient.h


Revision: 177
Author: meanmon13
Date: 12:39:56 AM, Wednesday, June 06, 2007
Message:
The swoop that is called from the datapad is now mountable via the /command .... /mount   it can be dismounted via /dismount   it can not be destroyed at the momement soon to be remidied!!! >.< swoop movment should also work
----
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/PacketFactory.cpp


Revision: 176
Author: ead
Date: 11:45:30 PM, Tuesday, June 05, 2007
Message:
added numbers to sql files  IF YOU WANT TO ADD A FILE PEPOLE MUST SOURCE  YOU MUST DO  SQLFILENAME.NUMBER/ORDER.SQL  AND IT MUST BE RUN BY 2 OTHER DEVS FIRST 
----
Added : /dbScript/BuildingDeeds.4.sql(Copy from path: /dbScript/BuildingDeeds.sql, Revision, 175
Deleted : /dbScript/BuildingDeeds.sql
Added : /dbScript/item_template.2.SQL(Copy from path: /dbScript/item_template.SQL, Revision, 175
Deleted : /dbScript/item_template.SQL
Modified : /dbScript/profession_skill_tree.prelemnary.sql
Added : /dbScript/static_npcs.3.sql(Copy from path: /dbScript/static_npcs.sql, Revision, 175
Deleted : /dbScript/static_npcs.sql
Added : /dbScript/swgprecu.1.sql(Copy from path: /dbScript/swgprecu.sql, Revision, 175
Deleted : /dbScript/swgprecu.sql


Revision: 175
Author: nelk
Date: 6:59:31 PM, Tuesday, June 05, 2007
Message:
Added Planetary Map Locations.Rtf
----
Added : /Documents/Packets/NGE
Added : /Documents/Packets/NGE/Planetary Map Locations.Rtf


Revision: 174
Author: nogard
Date: 4:58:35 PM, Tuesday, June 05, 2007
Message:
Added LORDcorms Travel stuff for him to fix and make DB driven
----
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/PacketFactory.h
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/shared/opcodes.h
Modified : /src/shared/tlog.cpp


Revision: 173
Author: Alaguerrano
Date: 4:20:35 PM, Tuesday, June 05, 2007
Message:
-Third time i have committed my Delete items of Inventory from DB, and from UI.
Please, dont delete my work again. :(
------
Alaguerrano
----
Modified : /src/ZoneServer/ObjControllers.cpp


Revision: 172
Author: maach_ine
Date: 1:19:31 PM, Tuesday, June 05, 2007
Message:
Updated new character start coordinates as per Meanmon.
----
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/PacketFactory.cpp


Revision: 171
Author: maach_ine
Date: 1:16:11 PM, Tuesday, June 05, 2007
Message:
Bugfixes
----
Modified : /dbScript/item_template.SQL
Modified : /dbScript/swgprecu.sql


Revision: 170
Author: plasmaflow
Date: 12:37:03 PM, Tuesday, June 05, 2007
Message:
**** YOU WILL NEED TO LOAD NEW swgprecu.sql FILE ******

We now update player position as we move based on a settable tick counter in each galaxy.
The default value is 10000 in a new column in the database for the galaxy table. column added at the end of the Galaxy table.
Setting default is 10000 but may be settable, recommended not to go below 200 and to be bumped up as more players play in the server or updates may overwhelm the server, also if you don't move no update is done until the player inactivity message is sent. 

Added a new set of resource tables to the main sql file as per maach_ines file.

Added a new File for letting you know what to load so your server works. File name is : LoadOrder.txt
We need to keep this file up to date. Im working on creating a script file that will load all the files for you.

all database changes are documented in the swgprecu.sql.changelog.txt file.

Various routines not used have been removed many have been documented. comments on all change logs have been added. (hope i didnt forget any).

This ocmpile has been tested and is stable needs multizone testing tho.
----
Added : /dbScript/LoadOrder.txt
Modified : /dbScript/swgprecu.sql
Modified : /dbScript/swgprecu.sql.changelog.txt
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 169
Author: maach_ine
Date: 12:17:04 PM, Tuesday, June 05, 2007
Message:
Updated design of ResourceData.sql  based on feedback from Nogard & PlasmaFlow.
----
Modified : /dbScript/ResourceData.sql


Revision: 168
Author: maach_ine
Date: 11:13:06 AM, Tuesday, June 05, 2007
Message:
Upload of Resources .sql file for merging into the main SQL script.  First step in getting spawnable resources, now that we have surveying and are working on crafting.
----
Added : /dbScript/ResourceData.sql


Revision: 167
Author: plasmaflow
Date: 9:27:09 AM, Tuesday, June 05, 2007
Message:
Documented various functions as per eads request.
Corrected problem with names containing ' character.
CreateNewCharacter in Database.cpp now checks for the presence of the ' character and inserts a literal \ so my sql will store the ' as a literal and not interpret it to be a string delimiter.

This check is also done for the character bio where all ' characters will be corrected to be \' when sent to the db.

Updated Dev City file in preparation for Dev City in northen Naboo Cove.

Updated HandleZone.cpp, somone added 60 to the function that requests buildings to be spawned. 
This was being passed SpawnBuilding(((60 * it->sBuildingID)+BUILDINGS_OFFSET),it->sBuildingCRC , it->cellCount, it->oN, it->oS, it->oE, it->oW, it->bX, it->bZ, it->bY);
in HANDLE_SelectCharacter.
SpawnBuilding function already adds 60 to the building id to correct for cell spacing between buildings. if you need to know what the database id of a building is you need to use the following formula.

((sBuildingID - BUILDINGS_OFFSET) / 60)

Login server now sets the population in the db to 0 when booting up.
----
Modified : /src/LoginServer/LoginServer.cpp
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 166
Author: meanmon13
Date: 3:54:17 AM, Tuesday, June 05, 2007
Message:
Swoop spawning is in :-D improved from the last time it was implemented
----
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/PacketFactory.h
Modified : /src/ZoneServer/ZoneClient.cpp
Modified : /src/ZoneServer/ZoneClient.h


Revision: 165
Author: ead
Date: 12:27:43 AM, Tuesday, June 05, 2007
Message:
ADDED TO DO LIST AND CUPLE CLEANUPS TO Database.cpp 

EACH FUNCTION NOW HAS SOME INFO ON WHATS NEEDED TO MAKE IT MORE READABLE  AND FIGURE OUT PROGRAM FLOW

THIS IS REQUIRED AND WE NEED TO START DOCUMENTING MORE    IF YOUR OUT OF THE LOOP FOR A DAY YOU CAN GET WEEKS BEHIND QUICKLY WITHOUT DOCUMENTAION
----
Modified : /src/shared/Database.cpp


Revision: 164
Author: nelk
Date: 9:50:44 PM, Monday, June 04, 2007
Message:
Breaks for Crafting, Surveying and Vendors(Bazaar)
----
Added : /Documents/Packets/Bazaar/Client-Server/AuctionQueryHeadersMessage.Rtf
Added : /Documents/Packets/Bazaar/Server-Client/AuctionQueryHeadersResponseMessage.Rtf
Added : /Documents/Packets/Crafting
Added : /Documents/Packets/Crafting/ObjControllerMessage_requestcraftingsession.Rtf
Added : /Documents/Packets/Survey
Added : /Documents/Packets/Survey/Break For entire Process
Added : /Documents/Packets/Survey/Break For entire Process/Survey Break.Rtf


Revision: 163
Author: nelk
Date: 6:21:25 PM, Monday, June 04, 2007
Message:
Fixed text error
----
Modified : /Documents/Packets/Bazaar/Server-Client/IsVendorOwnerResponseMessage.Rtf


Revision: 162
Author: lordcorm
Date: 3:30:10 PM, Monday, June 04, 2007
Message:
Added Update to the BuildingDeeds.sql file so it works correctly.
Added parts to the soe disconnect function so it save character positions, Plasma will be taking care of the rest. Also added to the Spawning Packet for SceneStart packet to use the players coords in the database and use the planet_id in the database so it will now load your characters positions from the database and save them after you log out and load the correct planet :D cheers!
----
Modified : /dbScript/BuildingDeeds.sql
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.cpp
Modified : /src/shared/Database.cpp


Revision: 161
Author: nelk
Date: 3:17:01 PM, Monday, June 04, 2007
Message:
New structure for packet documents added :D
Added what little actual plain text packet documents and structs I had to the folder
----
Added : /Documents/Packets/Bazaar
Added : /Documents/Packets/Bazaar/Client-Server
Added : /Documents/Packets/Bazaar/Server-Client
Added : /Documents/Packets/Bazaar/Server-Client/IsVendorOwnerResponseMessage.Rtf
Added : /Documents/Packets/Client-Server
Added : /Documents/Packets/Client-Server/ObjControllerMessage
Added : /Documents/Packets/Client-Server/ObjControllerMessage/getattributesbatch
Added : /Documents/Packets/Client-Server/ObjControllerMessage/getattributesbatch/getattributesbatch.Rtf
Added : /Documents/Packets/Client-Server/ObjControllerMessage/getattributesbatch/getattributesbatch.doc
Added : /Documents/Packets/Client-Server/ObjControllerMessage/getattributesbatch/getattributesbatch.txt
Added : /Documents/Packets/Misc
Added : /Documents/Packets/Misc/Place_structure.Rtf
Added : /Documents/Packets/Server-Client
Added : /Documents/Packets/Server-Client/AttributeListMessage
Added : /Documents/Packets/Server-Client/AttributeListMessage/AttributeListMessage.Rtf
Added : /Documents/Packets/Server-Client/AttributeListMessage/AttributeListMessage.doc
Added : /Documents/Packets/Server-Client/AttributeListMessage/AttributeListMessage.txt
Added : /Documents/Packets/Server-Client/ErrorMessage
Added : /Documents/Packets/Server-Client/ErrorMessage/ErrorMessage.Rtf
Added : /Documents/Packets/Server-Client/ObjControllerMessage
Added : /Documents/Packets/Server-Client/ObjControllerMessage/CommandAddToQueue
Added : /Documents/Packets/Server-Client/ObjControllerMessage/CommandAddToQueue/CommandAddToQueue.Rtf
Added : /Documents/Packets/Server-Client/ObjControllerMessage/CommandRemoveFromQueue
Added : /Documents/Packets/Server-Client/ObjControllerMessage/CommandRemoveFromQueue/CommandRemoveFromQueue.rtf
Added : /Documents/Packets/Server-Client/PlayClientEffectObjectMessage
Added : /Documents/Packets/Server-Client/PlayClientEffectObjectMessage/PlayClientEffectObjectMessage.rtf
Added : /Documents/Packets/Server-Client/Unknown WTF packets
Added : /Documents/Packets/Server-Client/Unknown WTF packets/Delta Play 1.rtf
Added : /Documents/Packets/Server-Client/Unknown WTF packets/ObjCtrl 1.rtf
Added : /Documents/Packets/ToDo


Revision: 160
Author: nelk
Date: 3:12:04 PM, Monday, June 04, 2007
Message:
Reorder docs
----
Deleted : /Documents/Bazaar
Added : /Documents/Packets


Revision: 159
Author: nelk
Date: 3:00:48 PM, Monday, June 04, 2007
Message:

----
Added : /Documents/Bazaar
Added : /Documents/Bazaar/IsVendorOwnerResponseMessage.Rtf


Revision: 158
Author: lordcorm
Date: 12:16:55 PM, Monday, June 04, 2007
Message:
Added database building spawning from database with right cell counts.
Added cell_num to the BuildingDeeds.sql file to get the right cell count! YAY!
----
Modified : /dbScript/BuildingDeeds.sql
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/shared/Database.cpp


Revision: 157
Author: ead
Date: 9:13:39 PM, Sunday, June 03, 2007
Message:
R0LL BACK TO REV 147 
----
Deleted : /Documents/Bosoa_db_test.xls
Replacing : /dbScript/starter_items.sql(Copy from path: /dbScript/starter_items.sql, Revision, 147
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/PacketFactory.h
Modified : /src/ZoneServer/ZoneClient.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/shared/opcodes.h


Revision: 156
Author: ead
Date: 6:17:01 PM, Sunday, June 03, 2007
Message:
ROLLBACK OF 155 AT MEAMONS REQUEST
----
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/OverTime.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/PacketFactory.h
Modified : /src/ZoneServer/ZoneClient.h


Revision: 155
Author: meanmon13
Date: 5:48:11 PM, Sunday, June 03, 2007
Message:
swoops can now be spawned and ridden
----
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/OverTime.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/PacketFactory.h
Modified : /src/ZoneServer/ZoneClient.h


Revision: 154
Author: meanmon13
Date: 2:17:59 PM, Sunday, June 03, 2007
Message:
Submitted Boasa's datapack work... its incomplete but it contains a shit load of data
----
Added : /Documents/Bosoa_db_test.xls


Revision: 153
Author: Interesting
Date: 1:12:00 PM, Sunday, June 03, 2007
Message:
Err..apparently this was the new version of the table. Sorry *blush*.
----
Added : /dbScript/starter_items.sql


Revision: 152
Author: Interesting
Date: 1:10:46 PM, Sunday, June 03, 2007
Message:
Removed my starter item table as it is obsolete and was making the dbscript folder kind of confusing.
----
Deleted : /dbScript/starter_items.sql


Revision: 151
Author: Alaguerrano
Date: 9:16:16 AM, Sunday, June 03, 2007
Message:
**LORDCORM DONT DELETE MY WORK AGAIN!!!!!!!! DO YOU HAVE A PROBLEM WITH ME OR WITH SVN?**
I dont know why Lordcorm in HIS rev 147 COMMITED OBJCONTROLLERS,CPP without before donwload THE SAME FILE FROM rev 146 MINE.
Result: My work of rev 146 dont work. 

PLEASE, BEFORE COMMIT, DOWNLOAD THE LASTEST REV.
THIS IS THE SECOND TIME I SAY YOU THE SAME. THE NEXT TIME YOU WILL MAKE ME WORK TWICE I KILL YOUUUUUUUU!!!!
:P
----
Modified : /src/ZoneServer/ObjControllers.cpp


Revision: 150
Author: meanmon13
Date: 7:30:16 AM, Sunday, June 03, 2007
Message:
Static and Intangable items are now in... this means non tano world items and datapad items now work.... also swoops are in with one exception... the swoop will not spawn :-( its sending the packets but nothing is happening... this needs to be looked into further
----
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/PacketFactory.h
Modified : /src/ZoneServer/ZoneClient.cpp
Modified : /src/ZoneServer/ZoneClient.h


Revision: 149
Author: ead
Date: 2:51:40 AM, Sunday, June 03, 2007
Message:

----
Deleted : /smap/Debug/main.obj
Deleted : /smap/Debug/stree.ilk
Deleted : /smap/Debug/stree.pdb
Deleted : /smap/Debug/vc80.idb
Deleted : /smap/Debug/vc80.pdb


Revision: 148
Author: nogard
Date: 2:13:21 AM, Sunday, June 03, 2007
Message:
Group Chat Needs to be handle but the id is 1337
----
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/shared/opcodes.h


Revision: 147
Author: lordcorm
Date: 1:22:07 AM, Sunday, June 03, 2007
Message:
Spawning Buildings from Deeds work now :D Spawning Static NPC's! :D and Credits from DB! :D
Lordcorm is the pwnsauce!
Any question contact me!
----
Modified : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/bin/Debug/log.log
Added : /dbScript/BuildingDeeds.sql
Modified : /dbScript/swgprecu.sql
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/PacketFactory.h
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 146
Author: Alaguerrano
Date: 12:33:01 AM, Sunday, June 03, 2007
Message:
Little fixed with Delete items of inventory from UI.
----
Modified : /src/ZoneServer/ObjControllers.cpp


Revision: 145
Author: Alaguerrano
Date: 12:21:18 AM, Sunday, June 03, 2007
Message:
**Delete Items of inventory from DB and UI**
-In Database.cpp added new bool function named DeleteItem()
This bool function use serial_item, return true if the item have been deleted from DB and false if not.
-In Database.h added bool DeleteItem(uint64 serial_item);
-In ObjControllers.cpp added Change Log for this File.
Added GNU General Public License for this File.
Added case 0xE7AEC4FB: { //Delete Item
Delete the item of inventory from DB and from UI.
//TODO Make a System Message 'Item Deleted' in-game.
----
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 144
Author: nogard
Date: 11:25:00 PM, Saturday, June 02, 2007
Message:
LordcormsStuff
----
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/PacketFactory.cpp


Revision: 143
Author: ead
Date: 10:03:18 PM, Saturday, June 02, 2007
Message:
msic debug additions  SMAP
----
Modified : /smap/Debug/BuildLog.htm
Modified : /smap/Debug/main.obj
Modified : /smap/Debug/mt.dep
Modified : /smap/Debug/stree.exe
Modified : /smap/Debug/stree.ilk
Modified : /smap/Debug/stree.map
Modified : /smap/Debug/stree.pdb
Modified : /smap/Debug/vc80.idb
Modified : /smap/Debug/vc80.pdb
Modified : /smap/main.cpp
Added : /smap/smap.sln
Added : /smap/smap.suo
Modified : /smap/stree.ncb
Deleted : /smap/stree.sln
Deleted : /smap/stree.suo
Modified : /smap/stree.vcproj


Revision: 142
Author: ead
Date: 9:54:47 PM, Saturday, June 02, 2007
Message:
added smap baseline simiworking demo
----
Added : /smap
Added : /smap/Debug
Added : /smap/Debug/BuildLog.htm
Added : /smap/Debug/main.obj
Added : /smap/Debug/mt.dep
Added : /smap/Debug/stree.exe
Added : /smap/Debug/stree.exe.intermediate.manifest
Added : /smap/Debug/stree.ilk
Added : /smap/Debug/stree.map
Added : /smap/Debug/stree.pdb
Added : /smap/Debug/vc80.idb
Added : /smap/Debug/vc80.pdb
Added : /smap/Release
Added : /smap/Release/BuildLog.htm
Added : /smap/Release/vc80.idb
Added : /smap/fptime.h
Added : /smap/main.cpp
Added : /smap/stree.ncb
Added : /smap/stree.sln
Added : /smap/stree.suo
Added : /smap/stree.vcproj
Added : /smap/stree.vcproj.LANMASTERCMD.pat.user


Revision: 141
Author: zewi
Date: 9:01:12 PM, Saturday, June 02, 2007
Message:
All starter Items Have Names!
----
Modified : /dbScript/item_template.SQL
Modified : /dbScript/item_template.ods
Modified : /dbScript/swgprecu.sql
Modified : /dbScript/swgprecu.sql.changelog.txt


Revision: 140
Author: meanmon13
Date: 6:23:40 PM, Saturday, June 02, 2007
Message:
Players will now be removed from zone when they disconnect 

Also spat text will no longer fully generate an emote when "lol"...etc is
----
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/PacketFactory.h
Modified : /src/ZoneServer/ZoneClient.cpp
Modified : /src/shared/opcodes.h


Revision: 139
Author: meanmon13
Date: 4:51:21 PM, Saturday, June 02, 2007
Message:
Emotes are in :-D
----
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/PacketFactory.h
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/shared/opcodes.h


Revision: 138
Author: nogard
Date: 4:42:10 PM, Saturday, June 02, 2007
Message:
Added in Building From deeds
----
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/PacketFactory.h
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/shared/opcodes.h


Revision: 137
Author: zewi
Date: 4:31:30 PM, Saturday, June 02, 2007
Message:
item_template is now its own MSQl file. 
Starter items are now DONE completly 
----
Modified : /dbScript/swgprecu.sql.changelog.txt


Revision: 136
Author: zewi
Date: 4:29:53 PM, Saturday, June 02, 2007
Message:

----
Modified : /dbScript/item_template.SQL
Modified : /dbScript/swgprecu.sql
Modified : /dbScript/swgprecu.sql.changelog.txt


Revision: 135
Author: ead
Date: 2:41:35 PM, Saturday, June 02, 2007
Message:
!!!!!!!!!I WILL CASTRATE ANYONE WHO DOSE NOT WRITE ALL CHANGES IN DETAL DONE TO SQL IN THE CHANGE LOG AND SVN!!!!!!!!!!!!
-- 06-02-07 ead		THE FOLOWING PEPOLE HAVE FAILED TO UPDATE THE SQL LOG AFTER MAKING CHANGES
MEANMON13  MOVED THE ITEM_TEMPLATE OVER TO THE WRONG FILE   AND DIDNT NOTE THE CHANGE ANYWARE
CHANGES HAVE BEEN UNDONE  AS IT SHULD OF NEVER BEEN MOVED OVER 
!!!!!!!!!I WILL CASTRATE ANYONE WHO DOSE NOT WRITE ALL CHANGES IN DETAL DONE TO SQL!!!!!!!!!!!!
----
Modified : /dbScript/swgprecu.sql
Modified : /dbScript/swgprecu.sql.changelog.txt


Revision: 134
Author: lordcorm
Date: 2:21:55 PM, Saturday, June 02, 2007
Message:
Nogard's InventoryDeed() function to check to see if the item id is a deed :) get us houses NOW! :P
----
Modified : /dbScript/DevCityBackup.sql
Modified : /dbScript/swgprecu.sql
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 133
Author: zewi
Date: 2:19:44 PM, Saturday, June 02, 2007
Message:

----
Modified : /dbScript/item_template.SQL
Modified : /dbScript/item_template.ods
Modified : /dbScript/swgprecu.sql.changelog.txt


Revision: 132
Author: meanmon13
Date: 1:52:22 PM, Saturday, June 02, 2007
Message:
Weapons can now be spawned :-p Booya!
----
Modified : /dbScript/swgprecu.sql
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/PacketFactory.h


Revision: 131
Author: lordcorm
Date: 11:30:42 AM, Saturday, June 02, 2007
Message:
You will now see other people spawn with there equiped items!
----
Modified : /src/ZoneServer/PacketFactory.cpp


Revision: 130
Author: zewi
Date: 2:51:14 AM, Saturday, June 02, 2007
Message:
Starter items, please read Changelog for update!
----
Modified : /dbScript/item_template.ods
Modified : /dbScript/swgprecu.sql
Modified : /dbScript/swgprecu.sql.changelog.txt


Revision: 129
Author: zewi
Date: 2:03:03 AM, Saturday, June 02, 2007
Message:
starter items update
----
Modified : /dbScript/swgprecu.sql


Revision: 128
Author: lordcorm
Date: 12:56:51 AM, Saturday, June 02, 2007
Message:
fix!
----
Modified : /src/ZoneServer/PacketFactory.cpp


Revision: 127
Author: zewi
Date: 12:39:35 AM, Saturday, June 02, 2007
Message:
starter Items
----
Modified : /dbScript/swgprecu.sql
Modified : /dbScript/swgprecu.sql.changelog.txt


Revision: 126
Author: Alaguerrano
Date: 10:26:54 PM, Friday, June 01, 2007
Message:
**Deleted Character´s items from DB when have been deleted the Chracter in Character Selection**
 Before, when you had been deleted a Character (for expample: character_id=25) from DB in Character Selection, and you made a new Character (With the same character_id like the other old Character), the inventory show twice items, because the old items from the old Character havent been deleted.
Now works correct!!
TODO: In item table from DB it is necessary add galaxy_id field. Now the function DeleteCharacter() use only the field character_id to delete the Character´s items, the correct way it is using both fields: character_id and galaxy_id in item table from DB, because it is possible that there will have two Characters with the same character_id and different galaxy_id.
----
Modified : /src/shared/Database.cpp


Revision: 125
Author: meanmon13
Date: 5:03:29 PM, Friday, June 01, 2007
Message:
Added bitmask support! read the comments in Constants.h for intructions on how to use bitmasks

Fixed the issue with hair...a few other housekeeping changes
----
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/shared/Common.h
Modified : /src/shared/opcodes.h


Revision: 124
Author: plasmaflow
Date: 12:30:17 PM, Friday, June 01, 2007
Message:
The function for adding the starter items needed
to have some safety if we didnt find items to give to the player. The  function now checks to see if items were returned or not.
----
Modified : /src/shared/Database.cpp


Revision: 123
Author: Alaguerrano
Date: 11:05:33 AM, Friday, June 01, 2007
Message:
I dont know why Lordcorm commited rev 115 without before donwload my rev 114.
Result: My work of rev 114 dont work for him. He updated a Database.cpp in rev 115 older, because he didnt download my rev 114 before he updated his rev.
My rev 114 worked perfect "Delete Character from DB, in Character Selection"
PLEASE, BEFORE OF COMMIT, DOWNLOAD THE LASTEST REV.
----
Modified : /src/shared/Database.cpp


Revision: 122
Author: plasmaflow
Date: 9:57:51 AM, Friday, June 01, 2007
Message:
Corrected starter_items.sql file
change log updated.

profession names were saved like

crafting_artisan_novice
the client passes
crafting_artisan

seems _novice suffix is not passed.
----
Modified : /dbScript/starter_items.sql
Modified : /dbScript/swgprecu.sql.changelog.txt


Revision: 121
Author: plasmaflow
Date: 9:46:28 AM, Friday, June 01, 2007
Message:
various corrections and updates regarding starting items.
column profession was spelled proffesion so sql query did never find items to add to the toons.
Comments on changelog
----
Modified : /dbScript/item_template.SQL
Modified : /dbScript/starter_items.sql
Modified : /dbScript/swgprecu.sql
Modified : /dbScript/swgprecu.sql.changelog.txt


Revision: 120
Author: meanmon13
Date: 4:40:44 AM, Friday, June 01, 2007
Message:
Fixed the issue with hair not loading at all... problem was that the HAIR_OFFSET was not being applyed to the id.. someone made up an offset that conflicted with the inventory id....

ALSO

zoneserver crashs during login... on lines 861 and 862 of PacketFactory

		QRow = mysql_fetch_row(QResult);
		SpawnItem(it->equiped ,ObjID, it->serial+ITEM_OFFSET, atof(QRow[8]) ," ", QRow[3], QRow[3],0,0,0,1,0,0,0,InventoryID,false,false);

the error is an Access Violation! please fix this because we can not zone currently...

same error accurrs during character creation 
on line 1402 of Database.cpp
	while((IRow = mysql_fetch_row(IResult)) != NULL)

this is on a fresh revision and freshly sources database
----
Modified : /src/ZoneServer/PacketFactory.cpp


Revision: 119
Author: meanmon13
Date: 3:17:12 AM, Friday, June 01, 2007
Message:
a small present for Nogard :-p 
----
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/shared/opcodes.h


Revision: 118
Author: meanmon13
Date: 3:00:40 AM, Friday, June 01, 2007
Message:
SVN freezes when downloading the content of the release folder... deleted till this issue can be fixed
----
Deleted : /Release


Revision: 117
Author: ead
Date: 1:49:59 AM, Friday, June 01, 2007
Message:
05-31-07 PINGSERVER LEAN AND MEAN  BY EAD
will add ini port numbers tomarow this file is finished and shuld not need any major changes
it is optimised as good as it gets
full runtime compile optmisations are in use asm output shows me that it cant get faster not even with asm unless a faster network lib is used
pingserver is set to build to release all the time
----
Modified : /ProjectFiles/PingServer/PingServer.vcproj
Modified : /ProjectFiles/SWGPreCU.sln
Modified : /ProjectFiles/SWGPreCU.vcproj
Added : /Release
Added : /Release/PingServer
Added : /Release/PingServer/AutoItX3.dll
Added : /Release/PingServer/libmysql.dll
Added : /Release/PingServer/zlib1.dll
Deleted : /debug/PingServer
Deleted : /src/PingServer/PingServer.cpp
Deleted : /src/PingServer/PingServer.h
Modified : /src/PingServer/SWGPreCU_Ping.cpp


Revision: 116
Author: meanmon13
Date: 1:23:53 AM, Friday, June 01, 2007
Message:
the nightmare of the 146h spam has been ended... no features added this rev just handling of the 146 to shut it up and make it stop wasting bandwidth
----
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/PacketFactory.h
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/shared/opcodes.h


Revision: 115
Author: lordcorm
Date: 12:19:51 AM, Friday, June 01, 2007
Message:
starter items!
----
Modified : /dbScript/swgprecu.sql
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 114
Author: Alaguerrano
Date: 10:12:12 PM, Thursday, May 31, 2007
Message:
**Delete Character from DB in Character Selection works 100% :-D**
-In HandleLogin.cpp commented several lines in HANDLE_ClientDeleteCharacter.
-In LoginClient.h added two news variables character_id and galaxy_id.
-In PacketFactory.cpp added new stuff to LClient::BUILD_ServerDeleteCharacter()
-In Database.cpp, the function DeleteCharacter() works 100% and will returns false if the Character have not been deleted and will returns true if the Character have been deleted from DB.
Now the Character is deleted from DB!!! :-D

------------------
Alaguerrano.
----
Modified : /src/LoginServer/HandleLogin.cpp
Modified : /src/LoginServer/LoginClient.h
Modified : /src/LoginServer/PacketFactory.cpp
Modified : /src/shared/Database.cpp


Revision: 113
Author: Nelk
Date: 8:14:45 PM, Thursday, May 31, 2007
Message:

----
Added : /Documents/Radials.xls


Revision: 112
Author: plasmaflow
Date: 12:59:07 PM, Thursday, May 31, 2007
Message:
Corrected SpawnBuilding Function.
This function has to change the incoming sBuildingID
and change it to : 
(((sBuildindID * 60 )+ sBuildingID)+BUILDINGS_OFFSET)
each building needs to be separated in their id by 60.
This obeys the rules of cell spawning.

When spawning a building only pass the Database ID and do not manipulate it.

sql Changelog has been updated.

Added a new SQL file containing the Dev city Buildings.
Includes: Starport, Cantina, Bank, Merchant Tent and a Guild Hall. Also you may be able to find the Downed At-At and the landed Lambda Shuttle.
More to come for the city.

added a new text file called "Cell Sizes.txt" under documents. These values need to be converted to consts if not reference it to be able to spawn a building. Each building has a given cell size. without it, it wont spawn.

PlasmaFlow
----
Added : /Documents/Cell Sizes.txt
Modified : /Documents/[GUIDE]Getting started (Setting up your server).URL
Added : /dbScript/DevCityBackup.sql
Modified : /dbScript/swgprecu.sql.changelog.txt
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/PacketFactory.cpp


Revision: 111
Author: plasmaflow
Date: 8:34:41 AM, Thursday, May 31, 2007
Message:
item_template.SQL changes done.
Corrected error where table would not load.
Comments in changelog file.
Added auto increment to items_template table.
----
Modified : /dbScript/item_template.SQL
Modified : /dbScript/swgprecu.sql
Modified : /dbScript/swgprecu.sql.changelog.txt


Revision: 110
Author: meanmon13
Date: 5:57:45 AM, Thursday, May 31, 2007
Message:
reworked the porject structure to better handle future growth and development. Object Controller Messages are now handled via function pointers... this should speed up handling of chat and movement and in the future will speed up handling of combat packets. Updated the Header_Architecture.ppt file with the two new files... Please have a look at it for an understanding of how they fit into the project. Other housekeeping changes
----
Modified : /Documents/Header_Architecture.ppt
Modified : /ProjectFiles/ZoneServer/ZoneServer.vcproj
Modified : /src/LoginServer/Constants.h
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/HandleZone.cpp
Added : /src/ZoneServer/ObjControllers.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Added : /src/ZoneServer/PacketFactory.h
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/shared/Common.h
Modified : /src/shared/opcodes.h


Revision: 109
Author: ead
Date: 11:00:43 PM, Wednesday, May 30, 2007
Message:
added a space before a comment to fix sql file
----
Modified : /dbScript/swgprecu.sql


Revision: 108
Author: ead
Date: 10:29:17 PM, Wednesday, May 30, 2007
Message:
-- 05-30-07 ead		rewrite of item_template
detales 
item_template is in its own file for size   using assumed inserts insted of full inserts 1/2 its orginal size and 50% faster to insert
removed the item template data dump from main sql file 
----
Modified : /dbScript/item_template.SQL
Added : /dbScript/item_template.ods
Modified : /dbScript/swgprecu.sql
Modified : /dbScript/swgprecu.sql.changelog.txt


Revision: 107
Author: Alaguerrano
Date: 9:18:39 PM, Wednesday, May 30, 2007
Message:
**Second step to Delete Character from Character Selection**
Now, the server send the correct packet to the client, and show in-game screen "The character have been deleted", but still it is necessary to finish the DB function to deleted from DB.
-In HandleLogin.cpp added new stuff to HANDLE_ClientDeleteCharacter.
-In LoginClient.h added ByteBuffer* BUILD_ServerDeleteCharacter(); 
-In PacketFactory.cpp added LClient::BUILD_ServerDeleteCharacter()
and the correct packet to send to the client. :-D
-In Database.cpp added new bool function named DeleteCharacter()
This bool function by now, always return true like if the Character was deleted from DB.
TODO: Make this function works 100% and will returns false if the Character have not been deleted 
and will returns true if the Character have been deleted.
-In Database.h added bool DeleteCharacter(int character_id, int galaxy_id);
-In opcodes.h added ServerDeleteCharacter opcode.
----
Modified : /src/LoginServer/HandleLogin.cpp
Modified : /src/LoginServer/LoginClient.h
Modified : /src/LoginServer/PacketFactory.cpp
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h
Modified : /src/shared/opcodes.h


Revision: 106
Author: Alaguerrano
Date: 7:33:15 PM, Wednesday, May 30, 2007
Message:
**First Step to Delete Character from Character Selection**
-In HandleLogin.cpp added HANDLE_ClientDeleteCharacter, first step to delete Character from Character Selection. From now, only show in console the Character´s Char Id and
Galaxy ID that we want to delete. :)
-In LoginClient.h added Change Log for this File.
And added new stuff to ClientDeleteCharacter, in line 78 and 116.
-In opcodes.h added Added ClientDeleteCharacter opcode.
----
Modified : /src/LoginServer/HandleLogin.cpp
Modified : /src/LoginServer/LoginClient.h
Modified : /src/shared/opcodes.h


Revision: 105
Author: nogard
Date: 7:04:17 PM, Wednesday, May 30, 2007
Message:
Fixed Cell Movement and added item_template.SQL  all the items spawnable are in that ... TODO: Add names for them  Delete all exesting data in the item_template before u add 
----
Added : /dbScript/item_template.SQL
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/shared/Database.cpp


Revision: 104
Author: meanmon13
Date: 6:56:36 PM, Wednesday, May 30, 2007
Message:
ID constants are in USE THEM when spawning items...

#define NPC_OFFSET 25000000
#define BUILDINGS_OFFSET 50000000
#define CELL_ITEM_OFFSET 60000000
#define WORLD_OBJECT_OFFSET 70000000
#define ITEM_OFFSET 100000000

NOTE: the structure_spawn table's id is going to need to increment by 25 :-D This is to handle the building's cell ids
----
Modified : /src/LoginServer/Constants.h
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/PacketFactory.cpp


Revision: 103
Author: meanmon13
Date: 3:48:41 PM, Wednesday, May 30, 2007
Message:
Fixed character selection screen and character login stuffs and other good stuff fixes... fixty fix fix fix
----
Modified : /src/LoginServer/Constants.h
Modified : /src/LoginServer/PacketFactory.cpp
Modified : /src/ZoneServer/HandleZone.cpp


Revision: 102
Author: maach_ine
Date: 3:00:15 PM, Wednesday, May 30, 2007
Message:
Starting ham based on character species and starting profession now works!
----
Deleted : /dbScript/starting_ham.sql
Modified : /dbScript/swgprecu.sql
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/shared/Database.cpp


Revision: 101
Author: maach_ine
Date: 2:43:08 PM, Wednesday, May 30, 2007
Message:
Re-fixed starting ham table.
----
Modified : /dbScript/starting_ham.sql


Revision: 100
Author: maach_ine
Date: 2:12:01 PM, Wednesday, May 30, 2007
Message:
Changed some of the values to line up better with what's in the code.
----
Modified : /dbScript/starting_ham.sql


Revision: 99
Author: plasmaflow
Date: 1:46:34 PM, Wednesday, May 30, 2007
Message:
Added variables to control hair object data.
Meanmon or Maach_Ine need to pass the data to the packet.
uint8 * iCharacterCustomHairData;
int iCharacterCustomHairDataLen;
string iCharacterHairObject;
int iCharacterHairObjectLen;

Updated SQL Log file to reflect last changes to the file.
----
Modified : /dbScript/swgprecu.sql.changelog.txt
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 98
Author: Interesting
Date: 1:36:20 PM, Wednesday, May 30, 2007
Message:
Uploaded a table that will tell the client which race/class combination gets how much starting health, action, mind, etc.
Also uploaded some documentation on it.
----
Added : /Documents/RaceID.rtf
Added : /Documents/Starting_HAM_by_species_and_profession.xls
Added : /Documents/ham.txt
Added : /dbScript/starting_ham.sql


Revision: 97
Author: plasmaflow
Date: 11:44:44 AM, Wednesday, May 30, 2007
Message:
Updated Commit sql File updated.
U WILL NEED TO USE THIS FILE
----
Modified : /dbScript/swgprecu.sql


Revision: 96
Author: plasmaflow
Date: 11:42:29 AM, Wednesday, May 30, 2007
Message:
*******NEW SQL FILE IN THIS COMMIT******
        YOU WILL NEED TO LOAD IT
****************************************
New Config file variables added.

Clustering variables to enable clustering.
NOTE CLUSTERING NOT IMPLEMENTED YET TAKE DEFAULTS PLS.
These will enable clustering all other values will be db driven.
int clustering_enabled  = Is it on or off?
int cluster_id = What cluster group does the server belong to?
int cluster_member_id = Who is the server in the cluster?
We now check to see if we want to encrypt the passwords in the db.
int enable_encryption
If we want to encrypt we need to set the encryption key. No longer than 100 chars. it is used to encrypt.
This allows for an encrypted user db to be used somewhere else so long as the keys match.
char encryption_key[100]

We now check for auto registration to be enabled or not.
int auto_registration


Hair Data is now saved to the db.

New SQL columns added to character table.

`custom_data_len` int unsigned default null,
`starting_profession` varchar(255),

Starting profession will save the profession chosen on startup.

BUG FIX
-------
Wookies were being saved with the first name as last name and first name.

Corrected.
----
Modified : /dbScript/swgprecu.sql
Modified : /src/LoginServer/HandleLogin.cpp
Modified : /src/LoginServer/LoginServer.cpp
Modified : /src/PingServer/SWGPreCU_Ping.cpp
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/SWGPreCU_Zone.cpp
Modified : /src/ZoneServer/ZoneServer.cpp
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h
Modified : /src/shared/config.cpp
Modified : /src/shared/config.h


Revision: 95
Author: meanmon13
Date: 10:15:33 PM, Tuesday, May 29, 2007
Message:
"Header_Architecture.ppt" has been updated... EVERYONE look @ it for a better understand of the program and how it flows... there will be a quiz!!! Muhahahaha
----
Modified : /Documents/Header_Architecture.ppt
Modified : /ProjectFiles/SWGPreCU.vcproj


Revision: 94
Author: nogard
Date: 10:14:56 PM, Tuesday, May 29, 2007
Message:
Added the Delta's for Creo 6
----
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/shared/opcodes.h


Revision: 93
Author: maach_ine
Date: 9:34:08 PM, Tuesday, May 29, 2007
Message:
Fixed "the other players" appearance data not showing.
----
Modified : /src/ZoneServer/PacketFactory.cpp


Revision: 92
Author: Alaguerrano
Date: 8:29:24 PM, Tuesday, May 29, 2007
Message:
-In Database.cpp added new stuff for Name Filter System. Now the Name Filter System detect if the FullName Character is or not is the same that other FullName Character in DB. If it is the same, dont let to create a new Char with name used for other person.
-In HandleZone.cpp added case 3 for SWITCH with the result of the CheckNewCharacter Function.
This case is when FullName Character is the same that other FullName Character in DB.
TODO:This option must be coded to respond the correct packet to the client. For the moment, use the default QUEUE_ClientCreateCharacterFailed
----
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/shared/Database.cpp


Revision: 91
Author: zstars
Date: 8:29:06 PM, Tuesday, May 29, 2007
Message:
-Added old memory debugger.
----
Modified : /ProjectFiles/PingServer/PingServer.vcproj
Modified : /ProjectFiles/SWGPreCU.vcproj
Modified : /ProjectFiles/ZoneServer/ZoneServer.vcproj
Added : /src/shared/Debug.cpp
Added : /src/shared/Debug.h


Revision: 90
Author: meanmon13
Date: 6:35:30 PM, Tuesday, May 29, 2007
Message:
added a bool for itmes for loading weapons... weapons haven't been implemented yet
----
Modified : /src/ZoneServer/OverTime.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.h


Revision: 89
Author: nogard
Date: 6:21:53 PM, Tuesday, May 29, 2007
Message:
Added the stuff meanmon wanted includes cell movement YAY!
----
Modified : /src/LoginServer/PacketFactory.cpp
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/shared/Database.cpp
Modified : /src/shared/opcodes.h
Modified : /src/shared/tlog.cpp


Revision: 88
Author: Alaguerrano
Date: 5:51:45 PM, Tuesday, May 29, 2007
Message:
-Fixed problem with Wookiee Race in CheckNewCharacter. Wookiee Race has only FirstName, and the LastName empty now is not a rule to Char Name would be Denied.
Now works perfect with Wookiee Race!!
----
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 87
Author: nogard
Date: 5:13:05 PM, Tuesday, May 29, 2007
Message:
Fixed Maachs Customization thing ... yeas.. it works
----
Modified : /src/ZoneServer/PacketFactory.cpp


Revision: 86
Author: maach_ine
Date: 4:31:06 PM, Tuesday, May 29, 2007
Message:
Fixing what I broke last rev.  Removed customization data, as it severely broke multi-zone.
----
Modified : /src/ZoneServer/PacketFactory.cpp


Revision: 85
Author: maach_ine
Date: 4:08:24 PM, Tuesday, May 29, 2007
Message:
WORKING APPEARANCE CUSTOMIZATION DATA!!!

Note to self:  If one is going to change the size of a packet, it is strongly advisable to tell the client the new size, else the client generally crashes.

* Machine smacks himself around a bit with a large trout
----
Modified : /src/ZoneServer/PacketFactory.cpp


Revision: 84
Author: maach_ine
Date: 4:02:14 PM, Tuesday, May 29, 2007
Message:
One of these days, I'll learn to upload ALL the files.
----
Added : /src/LoginServer/Constants.h


Revision: 83
Author: maach_ine
Date: 3:40:42 PM, Tuesday, May 29, 2007
Message:
Fixed what was broken last commit.  This is now a working revision.

Change:  We now see the correct species for ourselves when we enter zone.

We can now also see the species of other players correctly.

NOTE:  If the species array index is NOT read properly from the database, the zone server WILL ABSOLUTELY MOST DEFINITELY CRASH, as the array index is being initialized to -1.
----
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.cpp


Revision: 82
Author: maach_ine
Date: 2:58:55 PM, Tuesday, May 29, 2007
Message:
In-progress commit so that others can test the code.

THIS REVISION MAY NOT BE STABLE!!!

----
Modified : /ProjectFiles/SWGPreCU.vcproj
Modified : /dbScript/swgprecu.sql
Modified : /src/LoginServer/HandleLogin.cpp
Modified : /src/LoginServer/LoginServer.h
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 81
Author: meanmon13
Date: 11:02:47 AM, Tuesday, May 29, 2007
Message:
movment tweak
----
Modified : /src/ZoneServer/OverTime.cpp
Modified : /src/ZoneServer/ZoneClient.cpp


Revision: 80
Author: plasmaflow
Date: 9:36:50 AM, Tuesday, May 29, 2007
Message:
Smooth movement tested to work perfectly.
Server updates population properly
server reads galaxy value from ini file so we can now cluster several servers.
We also now load the local galaxy values from db and set them. Not only the cluster.
Motd is database driven
neew motd column in galaxy table,
u need to load this sql file.
----
Modified : /dbScript/swgprecu.sql
Modified : /src/LoginServer/LoginServer.cpp
Modified : /src/LoginServer/SWGPreCU_Login.cpp
Modified : /src/PingServer/PingServer.cpp
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.cpp
Modified : /src/ZoneServer/ZoneServer.cpp
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h
Modified : /src/shared/config.cpp
Modified : /src/shared/config.h


Revision: 79
Author: meanmon13
Date: 9:23:40 AM, Tuesday, May 29, 2007
Message:
the players postion should now be updated before sending the updatetransformmessage
----
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/OverTime.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.h


Revision: 78
Author: maach_ine
Date: 9:32:38 PM, Monday, May 28, 2007
Message:
Player HAM values are now read from the database.
----
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 77
Author: meanmon13
Date: 8:47:16 PM, Monday, May 28, 2007
Message:
Movment debug commit... we need to calculate the new postion the player should be at according to their speed and direction and send those new values in the UTM
----
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/OverTime.cpp
Modified : /src/ZoneServer/ZoneClient.cpp


Revision: 76
Author: meanmon13
Date: 6:27:38 PM, Monday, May 28, 2007
Message:
Comands fix defautl value refinement
----
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/ZoneClient.cpp


Revision: 75
Author: Alaguerrano
Date: 5:52:17 PM, Monday, May 28, 2007
Message:
--Added in Database.cpp, in the function CheckNewCharacter a process to check if FirstName or LastName are empty fields.
--Added in HandleZone.cpp, new stuff in ClientCreateCharacter,
Added case 2 for SWITCH with the result of the CheckNewCharacter Function.
This case is when the Character FirstName or LastName is EMPTY.
TODO:This option must be coded to respond the correct packet to the client. For the moment, use the default QUEUE_ClientCreateCharacterFailed
----
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/shared/Database.cpp


Revision: 74
Author: meanmon13
Date: 5:33:49 PM, Monday, May 28, 2007
Message:
commmand update
----
Modified : /src/ZoneServer/HandleZone.cpp


Revision: 73
Author: meanmon13
Date: 5:05:30 PM, Monday, May 28, 2007
Message:
ingame commands &rt and &rd
----
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/OverTime.cpp
Modified : /src/ZoneServer/ZoneClient.cpp
Modified : /src/ZoneServer/ZoneClient.h


Revision: 72
Author: Nelk
Date: 3:25:01 PM, Monday, May 28, 2007
Message:
Added the source of the Admin tool to the SVN
Deleted the old folder containing the exe only
----
Deleted : /AdminTool
Added : /Pre-Cu Emu Admin Tool
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/Dialog
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/Dialog/Login.Designer.vb
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/Dialog/Login.resx
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/Dialog/Login.vb
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/Main.Designer.vb
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/Main.resx
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/Main.vb
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/My Project
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/My Project/Application.Designer.vb
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/My Project/Application.myapp
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/My Project/AssemblyInfo.vb
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/My Project/Resources.Designer.vb
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/My Project/Resources.resx
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/My Project/Settings.Designer.vb
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/My Project/Settings.settings
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/Packets
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/Packets/AUTH.vb
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/Packets/ServerWide.vb
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/Parsing
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool.vbproj
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/bin
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/bin/Debug
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/bin/Debug/Pre-Cu Emu Admin Tool.exe
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/bin/Debug/Pre-Cu Emu Admin Tool.pdb
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/bin/Debug/Pre-Cu Emu Admin Tool.vshost.exe
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/bin/Debug/Pre-Cu Emu Admin Tool.xml
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/bin/Debug/ecrypt.dll
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/bin/Debug/log.log
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/bin/Debug/zlib1.dll
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/bin/Release
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/bin/Release/Pre-Cu Emu Admin Tool.exe
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/bin/Release/Pre-Cu Emu Admin Tool.pdb
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/bin/Release/Pre-Cu Emu Admin Tool.rar
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/bin/Release/Pre-Cu Emu Admin Tool.xml
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/bin/Release/ecrypt.dll
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/bin/Release/log.log
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/bin/Release/zlib1.dll
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/ecrypt.dll
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/obj
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/obj/Debug
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/obj/Debug/Pre-Cu Emu Admin Tool.exe
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/obj/Debug/Pre-Cu Emu Admin Tool.pdb
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/obj/Debug/Pre-Cu Emu Admin Tool.vbproj.GenerateResource.Cache
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/obj/Debug/Pre-Cu Emu Admin Tool.xml
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/obj/Debug/Pre_Cu_Emu_Admin_Tool.Login.resources
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/obj/Debug/Pre_Cu_Emu_Admin_Tool.Main.resources
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/obj/Debug/Pre_Cu_Emu_Admin_Tool.Resources.resources
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/obj/Debug/TempPE
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/obj/Debug/TempPE/My Project.Resources.Designer.vb.dll
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/obj/Pre-Cu Emu Admin Tool.vbproj.FileList.txt
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/obj/Release
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/obj/Release/Pre-Cu Emu Admin Tool.exe
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/obj/Release/Pre-Cu Emu Admin Tool.pdb
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/obj/Release/Pre-Cu Emu Admin Tool.vbproj.GenerateResource.Cache
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/obj/Release/Pre-Cu Emu Admin Tool.xml
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/obj/Release/Pre_Cu_Emu_Admin_Tool.Login.resources
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/obj/Release/Pre_Cu_Emu_Admin_Tool.Main.resources
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/obj/Release/Pre_Cu_Emu_Admin_Tool.Resources.resources
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/obj/Release/TempPE
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/obj/Release/TempPE/My Project.Resources.Designer.vb.dll
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool/zlib1.dll
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool.sln
Added : /Pre-Cu Emu Admin Tool/Pre-Cu Emu Admin Tool.suo


Revision: 71
Author: lordcorm
Date: 2:17:34 PM, Monday, May 28, 2007
Message:

----
Modified : /dbScript/swgprecu.sql
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 70
Author: lordcorm
Date: 12:22:37 PM, Monday, May 28, 2007
Message:
Made inventory work from DB, dont equip weapons because they will not work yet. Make sure to update you .sql file, i changed the hex numbers in the item_template table to normal decimal numbers for CRC's also changed some other stuff in the .sql
----
Modified : /dbScript/starter_items.sql
Modified : /dbScript/static_npcs.sql
Modified : /dbScript/swgprecu.sql
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 69
Author: meanmon13
Date: 4:25:46 AM, Monday, May 28, 2007
Message:
smooth movment tweak
----
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/OverTime.cpp


Revision: 68
Author: meanmon13
Date: 3:57:31 AM, Monday, May 28, 2007
Message:
reset creo4 values could have led to issues with smooth movment
----
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.cpp


Revision: 67
Author: meanmon13
Date: 3:34:01 AM, Monday, May 28, 2007
Message:
smooth movment test
----
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.h


Revision: 66
Author: meanmon13
Date: 2:54:18 AM, Monday, May 28, 2007
Message:
smooth movment test
----
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/OverTime.cpp
Modified : /src/ZoneServer/PacketFactory.cpp


Revision: 65
Author: meanmon13
Date: 1:14:01 AM, Monday, May 28, 2007
Message:
Nelk fixed the admin tool and i added server side code to handle it
----
Modified : /AdminTool/Pre-Cu Emu Admin Tool.exe
Modified : /ProjectFiles/PingServer/PingServer.vcproj
Modified : /ProjectFiles/SWGPreCU.vcproj
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/ZoneServer/ZoneServer.cpp
Modified : /src/ZoneServer/ZoneServer.h
Modified : /src/ZoneServer/admin.cpp
Modified : /src/ZoneServer/admin.h


Revision: 64
Author: ead
Date: 11:57:40 PM, Sunday, May 27, 2007
Message:
-- 05-27-07 ead			ADDED base releaseitem_stat_wep item_stat_armor 
detals
added the above 2 tables and most of the stats involved in each
more to come
added wep_id and armor_id  unsigned int to item table   
if null  dont look up the stats table 
if not null use value to look up items stats row
----
Modified : /dbScript/swgprecu.sql
Modified : /dbScript/swgprecu.sql.changelog.txt


Revision: 63
Author: maach_ine
Date: 10:22:27 PM, Sunday, May 27, 2007
Message:
Readded EncodeSQL, DecodeSQL, QuoteSQL from Core 1 Rev Z as discussed with Meanmon.

Altered character creation string to add values for new database required fields.
----
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 62
Author: ead
Date: 8:03:57 PM, Sunday, May 27, 2007
Message:
roll back to rev 54 at request of meanmon
reson
buggy code put in without testing    causses crahses
broke multizone
broke charater creation
added memory leak

change affecting only /reporoot/src/*.* folder and sub folders
----
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 61
Author: ead
Date: 7:40:46 PM, Sunday, May 27, 2007
Message:
roll back of rev 60
----
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 60
Author: lordcorm
Date: 6:27:36 PM, Sunday, May 27, 2007
Message:

----
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 59
Author: maach_ine
Date: 5:22:02 PM, Sunday, May 27, 2007
Message:
HAM values of:  Current HAM, MAX HAM, HAM Wounds are now database driven.  Encumberances and other modifiers may be calculated during Zone insertion.
----
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 58
Author: ead
Date: 4:38:51 PM, Sunday, May 27, 2007
Message:
-- 05-27-07 ead 		ADDED professsion_skill_tree.prelemnary.sql
DETALS
this file is a dump of what the datapack team me a someone i cant rember wer working on 
the entire medic profession is in as a example

idea is that
profession table has sktr1-4  each corasponds to a stree id number
stree table has 4 skills that make up that colum of the skill 
each profession can require a skill  or  unlock another skill  same with each skill 
its not compleat   there are no crc's   but  its a great start 
also added the start of xp types  agan its a start  no crcs yet but gives us somthign to work from 
----
Added : /dbScript/profession_skill_tree.prelemnary.sql
Modified : /dbScript/swgprecu.sql.changelog.txt


Revision: 57
Author: Interesting
Date: 3:59:55 PM, Sunday, May 27, 2007
Message:
Added starting item table for approval.
----
Modified : /Documents/Database Item Documentation.txt
Added : /dbScript/starter_items.sql


Revision: 56
Author: ead
Date: 3:45:34 PM, Sunday, May 27, 2007
Message:
-- 05-27-07 ead			added ham stats to charater table  more stats to come  working on item stats now
DETALS
ADDED COLUMS

MAX HELTH		`h_hea``h_str``h_con`
DAMAGE ON PLAYER	`h_d_hea``h_d_str``h_d_con`
WOUND ON PLAYER		`h_w_hea``h_w_str``h_w_con`
MAX HELTH		`a_act` `a_qui` `a_sta`
DAMAGE ON PLAYER	`a_d_act``a_d_qui``a_d_sta`
WOUND ON PLAYER		`a_w_act``a_w_qui``a_w_sta`
MAX HELTH		`m_mind` `m_foc``m_wil`
DAMAGE ON PLAYER	`m_d_mind``m_d_foc``m_d_wil`
WOUND ON PLAYER		`m_w_mind``m_w_foc``m_w_wil`
ALL UNSIGNED SMALLINT 5
----
Modified : /dbScript/swgprecu.sql
Modified : /dbScript/swgprecu.sql.changelog.txt


Revision: 55
Author: maach_ine
Date: 11:12:16 AM, Sunday, May 27, 2007
Message:
After consulting with Meanmon on appearance data, got authorization to cut/copy/paste the functions EncodeSQL, DecodeSQL, and QuoteSQL from Core 1 Rev Z into the DBConnect class.  These are PRIVATE functions and are not meant to be used outside the database object.

Appearance data is now being correctly saved in the database, and correctly loaded from it.

TOFIX:  Client crashes when actually sending this appearance data in the CREO3 packet.  A byte by byte comparison of the data the client sends during character creation, and the data the server sends during zoning, reveals that the appearance data is IDENTICAL.

A comparison of our CREO3 packet to a Core 1 CREO3 packet reveals them to be IDENTICAL except:  We send the entire species string where Core 1 does not, our HAM wound update counter is correct, Core 1's was not.

Hackishly added support for different character race toons to be zoned in.  The current implementation is VERY inefficient.  TODO:  Alter the Database's character table:  species_id field.  It is to be a Byte value (or smaller), and will hold the species ID.  Human Male = 0, Human Female = 1, etc. etc.
----
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 54
Author: meanmon13
Date: 7:40:14 AM, Sunday, May 27, 2007
Message:
smoothed out movment some... fixed issue where the last person spawned was the name sent to everyone else when zoning was finished... a few housekeeping changes... possible fixes to the memory leak.
----
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.h


Revision: 53
Author: meanmon13
Date: 5:48:58 AM, Sunday, May 27, 2007
Message:
created a new function named SpawnFellowPlayer() using this function will result in the spawning of actual players instead of client controlled npcs. Fellow players are finally decent and have titles... this involved changing the SpawnItem() function a little (sorry Lordcorm). Some housekeeping changes... The server has a very small memory leak that could prove to be a big problem if we don't nip it right now... not sure what its related too. Also made movment a little smoother
----
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/OverTime.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/ZoneServer/ZoneServer.cpp


Revision: 52
Author: lordcorm
Date: 1:53:17 AM, Sunday, May 27, 2007
Message:

----
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/shared/Database.cpp


Revision: 51
Author: meanmon13
Date: 1:44:10 AM, Sunday, May 27, 2007
Message:
Added an admin class to be used with the admin tool... also included alpha version of the admin tool... the encryption between the two is not working right atm so it doesn't work.
----
Added : /AdminTool
Added : /AdminTool/Pre-Cu Emu Admin Tool.exe
Added : /AdminTool/ecrypt.dll
Added : /AdminTool/zlib1.dll
Modified : /ProjectFiles/ZoneServer/ZoneServer.vcproj
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/ZoneServer/ZoneServer.cpp
Modified : /src/ZoneServer/ZoneServer.h
Added : /src/ZoneServer/admin.cpp
Added : /src/ZoneServer/admin.h


Revision: 50
Author: meanmon13
Date: 10:49:07 PM, Saturday, May 26, 2007
Message:
MOTD and global system messages have been implemented!
----
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/shared/Common.h
Modified : /src/shared/opcodes.h


Revision: 49
Author: meanmon13
Date: 8:58:48 PM, Saturday, May 26, 2007
Message:
fixed issue with recipiant IDs
----
Modified : /src/ZoneServer/OverTime.cpp
Modified : /src/ZoneServer/ZoneClient.cpp
Modified : /src/shared/ByteBuffer.cpp
Modified : /src/shared/ByteBuffer.h


Revision: 48
Author: meanmon13
Date: 8:20:28 PM, Saturday, May 26, 2007
Message:
Spatical chat now works
----
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/OverTime.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/shared/ByteBuffer.cpp
Modified : /src/shared/ByteBuffer.h
Modified : /src/shared/Common.h


Revision: 47
Author: lordcorm
Date: 5:45:30 PM, Saturday, May 26, 2007
Message:

----
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 46
Author: meanmon13
Date: 5:25:10 PM, Saturday, May 26, 2007
Message:
movment should be smoother
----
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/OverTime.cpp


Revision: 45
Author: meanmon13
Date: 4:24:50 PM, Saturday, May 26, 2007
Message:
If all goes well this should be smooth movment
----
Modified : /ProjectFiles/ZoneServer/ZoneServer.vcproj
Modified : /src/ZoneServer/HandleZone.cpp
Added : /src/ZoneServer/OverTime.cpp
Modified : /src/ZoneServer/ZoneClient.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/ZoneServer/ZoneServer.cpp
Modified : /src/ZoneServer/ZoneServer.h
Modified : /src/shared/Common.h
Modified : /src/shared/Sockets.h
Deleted : /src/shared/common.cpp


Revision: 44
Author: Interesting
Date: 9:41:08 AM, Saturday, May 26, 2007
Message:
Uploaded Static NPC table, the only NPC we have is hard coded.
----
Added : /dbScript/static_npcs.sql
Modified : /dbScript/swgprecu.sql.changelog.txt


Revision: 43
Author: ead
Date: 11:40:29 PM, Friday, May 25, 2007
Message:
added asm timmmer function
----
Modified : /src/shared/Common.h
Added : /src/shared/common.cpp


Revision: 42
Author: Alaguerrano
Date: 10:59:08 PM, Friday, May 25, 2007
Message:
**NAME FILTER SYSTEM**
-- In Database.cpp created new function named CheckNewCharacter.
It is called from HANDLE_ClientCreateCharacter() in HandleZone.cpp before it have been created a new char.
It takes the FirstName and LastName values of the new Character, and checks with filter_name table DB
Returns 1 if FirstName or LastName are in filter_name table
Returns 0 if they are not in filter_name table.
It is not a bool function, it is a INT function because the name_response_codes in DB there are more than two options.
This functions it isnt done 100%, the rest of the name_response_codes must be coded.
This is only the first step to a completed name filter system.
-- In Database.h added int CheckNewCharacter(string sFirstName, string sLastName); line 218
-- In HandleZone.cpp added a call to the CheckNewCharacter Function to check the filter name in line 97.
Added a SWITCH with the result of the CheckNewCharacter Function.
Case 0: is when the Character FirstName and LastName is NOT in the filter_name table from DB. Then executes the older New Char Creation System.
Case 1: is when the Character FirstName and LastName IS in the filter_name table from DB.
					         TODO:This option must be coded to respond the correct packet to the client. From now use the default QUEUE_ClientCreateCharacterFailed.
----
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 41
Author: meanmon13
Date: 6:06:50 PM, Friday, May 25, 2007
Message:
test commit --- movment related
----
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/PacketFactory.cpp


Revision: 40
Author: meanmon13
Date: 5:10:35 PM, Friday, May 25, 2007
Message:
test commit -- movment related
----
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.cpp
Modified : /src/ZoneServer/ZoneClient.h


Revision: 39
Author: Interesting
Date: 5:01:34 PM, Friday, May 25, 2007
Message:
Woopsy. Last commit didn't delete my table all the way through.
----
Deleted : /dbScript/spawned_structures.sql


Revision: 38
Author: Interesting
Date: 4:59:43 PM, Friday, May 25, 2007
Message:
Final of the housekeeping changes to the changelog file.
Deleted spawned_structures.sql file now that its been added to the database.
----
Modified : /dbScript/swgprecu.sql.changelog.txt


Revision: 37
Author: meanmon13
Date: 4:08:58 PM, Friday, May 25, 2007
Message:
another test commit related to movment
----
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/PacketFactory.cpp


Revision: 36
Author: plasmaflow
Date: 3:43:05 PM, Friday, May 25, 2007
Message:
Login server will now upon boot set galaxy status in database to 0 = off line.

Zone Server will now upon boot set galaxy status in database to 2 = on line

Galaxies will be reloaded and status updated upon server receiving a new connection requesting that we enum the cluster.

added a new function SetServerStatus
takes GalaxyID as int and status as int to set status 
of the galaxies in the cluster.
added new function GetServerStatus that takes 1 argument int GalaxyID and returns the curretn state of the galaxy requested. 0=offline 1=loading 2=online.
These status are queried from the database.

Minor changes on some data types on the sql file have been done and logged in the log file.

Spawned Structures sql file added by interesting has been added to the sql file and tested to load properly.
----
Modified : /dbScript/swgprecu.sql
Modified : /dbScript/swgprecu.sql.changelog.txt
Modified : /src/LoginServer/HandleLogin.cpp
Modified : /src/LoginServer/LoginServer.cpp
Modified : /src/LoginServer/PacketFactory.cpp
Modified : /src/PingServer/PingServer.cpp
Modified : /src/ZoneServer/ZoneServer.cpp
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 35
Author: meanmon13
Date: 3:33:29 PM, Friday, May 25, 2007
Message:
test commit.. added support for movement.. needs to be tested
----
Modified : /src/LoginServer/PacketFactory.cpp
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/shared/opcodes.h


Revision: 34
Author: Interesting
Date: 10:47:40 AM, Friday, May 25, 2007
Message:
Cleaned up the Changelog a tad, just evened up a few bars of text.
Uploaded a table to handle Admin Spawned world objects. This table is not for player housing.
----
Added : /dbScript/spawned_structures.sql
Modified : /dbScript/swgprecu.sql.changelog.txt


Revision: 33
Author: plasmaflow
Date: 9:40:54 AM, Friday, May 25, 2007
Message:
Did some minor DB Changes for the appearance data.
Left a comment in the character creation query area in Database.cpp.

Need someone to help me build a byte based query using a char * variable.
----
Modified : /dbScript/swgprecu.sql
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 32
Author: meanmon13
Date: 4:13:57 AM, Friday, May 25, 2007
Message:
did some house keeping changes... a little this... a little that... ohyea btw... mutlizone works :-p Enjoy!!!!!
----
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/PacketFactory.cpp


Revision: 31
Author: meanmon13
Date: 12:25:16 AM, Friday, May 25, 2007
Message:
Test commit
----
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/PacketFactory.cpp


Revision: 30
Author: maach_ine
Date: 4:03:41 PM, Thursday, May 24, 2007
Message:
For PlasmaFlow:  Added the newCharacterCustomizationData pointer to the paramaters list passed to the function DBConnect::CreateNewCharacter.

The database will call it appearanceData.
----
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 29
Author: maach_ine
Date: 11:14:20 AM, Thursday, May 24, 2007
Message:
All HAM-related entries in the CREO 1, 3, 4, 6 packets are now soft-coded, preparatory to HAM values being stored in the database.

Fixed a minor error related to loading character data from the database.  The code was reporting that the query failed when in fact it succeeded, and reporting that it succeeded when in fact it failed.
----
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.cpp
Modified : /src/ZoneServer/ZoneClient.h


Revision: 28
Author: plasmaflow
Date: 10:40:55 AM, Thursday, May 24, 2007
Message:
New function added to load a variable and pass all of the data in the character table and place it inside of SpawnPlayer. New function name is GetPlayerData it takes one int as argument and the int must be the ObjID or the character id in the Database.

All values are passed in this variable. so adding the rest to the spawn player function is just a matter of addressing it from the variable as LoadedPlayerData.varname, each subscript has the appropriate data type.
Also change the sql file, types for coordinates in the character table have been changed to float. Decimal was not converting right when the row was read into the PlayerData Variable.
Scale in the sql file was changed to FLOAT as well.

PLASMAFLOW
----
Modified : /dbScript/swgprecu.sql
Modified : /dbScript/swgprecu.sql.changelog.txt
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 27
Author: Alaguerrano
Date: 9:24:27 AM, Thursday, May 24, 2007
Message:
**CREATE NEW ACCOUNT IN DB WORKS**
Fixed the query to create a new account to DB. String sID it is now obsolete with the new hacked station id.
Now creating a new account to DB works correctly.

------------
Alaguerrano
----
Modified : /src/shared/Database.cpp


Revision: 26
Author: meanmon13
Date: 4:12:03 AM, Thursday, May 24, 2007
Message:
Multizone fixed :-D Players should see each other however there will be no movement, no chat.. etc You will only see that a "fellow player" is logged in.
----
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.cpp
Modified : /src/shared/ByteBuffer.cpp
Modified : /src/shared/ByteBuffer.h


Revision: 25
Author: ead
Date: 2:37:24 AM, Thursday, May 24, 2007
Message:
fixed build problem and it makes the table right now
----
Modified : /src/shared/Database.cpp


Revision: 24
Author: meanmon13
Date: 2:06:39 AM, Thursday, May 24, 2007
Message:
Fixed issue where an access violation was being thrown... also player posture wasn't being set by the db so we were zoning in incapped.. this has been temp fixed till posture is pulled from the db
----
Modified : /src/ZoneServer/PacketFactory.cpp


Revision: 23
Author: ead
Date: 2:03:38 AM, Thursday, May 24, 2007
Message:
hacked station id so it is = to account_id tell station_id can be fully removed
combined account creation in to the canconnect reducing another sql quarry
----
Modified : /src/shared/Database.cpp


Revision: 22
Author: ead
Date: 1:13:59 AM, Thursday, May 24, 2007
Message:
FIXED ACCOUNT CREATION   REMOVED ANOTHER MYSQL QUARRY   COMBINED  CreateNewUser IN TO CanLogin
----
Modified : /src/shared/Database.cpp


Revision: 21
Author: maach_ine
Date: 12:10:31 AM, Thursday, May 24, 2007
Message:
Soft-coded almost all of the Creo3 packet.  Appearance Data is causing a crash.

Added some private variables to the ZoneClient, and initialized them in the ZoneClient constructor.

Added constants for the 9 parts of the HAM bar, for going through the HAM array.

Added a couple of checks to verify that we have a useable scale and name for the character, whatever else happens.
----
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.cpp
Modified : /src/ZoneServer/ZoneClient.h


Revision: 20
Author: nogard
Date: 9:55:31 PM, Wednesday, May 23, 2007
Message:
Nogard's Commit with Some new goodies to make DB driven ...
----
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/shared/opcodes.h


Revision: 19
Author: ead
Date: 8:41:56 PM, Wednesday, May 23, 2007
Message:
Database.cpp
rewrote account function removed 3 of the 4 mysql quarrys  added much needed comments 
added database function standard instructions
----
Modified : /src/shared/Database.cpp


Revision: 18
Author: meanmon13
Date: 3:29:36 PM, Wednesday, May 23, 2007
Message:
debugging commit
----
Modified : /src/ZoneServer/ZoneClient.cpp


Revision: 17
Author: Interesting
Date: 3:24:09 PM, Wednesday, May 23, 2007
Message:
Added a Chatroom List table.
Updated Item_Template to have the CRC values for the item in order to spawn items faster.
----
Modified : /dbScript/swgprecu.sql
Modified : /dbScript/swgprecu.sql.changelog.txt


Revision: 16
Author: plasmaflow
Date: 2:19:18 PM, Wednesday, May 23, 2007
Message:
New characters are now saved and pulled properly from db.
also Proper pull of appearance CRC has  been corrected,
?you need to use database included in this commit or else it wont work.
Some fields in database .sql file have been changed.,
Log entries for sql file have been updated.
Character table appearance crc has been chnaged to bigint since toon crc values can be that long.
Source code functions have been changed to match.
Proper Database ID is now returned from CreateNewCharacter function.

PLASMAFLOW
----
Modified : /dbScript/swgprecu.sql
Modified : /dbScript/swgprecu.sql.changelog.txt
Modified : /src/LoginServer/PacketFactory.cpp
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h
Modified : /src/shared/config.cpp
Modified : /src/shared/config.h


Revision: 15
Author: Interesting
Date: 12:14:33 PM, Wednesday, May 23, 2007
Message:
Added a table to track player health and stat information. Specifics in the change log.
Cleaned the change log to make it look pretty.
----
Modified : /dbScript/swgprecu.sql
Modified : /dbScript/swgprecu.sql.changelog.txt


Revision: 14
Author: meanmon13
Date: 10:34:38 AM, Wednesday, May 23, 2007
Message:
You will be able to see anyone that logins in AFTER you. This is a test commit... single zone still works as before
----
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/ZoneServer/ZoneServer.cpp
Modified : /src/ZoneServer/ZoneServer.h
Modified : /src/shared/Common.h


Revision: 13
Author: meanmon13
Date: 2:37:10 AM, Wednesday, May 23, 2007
Message:
Fixed an access violation issue with packet identification! This issue has been fully debugged :-)
----
Modified : /src/LoginServer/LoginClient.cpp
Modified : /src/LoginServer/LoginClient.h
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/ZoneClient.cpp
Modified : /src/ZoneServer/ZoneClient.h


Revision: 12
Author: meanmon13
Date: 12:57:14 AM, Wednesday, May 23, 2007
Message:
further optimized packet identification and fixed a small bug related to that
----
Modified : /src/LoginServer/LoginClient.cpp
Modified : /src/LoginServer/LoginClient.h
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/ZoneClient.cpp


Revision: 11
Author: meanmon13
Date: 11:40:05 PM, Tuesday, May 22, 2007
Message:
fixed a small issue that was happening when i packet is unhandled
----
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/ZoneClient.cpp


Revision: 10
Author: meanmon13
Date: 6:27:10 PM, Tuesday, May 22, 2007
Message:
Incomming packet identification has been optimized for the zone server! The function IdentifyPacket has been erased in lue of a list of function pointer handlers
----
Modified : /src/LoginServer/LoginClient.h
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/ZoneClient.cpp
Modified : /src/ZoneServer/ZoneClient.h


Revision: 9
Author: meanmon13
Date: 3:21:17 AM, Tuesday, May 22, 2007
Message:
optimized the zone server's packet queue... it now automatically mutlipackets outgoing packets when there is more then 1 packet contained in the queue... as a result zone time should be SIGNIFICANTLY decreased! Instead of sending 40+ individual packets its now only 11 mutlipackets.  
----
Modified : /ProjectFiles/PingServer/PingServer.vcproj
Modified : /ProjectFiles/ZoneServer/ZoneServer.vcproj
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.cpp
Modified : /src/ZoneServer/ZoneClient.h


Revision: 8
Author: ead
Date: 2:56:23 AM, Tuesday, May 22, 2007
Message:
fixed 3 freaky stray values at start of file that dont show up in any editor but hexplorer  and cause mysql panic
----
Modified : /dbScript/swgprecu.sql


Revision: 7
Author: ead
Date: 1:28:00 AM, Tuesday, May 22, 2007
Message:
changed for db compatablty 
removedsGalaxyIPaddress 
added sGalaxyIPWAN sGalaxyIPLAN

DATABASE NOTES\/\/\/\/\/
-- 05-21-07 ead			massive updates fixes and changes   50% done as it sits 
				
-- = == CHANGE  + == ADDED ~ == droped
--	TABLE ACCOUNT
--=ACCOUNT ID     UNSIGNED =
--=USERNAME PASSWORD  LENGHT FROM 20 TO 30 
--=GM TINYINT U
--=BANNED ACTIVE  BINARY 1 
--=joindate lastlogin to timestamp
--+lastlogin added ON UPDATE CURRENT_TIMESTAMP
--	TABLE CHARATER
--=CHARATER ID ACCOUNT ID  GALAXY ID  TO INT UNSIGNED
--=GUILD INSTANCE_ID TO SMALLINT UNSIGNED
--=X Y Z N S E W CELLX CELLY CELLZ CELLON CELLOS CELLOE CELLOW FROM FLOAT TO DECMAL 5,1
--=PLANET_ID LOTS FACTION_ID TO TINYINT UNSIGND
--=APPERANCELEN HAIRLEN TO INT UNSIGNED
--=biography longtext4,294,967,295 characters to text65,535 characters
--=lfg helper roleplayer archived 
--~height   was dupicate of scale
--~profession   wrong format  unplanned unlayed out yet
--	TABLE galaxy
--+ip_lan
--=ip to ip_Wan
--=ip_wan ip_lan to varachar 16
--=zoneport pingport to smallint
--=status max_characters_per_account to tinyint unsignd
--=distance to gmt_time_offset int to tinyint
--=max_characters_per_server to int unsignd
--+active_feature_profile
--	TABLE game_features
--~active_feature_profile
--=id int unsignd
--=min pvp lvl email_gateway_port smallint unsigned
--=flatten_name pvp_only non_combat_pvp_only factional_pvp_only filter_names email_gateway_allowed email_gateway_use_password --=email_gateway_send_cleartextpass email_gateway_system_wide to binary 1
--=locale_value to server_lang
--TABLE item
--+salt int signed
--=container to container_id  this is null unless its a contaner then it corasponds to a container id from container table
--=appearance int100 to int   there is no such thing as int 100  11 is max
--=equipped int to biinary 1
--	TABLE MERGE from item stats
--+cur_condition int unsignd // current condition
--+min_condition // greater than 0 prevents item distruction
--+max condition int unsignd //orginal starting conditon
--+dec_condition int unsignd //standard ammount to decrment  componet of math to find true value  after damage and spetchals are considerd
--stats of a item we arnt ready to do  heavy condsideration must be done before we do stats
--	TABLE DROP item_stats table was merged in to item 
--~droped item_stats
--
--_____________________________________________________________________________________
--
-- -----------------------------------------------------------------------------------------------------
--NOTICE I PLAN TO SPLIT THE DB IN TO MULTIPLE FILES  1 TO A TABLE TO MAKE UPDATEING EASER 
--AND SO ONLY RELEVENT TABLES NEED LOCKED DURING CHANGES EAD
-- -----------------------------------------------------------------------------------------------------
--NOTICE   I EXPECT DETALED LOGS OF ALL CHANGES MADE  SEE MY RECENT CHANGE LOG FOR EXAMPLE 
--  + = ~ ARE SUGESTIONS FOR ADD CHANGE DROP SPELLING EM OUT WILL WORK  
--I JUST WANT TO SEE A LOG OF EVERY CHANGE YOU MAKE YOUR OWN STYLE THAT GETS THE SAME INFO ACROSS WILL WORK JUST MAKE IT LOGICAL
-- COMMITS MISSING A LOG OR NOT LISTING EVERY CHANGE WILL BE ROLLED BACK TO PREVENT THIS FILE FROM BECOMEING A MESS AGAN
--THIS MEANS THE WHOLE COMMIT     AND I KNOW THIS LEVAL OF LOGGING IS INPRACTCAL IN THE SOURCE BUT IN SQL  IT IS REQUIRED
--THANK YOU FOR YOUR ASSTANCE EAD
-- -----------------------------------------------------------------------------------------------------
----
Modified : /dbScript/swgprecu.sql
Added : /dbScript/swgprecu.sql.changelog.txt
Modified : /src/LoginServer/PacketFactory.cpp
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 6
Author: Alaguerrano
Date: 9:01:30 PM, Monday, May 21, 2007
Message:
Uppercase in Generate Random Name.
==================================
Added two new string variables in GenerateRandomName() 'String FirstName' and 'String LastName'. These variables have the Generate Random Name and Lastname with the first letter uppercase.
And added the way to change lowercase to uppercase first letter in Generate Radom Name and Lastname.

Now the Generate Random Name works with the first letters uppercase.

----------
Alaguerrano
----
Modified : /src/shared/Database.cpp


Revision: 5
Author: meanmon13
Date: 4:55:50 PM, Monday, May 21, 2007
Message:
The Login Server has now been optimized to the point that you can spam logging in and out so fast that it crashs the client!!

Optimizations include: 
*complete removal of the IdentifyPacket() function... it is now handled by a list that contains function pointers to the functions that handle the variaous packet.
*Mutlipacketing of outgoing packets. Instead of sending 4 seperate packets... they are combined and sent as one.

Some houskeeping changes in the login server
----
Modified : /src/LoginServer/HandleLogin.cpp
Modified : /src/LoginServer/LoginClient.cpp
Modified : /src/LoginServer/LoginClient.h
Modified : /src/ZoneServer/Constants.h
Modified : /src/ZoneServer/PacketFactory.cpp
Modified : /src/ZoneServer/ZoneClient.h


Revision: 4
Author: Alaguerrano
Date: 1:20:10 PM, Monday, May 21, 2007
Message:
*** COMMITTED BY PLASMAFLOW ***

Name Generator is now its own routine and returns a name back to the handler as a string.
----
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/ZoneServer/ZoneClient.cpp
Modified : /src/ZoneServer/ZoneClient.h
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 3
Author: Alaguerrano
Date: 12:37:59 PM, Monday, May 21, 2007
Message:
*** COMMITED BY PLASMAFLOW ***

Name Generator Fix, Will not crash or cause issues.
All Database calls have been moved from Name Gen to Database.cpp and Database.h.

Tested Name Gen to generate names as fast as 6 or more within the same 1/2 second.
----
Modified : /dbScript/swgprecu.sql
Modified : /src/ZoneServer/HandleZone.cpp
Modified : /src/shared/Database.cpp
Modified : /src/shared/Database.h


Revision: 2
Author: Alaguerrano
Date: 5:30:02 PM, Sunday, May 20, 2007
Message:
Fix a problem with Random Name Generator routine. Before, when you tried to generate a Random Name in-game, and make it more of three times, crash the server.
Now fixed, commented the duplicated line 170 in HandleZone.cpp.
----
Modified : /src/ZoneServer/HandleZone.cpp


Revision: 1
Author: meanmon13
Date: 2:39:47 PM, Sunday, May 20, 2007
Message:
Hopefully last svn switch :-\
----
Added : /Documents
Added : /Documents/Approved Char Name Request Decoded.txt
Added : /Documents/Credits.txt
Added : /Documents/Database Item Documentation.txt
Added : /Documents/Denied Char Name Request.txt
Added : /Documents/Header_Architecture.ppt
Added : /Documents/Header_Architecture_rev90.jpg
Added : /Documents/License.pdf
Added : /Documents/License.txt
Added : /Documents/Life of a Login Server Packet.rtf
Added : /Documents/SWGPreCU Packet Documentation.rtf
Added : /Documents/[GUIDE]Getting started (Setting up your server).URL
Added : /Documents/master_opcode_list.txt
Added : /Lib
Added : /Lib/AutoItX3.lib
Added : /Lib/libmysql.dll
Added : /Lib/libmysql.lib
Added : /Lib/libzdll.a
Added : /Lib/mysqlclient.lib
Added : /Lib/mysys-nt.lib
Added : /Lib/regex.lib
Added : /Lib/strings.lib
Added : /Lib/zdll.exp
Added : /Lib/zdll.lib
Added : /Lib/zlib.lib
Added : /Lib/zlib1.exp
Added : /Lib/zlib1.lib
Added : /ProjectFiles
Added : /ProjectFiles/PingServer
Added : /ProjectFiles/PingServer/PingServer.vcproj
Added : /ProjectFiles/SWGPreCU.sln
Added : /ProjectFiles/SWGPreCU.vcproj
Added : /ProjectFiles/ZoneServer
Added : /ProjectFiles/ZoneServer/ZoneServer.vcproj
Added : /dbScript
Added : /dbScript/swgprecu.sql
Added : /debug
Added : /debug/PingServer
Added : /debug/PingServer/AutoItX3.dll
Added : /debug/PingServer/Logs
Added : /debug/PingServer/Logs/CoreLogs
Added : /debug/PingServer/Logs/LoginLogs
Added : /debug/PingServer/Logs/PacketLogs
Added : /debug/PingServer/Logs/PingLogs
Added : /debug/PingServer/Logs/ZoneLogs
Added : /debug/PingServer/libmysql.dll
Added : /debug/PingServer/zlib1.dll
Added : /debug/ZoneServer
Added : /debug/ZoneServer/AutoItX3.dll
Added : /debug/ZoneServer/Logs
Added : /debug/ZoneServer/Logs/CoreLogs
Added : /debug/ZoneServer/Logs/LoginLogs
Added : /debug/ZoneServer/Logs/PacketLogs
Added : /debug/ZoneServer/Logs/PingLogs
Added : /debug/ZoneServer/Logs/ZoneLogs
Added : /debug/ZoneServer/libmysql.dll
Added : /debug/ZoneServer/zlib1.dll
Added : /debug/loginserver
Added : /debug/loginserver/AutoItX3.dll
Added : /debug/loginserver/Logs
Added : /debug/loginserver/Logs/CoreLogs
Added : /debug/loginserver/Logs/LoginLogs
Added : /debug/loginserver/Logs/PacketLogs
Added : /debug/loginserver/Logs/PingLogs
Added : /debug/loginserver/Logs/ZoneLogs
Added : /debug/loginserver/libmysql.dll
Added : /debug/loginserver/zlib1.dll
Added : /src
Added : /src/License.h
Added : /src/LoginServer
Added : /src/LoginServer/HandleLogin.cpp
Added : /src/LoginServer/LoginClient.cpp
Added : /src/LoginServer/LoginClient.h
Added : /src/LoginServer/LoginServer.cpp
Added : /src/LoginServer/LoginServer.h
Added : /src/LoginServer/PacketFactory.cpp
Added : /src/LoginServer/SWGPreCU_Login.cpp
Added : /src/PingServer
Added : /src/PingServer/PingServer.cpp
Added : /src/PingServer/PingServer.h
Added : /src/PingServer/SWGPreCU_Ping.cpp
Added : /src/ScratchPad.h
Added : /src/ZoneServer
Added : /src/ZoneServer/Constants.h
Added : /src/ZoneServer/HandleZone.cpp
Added : /src/ZoneServer/PacketFactory.cpp
Added : /src/ZoneServer/SWGPreCU_Zone.cpp
Added : /src/ZoneServer/ZoneClient.cpp
Added : /src/ZoneServer/ZoneClient.h
Added : /src/ZoneServer/ZoneServer.cpp
Added : /src/ZoneServer/ZoneServer.h
Added : /src/shared
Added : /src/shared/AutoIt3.h
Added : /src/shared/ByteBuffer.cpp
Added : /src/shared/ByteBuffer.h
Added : /src/shared/Common.h
Added : /src/shared/Compression.cpp
Added : /src/shared/Compression.h
Added : /src/shared/Crypto.cpp
Added : /src/shared/Crypto.h
Added : /src/shared/Database.cpp
Added : /src/shared/Database.h
Added : /src/shared/Sockets.h
Added : /src/shared/config.cpp
Added : /src/shared/config.h
Added : /src/shared/crc.cpp
Added : /src/shared/crc.h
Added : /src/shared/opcodes.h
Added : /src/shared/tlog.cpp
Added : /src/shared/tlog.h
Added : /src/shared/zconf.h
Added : /src/shared/zlib.h