47 Commits

Author SHA1 Message Date
Kinglykrab
d38b8a4867
[Bug Fix] Fix possible crash in #givemoney. (#1828) 2021-11-25 13:55:06 -05:00
Kinglykrab
cece66adc6
[Commands] Cleanup #instance Command. (#1803)
* [Commands] Cleanup #instance Command.
- Cleanups message and logic.
- Cleanup ListAllInstances() method.
- Fix day calculation in ConvertSecondsToTime().

* Cleanup.

* Add return.
2021-11-21 19:02:01 -05:00
Kinglykrab
5470ec6293
[Commands] Cleanup #corpse Command. (#1790)
- Cleanup message and logic.
- Add ConvertMoneyToString(platinum, gold, silver, copper) helper method.
- Cleanup NPC::QueryLoot() and Corpse::QueryLoot().
2021-11-21 14:02:03 -05:00
Kinglykrab
40edefa6f4
[Commands] Cleanup #camerashake Command. (#1787)
- Cleanup message and logic.
- Fix ConvertSecondsToTime logic for milliseconds.
- Add ConvertMillisecondsToTime inline function.
2021-11-21 10:03:20 -05:00
Kinglykrab
ddcb184183
[Commands] Cleanup #stun Command. (#1749)
* [Commands] Cleanup #stun Command.
- Cleanup message.
- Add ConvertSecondsToTime() to string_util.h and convert Quest API Methods to use helper.

* Add days to ConvertSecondsToTime() and cleanup logic.

* Cleanup.

* Typo.

* Cleanup.

