Important Pluton for Experimental Branch

Status
Not open for further replies.

mikec

Master Of All That I Survey
Administrator
Jul 12, 2014
296
109
28
Los Angeles, California, USA
Hooks
C#:
On_Chat(Chat msg)
On_ClientAuth(AuthEvent ae)
On_Command(Command c)
On_CorpseDropped(CorpseInitEvent cie)
On_CorpseAttacked(CorpseHurtEvent che)
On_BuildingComplete(BuildingPart bp)
On_BuildingUpdate(BuildingEvent be)
On_BuildingPartAttacked(BuildingHurtEvent bhe)
On_BuildingPartDestroyed(BuildingHurtEvent bhe)
On_FrameDeployed(BuildingPart bp)
On_NPCAttacked(NPCHurtEvent nhe)
On_NPCKilled(NPCDeathEvent nde)
On_LootingEntity(EntityLootEvent ele)
On_LootingPlayer(PlayerLootEvent ple)
On_LootingItem(ItemLootEvent ile)
On_PlayerConnected(Player p)
On_PlayerDisconnected(Player p)
On_PlayerGathering(GatherEvent ge)
On_PlayerAttacked(PlayerHurtEvent phe)
On_PlayerDied(PlayerDeathEvent pde)
On_PlayerTakeDamage(PlayerTakeDmgEvent ptd)
On_PlayerTakeRadiation(PlayerTakeRadsEvent ptr)
On_ServerShutdown()
On_PluginInit()
Classes
C#:
Pluton.BuildingPart(BuildingBlock bb)
    .FindSocket(string name):Construction.Socket
    .buildingBlock:BuildingBlock
    .Health:float
    .IsFrame:bool
    .ItemIDBase:int
    .Location:Vector3
    .OwnerID:ulong
    .OwnerName:string
    .X .Y .Z :float

Pluton.Chat(Pluton.Player player, ConsoleSystem.Arg args)
    ._arg:ConsoleSystem.Arg
    .BroadcastName:string
    .FinalText:string
    .OriginalText:string
    .ReplyWith:string
    .User:Pluton.Player

Pluton.Command(Pluton.Player player, string[] args)
    .GetQuotedStringArr(string[] sArr):string[]
    .args:string[]
    .cmd:string
    .ReplyWith:string
    .quotedArgs:string[]
    .User:Pluton.Player

Pluton.Entity(BaseEntity entity)
    .baseEntity:BaseEntity
    .Location:Vector3
    .Name:string
    .X .Y .Z :float

Pluton.Inv(PlayerInventory inv)
    .Add(Pluton.InvItem item):bool
    .Add(Pluton.InvItem item, ItemContainer con):bool
    .Add(int itemID):bool
    .Add(int itemID, int amoun):bool
    .AllItems():List<Pluton.InvItem>
    .BeltItems():List<Pluton.InvItem>
    .MainItems():List<Pluton.InvItem>
    .WearItems():List<Pluton.InvItem>
    ._inv:PlayerInventory
    .InnerBelt:ItemContainer
    .InnerMain:ItemContainer
    .InnerWear:ItemContainer
    .owner:Pluton.Player

Pluton.InvItem(string Name, int Amount) (string Name) (Item item)
    .CanStack(Pluton.InvItem item):bool
    .Drop(Vector3 position, Vector3 offset):void
    .GetContainerPreference(string category):enum
    .GetItemID(string itemName):int
    .Instantiate(Vector3 position):Pluton.Entity
    .Instantiate(Vector3 position, Quaternion rotation):Pluton.Entity
    ._item:Item
    .containerPref:enum
    .Category:string
    .ItemID:int
    .Name:string
    .Quantity:int
    .Slot:int

Pluton.LoadOut(string Name)
    .Add(Pluton.InvItem item):bool
    .Add(Pluton.LoadOutItem item):bool
    .Remove(int Item):bool
    .ToIni():void
    .ToInv(Pluton.Inv inv):void
    .itemCount:int
    .items:Dictionary<int, Pluton.LoadOutItem>
    .ModeratorUse:bool
    .Name:string
    .NormalUse:bool
    .OwnerUse:bool
    .path:string

