void Channel::Invite(Player *p, const char *newname) { WorldPacket data; if(!IsOn(p)) { MakeNotOn(&data); SendToOne(&data,p); } else { Player *newp = objmgr.GetPlayer(newname); if(newp == NULL) { MakeNotOn(&data,newname); SendToOne(&data,p); } else if(IsOn(newp)) { MakeAlreadyOn(&data,newp); SendToOne(&data,p); } else { MakeInvited(&data,p); SendToOne(&data,newp); data.clear(); MakeYouInvited(&data,newp); SendToOne(&data,p); } } }
void Channel::Invite(uint64 p, const char *newname) { if(!IsOn(p)) { WorldPacket data; MakeNotOn(&data); SendToOne(&data,p); } else { Player *newp = objmgr.GetPlayer(newname); if(!newp) { WorldPacket data; MakeNotOn(&data,newname); SendToOne(&data,p); } else if(IsOn(newp->GetGUID())) { WorldPacket data; MakeAlreadyOn(&data,newp->GetGUID()); SendToOne(&data,p); } else { WorldPacket data; if(!newp->HasInIgnoreList(p)) { MakeInvited(&data,p); SendToOne(&data,newp->GetGUID()); data.clear(); } MakeYouInvited(&data,newp->GetGUID()); SendToOne(&data,p); } } }