Author Topic: Current documentation + mysql functions  (Read 1945 times)

0 Members and 1 Guest are viewing this topic.

Offline Szaman

  • Soldier
  • **
  • Posts: 145
Current documentation + mysql functions
« on: July 27, 2013, 07:00:48 pm »
Hi,

I would like to write some script's for Soldat server, but I have some problems with finding current documentation of script engine. Or maybe, just a list of functions with parameteres.

Can you, please, help me ?
I was reading the http://devs.soldat.pl/index.php/Main_Page page but I think it has not all of available functions (for example for MySQL).

Maybe I could help in creating documentation in some way ?

Also - the new script engine provides structures, like TActivePlayer (http://devs.soldat.pl/index.php/TActivePlayer). How does this match to the "good old" GetPlayerStat (http://devs.soldat.pl/index.php/GetPlayerStat) and so on ?

Thank you in advance for help and response :)

Best regards,
Peter.

Offline JotEmI

  • Soldier
  • **
  • Posts: 188
Re: Current documentation + mysql functions
« Reply #1 on: July 27, 2013, 07:27:25 pm »
Documentation for old ScriptCore 2.0 can be found here http://devs.soldat.pl/index.php/Server_Scripting.
The structure TActivePlayer that you refer to is a part of the new ScriptCore 3.0 which isn't documented yet, Falcon is working on that.

Both ScriptCores 2.0 and 3.0 don't support MySQL at this moment (afaik, Falcon didn't mention anything about MySQL in 3.0 so I assume it isn't supported). Some time ago EnEsCe added it to the server but those changes were reverted.

You can wait for Falcon to fully document 3.0 and use old ScriptCore 2.0 for now.

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: Current documentation + mysql functions
« Reply #2 on: July 27, 2013, 08:11:58 pm »
TActivePlayer properties named by GetPlayerStats stat "ID" are mostly matching each other. Except of fact that they're returned in target type, not some idiotic Variant.
If you're not paying for something, you're not the customer; you're the product being sold.
- Andrew Lewis

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

Offline Szaman

  • Soldier
  • **
  • Posts: 145
Re: Current documentation + mysql functions
« Reply #3 on: July 28, 2013, 03:32:47 am »
Thank you both for your replies.

@FalconPL: Yes, I've noticed that they are quite similiar, but is there any example how to use that TActivePlayer instead of GetPlayerStat() ? Or it will be attached in newly created documentation ? Could you, please, estimate somehow, when we (community) can expect (maybe just partly) finished documentation ? A week ? Month ? Can I help you in any way with that ?

@JotEmI: Yeah, I've read that page. It is very useful :) But - as you said - it is about SC 2.0.
Oh, I am nearly sure, that somewhere I've read about those functions (some changelog or sth). Maybe it was EnEsCe post about adding those features. Can I ask, why did you removed those functions ? How can I perform such operations now ? Can I attach for example some DLL ?

I've read somewhere that multi-threading is now disabled. What is an equivalent for that now ?

Offline JotEmI

  • Soldier
  • **
  • Posts: 188
Re: Current documentation + mysql functions
« Reply #4 on: July 28, 2013, 08:48:41 am »
[...]Can I attach for example some DLL ?

I've read somewhere that multi-threading is now disabled. What is an equivalent for that now ?

Yes, you can use external DLLs. There you can have MySQL support, multi-threading, whatever you like. Check http://www.chmlib.com/ISetup/topic_scriptdll.htm for syntax.

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: Current documentation + mysql functions
« Reply #5 on: July 28, 2013, 09:23:18 am »
@FalconPL: Yes, I've noticed that they are quite similiar, but is there any example how to use that TActivePlayer instead of GetPlayerStat() ? Or it will be attached in newly created documentation ? Could you, please, estimate somehow, when we (community) can expect (maybe just partly) finished documentation ? A week ? Month ? Can I help you in any way with that ?
Documentation is already almost complete. It misses some parts of File API and config file documentation + maybe some introduction page. I'll work on these next week.

@JotEmI: Yeah, I've read that page. It is very useful :) But - as you said - it is about SC 2.0.
Oh, I am nearly sure, that somewhere I've read about those functions (some changelog or sth). Maybe it was EnEsCe post about adding those features. Can I ask, why did you removed those functions ? How can I perform such operations now ? Can I attach for example some DLL ?
EnEsCe made his 2.7.3 and then left without a word more or less. Code he wrote never reached us, the new dev team. So, as a result, features he added are gone.

I've read somewhere that multi-threading is now disabled. What is an equivalent for that now ?
Multi-threading newer was a part of scriptcore. ThreadFunc() was just some really bad joke, the only thing it was doing properly was crashing the server. Scriptcore just isn't threadsafe, i don't know when i'll be working on this, if at all.
If you're not paying for something, you're not the customer; you're the product being sold.
- Andrew Lewis

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

Offline Szaman

  • Soldier
  • **
  • Posts: 145
