Search found 21 matches

by Chrisber
Thu Oct 30, 2014 4:09 pm
Forum: General Discussion
Topic: Extending via C++, adding a module throws exception
Replies: 23
Views: 16749

Hi, sorry! boost.python didn't even get contact to Source.Pythons python instance. So I firstly tried to use the plain API.
Holy sh........ it works.
Time of life wasted: four hours.

Thank you...
by Chrisber
Thu Oct 30, 2014 3:50 pm
Forum: General Discussion
Topic: Extending via C++, adding a module throws exception
Replies: 23
Views: 16749

Of course. I commented the SDK_OnLoad function. static int numargs = 0; static PyObject* pawnbridge_numargs(PyObject *self, PyObject *args) { if (!PyArg_ParseTuple(args, ":numargs")) return NULL; return PyLong_FromLong(numargs); } static PyMethodDef PawnBrid...
by Chrisber
Thu Oct 30, 2014 3:40 pm
Forum: General Discussion
Topic: Extending via C++, adding a module throws exception
Replies: 23
Views: 16749

I call the init func. It doesn't work.
I also tried:

Code: Select all

   std::wstring x = Py_GetPath();
   x += L";D:\\C++\\Source\\SrcDS\\games\\css\\cstrike\\addons\\sourcemod\\extensions";
   Py_SetPath(x.c_str());

But it has no effect :/
by Chrisber
Thu Oct 30, 2014 3:32 pm
Forum: General Discussion
Topic: Extending via C++, adding a module throws exception
Replies: 23
Views: 16749

by Chrisber
Thu Oct 30, 2014 3:01 pm
Forum: General Discussion
Topic: Extending via C++, adding a module throws exception
Replies: 23
Views: 16749

Yes, works: http://img.r4nz.de/d2565.png
I guess the way is right that it doesn't lookup my dll for PyInit_pawnbridge, but adding it to sys.path doesn't seem the solution.
by Chrisber
Thu Oct 30, 2014 2:18 pm
Forum: General Discussion
Topic: Extending via C++, adding a module throws exception
Replies: 23
Views: 16749