* Cleanup.
2021-11-14 14:05:44 -05:00
Chris Miles
a9d1034298
[Loginserver] Worldserver Name Sanitization (#1739)
* Sanitize bad words in server names

* Add config options and enforcement for dev/test servers and servers starting with a special character

* Refine bad word logic

* Add installer to dev/test servers

* Change server prefixes

* Special char prefix

* Formatting

* Remove multi words

* Add server types enum

* Add error constants

* Remove sanitize from world level

* Use strn0cpy
2021-11-12 23:02:05 -06:00
hg
873f1f7f34
[Hotfix] Add include to fix windows build (#1657) 2021-10-30 21:11:04 -05:00
Chris Miles
d87db648c3
[Loginserver] Code Cleanup and Tweaks (#1653)
* if for whatever reason the world server is not sending an address, use the local address it sends

* Log when world is sending loginserver info

* Force legacy mode when login host is login.eqemulator.net to avoid misconfigurations at least until things change

* Add human IP translation to log messages

* Sanitize world server name

* Code cleanup and renaming member variables

* More cleanup

* Remove this->

* Validation constants

* Key worldserver lookups by both longname and shortname both

* Update allowed character list

* Fix short_name API response field; add world_id to response

* Shorten receiver verbosity

* Remove unnecessary member variables from database and rename database to m_database

* Adjust MAX_SERVER_VERSION_LENGTH

* Fix indents
2021-10-30 19:09:42 -05:00
Chris Miles
c078257f70
[Quest API] Port DiaWind Plugin to Native Quest API (#1521)
* Port DiaWind plugin to native Quest API

* Add no logging aliases
2021-09-05 20:29:21 -05:00
Michael Cook (mackal)
dba3010c89
[Strings] Split String Optimizations (#1325)
* Switch the 2 split calls to SplitString

* Nuke duplicate split in favor of SplitString #1263

* Add a test for SplitString

* Optimize SplitString

Benchmarking:
--------------------------------------------------------------
Benchmark                       Time           CPU Iterations
--------------------------------------------------------------
bench_oldsplit               5201 ns       5201 ns     129500
bench_split                  1269 ns       1269 ns     548906

This is splitting a VERY long SpecialAbilities string. This is ~75%
speed up.
2021-04-22 23:36:39 -05:00
Michael Cook (mackal)
86ce506956
[Cleanup] Nuke Make/AppendAnyLenString (#1251)
* Add a std::string overload for Database::SetMQDetectionFlag

* Replace calls to MakeAnyLenString in client_packet.cpp

At least the SetMQDetectionFlag ones

* Replace MakeAnyLenString calls in client_process

At least SetMQDectectionFlag ones

* Replace MakeAnyLenString in embparser

fmtlib actually is gross here, oh well.

* Replace MakeAnyLenString in merc

* Replace MakeAnyLenString in inventory

Also if'd out an unfinished implementation of Client::GetItemLinkHash

* Replace AppendAnyLenString in zonelist

* Replace AppendAnyLenString in zonelist

* Replace MakeAnyLenString in clientlist

* Nuke MakeAnyLenString/AppendAnyLenString

* Fix formatting string in zonelist
2021-02-23 18:32:19 -06:00
Michael Cook (mackal)
74ce20b256
Add string util search_deliminated_string (#1260)
This function takes a string of deliminated an see if another string is
one of those

This function also verifies it's not finding a substring
2021-02-23 11:52:34 -06:00
Michael Cook (mackal)
f9923ffda0
Fix va_list leaks in MakeAnyLenString/AppendAnyLenString (#1240)
Slowly leaking memory for ages!

clang-tidy complained about it
2021-02-12 02:07:47 -06:00
hg
d2ad2ec078 Add comment to FormatName 2020-12-30 18:47:31 -05:00
hg
da067be2fa Implement initial expedition system
Add Expeditions logging category

Add handlers for all Dynamic Zone/Expedition related opcodes

Add FormatName string_util function to format character names

Add Zone::IsZone helper method

Add cross zone MessageString support with variable parameters

Add static Client method helpers for cross zone messaging

Add #dz gm command to debug expedition cache for current zone
2020-12-30 18:47:06 -05:00
Akkadius
2e0c892b07 Add cli character:copy-character and #copycharacter 2020-07-18 21:07:22 -05:00
Noudess
4a23086183 Fixes to #grid show. Added new string utilities. 2020-05-28 08:41:10 -04:00
Michael Cook (mackal)
4241fba7e2 Forgot 2 exceptions 2020-01-16 19:10:04 -05:00
Uleat
cf80e594bc Merge branch 'master' of https://github.com/EQEmu/Server into lsid
# Conflicts:
#	common/ruletypes.h
#	world/net.cpp
#	zone/bot_command.cpp
#	zone/command.cpp
#	zone/zonedb.cpp
2019-09-12 01:54:37 -04:00
Akkadius
b63821bbae Change account parse delimiter [skip ci] 2019-09-08 15:44:19 -05:00
Akkadius
db5e511af3 Merge branch 'master' of https://github.com/EQEmu/Server into lsid 2019-09-01 19:23:56 -05:00
Uleat
a534ab83ec Converted new implode and join_pair functions to template functions 2019-08-31 20:55:46 -04:00
Uleat
d341a1b38f Updated the command systems to automatically add new commands and remove orphaned entries from the command settings tables 2019-08-30 06:38:48 -04:00
Akkadius
1c6a76246f Added bulk edit command #npceditmass <column-to-search> <column-search-value> <change-column> <change-value> 2019-08-11 02:40:23 -05:00
Akkadius
57354579aa Unify chat constants usage 2019-08-11 00:00:55 -05:00
Akkadius
a9969e500b ls tweaks 2019-07-05 21:22:35 -05:00
Akkadius
8bb909090b Merge branch 'master' into lsid 2019-06-26 00:56:13 -05:00
Akkadius
f3067872c4 Appveyor take 2 2018-11-19 02:57:38 -06:00
Akkadius
020b144449 Try to make appveyor happy 2018-11-19 02:52:53 -06:00
Akkadius
1061788610 Even more mob_info work 2018-11-14 02:23:38 -06:00
Akkadius
4758c04e99 More mob_info work 2018-11-13 03:07:18 -06:00
Akkadius
775b5fcaf1 Mostly done with global base scaling work, dev tooling and various other works 2018-11-04 23:26:34 -06:00
KimLS
0ec53eff52 Reimplement some functions 2017-12-24 23:21:17 -08:00
KimLS
18d28ae8d3 Console initial implementation 2017-04-09 20:17:48 -07:00
Uleat
a37a811014 Imported memory_buffer files from inv2 branch 2016-05-27 20:39:11 -04:00
Michael Cook (mackal)
60da544d3a clang-tidy modernize-use-auto 2016-05-25 16:10:28 -04:00
Uleat
ffb88e0a8f Added EQEmu::OutBuffer() - stringstream-derived class with a few additional methods 2016-05-18 22:38:41 -04:00
Akkadius
d2b9d4ab20 find_replace fix for real 2015-02-01 22:40:56 -06:00
Akkadius
f9ba99e99f Merge branch 'master' of https://github.com/EQEmu/Server
Conflicts:
	common/eqemu_logsys.h
2015-02-01 15:56:05 -06:00
Akkadius
ed9bdaf60c Add to string_util.h void find_replace(std::string& string_subject, std::string& search_string, std::string& replace_string) { 2015-02-01 01:00:05 -06:00
JJ
96925f0dde Some minor cleanup. [skip ci] 2015-01-31 17:03:44 -05:00
Akkadius
a6b95aeceb At point in which Client -> Server packet logging is working, will do more prechecking to declare that anything actually is subscribed to this category before outputting 2015-01-31 02:23:58 -06:00
Michael Cook (mackal)
6e295a1102 Rewrite StringFormat to take advantage of RVO
The standard stipulates that if RVO doesn't take place, that it should
return an rvalue anyways, so move semantics should take place without
the std::move, which were just forcing RVO to not be attempted.

Also removed duplicate code

The only thing that /might/ be slower is the output.clear() but that's
an edge case anyways.
2015-01-26 00:31:50 -05:00
Akkadius
40377447ac string_util.cpp & .h header include cleanup 2014-12-15 22:47:48 -06:00
KimLS
412835d7fa Basic string tests, plus fix for StringFormat returning a std::string that was just very subtley malformed. 2014-08-24 16:26:51 -07:00
KimLS
7fc21b9e3a Tons of renames 2014-08-21 19:33:02 -07:00
KimLS
405884f47d More file renames. 2014-08-21 16:59:32 -07:00