New release July 2nd, 2015!!

Official Announcements about Source.Python.
User avatar
satoon101
Project Leader
Posts: 2295
Joined: Sat Jul 07, 2012 1:59 am

New release July 2nd, 2015!!

Postby satoon101 » Thu Jul 02, 2015 4:24 am

There have been a lot of good updates since the last release. Here is a quick rundown of the highlights to those changes:

  • added PlayerEntity.client_command(<str command>, [bool server_side])
  • added PlayerEntity.slay()
  • added EntityPostHook and EntityPreHook decorators to entities.hooks:
    • @Entity<type>Hook(<str/list entity type(s)>, <str entity-method>)
    • no longer a need to make sure an entity is on the server to create the hook
  • added set_transmit virtual function to CBaseEntity data
  • added sys.argv to get command line arguments when server was initialized
  • added hard-coded entity KeyValues capabilities to Entity/PlayerEntity server classes
  • added voice module with voice_server singleton
  • added ability to get virtual functions of exposed member functions
    • added a new FunctionInfo class, which stores information of a virtual member function.
    • added a new Pointer.make_function() method, which requires a FunctionInfo object.
    • added new functions to the memory module to retrieve FunctionInfo objects, class information, class names of the C++ classes, etc.
    • Note: currently we have only added FunctionInfo objects for the IVoiceServer class. We will add more very soon.
    • Here is an example on how to use the new functionality:

      Syntax: Select all

      import memory

      from memory.hooks import PreHook
      from players.voice import voice_server

      # This function will be added in the next release
      def get_function(obj, function_name, function_index=0):
      return memory.get_object_pointer(obj).make_function(
      memory.get_function_info(obj, function_name, function_index))

      @PreHook(get_function(voice_server, 'SetClientListening'))
      def on_pre_set_client_listening(args):
      print(args)
  • correctly raises a NameError when trying to get an entity KeyValue when the entity contains no KeyValue of the given name
  • exposed CCheckTransmitInfo
  • fixed several reported issues
  • added Function.is_hooked() to test if the function (address) was hooked by SP
  • reorganized the memory module on the C++ side (it's now much easier to read. though, that's just an internal change)
  • updated data files (virtual function indexes)

For the full change log, look here:
https://github.com/Source-Python-Dev-Team/Source.Python/compare/90bf270...37a0444

As always, the release can be found here:
https://github.com/Source-Python-Dev-Team/Source.Python/releases

We do hope to have a build-bot site up and running fairly soon. We are just waiting on a couple things to get done before that becomes a reality. This means that in the future, you will be able to get an updated snapshot when we commit to the development branch.
Image
stonedegg
Senior Member
Posts: 141
Joined: Sun Aug 12, 2012 11:45 am

Postby stonedegg » Thu Jul 02, 2015 9:18 am

As always, great work!
Mahi
Senior Member
Posts: 210
Joined: Wed Aug 29, 2012 8:39 pm
Location: Finland

Postby Mahi » Thu Jul 02, 2015 11:50 am

These are some insanely nice features! Awesome job, thank you very much for these! :)
User avatar
Ayuto
Project Leader
Posts: 1546
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Postby Ayuto » Thu Jul 02, 2015 7:54 pm

I have updated the main post with some additional points. :)
qazuar
Junior Member
Posts: 14
Joined: Fri Jun 20, 2014 9:05 am

Postby qazuar » Wed Jul 15, 2015 9:13 pm

I wrote this in the previous release:
I have a small issue with remove_entity.
It works fine with 1 client connected to the server, it does however not work at all when there are multiple clients on the server.
I'm talking about actual human players and not bots, as I've been unable to meet this issue with me alone and a lot of bots.

This is on CS:GO (I dont know about the other games), and I've tested it on 2 different windows servers.
No errors appear in the console, basically remove_entity is just doing nothing.


I've been able to reproduce the issue, and it has nothing to do with the amount of players connected.
The issue basically starts to happen if you do like the following:

Syntax: Select all

def test():
remove_entity(index1)
remove_entity(index2)


Using it like that somehow breaks everything and remove_entity entirely stops working until you change map.

Technically, I just want to know if it is supposed to stop working when used multiple times at the same time in the code.
Although this did not happen a long time ago.