Pluton.LoadOutItem(string Name) (string Name, int Amount)
    .Amount:int
    .Name:string
    .invItem:Pluton.InvItem

Pluton.NPC(BaseAnimal animal)
    .Kill():void
    .Prefab:string
    .ID:uint
    .Health:float
    .Location:Vector3
    .X .Y .Z :float

Pluton.OfflinePlayer(Pluton.Player player) // you shouldn't ever call this constructor manually
    .Get(ulong steamid):Plutom.OfflinePlayer
    .Get(string steamid):Pluton.OfflinePlayer
    .Admin:bool
    .IP:string
    .Name:string
    .OS:string
    .totalTimeOnline:ulong
    .X .Y .Z :float

Pluton.Player(BasePlayer player)
    .Find(string nameOrsteamidOrip):Pluton.Player
    .FindByGameID(ulong steamid):Pluton.Player
    .FindBySteamID(string steamid):Pluton.Player
    .Ban(string reason*):void
    .Kick(string reason*):void
    .Reject(string reason*):void
    .Kill():void
    .MakeNone(string reason*):void
    .MakeModerator(string reason*):void
    .MakeOwner(string reason*):void
    .Message(string msg):void
    .MessageFrom(string nameFrom, string msg).void
    .Admin:bool
    .AuthStatus:string
    .basePlayer:BasePlayer
    .GameID:ulong
    .Health:float
    .Inventory:Pluton.Inv
    .IP:string
    .Location:Vector3
    .Moderator:bool
    .Name:string
    .Owner:bool
    .OS:string
    .Ping:int
    .Stats:Pluton.PlayerStats
    .SteamID:string
    .TimeOnline:float
    .X .Y .Z :float

Pluton.PlayerStats(string steamid)
    .Kills            |
    .Deaths            |
    .PlayerKills    |
    .PlayerDeaths    |
    .NPCKills        |
    .NPCDeaths        |:uint
    .TotalDamageTaken    |
    .TotalDamageDone    |
    .DamageToPlayers    |
    .DamageFromPlayers    |
    .DamageToNPCs        |
    .DamageFromNPCs        |
    .DamageToEntities    |
    .FallDamage:double

Pluton.Server
    .Broadcast(string msg):void
    .Broadcast(string nameFrom, string msg):void
    .FindPlayer(string something):Pluton.Player
    .ActivePlayers:List<Pluton.Player>
    .Players:Dictionary<ulong, Pluton.Player>
    .SleepingPlayers:List<Pluton.Player>
    .server_message_name:string

Pluton.Util
    .CreateLoadOut(string Name):LoadOut
    .GetVectorsDistance(Vector3 p1, Vector3 p2):float
    .Items():void
    .IsNull(object obj):bool
    .Log(string str):void
    .Regex(string input, string match):Match
    .RotateX(Quaternion q, float angle):Quaternion
    .RotateY(Quaternion q, float angle):Quaternion
    .RotateZ(Quaternion q, float angle):Quaternion
    .TryFindType(string typeName, out System.Type t):bool
    .TryFindReturnType(string typeName):System.Type
Events
C#:
Pluton.Events.AuthEvent(Connection connection)
    .Reject(string reason*):void
    ._reason:string
    .approved:bool
    .con:Connection
    .GameID:ulong
    .IP:string
    .Name:string
    .OS:string

Pluton.Events.BuildingEvent(BuildingPart bp, Player, float prof)
    ._block:BuildingBlock
    .BuildingPart:Pluton.BuildingPart
    .Builder:Pluton.Player
    .BlockFullName:string
    .BlockName:string
    .Proficiency:float
    .Sockets:List<Construction.Socket>

Pluton.Events.BuildingHurtEvent(BuildingPart bp, HitInfo info):HurtEvent
    .Victim:Pluton.BuildingPart

Pluton.Events.CorpseHurtEvent(BaseCorpse corpse, HitInfo info):HurtEvent
    .corpse:BaseCorpse

Pluton.Events.CorpseInitEvent(BaseCorpse corpse, BaseEntity parent)
    .Corpse:BaseCorpse
    .Parent:Pluton.Entity