In co-work with your-name-here, I debugged a little bit. This is what comes out:
The attachment 30.10.2014 15_15_47.jpg is no longer available
(bigger: http://img.unsuspicious.de/c5c33.png)
You see that this is definitely the same python instance running. Guess, it doesn't work either. :confused:
by Chrisber
Thu Oct 30, 2014 1:48 pm
Forum: General Discussion
Topic: Extending via C++, adding a module throws exception
Replies: 23
Views: 16749

This is a SourceMod extension. It is loaded after Source.Python is loaded. Testscript is (from boost.python now). It is under plugins/pbtest/pbtest.py. import pawnbridge from core import echo_console @Event def game_start(game_event): echo_console('This is a test: {:s}'.format(pawnbridge.greet()))
by Chrisber
Thu Oct 30, 2014 1:38 pm
Forum: General Discussion
Topic: Extending via C++, adding a module throws exception
Replies: 23
Views: 16749

Nothing happens if I remove that line.
Well, it does not initialize it. It now says "no module named pawnbridge". I'm unsure whether it's possible to extend a given boost.python instance with another library.
by Chrisber
Thu Oct 30, 2014 1:32 pm
Forum: General Discussion
Topic: Extending via C++, adding a module throws exception
Replies: 23
Views: 16749

Hi, this is out of the official documentation where they are saying "extending an embedded python". As for Python 2, you had to call the Py_Initialize() from extending libraries too. Even removing it, it does not change anything. Your code sample looks nearly the same as the code above. I am confuse...
by Chrisber
Thu Oct 30, 2014 12:21 pm
Forum: General Discussion
Topic: Extending via C++, adding a module throws exception
Replies: 23
Views: 16749

Your statement makes sense if considering the following sentence (same link as yours): and should be the only non-static item defined in the module file: PyMODINIT_FUNC PyInit_spam(void) { return PyModule_Create(&spammodule); } This is ok, since PyMODINIT_FUNC translates to an exporting function. Pr...
by Chrisber
Thu Oct 30, 2014 3:07 am
Forum: General Discussion
Topic: Extending via C++, adding a module throws exception
Replies: 23
Views: 16749

This does not change anything. Of course it does not, since this is only the internal symbol name. Python doesn't care about them. Thanks anyway :-)
by Chrisber
Thu Oct 30, 2014 1:39 am
Forum: General Discussion
Topic: Extending via C++, adding a module throws exception
Replies: 23
Views: 16749

Extending via C++, adding a module throws exception

Hello, I'm trying to extend SP with a C++ addon. The following exception is thrown: sp load pbtest [SP] Loading plugin 'pbtest'... [SP] Caught an Exception: Traceback (most recent call last): File '..\addons\source-python\packages\source-python\plugins\manager.py', line 72, in __missing__ instance =...
by Chrisber
Mon Sep 16, 2013 7:11 am
Forum: General Discussion
Topic: Bot trying to login with my account
Replies: 7
Views: 12126

Hello, it just came up again. Dear Chrisber, Someone has tried to log into your account on Source.Python with an incorrect password at least 5 times. This person has been prevented from attempting to login to your account for the next 15 minutes. The person trying to log into your account had the fo...
by Chrisber
Wed May 15, 2013 1:28 pm
Forum: General Discussion
Topic: Bot trying to login with my account
Replies: 7
Views: 12126

Bot trying to login with my account

I received the following e-mail seconds ago: Dear Chrisber, Someone has tried to log into your account on Source.Python with an incorrect password at least 5 times. This person has been prevented from attempting to login to your account for the next 15 minutes. The person trying to log into your acc...
by Chrisber
Fri Jul 20, 2012 8:47 pm
Forum: API Design
Topic: Thinking of object orientation
Replies: 3
Views: 5591

Oh, well. Then I totally misunderstood the idea of Source.Python. Sorry ;-)
by Chrisber
Fri Jul 20, 2012 7:24 am
Forum: API Design
Topic: Different execution contexts?
Replies: 1
Views: 3631

Different execution contexts?

Hello,

is Source.Python executing scripts currently in a seperated context? Or is it designed like EventScripts does this?
If it's not the case, do you ever thought aber doing this?

Chris
by Chrisber
Fri Jul 20, 2012 7:16 am
Forum: API Design
Topic: Thinking of object orientation
Replies: 3
Views: 5591

Thinking of object orientation

Hello everyone, I've seen that you are designing the core and the API. We all know how EventScripts worked - and of course we like it. But EventScripts was contaminated with the old EventScripts Shell language (this is not being ment negative). And now you have the chance to stop thinking of old beh...
by Chrisber
Fri Jul 20, 2012 7:08 am
Forum: API Design
Topic: Event system discussion
Replies: 22
Views: 25851

Which is good! ...and bad at the same time. This design speaks against the - more or less - strict typing of python. It is against its nature and that makes me think about to solve this. @ynh: I know it's a lot of work, but where's the problem to parse the resource files? I've did the same in Nativ...
by Chrisber
Fri Jul 20, 2012 7:02 am
Forum: API Design
Topic: Get/Set event variables
Replies: 6
Views: 8428

Well, object orientation is good. But why don't you allow a lot more intuitive design?

Syntax: Select all

def player_connect(ev):
ev["reason"] = ev["steamid"] + " left the game"
# or ev.reason / ev.steamid
by Chrisber
Fri Jul 20, 2012 5:29 am
Forum: Whatever
Topic: Wow ;-)
Replies: 3
Views: 5190

I don't know if I'm right in this topic, but I can't find another one..
What about linking the page header to the forums index instead of the portal? I'd appreciate, it's normal behaviour in the most forums.

Go to advanced search