Znote / ZnoteAAC

Developement repository for the Znote AAC project. A website portal to represent and manage your Open Tibia server.
MIT License
143 stars 127 forks source link

proxy support #503

Open rookgaard opened 2 years ago

rookgaard commented 2 years ago

That way if anyone have proxy server (in USA, Brazil or Austrialia for example) he can just uncomment world entry creation + player proxy entry. Because Cipsoft client won't allow for two the same character names, I'm adding suffix [proxy], so it require changes in engine to ignore that name part:

https://github.com/otland/forgottenserver/blob/master/src/protocolgame.cpp#L433

std::string characterName = msg.getString();

to

std::string rawCharacterName = msg.getString();
std::size_t proxyPos = rawCharacterName.find(" [");
std::string characterName = proxyPos != std::string::npos ? rawCharacterName.substr(0, proxyPos) : rawCharacterName;
Znote commented 2 years ago

Wouldn't it be more organized to use a prefix instead of a suffix? Could you link me the code for this proxy system?