cheahjs / TerrariaAPI-Server

Fork is now over at https://github.com/NyxStudios/TerrariaAPI-Server
https://tshock.co
32 stars 24 forks source link

TerrariaApi-Sever Revamp #15

Closed CoderCow closed 11 years ago

CoderCow commented 11 years ago

Implements #14.

hakusaro commented 11 years ago

I can't really code review on my phone, but I'm inclined to want to accept this and fix any regressions ourselves based on the previous discussion about upgrading to a better API.

Lucas Nicodemus via Google Nexus 4 On Aug 7, 2013 1:14 AM, "CoderCow" notifications@github.com wrote:

Implements #14 https://github.com/Deathmax/TerrariaAPI-Server/issues/14.

You can merge this Pull Request by running

git pull https://github.com/CoderCow/TerrariaAPI-Server 1.14

Or view, comment on, or merge it at:

https://github.com/Deathmax/TerrariaAPI-Server/pull/15 Commit Summary

  • Added .editorconfig. It will automatically set the given settings in the used text editor if the Editor Config plugin is installed (available for several text editors), info: http://editorconfig.org/
  • -Revamped the hook system.
  • Replaced all old hook calls with the new ones.
  • Renamed hook "GameHardUpdate" to "GameHardmodeTileUpdate".
  • -Added the default ServerLogWriter.
  • -Added some basic log output to ProgramServer and replaced crashlog.txt with log writer output.
  • Added ProfilerManager.
  • -Added IProfiler.InputPluginCustomProcessingTime.
  • Added some Profiler input calls.
  • -Moved init procedure, command line handling and some more stuff to PluginApi.
  • -Removed plugin reload functionality as this implementation would never have worked properly.
  • Renamed PluginApi to ServerApi.
  • -Implemented proper plugin unload and profiler / log writer detaching.
  • -Properly removed the reload plugins functionality.
  • Fixed a bug where hook where not initialized before their first invoke.
  • Renamed namespace ServerApi to TerrariaApi.Server.
  • -Fixed a bug where hook where not initialized before their first invoke. (second try).
  • -Improved plugin loading error handling.
  • Moved related classes to the proper TerrariaApi.Server
  • -Version tick 1.14.
  • Improved startup output.
  • Whenever hook handlers are registered without priority, they will take over the Order index of the registering plugin.
  • Fixed spaces -> tabs.
  • Fixed a bug causing the hook system to mess up when no profiler was attached.
  • Made ServerApi.Profiler public.
  • Fixed WorldChristmasCheck hook.
  • -Registering / Deregistering / Invoking of handlers is now thread safe.

