/*void ProcessGold(unsigned int amount, unsigned char glue, int ID, bool add); void Instance::SendFromService(char *service, char *text, NetMessage *s) { CompiledPacket cp; unsigned char pk[12]={0x22, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00}; unsigned char servname[40];memset(servname, 0, 40); strcpy((char*)servname, service); unsigned long sl=(unsigned long)strlen((char*)servname); Util::ConvertToUnicode(servname); pk[10]=(unsigned char)sl & 0xFF; cp.Add(pk, 12, false); cp.Add(servname, sl*2, false); unsigned char ts[2]; ts[1]=0; ts[0]=(unsigned char)strlen(text) & 0xFF; unsigned char data[570];memset(data, 0, 570); strcpy((char*)data, text); sl=(unsigned char)strlen((char*)data) & 0xFF; Util::ConvertToUnicode(data); cp.Add(ts, 2, false); cp.Add(data, sl*2, false); s->data=cp.GetString(&s->dataSize); Util::CryptoNetMessage(s); gameServer->SendData(s); } // build and send emote text packet given which emote we want to perform void Instance::BuildEmoteText(unsigned char cmd, unsigned long emoteID, unsigned char localID, int ID) { int pos = this->FindPlayerByNID(ID); unsigned long spawnID = this->players[pos].GetAgentID(); if (spawnID == -1) return; NetMessage s; s.ID = ID; PacketManager.DirSwitch("Data/Packets/"); s.data=PacketManager.getData("EmoteText", &s.dataSize); s.data[0x4] = cmd; s.data[0x8] = s.data[0xC] = localID; //this is for certain // this is what we are calling spawn ID (4 bytes long) // it is used for player movement tracking memcpy(&s.data[0x15], &spawnID, 4); memcpy(&s.data[0x23], &spawnID, 4); //s.data[0x15] = s.data[0x23] = 0x15; //0x94; // = 0x00; //s.data[0x16] = s.data[0x24] = 0x01; //0x00; // = 0x13; // 4 byte action ID of the emote that the client wants to do memcpy(&s.data[0x19], &emoteID, 4); s.data[0x2D] = 0x48; //this has to do with the CUP packet CoreLog.LogUnknownPacket(s.data, s.dataSize); printf("\n"); Util::CryptoNetMessage(&s); GameServer->SendData(&s); Util::CryptoNetMessage(&s); //restore data to original state unsigned char emotepkt[22]; memset(emotepkt, 0, 22); memcpy(&emotepkt[0], &s.data[0x1D], 20); Sleep(50); s.data=emotepkt; s.dataSize = 20; s.ID = ID; CoreLog.LogUnknownPacket(s.data, s.dataSize); Util::CryptoNetMessage(&s); GameServer->SendData(&s); } //temporary while we acquire 4 byte emote ID's, right now just does laugh action void Instance::BuildEmoteText(unsigned char cmd, unsigned char localID, int ID) { BuildEmoteText(cmd, EMOTE_LAUGH, localID, ID); } void Instance::ProcessCommand(unsigned char *dest, NetMessage *d, NetMessage *s, void* lir2) { LOGIN_INFO *lir=(LOGIN_INFO*)lir2; //Extract and convert the information char text[122*2];memset(text, 0, 122*2); memcpy(text, dest+6, (int)(dest[2]-1)*2); Util::StripUnicode(text); //Split the text into tokens char *t=strtok(text, " "); NetMessage st; st.ID = d->ID; unsigned char localID = players[FindPlayerByNID(d->ID)].GetLocalID(); //Start check for specific commands if (strcmp(t, "version")==0) { ostringstream buf; buf << "GWLP Version: " << VERSION << endl; SendFromService("@AdminServ", (char*)buf.str().c_str(), s); } else if (strcmp(t, "agree") == 0) { BuildEmoteText(AGREE_TXT, EMOTE_AGREE, localID, d->ID); } else if (strcmp(t, "attention") == 0) { BuildEmoteText(ATTENT_TXT, EMOTE_ATTENT, localID, d->ID); } else if (strcmp(t, "beg") == 0) { BuildEmoteText(BEG_TXT, EMOTE_BEG, localID, d->ID); } else if (strcmp(t, "boo") == 0) { BuildEmoteText(BOO_TXT, EMOTE_BOO, localID, d->ID); } else if (strcmp(t, "bored") == 0) { BuildEmoteText(BORED_TXT, EMOTE_BORED, localID, d->ID); } else if (strcmp(t, "bow") == 0) { BuildEmoteText(BOW_TXT, EMOTE_BOW, localID, d->ID); } else if (strcmp(t, "bowhead") == 0) { BuildEmoteText(BOWHEAD_TXT, EMOTE_BOWHEAD, localID, d->ID); } else if (strcmp(t, "cheer") == 0) { BuildEmoteText(CHEER_TXT, localID, d->ID); } else if (strcmp(t, "catchbreath") == 0) { BuildEmoteText(CATCHBR_TXT, EMOTE_CATCHBR, localID, d->ID); } else if (strcmp(t, "clap") == 0) { BuildEmoteText(CLAP_TXT, EMOTE_CLAP, localID, d->ID); } else if (strcmp(t, "congrats") == 0) { BuildEmoteText(CONGRATS_TXT, EMOTE_CONGRATS, localID, d->ID); } else if (strcmp(t, "dance") == 0) { BuildEmoteText(DANCE_TXT, localID, d->ID); } else if (strcmp(t, "doh") == 0) { BuildEmoteText(DOH_TXT, EMOTE_DOH, localID, d->ID); } else if (strcmp(t, "doubletake") == 0) { BuildEmoteText(DOUBTAKE_TXT, EMOTE_DOUBTAKE, localID, d->ID); } else if (strcmp(t, "drums") == 0) { BuildEmoteText(DRUMS_TXT, EMOTE_DRUMS, localID, d->ID); } else if (strcmp(t, "excited") == 0) { BuildEmoteText(EXCITED_TXT, EMOTE_EXCITED, localID, d->ID); } else if (strcmp(t, "fistshake") == 0) { BuildEmoteText(FISTSHAKE_TXT, EMOTE_FISTSHAKE, localID, d->ID); } else if (strcmp(t, "flex") == 0) { BuildEmoteText(FLEX_TXT, EMOTE_FLEX, localID, d->ID); } else if (strcmp(t, "flute") == 0) { BuildEmoteText(FLUTE_TXT, EMOTE_FLUTE, localID, d->ID); } else if (strcmp(t, "goteam") == 0) { BuildEmoteText(GOTEAM_TXT, EMOTE_GOTEAM, localID, d->ID); } else if (strcmp(t, "guitar") == 0) { BuildEmoteText(GUITAR_TXT, EMOTE_GUITAR, localID, d->ID); } else if (strcmp(t, "health") == 0) { } else if (strcmp(t, "help") == 0) { BuildEmoteText(HELP_TXT, EMOTE_HELP, localID, d->ID); } else if (strcmp(t, "highfive") == 0) { BuildEmoteText(HIGHFIVE_TXT, EMOTE_HIGHFIVE, localID, d->ID); } else if (strcmp(t, "ignore") == 0) { } else if (strcmp(t, "jump") == 0) { BuildEmoteText(JUMP_TXT, EMOTE_JUMP, localID, d->ID); } else if (strcmp(t, "kneel") == 0) { BuildEmoteText(KNEEL_TXT, EMOTE_KNEEL, localID, d->ID); } else if (strcmp(t, "laugh") == 0) { BuildEmoteText(LAUGH_TXT, EMOTE_LAUGH, localID, d->ID); } else if (strcmp(t, "sigh") == 0) { BuildEmoteText(SIGH_TXT, localID, d->ID); PacketManager.DirSwitch("Data/Packets/"); st.data=PacketManager.getData("EmoteSigh", &st.dataSize); //s.data[2] = CURRENT_TEAM_ID; Util::CryptoNetMessage(&st); GameServer->SendData(&st); } else if (strcmp(t, "TestMoneyAdd") == 0) { /* ; log("adding money"); ; unsigned char response_packet[20]; memset(response_packet, 0, 20); unsigned int amount = 3000; unsigned char id = 0x15; unsigned char respond[] = {0x43, 00, 0x15, 00, 0, 0, 00, 00, 0x24, 0x01, 0x15, 00, 0xE8, 0x03, 00, 00, 0x01, 00, 0xFA, 00, 00, 00}; NetMessage s(respond, 22, s->ID); CryptoNetMessage(&s); GameServer->SendData(&s); *//* } else if (strcmp(t, "TestWonHalls") == 0) { PacketManager.DirSwitch("Data/Packets/"); st.data=PacketManager.getData("WonHalls", &st.dataSize); printf("sending won halls packet\n"); Util::CryptoNetMessage(&st); GameServer->SendData(&st); } else if (strcmp(t, "TestGuildChat") == 0) { PacketManager.DirSwitch("Data/Packets/"); st.data=PacketManager.getData("GuildText", &st.dataSize); Util::CryptoNetMessage(&st); GameServer->SendData(&st); } else if (strcmp(t, "TestUnlock") == 0) { PacketManager.DirSwitch("Data/Packets/"); st.data=PacketManager.getData("UnlockTrappersSpeed", &st.dataSize); st.data[0xC] = 0x9B; st.data[0xD] = 0x01; Util::CryptoNetMessage(&st); GameServer->SendData(&st); Sleep(100); st.data=PacketManager.getData("UnlockSnare", &st.dataSize); Util::CryptoNetMessage(&st); GameServer->SendData(&st); } else if (strcmp(t, "TestMerchant") == 0) { PacketManager.DirSwitch("Data/Packets/"); st.data=PacketManager.getData("TestMerchant", &st.dataSize); Util::CryptoNetMessage(&st); GameServer->SendData(&st); } else if (strcmp(t, "TestBuy") == 0) { PacketManager.DirSwitch("Data/Packets/"); st.data=PacketManager.getData("BuyGrayDye", &st.dataSize); st.data[0x02] = st.data[0x3E] = 0x3D; //this was previously assumed to be st.data[0x44] = 0x60; //0x41; st.data[0x45] = 0x02; //0x01; Util::CryptoNetMessage(&st); GameServer->SendData(&st); } else if (strcmp(t, "TestInc") == 0) { st.data=PacketManager.getData("IncGrayDye", &st.dataSize); st.data[0x02] /*= st.data[0x15]*/ //= 0x3D; /* st.data[0x17] = 0x60; st.data[0x18] = 0x02; Util::CryptoNetMessage(&st); GameServer->SendData(&st); } else if (strcmp(t, "TestQuest") == 0) { PacketManager.DirSwitch("Data/Packets/"); st.data=PacketManager.getData("TestQuest", &st.dataSize); Util::CryptoNetMessage(&st); GameServer->SendData(&st); } else if (strcmp(t, "TestAttack") == 0) { PacketManager.DirSwitch("Data/Packets/"); st.data=PacketManager.getData("TestAttack", &st.dataSize); //st.data[4] = 0x25; CoreLog.LogUnknownPacket(st.data, st.dataSize); Util::CryptoNetMessage(&st); GameServer->SendData(&st); //working functions below } else if (strcmp(t, "Unlock") == 0) { unsigned short skillID; t = strtok(NULL, " "); sscanf(t, "%4X", &skillID); PacketManager.DirSwitch("Data/Packets/"); st.data=PacketManager.getData("UnlockTrappersSpeed", &st.dataSize); memcpy(&st.data[0xC], &skillID, 2); Util::CryptoNetMessage(&st); GameServer->SendData(&st); } else if (strcmp(t, "AddGold") == 0) { t = strtok(NULL, " "); unsigned int amount = atoi(t); unsigned char inventoryID = lir->instancePtr->AccessPlayer(d->ID)->GetStreamID() & 0xFF; if (t != NULL) ProcessGold(amount, inventoryID, d->ID, true); } else if (strcmp(t, "RemoveGold") == 0) { t = strtok(NULL, " "); unsigned int amount = atoi(t); unsigned char inventoryID = lir->instancePtr->AccessPlayer(d->ID)->GetStreamID() & 0xFF; if (t != NULL) ProcessGold(amount, inventoryID, d->ID, false); } else if (strcmp(t, "ReplayPacket") == 0) { //t = strtok(NULL, " "); PacketManager.DirSwitch("Data/Packets/Zone/"); t = strtok(NULL, " "); if (t == NULL) return; CoreLog.debug("Replaying packet: %s", t); st.data=PacketManager.getData(t, &st.dataSize); if (st.data == NULL) { CoreLog.debug("Unable to replay packet"); return; } Util::CryptoNetMessage(&st); GameServer->SendData(&st); } else if (strcmp(t, "ReplayInstPkt") == 0) { t = strtok(NULL, " "); if (t == NULL) return; CoreLog.debug("Replaying packet: %s", t); st.data=packetMan.getData(t, &st.dataSize); if (st.data == NULL) { CoreLog.debug("Unable to replay packet"); return; } Util::CryptoNetMessage(&st); GameServer->SendData(&st); } else if (strcmp(t, "ReplayDir") == 0) { t = strtok(NULL, " "); if (t == NULL) return; PacketManager.DirSwitch(t); //PacketManager.replayPackets(); } else if (strcmp(t, "MapTravel") == 0) { this->mapTravel = true; PacketManager.DirSwitch("Data/Packets/"); st.data=PacketManager.getData("54.bin", &st.dataSize); Util::CryptoNetMessage(&st); GameServer->SendData(&st); this->zoneID = 0x011A; st.data=PacketManager.getData("55.bin", &st.dataSize); //memcpy(&st.data[st.dataSize - 3], &this->zoneID, 2); Util::CryptoNetMessage(&st); GameServer->SendData(&st); } else { //unknown command, send unknown command message //after this command is sent, client sends back a message //to the login server, which the login server must reply to //so that the "unknown command" message is displayed unsigned char retp[12]; memset(retp, 0, 12); retp[0] = UNKNOWN_CMD_PACKET; retp[6] = 0x10; retp[8] = 0xFA; st.data = retp; st.dataSize = 12; Util::CryptoNetMessage(&st); GameServer->SendData(&st); } } // Handles guild text which needs to be broadcasted to guild chat // STATUS: working void Instance::GuildText(int ID, unsigned char *d) { NetMessage st; st.ID = ID; int name_length; int len = (int)(d[2]-1)*2; unsigned char *name = AccessPlayer(ID)->GetPlayerNameUnicode(&name_length); unsigned char *newpkt = new unsigned char[17+len+name_length+6]; memset(newpkt, 0, 17+len+name_length+6); newpkt[0] = CHAT_RESPONSE_SVR; newpkt[2] = d[2] + 2; //length of non-unicode string plus 2 //below seems to be constant newpkt[4] = 0x08; newpkt[5] = 0x01; newpkt[6] = 0x07; newpkt[7] = 0x01; memcpy(newpkt+8, d+6, len); //copy message into packet newpkt[8+len] = 0x01; newpkt[10+len] = GUILD_RESPONSE_CMD; newpkt[12+len] = GUILD_CHAT; newpkt[13+len] = name_length / 2; // non-unicode length of player's name memcpy(newpkt+15+len, name, name_length); // copy players unicode name into packet newpkt[15+len+name_length+2] = 0x10; newpkt[15+len+name_length+4] = 0xFA; //for (int i = 0; i < 17+len+name_length+6; i++) printf("%X ", newpkt[i]); printf("\n"); st.dataSize = 17+len+name_length+6; st.data = newpkt; Util::CryptoNetMessage(&st); //for now, just send the message to everyone in this instance (will do checking later) for (unsigned int j = 0; j < players.size(); j++) { st.ID = players[j].GetnetworkId(); gameServer->SendData(&st); } delete newpkt; } // Handles local text which needs to be broadcasted to local, team, or trade chat // STATUS: working void Instance::LocalText(unsigned char localID, unsigned char type, int ID, unsigned char *d) { NetMessage st; st.ID = ID; int endstr = (int)(d[2]-1)*2; unsigned char *retp = new unsigned char[endstr + 16]; memset(&retp[0], 0, endstr + 16); retp[0] = CHAT_RESPONSE_SVR; retp[2] = d[2] + 2; retp[4] = 0x08; retp[5] = retp[7] = 0x01; retp[6] = 0x07; memcpy(&retp[8], d+6, endstr); retp[8 + endstr] = 0x01; retp[8 + endstr + 2] = CHAT_RESPONSE_CMD; retp[8 + endstr + 4] = localID; retp[8 + endstr + 6] = type; st.data = retp; st.dataSize = endstr + 15; CoreLog.LogUnknownPacket(st.data, st.dataSize); Util::CryptoNetMessage(&st); GameServer->SendData(&st); /* //for now, just send the message to everyone in this instance (will do checking later) for (unsigned int j = 0; j < players.size(); j++) { st.ID = players[j].GetnetworkId(); gameServer->SendData(&st); } */ /* delete[] retp; } //process team chat void Instance::ProcessTeamChat(unsigned char *dest, NetMessage *d, NetMessage *s, void* lir) { LocalText(players[FindPlayerByNID(d->ID)].GetLocalID(), TEAM_CHAT, d->ID, dest); /* //Extract and convert the information char text[122*2];memset(text, 0, 122*2); memcpy(text, dest+6, (int)(dest[2]-1)*2); StripUnicode(text); printf("%s \n", text); for (int i = 0; i < 8; i++) printf("%x ", dest[i]); printf("\n"); //Split the text into tokens char *t=strtok(text, " "); NetMessage st; PacketManager.DirSwitch("Data/Packets/"); st.ID = d->ID; //st.data=PacketManager.getData("NoBodyHearsYou", &st.dataSize); unsigned char *tmppkt=PacketManager.getData("LocalText", &st.dataSize); int endstr = (int)(dest[2]-1)*2; st.dataSize = st.dataSize - 10 + endstr; unsigned char *newpkt = new unsigned char[st.dataSize]; tmppkt[2] = dest[2] + 2; //don't ask me (length + 2 ?) memcpy(&newpkt[0], &tmppkt[0], 8); memcpy(&newpkt[8], dest+6, endstr); tmppkt[0x14] = CHAT_RESPONSE_CMD; tmppkt[0x16] = tmppkt[0x21] = CURRENT_TEAM_ID; tmppkt[0x18] = TEAM_CHAT; memcpy(&newpkt[endstr+8], &tmppkt[0x12], 13); st.data = newpkt; CryptoNetMessage(&st); GameServer->SendData(&st); //for (int i = 0; i < instances.size(); i++) //broadcast chat to all connected users // instances[i].gameServer->SendData(&st); delete newpkt; *//* } //process local chat void Instance::ProcessLocalChat(unsigned char *dest, NetMessage *d, NetMessage *s, void* lir) { LocalText(players[FindPlayerByNID(d->ID)].GetLocalID(), LOCAL_CHAT, d->ID, dest); /* //Extract and convert the information char text[122*2];memset(text, 0, 122*2); memcpy(text, dest+6, (int)(dest[2]-1)*2); StripUnicode(text); printf("%s \n", text); for (int i = 0; i < 8; i++) printf("%x ", dest[i]); printf("\n"); //Split the text into tokens char *t=strtok(text, " "); NetMessage st; PacketManager.DirSwitch("Data/Packets/"); st.ID = d->ID; //st.data=PacketManager.getData("NoBodyHearsYou", &st.dataSize); unsigned char *tmppkt=PacketManager.getData("LocalText", &st.dataSize); int endstr = (int)(dest[2]-1)*2; st.dataSize = st.dataSize - 10 + endstr; unsigned char *newpkt = new unsigned char[st.dataSize]; tmppkt[2] = dest[2] + 2; //don't ask me (length + 2 ?) memcpy(&newpkt[0], &tmppkt[0], 8); memcpy(&newpkt[8], dest+6, endstr); tmppkt[0x14] = CHAT_RESPONSE_CMD; tmppkt[0x16] = tmppkt[0x21] = CURRENT_TEAM_ID; tmppkt[0x18] = LOCAL_CHAT; memcpy(&newpkt[endstr+8], &tmppkt[0x12], 13); st.data = newpkt; CryptoNetMessage(&st); GameServer->SendData(&st); */ /* for (int i = 0; i < instances.size(); i++) { //broadcast chat to all connected users if (this->GetZoneID() == instances[i].GetZoneID()) { for (int j = 0; j < instances[i].players.size(); j++) { st.ID = instances[i].players[j].GetnetworkId(); instances[i].gameServer->SendData(&st); } break; } } */ // delete newpkt; /* } //process Trade chat void Instance::ProcessTradeChat(unsigned char *dest, NetMessage *d, NetMessage *s, void* lir) { LocalText(players[FindPlayerByNID(d->ID)].GetLocalID(), TRADE_CHAT, d->ID, dest); } #define DATA_OFF 0xE void Instance::ProcessWhisperChat(unsigned char *dest, NetMessage *d, NetMessage *s, void* lir) { //Extract and convert the information int len = (int)(dest[2]-1)*2; NetMessage st; st.ID = InternalComm->GetClientModeID(); unsigned char *retpkt = new unsigned char[DATA_OFF + len + 6]; memset(retpkt, 0, DATA_OFF +len + 6); memcpy(&retpkt[DATA_OFF], &dest[6], len); retpkt[2] = SEND_PM_HEADER1; retpkt[4] = 0x02; for (int i = DATA_OFF; i < len+DATA_OFF; i++) { //replace comma with width of the message text and update //the nickname width field at offset 0xA if (retpkt[i] == ', ') { retpkt[i] = (unsigned char)((len - i + DATA_OFF)/2 - 1); retpkt[0xA+2] = (unsigned char)((i - DATA_OFF)/2); //end of chat packet signature? retpkt[DATA_OFF + len] = 0x10; retpkt[DATA_OFF + len + 2] = 0x0A; retpkt[DATA_OFF + len + 3] = 0x01; } } //send a packet back to the sender confirming the message was sent st.dataSize = DATA_OFF + len + 4; st.data = &retpkt[2]; //LogUnknownPacket(&st); Util::CryptoNetMessage(&st); GameServer->SendData(&st); //send the message to the requested receiver if they are online st.data = &retpkt[4]; st.dataSize = DATA_OFF + len - 4; st.data[0] = 0x08; // header for whisper packets defined for ICProcess st.data[1] = (unsigned char)(st.dataSize - 2); st.data[2] = SEND_PM_HEADER2; //LogUnknownPacket(&st); Util::CryptoNetMessage(&st, 2); InternalComm->SendData(&st); Sleep(100); delete retpkt; } //////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////// /* WARNING: NASTY UGLY MESS BELOW(WELL ACTUALLY THE WHOLE FILE BUT YEAH) */ /* if (dest[1] == 0x00) { int pos = this->FindPlayerByNID(d->ID); Player *p = &this->players[pos]; unsigned char retpp[] = {0x02, 0x00, 0xC5, 0x01, 0x00, 0x00, 0x10, 0x00, 0xFA, 0x00, 0x00, 0x00}; switch (dest[0]) { case 0x99: s->ID = d->ID; s->data = retpp; s->dataSize = sizeof(retpp); CryptoNetMessage(s); GameServer->SendData(s); return true; case 0x00: if (d->dataSize == 2 && this->mapTravel == false) { int accountID = p->getAccountID(); unsigned char logoutpkt[6]; // tell the login server the user is logging out logoutpkt[0] = 0x0A; logoutpkt[1] = sizeof(int); memcpy(&logoutpkt[2], &accountID, 4); //log << "client with ID " << accountID << "logging out" << ; s->ID = InternalComm->GetClientModeID(); s->data = logoutpkt; s->dataSize = 6; CryptoNetMessage(s, 2); InternalComm->SendData(s); unsigned char retp[] = {0x02, 0x00, 0x5E, 0x00, 0x00, 0x00, 0x10, 0x00, 0xFA, 0x00, 0x00, 0x00}; s->ID = d->ID; s->data = retp; s->dataSize = sizeof(retp); CryptoNetMessage(s); //GameServer->SendData(s); } else { //performing a map travel PacketManager.DirSwitch("Data/Packets/Zone/"); int dsize = 0; unsigned char *datacomp2 = PacketManager.getData("Datacomp2", &dsize); //datacomp2[0] = 0x04; //if (this->mapTravel == true) SendInitialPacket(p); } return false; case SET_SECONDARY: // client is changing the secondary profession under skills ProcessSetSecondary(d->ID, dest, d->dataSize); return true; case MOVE_SKILL: // client is moving a skill to or from the skill bar ProcessSkillMove(d->ID, dest, d->dataSize); return true; case DELETE_ITEM: // client is deleting an item from inventory ProcessItemDelete(p->getInventoryID() & 0xFF, d->ID, dest, d->dataSize); return true; case MOVE_ITEM: // client is moving an item in inventory (maybe storage also?) ProcessItemMove(p->getInventoryID() & 0xFF, d->ID, dest, d->dataSize); return true; case MOVE_ROTATE: // client has performed a rotation ProcessMove(d->ID, dest, d->dataSize, this->zoneID, p->GetLocalID(), p->getSpawnID()); return true; case MOVE_RELEASE: // client has released a key ProcessMove(d->ID, dest, d->dataSize, this->zoneID, p->GetLocalID(), p->getSpawnID()); return true; case MOVE_TO_CLICK: // client has clicked to move to a location ProcessMove(d->ID, dest, d->dataSize, this->zoneID, p->GetLocalID(), p->getSpawnID()); return true; case MOVE_UPDATE: // periodically updated while client is moving ProcessMove(d->ID, dest, d->dataSize, this->zoneID, p->GetLocalID(), p->getSpawnID()); return true; case TARGET_PLAYER: if (d->dataSize == 6) { //log << << "Selecting Player with ID: " << dest[2] << ; return false; } else return false; case TARGET_NPC: // client is targeting an NPC ProcessTargetNPC(d->ID, dest, d->dataSize, p->GetLocalID()); return false; case COMPASS_PING: // client has pinged the compass ProcessCompass(dest[0], d->ID, dest[8], dest[10], dest[2]); return true; case TARGET_SELF: // client is targeting their self //log << "Targeting self, self team ID = " << dest[2] << ; //there needs to be some code here to send message if (d->dataSize != 6) { //send out self targetting message to team chat PacketManager.DirSwitch("Data/Packets/"); s->data=PacketManager.getData("SelfTarget", &s->dataSize); s->data[8] = dest[2]; CryptoNetMessage(s); GameServer->SendData(s); } return true; case ATTRIB_TEAM: // client is sending an attribute to team chat ProcessTeamAction(d->ID, p->GetLocalID(), d->dataSize, dest); return true; case PARTY_ADDHENCH: // player is trying to add henchman to their party if (d->dataSize == 4) { //log << "Adding henchman with id: " << dest[2] << "to the party" << ; } return true; case PARTY_ADDPL: // client is attempting to add a player to their party StripUnicode(&dest[4], (int)dest[2]); //log << << "Adding player to party: " << (char*)&dest[4] << ; //log << "Name length: " << dest[2] << ; return true; case MAP_TRAVEL: // client is performing a map travel return false; case CHAR_UPDATE: // I think this means client is sending update character information before loading into a new instance // this usually appears as a 94 byte packet, here is the general flow of packets on a map travel: // 1) client sends map travel request with MAP_TRAVEL header // 2) server responds with approximately 148 byte packet and // 3) client sends character update packet (this one) with CHAR_UPDATE header // 4) server sends 55 byte packet with character info and zone info (in response to normal client request) // 5) server sends charinfo (normal header), server sends 18bReply, server sends zone data (header 04 00) // just ignore received data for now, send 55 byte packet so client knows we are doing a map travel //SendInitialPacket(p); return false; case SEEK_PARTY: // client has seek party message enabled ProcessLocalAction(dest[0], d->ID, dest[2], d->dataSize, (char*)&dest[5]); return true; case UNSEEK_PARTY: // client has disabled seek party message ProcessLocalAction(dest[0], d->ID, 0, d->dataSize, NULL); return true; } } */ /*return false; } void Instance::BuildDatacomp(Player *p) { /* unsigned char *data; int dataSize; NetMessage s; CompiledPacket pkt; data = p->DatacompStart(&dataSize); pkt.Add(data, dataSize, false); data = p->SkillbarPacket(&dataSize); pkt.Add(data, dataSize, false); data = p->UnlockedSkillsPacket(&dataSize); pkt.Add(data, dataSize, false); data = p->ExperiencePacket(&dataSize); pkt.Add(data, dataSize, false); data = p->SetAttributesPacket(&dataSize); pkt.Add(data, dataSize, false); data = p->GuildStartPacket(&dataSize); pkt.Add(data, dataSize, false); data = p->PlayerPacket(&dataSize); pkt.Add(data, dataSize, false); data = p->DatacompEnd(&dataSize); pkt.Add(data, dataSize, false); s.ID=p->GetnetworkId(); s.data=pkt.GetString(&s.dataSize); LogUnknownPacket(&s); CryptoNetMessage(&s); gameServer->SendData(&s); */ //}