Jump to content

Toinan67

Members
  • Posts

    389
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Toinan67's Achievements

Advanced Member

Advanced Member (3/3)

0

Reputation

  1. Very interesting, thank you amaru I had no idea of : "and it would 'grab' nearest bytes depending on T size" Thanks again
  2. Hi ! It's been a very long time since i posted, i'm pleased to be back I have a question about the ByteBuffer class, which is the parent class of WorldPacket. If i understood correctly, when you do this : uint32 value; packet >> value; You get into that function : ByteBuffer &operator>>(uint32 &value) { value = read<uint32>(); return *this; } Which ultimately calls that function : template <typename T> T read(size_t pos) const { if(pos + sizeof(T) > size()) throw ByteBufferException(false, pos, sizeof(T), size()); T val = *((T const*)&_storage[pos]); EndianConvert(val); return val; } _storage is a vector<uint8>. I have a problem with : T val = *((T const*)&_storage[pos]); (sorry about the code display, it seems like there is some troubles) So basically we're storing a uint32 in a uint8 ?! Then why do we use uint32? Why not using uint8 everywhere? And why is this line so complicated? Why not : T val = _storage[pos]; I hope i've been clear Thank you!
  3. If you're on Unix : grep "latency" mangos/src You'll find everything you want, especially this : pPlayer->GetSession()->GetLatency(); So I suggest a simple timer in WorldSession::Update such as : if (m_latencyCheckTimer < diff) { if (GetLatency() > 500 /*replace it by whatever you want*/) { KickPlayer(); m_latencyCheckTimer = 1 * MINUTE * IN_MILLISECONDS; } } else m_latencyCheckTimer = 1 * MINUTE * IN_MILLISECONDS; Very basic, but you can improve it if you want (take values from conf, write something about the kicked player in logs, etc) Edit : actually my code is really bad, since a player could have a huge lag for 2 or 3 secs and be kicked just because the check would occur during those 2 or 3 secs.
  4. TrainerSpellData const* cSpells = unit->GetTrainerSpells(); TrainerSpellData const* tSpells = unit->GetTrainerTemplateSpells(); if (!cSpells && !tSpells) { DEBUG_LOG("WORLD: SendTrainerList - Training spells not found for %s", guid.GetString().c_str()); return; } uint32 maxcount = (cSpells ? cSpells->spellList.size() : 0) + (tSpells ? tSpells->spellList.size() : 0); WorldPacket data( SMSG_TRAINER_LIST, 8+4+4+maxcount*38 + strTitle.size()+1); data << ObjectGuid(guid); data << uint32(cSpells->trainerType ? cSpells->trainerType : tSpells->trainerType); Something wrong with the last line : we use cSpells->trainerType without being sure it's not NULL. data << uint32(cSpells && cSpells->trainerType ? cSpells->trainerType : tSpells->trainerType); might be better?
  5. I started a spell tutorial a few months ago : http://getmangos.eu/wiki/Spell_system Unfortunately it's not complete at all....but at the moment I have very few time to continue it. I hope someone will find time to correct it/continue it with or without me
  6. I'd like to hear some comments from the devs themself : what do they think of all this? I mean, they're the heart of MaNGOS, they make it go further every day with new patches. This is a big big step for this community, I think devs should give us their thoughts =)
  7. I have been investing money into this since 2005, just because I love the idea, and let alone seeing the progress and knowledge shown by the team is worth it. And I will surely continue to do so. Do you already have an idea of the money needed? Definitely.
  8. And what about the Wiki changes? I can supply more stuff, templates, general docs, structure, etc. if the changes from today smell good. I have some troubles accessing the internet this afternoon, I'll have a look at the wiki in a few hours.
  9. This should be MaNGOS motto. I've learned so many things too... I strongly support this idea of creating a legal body around MaNGOS. Legal issues have always created debates inside and outside the community, and today what you plan to do might end those debates. I have absolutely no knowledge is legal stuff, I don't know if your plan is even possible, but I really think this could be a great improvement. However I have a few questions : - what would this "legal body" be actually? - what will we have to do to be "protected" inside this legal body ? About that, I'm thinking of some "bad" people who might use this legal body to justify their unauthorized use of MaNGOS... Is something like that going to be a problem? - you were talking about a "founding documentation".... I can't find it at the moment, neither on the index, nor on the wiki Anyway, since my arrival I'm amazed by what this community can achieve. There are a lot of very talented and interesting people around here, Vladimir, laise, Lynx3d, NoFantasy, TOM_RUS, Ambal, faramir118, qsa, Schmoo, zergtmn, and everyone else... (the sheep included ) I'm thankful to all of them to be a part of this project! MaNGOS should be a citizenship.
  10. A cloud with a flash, or a brain working hard to learn new things =) (That's how I understand it) Very nice new logo, I like it very much!
  11. Safari 5.0.3 on Mac OS X, same problem. Actually I think it's something TheLuda wanted, am I wrong?
  12. This is really nice indeed, where did you find this False.Genesis? Did you do it yourself? It could be a very nice core mod added to the official core (with a conf option to activate/deactivate it)
  13. There's no * (DELETE FROM whatever) ^^ @EARTHWALKER : Schmoo was telling you to delete everything from those tables so that new instance reset times could be created
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use