File Changes

  • A .editorconfighttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-0(9)
  • D APIVersionAttribute.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-1(13)
  • D Hooks/Classes/ChristmasCheckEventArgs.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-2(17)
  • D Hooks/Classes/HardUpdateEventArgs.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-3(26)
  • D Hooks/Classes/MeteorDropEventArgs.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-4(14)
  • D Hooks/Classes/MethodHookAttribute.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-5(8)
  • D Hooks/Classes/NPCLootDropEventArgs.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-6(22)
  • D Hooks/Classes/SetDefaultsD.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-7(5)
  • D Hooks/Classes/StatueSpawnEventArgs.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-8(19)
  • D Hooks/ClientHooks.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-9(55)
  • D Hooks/GameHooks.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-10(145)
  • D Hooks/ItemHooks.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-11(54)
  • D Hooks/NetHooks.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-12(95)
  • D Hooks/NpcHooks.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-13(113)
  • D Hooks/PlayerHooks.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-14(16)
  • D Hooks/ProjectileHooks.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-15(25)
  • D Hooks/ServerHooks.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-16(109)
  • D Hooks/WorldHooks.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-17(63)
  • D PluginContainer.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-18(41)
  • A Properties/AssemblyInfo.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-19(33)
  • M Terraria/Item.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-20(11)
  • M Terraria/Main.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-21(35)
  • M Terraria/NPC.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-22(199)
  • M Terraria/NetMessage.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-23(9)
  • M Terraria/Netplay.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-24(4)
  • M Terraria/ProgramServer.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-25(279)
  • M Terraria/Projectile.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-26(5)
  • M Terraria/ServerSock.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-27(4)
  • M Terraria/WorldGen.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-28(109)
  • M Terraria/messageBuffer.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-29(6)
  • M TerrariaAPI-Server.csprojhttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-30(350)
  • A TerrariaApi.Server/ApiVersionAttribute.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-31(17)
  • A TerrariaApi.Server/EventArgs/ChatEventArgs.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-32(14)
  • A TerrariaApi.Server/EventArgs/ChatReceivedEventArgs.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-33(23)
  • A TerrariaApi.Server/EventArgs/ChristmasCheckEventArgs.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-34(14)
  • A TerrariaApi.Server/EventArgs/CommandEventArgs.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-35(14)
  • A TerrariaApi.Server/EventArgs/ConnectEventArgs.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-36(14)
  • R TerrariaApi.Server/EventArgs/GetDataEventArgs.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-37(5)
  • A TerrariaApi.Server/EventArgs/GreetPlayerEventArgs.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-38(14)
  • A TerrariaApi.Server/EventArgs/HardmodeTileUpdateEventArgs.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-39(26)
  • A TerrariaApi.Server/EventArgs/JoinEventArgs.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-40(14)
  • A TerrariaApi.Server/EventArgs/LeaveEventArgs.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-41(13)
  • A TerrariaApi.Server/EventArgs/MeteorDropEventArgs.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-42(11)
  • A TerrariaApi.Server/EventArgs/NameCollisionEventArgs.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-43(19)
  • A TerrariaApi.Server/EventArgs/NpcLootDropEventArgs.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-44(59)
  • R TerrariaApi.Server/EventArgs/NpcSpawnEventArgs.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-45(7)
  • R TerrariaApi.Server/EventArgs/NpcStrikeEventArgs.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-46(25)
  • A TerrariaApi.Server/EventArgs/SendBytesEventArgs.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-47(30)
  • R TerrariaApi.Server/EventArgs/SendDataEventArgs.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-48(16)
  • A TerrariaApi.Server/EventArgs/ServerChatEventArgs.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-49(25)
  • R TerrariaApi.Server/EventArgs/SetDefaultsEventArgs.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-50(5)
  • A TerrariaApi.Server/EventArgs/SocketResetEventArgs.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-51(14)
  • A TerrariaApi.Server/EventArgs/StatueSpawnEventArgs.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-52(44)
  • A TerrariaApi.Server/EventArgs/UpdatePhysicsEventArgs.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-53(14)
  • A TerrariaApi.Server/EventArgs/WorldSaveEventArgs.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-54(14)
  • A TerrariaApi.Server/HandlerCollection.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-55(140)
  • A TerrariaApi.Server/HandlerRegistration.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-56(38)
  • A TerrariaApi.Server/HookManager.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-57(918)
  • A TerrariaApi.Server/ILogWriter.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-58(50)
  • A TerrariaApi.Server/IProfiler.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-59(128)
  • A TerrariaApi.Server/LogWriterManager.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-60(110)
  • A TerrariaApi.Server/PluginContainer.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-61(50)
  • A TerrariaApi.Server/ProfilerManager.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-62(253)
  • A TerrariaApi.Server/ServerApi.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-63(445)
  • A TerrariaApi.Server/ServerLogWriter.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-64(99)
  • A TerrariaApi.Server/TerrariaPlugin.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-65(82)
  • D TerrariaPlugin.cshttps://github.com/Deathmax/TerrariaAPI-Server/pull/15/files#diff-66(73)

Patch Links:

Olink commented 11 years ago

I still think a new branch for this would be better than nuking our master branch, for regression sake.

hakusaro commented 11 years ago

It's not possible to do a pull request to a repo to a branch that doesn't exist. Keeping this here for discussion, though, is fine. If you're all okay with it, I'll go ahead and pull in the changes with git fetch and push to a different branch.

Lucas Nicodemus via Web

On Wed, Aug 7, 2013 at 10:46 AM, Zack notifications@github.com wrote:

I still think a new branch for this would be better than nuking our master branch, for regression sake.

— Reply to this email directly or view it on GitHubhttps://github.com/Deathmax/TerrariaAPI-Server/pull/15#issuecomment-22265458 .

Olink commented 11 years ago

well yea, i know that, I was suggesting that we make a "improved api" branch and have him pr there.

hakusaro commented 11 years ago

I'm fine with this as is. I don't mind git fetch.

Lucas Nicodemus via Web

On Wed, Aug 7, 2013 at 12:25 PM, Zack notifications@github.com wrote:

well yea, i know that, I was suggesting that we make a "improved api" branch and have him pr there.

— Reply to this email directly or view it on GitHubhttps://github.com/Deathmax/TerrariaAPI-Server/pull/15#issuecomment-22272576 .

CoderCow commented 11 years ago

This is why I was asking for a new branch in the first place, but I don't mind either way.

CoderCow commented 11 years ago

Implemented a simple profiler, this is an example profile it has just generated: https://gist.github.com/CoderCow/f135767b3a1fe64f3802