Re: Current documentation + mysql functions
« Reply #6 on: July 28, 2013, 05:43:21 pm »
Quote
Yes, you can use external DLLs. There you can have MySQL support, multi-threading, whatever you like. Check http://www.chmlib.com/ISetup/topic_scriptdll.htm for syntax.
Thanku you :) But how could I call a function originated in script-core, for example change team of player from the DLL function ? How do I reference it from DLL ?

@FalconPL: Oh, nice :) Thank you for this info and generally - for your work on that documentation :)
That's very bad that EnEsCe haven't shared this code :( Hmm... in my opinion, the multi-threading feature is very useful but if it's hard to develop then we must accept ScriptCore as is ;)

Offline JotEmI

  • Soldier
  • **
  • Posts: 188
Re: Current documentation + mysql functions
« Reply #7 on: July 28, 2013, 06:04:32 pm »
Quote
Yes, you can use external DLLs. There you can have MySQL support, multi-threading, whatever you like. Check http://www.chmlib.com/ISetup/topic_scriptdll.htm for syntax.
Thanku you :) But how could I call a function originated in script-core, for example change team of player from the DLL function ? How do I reference it from DLL ?
I guess you can't, you can only reference DLL from your script and pass whatever info is needed to it, then check the result and act accordingly.

Offline Szaman

  • Soldier
  • **
  • Posts: 145
Re: Current documentation + mysql functions
« Reply #8 on: July 28, 2013, 06:10:28 pm »
Quote
Yes, you can use external DLLs. There you can have MySQL support, multi-threading, whatever you like. Check http://www.chmlib.com/ISetup/topic_scriptdll.htm for syntax.
Thanku you :) But how could I call a function originated in script-core, for example change team of player from the DLL function ? How do I reference it from DLL ?
I guess you can't, you can only reference DLL from your script and pass whatever info is needed to it, then check the result and act accordingly.
That's what I thought :( Thanks for that idea with acting depending on DLL function result.

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: Current documentation + mysql functions
« Reply #9 on: July 28, 2013, 06:35:05 pm »
If you're looking for mysql library then there are some already out there.
If you're not paying for something, you're not the customer; you're the product being sold.
- Andrew Lewis

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

Offline Szaman

  • Soldier
  • **
  • Posts: 145
Re: Current documentation + mysql functions
« Reply #10 on: July 29, 2013, 04:09:36 am »
Yeah, I've spotted that libdb. Thanks for SoldatSOCI :) I will try them :)

Are there, in ScriptCore 3, some network functions (sockets, etc.) but with non-blocking receiving (due to no multi-threading) ?

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Odp: Current documentation + mysql functions
« Reply #11 on: July 29, 2013, 04:23:31 am »
No
If you're not paying for something, you're not the customer; you're the product being sold.
- Andrew Lewis

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

Offline Szaman

  • Soldier
  • **
  • Posts: 145
Re: Current documentation + mysql functions
« Reply #12 on: July 29, 2013, 04:37:14 am »
Ok. Thank you very much for help :)
For now, I don't have any more questions :)

Offline Szaman

  • Soldier
  • **
  • Posts: 145
Re: Current documentation + mysql functions
« Reply #13 on: August 10, 2013, 05:58:59 pm »
@FalconPL: Falcon, maybe you had a chance to finish that new documentation recently ? I would be very grateful if there would be full documentation of SC3 available.

Best regards,
Peter.

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
If you're not paying for something, you're not the customer; you're the product being sold.
- Andrew Lewis

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

Offline Szaman

  • Soldier
  • **
  • Posts: 145
Re: Current documentation + mysql functions
« Reply #15 on: August 11, 2013, 04:39:35 am »
Thanks :) But I am looking for some more complex examples how to properly use those objects. Are those old functions like "OnJoinGame" are still recommended to use or shoud I search for an equivalent somewhere in those classes (like TGame)? Is mixing of those classes and "old" functions is possible ? What is the sequence of executing those handlers (old functions and class methods) - which one is executed as first one ? Does changes provided by "old" functions are immediately visible by this "classes" interface ?

Best regards,
Peter.

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: Current documentation + mysql functions
« Reply #16 on: August 11, 2013, 09:51:20 am »
Are those old functions like "OnJoinGame" are still recommended to use or shoud I search for an equivalent somewhere in those classes (like TGame)?
You should search for equivalent.

Is mixing of those classes and "old" functions is possible ?
Yes, if you turn on legacy mode (see config file page)

What is the sequence of executing those handlers (old functions and class methods) - which one is executed as first one ?
First legacy handlers are executed, then new ones.

Does changes provided by "old" functions are immediately visible by this "classes" interface ?
Yes.
If you're not paying for something, you're not the customer; you're the product being sold.
- Andrew Lewis

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

Offline Szaman

  • Soldier
  • **
  • Posts: 145
Re: Current documentation + mysql functions
« Reply #17 on: August 11, 2013, 07:13:26 pm »
Ok. Thank you very much for your response :)