Author Topic: CreateSocket() function from EnEsCe tutorial - access violation problem  (Read 962 times)

0 Members and 1 Guest are viewing this topic.

Offline Szaman

  • Soldier
  • **
  • Posts: 145
Hi !

I am trying to write script that will allow me to communicate with server written in Java (simply: I just want to move 'script logic' to Java instead of Pascal). I am using CreateSocket() function from EnEsCe tutorial (http://enesce.com/help/html/TCP%20Sockets.html).

When I call it, it calls CreateThreaded and then server reports Access Violation exception from CreateThreaded, but server still works (exception in created thread ?). I call CreateSocket from ActivateServer(). The only thing I modified in EnEsCe's tutorial is that I added some WriteConsole() for example in OnConnected().

Please, tell me if this function is still experimental ? Or maybe it is now well tested ? I use recent version of server (1.6.2). The bug occurs when remote server is running and when it's not running. Server does not seen any connection attempt. What could I possibly fix or maybe it's the internal bug ?

Thanks in advance for any help :)

http://imageshack.us/photo/my-images/714/serverbugm.png/ - how the bug occurs
http://4programmers.net/Pastebin/1452 - code of the script (some crappy code from "user-login-script" I found on the net (I will refactor it later and probably move to Java if my project succedees) and on THE BOTTOM of the script there is this "network code").

Greets,

Szaman.

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: CreateSocket() function from EnEsCe tutorial - access violation problem
« Reply #1 on: November 29, 2011, 06:45:00 am »
Please, tell me if this function is still experimental ? Or maybe it is now well tested

This. threadfunc() in soldat scriptcore is a very, very, very unstable function. What comes to sockets idk, i've never used them,  because they don't have any sense w/o threadfunc.
To communicate with external applications, many scripters use adminport. Try this one, hope you succeed.
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 Shoozza

  • Retired Soldat Developer
  • Veteran
  • ******
  • Posts: 1632
  • Soldat's Babysitter
    • Website
Re: CreateSocket() function from EnEsCe tutorial - access violation problem
« Reply #2 on: December 05, 2011, 02:32:15 am »
Hi !

I am trying to write script that will allow me to communicate with server written in Java (simply: I just want to move 'script logic' to Java instead of Pascal). I am using CreateSocket() function from EnEsCe tutorial (http://enesce.com/help/html/TCP%20Sockets.html).

When I call it, it calls CreateThreaded and then server reports Access Violation exception from CreateThreaded, but server still works (exception in created thread ?). I call CreateSocket from ActivateServer(). The only thing I modified in EnEsCe's tutorial is that I added some WriteConsole() for example in OnConnected().

Please, tell me if this function is still experimental ? Or maybe it is now well tested ? I use recent version of server (1.6.2). The bug occurs when remote server is running and when it's not running. Server does not seen any connection attempt. What could I possibly fix or maybe it's the internal bug ?

Thanks in advance for any help :)

http://imageshack.us/photo/my-images/714/serverbugm.png/ - how the bug occurs
http://4programmers.net/Pastebin/1452 - code of the script (some crappy code from "user-login-script" I found on the net (I will refactor it later and probably move to Java if my project succedees) and on THE BOTTOM of the script there is this "network code").

Greets,

Szaman.

Hi,

I don't think it's well tested. But we can fix this bug if you help us.

Could you please try if the bug is also present in older versions of Soldat server (for Soldat 1.6.1, 1.6.0, 1.5.0 and 1.4.2)?
Also please add the bug post to the bugtracker (http://bugs.soldat.pl) with the additional information so we don't forget about it ;)
« Last Edit: December 05, 2011, 02:34:44 am by Shoozza »
Rules
Tools: ARSSE - SARS - SRB - chatMod