Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12-09-2012, 01:52 PM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
Messing around with TSockets

Hi, been messing around with TSockets a bit and can't seem to get it to work. Iv'e even tried copying methods used in cbk1994's Grattpd.
Here is what I have in a DBNPC.
PHP Code:
function onCreated(){
  
temp.url "http://automation.whatismyip.com/n09230945.asp";
  
temp.req requesturl(url);
  
waitfor(req"onReceiveData"5);
  
this.ip req.data[0];
  if(!
this.ip){
     echo(
"Failed to get server IP.");
  }
  
this.ls = new TSocket();
  
this.ls.bind(0false);
  
thiso.catchevent(this.ls"onBind""onBound");
  
thiso.catchevent(this.ls"onBindFailed""onBoundFailed");
}
function 
onBound(){
  echo(
"Bound!");
}
function 
onBoundFailed(){
  echo(
"Not bound!");

__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion
Reply With Quote
  #2  
Old 12-09-2012, 02:57 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by cbk1994 View Post
I think you're going to run into bigger problems because afaik Stefan has disabled listening to random ports and now requires you to get all listening services cleared with him (and then he'll give you a port you can use). It's possible to listen, but it appears that it can't be reached from the outside. We tried unsuccessfully on Kingdoms Debug a few days ago and couldn't figure out any way past it. Maybe that's just a server-specific thing though?

If he disabled outgoing connections (not sure if he did or not), then that could also be the cause of the lack of IP shown.
..
__________________
Reply With Quote
  #3  
Old 12-10-2012, 12:50 AM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
If it's possible to listen then why isn't the onBound method being invoked?
It should still bind.
__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:52 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.