Still only tested on CS:GO windows.
User avatar
Ayuto
Project Leader
Posts: 1546
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Postby Ayuto » Wed Jul 15, 2015 9:20 pm

We are using a little workaround on CS:GO to remove entities. What happens if you remove this function instead?

Syntax: Select all

from entities.entity import Entity

def remove_entity(index):
Entity(index).call_input('Kill')
qazuar
Junior Member
Posts: 14
Joined: Fri Jun 20, 2014 9:05 am

Postby qazuar » Thu Jul 16, 2015 4:05 pm

Don't you mean "use this function instead?".
Anyway, yes it seems to work fine using call_input('Kill') as an alternative solution.
User avatar
satoon101
Project Leader
Posts: 2295
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Thu Jul 16, 2015 5:34 pm

Yes, that is what he meant. Also, we have the Kill Input dynamically added as the 'remove' method for the Entity class:

https://github.com/Source-Python-Dev-Team/Source.Python/blob/master/addons/source-python/data/source-python/entities/CBaseEntity.ini#L16

Syntax: Select all

Entity(index).remove()
Image
Mahi
Senior Member
Posts: 210
Joined: Wed Aug 29, 2012 8:39 pm
Location: Finland

Postby Mahi » Fri Jul 17, 2015 11:10 am

satoon101 wrote:Yes, that is what he meant. Also, we have the Kill Input dynamically added as the 'remove' method for the Entity class:

https://github.com/Source-Python-Dev-Team/Source.Python/blob/master/addons/source-python/data/source-python/entities/CBaseEntity.ini#L16

Syntax: Select all

Entity(index).remove()

Is there a reason it's not called .kill()? Just wondering, since SP is quite consistent with the Source engine's naming.
User avatar
satoon101
Project Leader
Posts: 2295
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Fri Jul 17, 2015 1:19 pm

When it was first added, we didn't have a built in way to slay a player. If someone saw that a PlayerEntity instance had a 'kill' method, they might try to use it and it would crash their server instead of kill the player. We do have a 'slay' method now, that we could also wrap with kill, which would eliminate that issue. That is something we probably need to consider. Though, remove is technically what the Kill input does, so that should be taken into consideration, as well.
Image
Mahi
Senior Member
Posts: 210
Joined: Wed Aug 29, 2012 8:39 pm
Location: Finland

Postby Mahi » Fri Jul 17, 2015 5:16 pm

satoon101 wrote:When it was first added, we didn't have a built in way to slay a player. If someone saw that a PlayerEntity instance had a 'kill' method, they might try to use it and it would crash their server instead of kill the player. We do have a 'slay' method now, that we could also wrap with kill, which would eliminate that issue. That is something we probably need to consider. Though, remove is technically what the Kill input does, so that should be taken into consideration, as well.

Yeah actually, I think .remove() sounds much better (even though it's not the one valve is using). kill really does sound like a way to kill a player, even if there's slay() for that.
nullable
Senior Member
Posts: 137
Joined: Sat Nov 08, 2014 7:22 pm

Postby nullable » Sat Jul 25, 2015 7:53 am

After install new version of plugin I can't send command exit to server. I have an error:

Syntax: Select all

Segmentation fault (core dumped)
BFD: Warning: /home/csgoserver/serverfiles/core is truncated: expected core file size >= 227799040, found: 1085440.
Cannot access memory at address 0xb7793908
Cannot access memory at address 0xb7793904
debug.cmds:1: Error in sourced command file:
Cannot access memory at address 0xbf853600
email debug.log to linux@valvesoftware.com
Sat Jul 25 07:43:30 UTC 2015: Server restart in 10 seconds
User avatar
Ayuto
Project Leader
Posts: 1546
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Postby Ayuto » Sat Jul 25, 2015 11:26 am

nullable
Senior Member
Posts: 137
Joined: Sat Nov 08, 2014 7:22 pm

Postby nullable » Sat Jul 25, 2015 11:31 am

Ok. Thanks. Can you make a new release with this fix?
nullable
Senior Member
Posts: 137
Joined: Sat Nov 08, 2014 7:22 pm

Postby nullable » Sun Jul 26, 2015 5:42 am

I think its a critical bug. When will the next release of the plugin?

Return to “News & Announcements”

Who is online

Users browsing this forum: No registered users and 1 guest