Pluton.Events.DeathEvent(HitInfo info)
    ._info:HitInfo
    .dropLoot:bool
    .DamageAmount:float
    .DamageType:Rust.DamageType
    .Attacker:BaseEntity

Pluton.Events.EntityLootEvent(PlayerLoot pl, Player looter, Entity looted):LootEvent
    .Target:Pluton.Entity

Pluton.Events.GatherEvent(BaseResource res, HitInfo info)
    .DamageAmount:float
    .DamageType:Rust.DamageType
    .Gatherer:Pluton.Player
    .Health:float
    .Prefab:string
    .Proficiency:float
    .Stage:int
    .WeaponName:string

Pluton.Events.HurEvent(HitInfo info)
    .DamageAmount:float
    .DamageType:Rust.DamageType

Pluton.Events.ItemLootEvent(PlayerLoot pl, Pluton.Player player, Item looted):LootEvent
    .Target:Item

Pluton.Events.LootEvent(PlayerLoot pl, Pluton.Player player)
    .Looter:Pluton.Player
    .pLoot:PlayerLoot

Pluton.Events.NPCDeathEventh(Pluton.NPC npc, HitInfo info):DeathEvent
    .Victim:Pluton.NPC

Pluton.Events.NPCHurtEvent(Pluton.NPC npc, HitInfo info):HurtEvent
    .Victim:Pluton.NPC

Pluton.Events.PlayerDeathEvent(Pluton.Player player, HitInfo info):DeathEvent
    .Victim:Pluton.Player

Pluton.Events.PlayerHurtEvent(Pluton.Player player, HitInfo info):HurtEvent
    .Victim:Pluton.Player

Pluton.Events.PlayerLootEvent(PlayerLoot pl, Pluton.Player player, Pluton.Player looted):LootEvent
    .Target:Pluton.Player

Pluton.Events.PlayerTakedmgEvent(Player p, float amount, Rust.DamageType type)
    .Victim:Pluton.Player
    .Amount:float
    .Type:Rust.DamageType

Pluton.Events.PlayerTakeRadsEvent(Player p, float amount)
    .Victim:Pluton.Player
    .Amount:float
* optional
 
Last edited:

mikec

Master Of All That I Survey
Administrator
Jul 12, 2014
296
109
28
Los Angeles, California, USA
Pluton builds, patches, and runs on Windows and Linux. Some hooks are only partially implemented in the game, and so do not do anything useful yet.

Special recognition to balu92 for taking the initiative, working out patching into the new assembly, and being able to reuse a lot of code from Fougerite and Magma. Viproz has contributed as well. I've done almost nothing but let the team use a private repo I had on Github to get it put together.

Pluton's only plugin support right now is IronPython.

A binary ZIP will be posted after we've gotten some feedback and hopefully contributions from other coders who are attracted to a mod for Experimental branch and who can build it themselves.
 

xEnt

Magma Author
Magma Author
Sep 6, 2014
48
17
8
well done. with the iron python thing, thats just temp right? will you keep JS?
 

balu92

Moderator
Moderator
Jul 11, 2014
338
71
28
27
well done. with the iron python thing, thats just temp right? will you keep JS?
Thanks! We plan to have both, @mikec said he wants to write a custom type converter first for the new jint, since using a dictionary and such in it is a big pain and ugly.
 

balu92

Moderator
Moderator
Jul 11, 2014
338
71
28
27
Example hello world plugin for pluton in python:
Python:
import clr
clr.AddReferenceByPartialName("Pluton")
import Pluton
from System import String

class HelloWorld:
  def On_PlayerConnected(self, player):
    player.Message("Welcome " + player.Name + "!")
    player.Message(String.Format("This server is powered by Pluton[{0}]", Pluton.Bootstrap.Version))
 

Jakkee

Plugin Developer
Plugin Developer
Contributor
Jul 28, 2014
1,466
326
83
Australia
im probably doing something wrong but these are the errors I get when I build the solution
 

sendjes

New Member
Member
Sep 1, 2014
15
0
1
Denmark
Nice job, I ran your Legacy version for awhile, can't wait to try this out, too bad I'm no VS wizard though, gonna have to wait for the binaries.
 

CorrosionX

Plugin Developer
Plugin Developer
Sep 3, 2014
212
38
18
California
Code:
ReflectionTypeLoadException: The classes in the module cannot be loaded.
  at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool)

  at System.Reflection.Assembly.GetTypes () [0x00000] in <filename unknown>:0

  at ConsoleSystem+Index.Build () [0x00000] in <filename unknown>:0

  at ConsoleSystem+Index.Find (System.String strName) [0x00000] in <filename unknown>:0

  at ConsoleSystem+Arg.BuildCommand (System.String command) [0x00000] in <filename unknown>:0

  at ConsoleSystem+Arg..ctor (System.String rconCommand) [0x00000] in <filename unknown>:0

  at ConsoleSystem.RunUnrestricted (System.String strCommand, Boolean WantsFeedback) [0x00000] in <filename unknown>:0

  at ConsoleSystem.UpdateValuesFromCommandLine () [0x00000] in <filename unknown>:0

  at Bootstrap.Initialization () [0x00000] in <filename unknown>:0

  at Bootstrap.Start () [0x00000] in <filename unknown>:0
(Filename:  Line: -1)
Code:
ReflectionTypeLoadException: The classes in the module cannot be loaded.</h3><pre>System.Reflection.Assembly.GetTypes ()
ConsoleSystem+Index.Build ()
ConsoleSystem+Index.Find (System.String strName)
ConsoleSystem+Arg.BuildCommand (System.String command)
ConsoleSystem+Arg..ctor (System.String rconCommand)
ConsoleSystem.RunUnrestricted (System.String strCommand, Boolean WantsFeedback)
ConsoleSystem.UpdateValuesFromCommandLine ()
Bootstrap.Initialization ()
Bootstrap.Start ()
:(
 

jeff

New Member
Member
Sep 17, 2014
17
1
3
The Netherlands
Hi, I've got my server running with Pluton but when I try to connect to the server I get this in my console:
Code:
Could not load type 'Pluton.Server' from assembly 'Pluton, Vesion=0.9.2.0, Culture=neutral, PublicKeyToken=null'.
What can I do about this?
 

balu92

Moderator
Moderator
Jul 11, 2014
338
71
28
27
Hi, I've got my server running with Pluton but when I try to connect to the server I get this in my console:
Code:
Could not load type 'Pluton.Server' from assembly 'Pluton, Vesion=0.9.2.0, Culture=neutral, PublicKeyToken=null'.
What can I do about this?
do you have pluton.dll in the managed folder?
 

jeff

New Member
Member
Sep 17, 2014
17
1
3
The Netherlands
This is the exact thing I'm getting in my console..

Code:
[EAC] Registering 'steamidhere'
Exception in Server.ReceivedMessage: 0 -> 2
TypeloadException: Could not load type 'Pluton.Server' from assembly 'Pluton, Version=0.9.2.0, Culture=neutral, PublicKeyToken=null'.
(name) has left
Server Network Exception
I also removed the entire server folder and installed again and then followed the exact same steps as described on GitHub
 

xEnt

Magma Author
Magma Author
Sep 6, 2014
48
17
8
yeah i just tried to take it for a quick spin, got the same errors as above

[EAC] Registering 'ID'
Exception in Server.ReceivedMessage: 0 -> 2
TypeLoadException: A type load exception has occurred.
xEnt has left
Server Network Exception
TypeLoadException: Could not load type 'Pluton.Server' from assembly 'Pluton, Ve
rsion=0.9.2.0, Culture=neutral, PublicKeyToken=null'.


tried to compile both patcher and pluton with 4.0 and 4.5 (mono) no same errors. what version do you guys use?.

steps i did.

grabbed latest zip from github
added both to Xamarin Studio, copied rust dll's to <project>/refs folder. changed patcher and pluton to reference from that folder (if it hadn't already)
compiled. dropped patcher and mono.cecil into Managed folder, also copied IronPython & System.Reactive to Managed, same with Pluton.dll.
ran the launcher, seemed to patch fine.
server started fine, upon joining i got kicked with that error.
 
Status
Not open for further replies.